StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
close.C
1 //usr/bin/env root4star -l -b -q $0'("'${1:-sim.fzd}'",'${2:-50}','${3:-0.001}','${4:-0.001}','${5:-3.0}','${6:-0.004}','${7:-0}',"'${8:- }'")'; exit $?
2 // that is a valid shebang to run script as executable, but with only one arg
3 
4 
5 // Run very fast fwd tracking
6 // generate some input data using genfzd
7 
8 TFile *output = 0;
9 
10 void close( char *inFile = "sim.fzd",
11  int n = 100000, // nEvents to run
12  double primaryVertexSigmaXY = 0.001,
13  double primaryVertexSigmaZ = 0.001,
14  double fstRasterR = 3.0,
15  double fstRasterPhi = 0.0040906154,
16  int numFttToUse = 0,
17  TString note = ""
18  ) {
19  // report all of the parameters passed in
20  cout << "inFile = " << inFile << endl;
21  cout << "nEvents = " << n << endl;
22  TString mOutput = TString::Format(
23  "closure_PV_XY%dum_Z%dum_FST_R%.2fcm_PHI%0.3frad_NumFTT%d%s",
24  (int)(primaryVertexSigmaXY*1e4),
25  (int)(primaryVertexSigmaZ*1e4),
26  fstRasterR,
27  fstRasterPhi,
28  numFttToUse,
29  note.Data()
30  );
31  // replace all "." with "p" in the output file name
32  mOutput.ReplaceAll(".", "p");
33  mOutput += ".root";
34  cout << "Output file = " << mOutput.Data() << endl;
35 
36  // Setup the chain for reading an FZD
37  TString _chain;
38  _chain = "fzin sdt20211016 MakeEvent bigbig evout cmudst tree";
39 
40 
41  gSystem->Load( "libStarRoot.so" );
42  gROOT->SetMacroPath(".:/star-sw/StRoot/macros/:./StRoot/macros:./StRoot/macros/graphics:./StRoot/macros/analysis:./StRoot/macros/test:./StRoot/macros/examples:./StRoot/macros/html:./StRoot/macros/qa:./StRoot/macros/calib:./StRoot/macros/mudst:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/graphics:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/analysis:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/test:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/examples:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/html:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/qa:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/calib:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/mudst:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/macros:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/tutorials");
43  gROOT->LoadMacro("bfc.C");
44  bfc(-1, _chain, inFile);
45 
46  gSystem->Load( "libStFttSimMaker" );
47  gSystem->Load( "libStFcsTrackMatchMaker" );
48 
49  gSystem->Load( "libMathMore.so" );
50  gSystem->Load( "libStarGeneratorUtil" );
51 
52  gSystem->Load("libXMLIO.so");
53  gSystem->Load("libgenfit2.so");
54  gSystem->Load("libKiTrack.so");
55  gSystem->Load("StarGeneratorUtil");
56  // gSystem->Load("libMathMore.so");
57  gSystem->Load("StEventUtilities");
58  gSystem->Load("StEpdUtil");
59  gSystem->Load("StFwdTrackMaker");
60 
61  gSystem->Load("StFwdUtils.so");
62 
63 
64  // Configure the Forward Tracker
65  StFwdClosureMaker * fwdClosure = new StFwdClosureMaker();
66  fwdClosure->SetDebug(1);
67  fwdClosure->mMaxIt = 4;
68 
69  fwdClosure->mBlowUp = 1e3;
70  fwdClosure->mPVal = 1e-3;
71  fwdClosure->mRelChi2 = 1e-3;
72 
73  fwdClosure->mFttMode = StFwdClosureMaker::kStrip;
74 
75  fwdClosure->mPrimaryVertexSigXY = primaryVertexSigmaXY;
76  fwdClosure->mPrimaryVertexSigZ = primaryVertexSigmaZ;
77  fwdClosure->mRasterR = fstRasterR;
78  fwdClosure->mRasterPhi = fstRasterPhi;
79  fwdClosure->mNumFttToUse = numFttToUse;
80  fwdClosure->mOutFile = mOutput;
81  fwdClosure->SetDebug(1);
82 
83  chain->AddBefore("MuDst", fwdClosure);
84 
85 
86  StMuDstMaker * muDstMaker = (StMuDstMaker*)chain->GetMaker( "MuDst" );
87 
88  // if (muDstMaker){
89  // StFwdQAMaker *fwdQA = new StFwdQAMaker();
90  // fwdQA->SetDebug(2);
91  // chain->AddAfter("MuDst", fwdQA);
92  // }
93 
94 chain_loop:
95  chain->Init();
96 
97  //_____________________________________________________________________________
98  //
99  // MAIN EVENT LOOP
100  //_____________________________________________________________________________
101  for (int i = 0; i < n; i++) {
102  cout << "--------->START EVENT: " << i << endl;
103  chain->Clear();
104  if (kStOK != chain->Make())
105  break;
106  cout << "<---------- END EVENT" << endl;
107  } // event loop
108 }
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Make()
Definition: StChain.cxx:110
Definition: Stypes.h:40