84 Bool_t doProfile =
false;
92 class StEventDisplayMaker;
93 StEventDisplayMaker *dsMaker = 0;
96 const char *dstFile = 0;
97 const char *xdfFile = 0;
98 const char *mdcFile = 0;
99 const char *fileList[] = {dstFile,xdfFile,mdcFile,0};
103 cout <<
"Usage: TestEvalIT.C(firstEvtIndex,nevents,\"-\",\"some_directory/some_dst_file.xdf\")" << endl;
104 cout <<
" TestEvalIT.C(firstEvtIndex,nevents,\"-\",\"some_directory/some_dst_file.root\")" << endl;
105 cout <<
" TestEvalIT.C(firstEvtIndex,nevents,\"some_directory\",\"*.dst.root\")" << endl;
108 void loadLibrairies(
bool doProfile)
110 cout<<
"Loading modules:"<<endl;
111 gSystem->Load(
"St_base");
112 gSystem->Load(
"StChain");
113 gSystem->Load(
"StUtilities");
114 gSystem->Load(
"StBFChain");
115 gSystem->Load(
"St_Tables");
117 gSystem->Load(
"libgen_Tables");
118 gSystem->Load(
"libsim_Tables");
119 gSystem->Load(
"libglobal_Tables");
120 gSystem->Load(
"geometry");
121 gSystem->Load(
"St_g2t");
122 gSystem->Load(
"St_geant_Maker");
123 gSystem->Load(
"StIOMaker");
124 gSystem->Load(
"StTreeMaker");
125 gSystem->Load(
"StarClassLibrary");
126 gSystem->Load(
"St_db_Maker");
127 gSystem->Load(
"StDbLib");
128 gSystem->Load(
"StDbBroker");
129 gSystem->Load(
"StSvtDbMaker");
130 gSystem->Load(
"StDbUtilities");
131 gSystem->Load(
"StTpcDb");
132 gSystem->Load(
"StEvent");
133 gSystem->Load(
"StEventMaker");
134 gSystem->Load(
"StEmcUtil");
135 gSystem->Load(
"StMcEvent");
136 gSystem->Load(
"StMcEventMaker");
137 gSystem->Load(
"StAssociationMaker");
138 gSystem->Load(
"StDaqLib");
139 gSystem->Load(
"StDAQMaker");
140 gSystem->Load(
"StDetectorDbMaker");
141 gSystem->Load(
"StSvtClassLibrary");
142 gSystem->Load(
"StSvtDaqMaker");
143 gSystem->Load(
"StSvtSimulationMaker");
144 gSystem->Load(
"StSvtCalibMaker");
145 gSystem->Load(
"StSvtSeqAdjMaker");
147 gSystem->Load(
"StSvtClusterMaker");
149 cout <<
"/Sti" << endl; gSystem->Load(
"Sti");
150 cout <<
"/StiGui"<< endl; gSystem->Load(
"StiGui");
151 cout <<
"/StiEvaluator"<< endl; gSystem->Load(
"StiEvaluator");
152 cout <<
"/libGui"<< endl; gSystem->Load(
"libGui");
153 cout <<
"/StiMaker"<< endl; gSystem->Load(
"StiMaker");
154 cout <<
"/StMiniMcEvent"<< endl; gSystem->Load(
"StMiniMcEvent");
155 cout <<
"/StMiniMcMaker"<< endl; gSystem->Load(
"StMiniMcMaker");
160 gSystem->Setenv(
"JPROF_FLAGS",
"JP_START JP_PERIOD=0.001");
161 gSystem->Load(
"libJprof");
166 void TestEvalIT(Int_t firstEvtIndex=0,
170 const Char_t* path =
"/star/data22/ITTF/EvalData/MCFiles/auau200/",
171 const Char_t* file=
"rcf0183_12_300evts.geant.root",
172 const Char_t *qaflag =
"off",
173 const Int_t wrStEOut = 0,
174 const int associateStiTrack=1,
175 const char* filePrefix =
"rcf")
182 const char *fileListQQ[]={0,0};
183 if (strncmp(path,
"GC",2)==0)
185 else if (path[0]==
'-')
190 fileListQQ[0] = gSystem->ConcatFileName(path,file);
191 TestEvalIT(firstEvtIndex, nevents,fileListQQ,qaflag,wrStEOut,associateStiTrack,filePrefix);
197 void TestEvalIT(Int_t firstEvtIndex,
199 const Char_t **fileList,
200 const Char_t *qaflag,
201 const Int_t wrStEOut,
202 const int associateStiTrack,
203 const char* filePrefix)
205 Int_t theRunNumber=0;
206 bool simulated =
true;
208 bool optimized =
false;
209 bool doProfile =
false;
210 char* outfile =
"Evaluation.root";
212 cout << endl << endl <<
" TestEvalIT - input # events = " << nevents << endl;
214 while(fileList[ilist]){
215 cout <<
" TestEvalIT - input fileList = " << fileList[ilist] << endl;
218 cout <<
" TestEvalIT - input qaflag = " << qaflag << endl;
219 cout <<
" TestEvalIT - input wrStEOut = " << wrStEOut << endl;
220 cout <<
" TestEvalIT - file Prefix = " << filePrefix << endl << endl;
223 TString fileName =
"EvalItTest";
224 TString MainFile = fileList[0];
225 int fileBeginIndex = MainFile.Index(filePrefix,0);
226 MainFile.Remove(0,fileBeginIndex);
227 fileName.Append(MainFile);
228 cout <<
"Output MiniMcTree : " << fileName << endl;
230 loadLibrairies(doProfile);
234 chain =
new StChain(
"StChain");
238 setFiles=
new StFile(fileList);
240 gSystem->Load(
"StChallenger");
241 setFiles = StChallenger::Challenge();
242 setFiles->SetDebug();
243 const char *Argv[]= {
245 "-q",
"mRunNumber=1228023",
246 "-c",
"/afs/rhic.bnl.gov/star/incoming/GCA/daq/stacs.rc"
248 Int_t Argc=
sizeof(Argv)/4;
249 setFiles->Init(Argc,Argv);
253 IOMk->SetBranch(
"*",0,
"0");
256 IOMk->SetBranch(
"eventBranch",0,
"r");
258 IOMk->SetBranch(
"geantBranch",0,
"r");
271 dbaseMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb");
274 if (simulated) dbaseMk-> SetDateTime(20010801,000000);
296 StiMaker* anaMk = StiMaker::instance();
299 cout <<
"\n --- Setup StiIOBroker ---\n"<<endl;
300 StiRootIOBroker* stiIO = anaMk->getIOBroker();
301 stiIO->setTPHFMinPadrow(1);
302 stiIO->setTPHFMaxPadrow(45);
303 stiIO->setETSFLowerBound(5);
304 stiIO->setETSFMaxHits(6);
305 stiIO->setDoTrackFit(doFit);
309 stiIO->setKTFMcsCalculated(
false);
310 stiIO->setKTFElossCalculated(
false);
311 stiIO->setKTFMaxChi2ForSelection(50);
312 stiIO->setKTFBField(.5);
313 stiIO->setKTFMassHypothesis(.1395);
314 stiIO->setKTFMinContiguousHitCount(2);
315 stiIO->setKTFMaxNullCount(40);
316 stiIO->setKTFMaxContiguousNullCount(25);
317 stiIO->setKTFMinSearchRadius(.5);
318 stiIO->setKTFMaxSearchRadius(4.);
319 stiIO->setKTFSearchWindowScale(5.);
323 stiIO->setLTSFZWindow(10.);
324 stiIO->setLTSFYWindow(4.);
325 stiIO->setLTSFSeedLength(2);
326 stiIO->setLTSFDoHelixFit(
true);
327 stiIO->setLTSFExtrapYWindow(1.);
328 stiIO->setLTSFExtrapZWindow(2.);
329 stiIO->setLTSFExtrapMaxSkipped(2);
330 stiIO->setLTSFExtrapMinLength(4);
331 stiIO->setLTSFExtrapMaxLength(5);
332 stiIO->setLTSFUseVertex(
true);
333 stiIO->setLTMDeltaR(1.);
336 for (
unsigned int sector=1; sector<=12; ++sector) {
337 stiIO->addLTSFSector(sector);
341 for (
unsigned int padrow=6; padrow<=45; padrow+=1) {
342 stiIO->addLTSFPadrow(padrow);
346 enum SeedFinderType {kUndefined=0, kComposite=1, kEvaluable=2};
349 enum FilterType {kPtFilter=0, kEtaFilter=1, kChi2Filter=2, kNptsFilter=3, kNFitPtsFilter=4,
350 kNGapsFilter=5, kFitPointRatioFilter=6, kPrimaryDcaFilter=7};
353 stiIO->setSeedFinderType(kComposite);
354 stiIO->addFilterType(kPtFilter);
355 stiIO->setFilterPtMin(.1);
356 stiIO->setFilterPtMax(50.);
357 stiIO->addFilterType(kEtaFilter);
358 stiIO->setFilterEtaMin(-2.);
359 stiIO->setFilterEtaMax(2.);
360 stiIO->addFilterType(kChi2Filter);
361 stiIO->setFilterChi2Max(10.);
362 stiIO->addFilterType(kNptsFilter);
363 stiIO->setFilterNptsMin(8);
364 stiIO->addFilterType(kNFitPtsFilter);
365 stiIO->setFilterNFitPtsMin(5);
366 stiIO->addFilterType(kNGapsFilter);
367 stiIO->setFilterNGapsMax(20);
370 stiIO->addFilterType(kPrimaryDcaFilter);
371 stiIO->setFilterPrimaryDcaMax(100.);
372 stiIO->setSimulated(simulated);
373 anaMk->setEvaluationFileName(outfile);
376 anaMk->setMcEventMaker(mcEventReader);
377 anaMk->setAssociationMaker(assocMaker);
382 StiGuiIOBroker* guiIO=0;
384 if (gROOT->IsBatch()||nevents>1)
386 cout <<
"Batch mode selected. Run Integrated Tracker in non-Gui Mode."<<endl;
387 stiIO->setUseGui(
false);
391 cout <<
"Interactive mode selected. Run Integrated Tracker in Gui Mode."<<endl;
392 sti =
new MainFrame(gClient->GetRoot(), 400, 220);
393 sti->setStChain(chain);
394 sti->setIoMaker(IOMk);
395 stiIO->setUseGui(
true);
396 guiIO = StiGuiIOBroker::instance();
398 guiIO->setUnMarkedHitSize(.3);
399 guiIO->setUnMarkedHitColor(4);
400 guiIO->setUnMarkedHitStyle(8);
401 guiIO->setUpdateEachTrack(
false);
403 guiIO->setMarkedHitSize(.3);
404 guiIO->setMarkedHitColor(2);
405 guiIO->setMarkedHitStyle(3);
407 cout <<
"\n --- Done setting up StiIOBroker --- \n"<<endl;
411 cout <<
"!!!! doEvents: will write out .event.root file !!" << endl << endl;
414 outMk->SetBranch(
"eventBranch",
"test.event.root",
"w");
415 outMk->IntoBranch(
"eventBranch",
"StEvent");
421 if(associateStiTrack) assocMakerIt->useInTracker();
422 assocMakerIt->SetDebug();
425 minimcMaker->setDebug();
426 minimcMaker->setOutDir(
"./");
427 minimcMaker->setFileName(fileName);
437 Int_t iInit = chain->Init();
438 if (iInit) chain->Fatal(iInit,
"on init");
439 chain->InitRun(theRunNumber);
443 int iLast=firstEvtIndex+nevents;
445 while (i < iLast && istat!=2)
447 cout <<
"============= Event " <<i<<
" started =============" << endl;
451 istat =chain->
Make(i);
454 case 2: cout <<
"Event completed with Status = 2" << endl;
break;
455 case 3: cout <<
"Event completed with error Status = 3" << endl;
break;
459 catch (runtime_error & rte)
461 cout <<
"TestEvalIT.C - ERROR -" << rte.what() << endl;
463 catch (exception & eee)
465 cout <<
"TestEvalIT.C - ERROR -" << eee.what() << endl;
469 cout <<
" TestEvalIT.C - ERROR - Unknown exception"<<endl;
473 cout <<
"\n=============== Event "<<i<<
" finished ============" << 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...
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.