17 TString dstFileName =
"$VMCWORKDIR/macro/run/bmndst.root",
18 Int_t nStartEvent = 0,
25 FairLogger::GetLogger()->SetLogScreenLevel(
"info");
36 FairRunAna* fRunAna =
new FairRunAna();
48 Int_t run_period = 8, run_number = -1;
51 fFileSource =
new FairFileSource(inFileName);
55 fFileSource =
new BmnFileSource(inFileName, run_period, run_number);
62 cout <<
"ERROR: could not load geometry '" << setupTag <<
"' from the Geometry Database" << endl;
71 if (field_voltage == NULL) {
72 cout <<
"ERROR: no field voltage was found for run " << run_period <<
":" << run_number << endl;
75 Double_t map_current = (run_period == 8) ? 112.0 : (run_period == 7) ? 55.87 : 0.0;
76 if (*field_voltage < 10) {
79 fieldScale = (*field_voltage) / map_current;
84 fRunAna->SetField(magField);
96 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
97 cout <<
"||\t\t\t\t\t\t\t||" << endl;
98 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
99 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
100 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
101 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
102 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
103 cout <<
"||\t\t\t\t\t\t\t||" << endl;
104 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
105 remove(geoFileName.Data());
108 fRunAna->SetSource(fFileSource);
110 if (dstFileName ==
"")
111 dstFileName =
"bmndst.root";
115 fRunAna->SetSink(
new FairRootFileSink(dstFileName));
116 fRunAna->SetGenerateRunInfo(
false);
132 fRunAna->AddTask(trig);
137 if (run_period >= 8) {
140 fRunAna->AddTask(sibtHM);
145 fRunAna->AddTask(mwpcHP);
148 fRunAna->AddTask(mwpcHM);
157 fRunAna->AddTask(siliconHM);
165 fRunAna->AddTask(gemHM);
175 fRunAna->AddTask(cscHM);
182 fRunAna->AddTask(tof1HP);
190 tof2HP->
SetMCTimeFile(
"TOF700_MC_xenon_dcmsmm_time_run8.txt");
198 fRunAna->AddTask(tof2HP);
211 bool IsGlobalCoordinates =
true;
212 if (run_period >= 8) {
216 fRunAna->AddTask(fhcalReco);
219 fRunAna->AddTask(zdcAna);
225 IsGlobalCoordinates =
true;
228 fRunAna->AddTask(scwallReco);
236 fRunAna->AddTask(hodoReco);
241 IsGlobalCoordinates =
true;
244 fRunAna->AddTask(ndetReco);
251 fRunAna->AddTask(vacReco);
258 innerTrackBranchName =
"StsTrack";
260 innerTrackBranchName =
"StsVector";
261 if (run_period >= 8) {
266 fRunAna->AddTask(hitConverter);
269 fRunAna->AddTask(kalman);
274 fRunAna->AddTask(l1);
278 fRunAna->AddTask(stsFindTracks);
283 fRunAna->AddTask(vf);
288 fRunAna->AddTask(stsMatchTracks);
293 fRunAna->AddTask(innerTF);
299 if (run_period >= 8) {
302 fRunAna->AddTask(beamTF);
306 fRunAna->AddTask(mwpcTF);
323 fRunAna->AddTask(findVertex);
327 fRunAna->AddTask(pvMPD);
339 fRunAna->AddTask(glTF);
350 fRunAna->AddTask(mcMatching);
357 fRunAna->AddTask(pid_analyser);
362 if (run_period < 8) {
364 fRunAna->AddTask(res);
371 fRunAna->AddTask(cclusterizer);
375 fRunAna->AddTask(dst_task);
378 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
379 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
380 FairParAsciiFileIo* parIo2 =
new FairParAsciiFileIo();
381 parIo1->open(inFileName.Data());
382 parIo2->open(parFileNameList,
"in");
383 rtdb->setFirstInput(parIo1);
384 rtdb->setSecondInput(parIo2);
388 fRunAna->GetMainTask()->SetVerbose(iVerbose);
393 FairParRootFileIo* parOut =
new FairParRootFileIo(
kTRUE);
396 rtdb->setOutput(parOut);
397 rtdb->writeContainer(rtdb->getContainer(
"FairGeoParSet"), rtdb->getCurrentRun());
402 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
410 cout << endl << endl;
411 cout <<
"Macro finished successfully." << endl;
412 cout <<
"Input file is " + inFileName << endl;
413 cout <<
"Output file is " + dstFileName << endl;
414 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;