10 void sim(
char *inFile =
"sim.fzd",
12 bool useFstForSeedFinding =
true,
13 bool enableTrackRefit =
true,
14 bool realisticSim =
true,
18 cout <<
"inFile = " << inFile << endl;
19 cout <<
"n = " << n << endl;
20 cout <<
"useFstForSeedFinding = " << useFstForSeedFinding << endl;
21 cout <<
"enableTrackRefit = " << enableTrackRefit << endl;
22 cout <<
"realisticSim = " << realisticSim << endl;
23 cout <<
"useZeroB = " << useZeroB << endl;
24 const char *geom =
"y2024 agml usexgeom";
29 bool useConstBz =
false;
42 _chain = Form(
"fzin %s sdt20211016 fstFastSim fcsSim fcsWFF fcsCluster fwdTrack MakeEvent StEvent McEvent ReverseField bigbig evout cmudst tree", _geom.Data() );
44 _chain = Form(
"fzin %s sdt20211016 MakeEvent StEvent ReverseField bigbig fstFastSim fcsSim fwdTrack evout cmudst tree", _geom.Data());
46 gSystem->Load(
"libStarRoot.so" );
47 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");
48 gROOT->LoadMacro(
"bfc.C");
49 bfc(-1, _chain, inFile);
52 StarMagField::setConstBz(
true);
54 gSystem->Load(
"libStFttSimMaker" );
55 gSystem->Load(
"libStFcsTrackMatchMaker" );
57 gSystem->Load(
"libMathMore.so" );
58 gSystem->Load(
"libStarGeneratorUtil" );
62 chain->AddAfter(
"fcsSim", fttSim);
68 cout <<
"fcsdbmkr="<<fcsdbmkr<<endl;
72 cout <<
"fcsdb="<<fcsdb<<endl;
81 fcsWFF->setEnergySelect(0);
88 gSystem->Load(
"StFwdUtils.so");
97 TString qaoutname(gSystem->BaseName(inFile));
98 qaoutname.ReplaceAll(
".fzd",
".FastSimu.QA.root");
102 fstFastSim->SetInEfficiency(0.1);
104 fstFastSim->SetQAFileName(qaoutname);
106 cout <<
"Adding StFstFastSimMaker to chain" << endl;
107 chain->AddAfter(
"fcsSim", fstFastSim);
114 fwdTrack->SetDebug(1);
117 cout <<
"Configured for ideal simulation (MC finding + MC mom seed)" << endl;
118 fwdTrack->setConfigForIdealSim( );
120 cout <<
"Configured for realistic simulation" << endl;
121 fwdTrack->setConfigForRealisticSim( );
122 cout <<
"Configured for realistic simulation DONE" << endl;
126 cout <<
"Using the Geometry cache: fGeom.root" << endl;
131 if (useFstForSeedFinding)
143 fwdTrack->
setOutputFilename( TString::Format(
"%s.output.root", inFile ).Data() );
144 fwdTrack->SetVisualize(
false );
145 fwdTrack->SetDebug();
146 fwdTrack->setIncludePrimaryVertexInFit(
false );
152 cout <<
"Setting B = 0" << endl;
157 StFwdFitQAMaker *fwdFitQA =
new StFwdFitQAMaker();
158 fwdFitQA->SetDebug();
159 TString fitqaoutname(gSystem->BaseName(inFile));
160 fitqaoutname.ReplaceAll(
".fzd",
".FwdFitQA.root");
161 fwdFitQA->setOutputFilename( fitqaoutname );
162 chain->AddAfter(
"fwdTrack", fwdFitQA);
164 cout <<
"fwd tracker setup" << endl;
167 bool doFwdAna =
true;
168 if (!useFCS && doFwdAna ){
171 chain->AddAfter(
"fwdTrack", fwdAna);
178 gSystem->Load(
"StFcsTrackMatchMaker");
180 match->setMaxDistance(6,10);
181 match->setFileName(
"fcstrk.root");
183 chain->AddMaker(match);
188 chain->AddAfter(
"FcsTrkMatch", fwdAna);
193 chain->AddAfter(
"FcsTrkMatch", muDstMaker );
196 chain->AddAfter(
"fwdAna", muDstMaker );
202 TString fwdqaname(gSystem->BaseName(inFile));
203 fwdqaname.ReplaceAll(
".fzd",
".FwdTree.root");
204 fwdQA->setTreeFilename(fwdqaname);
205 chain->AddAfter(
"MuDst", fwdQA);
209 gSystem->Load(
"libStPicoEvent");
210 gSystem->Load(
"libStPicoDstMaker");
212 cout <<
"picoMk = " << picoMk << endl;
223 for (
int i = 0; i < n; i++) {
225 cout <<
"--------->START EVENT: " << i << endl;
240 cout <<
"<---------- END EVENT" << endl;
Class that converts MuDst into PicoDst.
void setZeroB(bool zeroB=true)
Set B-field to zero (for zero field running)
void forceFixGainCorrection()
fixed default gain
virtual void Clear(Option_t *option="")
User defined functions.
void setConstB(bool constB=true)
Set B-field to constant (even outside of TPC)
void setSeedFindingWithFtt()
Use Ftt hits in the Seed Finding.
void setVtxMode(const PicoVtxMode vtxMode)
Set vertex selection mode.
void setOutputFilename(std::string fn)
Set the filename for output ROOT file.
void setTrackRefit(bool refit=true)
Sets the tracking to refit This adds compatible hits from whichever detector was NOT used in seed fin...
void setGeoCache(TString gc)
Sets geometry cache filename.
void forceFixGain()
Gain mode switch.
void setSeedFindingWithFst()
Use Fst hits in the Seed Finding.