20 void WriteStiEvents(Int_t nevents=1,
21 const Char_t *Mainfile =
"/star/data22/ITTF/EvalData/MCFiles/auau200/rcf0183_12_300evts.geant.root",
22 const Char_t *outfile=
"test.event.root",
23 bool simulated =
true)
26 gSystem->Load(
"St_base");
27 gSystem->Load(
"StChain");
28 gSystem->Load(
"StUtilities");
29 gSystem->Load(
"St_Tables");
30 gSystem->Load(
"StarClassLibrary");
32 gSystem->Load(
"StIOMaker");
33 gSystem->Load(
"StEvent");
34 gSystem->Load(
"StEmcUtil");
35 gSystem->Load(
"StMcEvent");
36 gSystem->Load(
"StMcEventMaker");
37 gSystem->Load(
"StAssociationMaker");
39 gSystem->Load(
"St_db_Maker");
40 gSystem->Load(
"StDbLib");
41 gSystem->Load(
"StDbBroker");
42 gSystem->Load(
"StDbUtilities");
43 gSystem->Load(
"StTpcDb");
44 gSystem->Load(
"StDetectorDbMaker");
45 gSystem->Load(
"StTreeMaker");
46 gSystem->Load(
"StSvtClassLibrary");
47 gSystem->Load(
"StSvtDbMaker");
50 gSystem->Load(
"libGui");
51 gSystem->Load(
"StiGui");
53 gSystem->Load(
"StiMaker");
57 IOMk->SetBranch(
"*",0,
"0");
60 IOMk->SetBranch(
"eventBranch",0,
"r");
61 IOMk->SetBranch(
"geantBranch",0,
"r");
63 dbaseMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb");
64 if (simulated) dbaseMk-> SetDateTime(20010801,000000);
71 bool optimized =
false;
73 StiMaker* anaMk = StiMaker::instance();
74 StiRootIOBroker* stiIO = anaMk->getIOBroker();
75 stiIO->setTPHFMinPadrow(1);
76 stiIO->setTPHFMaxPadrow(45);
77 stiIO->setETSFLowerBound(5);
78 stiIO->setETSFMaxHits(6);
80 stiIO->setDoTrackFit(doFit);
83 stiIO->setKTFMcsCalculated(
false);
84 stiIO->setKTFElossCalculated(
false);
85 stiIO->setKTFMaxChi2ForSelection(50);
86 stiIO->setKTFBField(.5);
87 stiIO->setKTFMassHypothesis(.1395);
88 stiIO->setKTFMinContiguousHitCount(2);
89 stiIO->setKTFMaxNullCount(40);
90 stiIO->setKTFMaxContiguousNullCount(25);
91 stiIO->setKTFMinSearchRadius(.5);
92 stiIO->setKTFMaxSearchRadius(4.);
93 stiIO->setKTFSearchWindowScale(5.);
96 stiIO->setLTSFZWindow(5.);
97 stiIO->setLTSFYWindow(2.);
98 stiIO->setLTSFSeedLength(2);
100 stiIO->setLTSFDoHelixFit(
true);
101 stiIO->setLTSFExtrapYWindow(1.);
102 stiIO->setLTSFExtrapZWindow(2.);
103 stiIO->setLTSFExtrapMaxSkipped(2);
104 stiIO->setLTSFExtrapMinLength(4);
105 stiIO->setLTSFExtrapMaxLength(5);
106 stiIO->setLTSFUseVertex(
true);
108 stiIO->setLTMDeltaR(1.);
111 for (
unsigned int sector=1; sector<=12; ++sector) {
112 stiIO->addLTSFSector(sector);
116 for (
unsigned int padrow=6; padrow<=45; padrow+=1) {
117 stiIO->addLTSFPadrow(padrow);
121 enum SeedFinderType {kUndefined=0, kComposite=1, kEvaluable=2};
123 stiIO->setSeedFinderType(kComposite);
126 enum FilterType {kPtFilter=0, kEtaFilter=1, kChi2Filter=2, kNptsFilter=3, kNFitPtsFilter=4,
127 kNGapsFilter=5, kFitPointRatioFilter=6, kPrimaryDcaFilter=7};
129 stiIO->addFilterType(kPtFilter);
130 stiIO->setFilterPtMin(.1);
131 stiIO->setFilterPtMax(50.);
133 stiIO->addFilterType(kEtaFilter);
134 stiIO->setFilterEtaMin(-2.);
135 stiIO->setFilterEtaMax(2.);
137 stiIO->addFilterType(kChi2Filter);
138 stiIO->setFilterChi2Max(10.);
140 stiIO->addFilterType(kNptsFilter);
141 stiIO->setFilterNptsMin(8);
143 stiIO->addFilterType(kNFitPtsFilter);
144 stiIO->setFilterNFitPtsMin(5);
146 stiIO->addFilterType(kNGapsFilter);
147 stiIO->setFilterNGapsMax(20);
149 stiIO->addFilterType(kPrimaryDcaFilter);
150 stiIO->setFilterPrimaryDcaMax(100.);
152 if (!simulated) stiIO->setSimulated(
false);
156 mcEventReader->doUseFtpc = kFALSE;
157 mcEventReader->doUseRich = kFALSE;
158 mcEventReader->doUseBemc = kFALSE;
159 mcEventReader->doUseBsmd = kFALSE;
161 cout <<
"!!!! doEvents: will write out .event.root file !!" << endl << endl;
164 outMk->SetBranch(
"eventBranch",outfile,
"w");
165 outMk->IntoBranch(
"eventBranch",
"StEvent");
168 if (simulated) assocMakerIt->useInTracker();
173 Int_t iInit = chain->Init();
174 if (iInit) chain->Fatal(iInit,
"on init");
181 EventLoop:
if (i <= nevents && istat!=2) {
183 cout << endl <<
"============================ Event " << i
184 <<
" start ============================" << endl;
187 istat = chain->
Make(i);
190 {cout <<
"Last event processed. Status = " << istat << endl;}
192 {cout <<
"Error event processed. Status = " << istat << endl;}
200 cout << endl <<
"============================ Event " << i
201 <<
" finish ============================" << endl;
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void Clear(Option_t *option="")
User defined functions.
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...