22 TString dstFileName =
"/home/igor/data.cache/Run9compare/rc_noa.run_Top_9555_ev0_p0.root",
23 Int_t nStartEvent = 0,
34 FairLogger::GetLogger()->SetLogScreenLevel(
"info");
46 FairRunAna* fRunAna =
new FairRunAna();
55 Int_t run_period = -1, run_number = -1;
57 fFileSource =
new FairFileSource(inFileName);
64 fFileSource =
new BmnFileSource(inFileName, run_period, run_number);
72 LOG(fatal) <<
"Geometry '" << geometryTag <<
"' not loaded. Error status: " << errStatus << endl;
73 LOG(info) <<
"Geometry with '" << geometryTag <<
"' tag is chosen";
85 int prev_mag_period = run_period, prev_mag_run = run_number;
87 if ((field_voltage == 0) and (prev_mag_run == run_number) and (prev_mag_period == run_period))
88 LOG(fatal) <<
"no any field voltage was found for run " << run_period <<
":" << run_number << endl;
90 LOG(fatal) <<
"no field voltage was found for run " << run_period <<
":" << run_number << endl;
92 Double_t map_voltage = (run_period < 8) ? 55.87 : 112.0;
94 if (field_voltage < 10) {
97 fieldScale = (field_voltage) / map_voltage;
100 if (beam_energy ==
nullptr)
101 LOG(warning) <<
"no beam energy was found for run " << run_period <<
":" << run_number
102 <<
", the field map scale is not corrected";
113 fRunAna->SetField(magField);
125 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
126 cout <<
"||\t\t\t\t\t\t\t||" << endl;
127 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
128 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
129 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
130 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
131 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
132 cout <<
"||\t\t\t\t\t\t\t||" << endl;
133 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
137 fRunAna->SetSource(fFileSource);
139 if (dstFileName ==
"")
140 dstFileName =
"bmndst.root";
144 fRunAna->SetSink(
new FairRootFileSink(dstFileName));
145 fRunAna->SetGenerateRunInfo(
false);
158 if (run_period == 8 && isExp) {
160 eventSelector->
SetRunId(run_number);
161 eventSelector->
SetInputFileName(
"$VMCWORKDIR/input/eventSelector_calib_run8.root");
162 fRunAna->AddTask(eventSelector);
169 fRunAna->AddTask(trig);
174 if (run_period >= 8) {
177 fRunAna->AddTask(sibtHM);
182 fRunAna->AddTask(mwpcHP);
185 fRunAna->AddTask(mwpcHM);
194 fRunAna->AddTask(vspHM);
202 fRunAna->AddTask(siliconHM);
210 fRunAna->AddTask(gemHM);
218 fRunAna->AddTask(cscHM);
225 fRunAna->AddTask(tof400HP);
232 fRunAna->AddTask(tof700HP);
245 bool IsGlobalCoordinates =
true;
246 if (run_period >= 8) {
250 fRunAna->AddTask(fhcalReco);
253 fRunAna->AddTask(zdcAna);
259 IsGlobalCoordinates =
true;
262 fRunAna->AddTask(scwallReco);
270 fRunAna->AddTask(hodoReco);
277 fRunAna->AddTask(ndetReco);
284 fRunAna->AddTask(vacReco);
294 innerTrackBranchName =
"StsTrack";
296 innerTrackBranchName =
"StsVector";
297 if (run_period >= 8) {
307 if (run_period > 8) {
313 fRunAna->AddTask(hitConverter);
316 fRunAna->AddTask(kalman);
325 fRunAna->AddTask(stsFindTracks);
331 if (run_period > 8) {
334 fRunAna->AddTask(vf);
339 fRunAna->AddTask(stsMatchTracks);
345 if (run_period >= 8) {
348 fRunAna->AddTask(beamTF);
352 fRunAna->AddTask(mwpcTF);
369 fRunAna->AddTask(findVertex);
373 fRunAna->AddTask(pvMPD);
376 fRunAna->AddTask(combPV);
390 glTF->SetRunNumber(run_number);
392 fRunAna->AddTask(glTF);
403 fRunAna->AddTask(mcMatching);
412 if (run_period == 8) {
414 fRunAna->AddTask(dedx);
420 if (run_period < 8) {
422 fRunAna->AddTask(res);
429 fRunAna->AddTask(cclusterizer);
433 fRunAna->AddTask(dst_task);
436 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
437 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
439 parIo1->open(inFileName.Data());
441 rtdb->setFirstInput(parIo1);
446 fRunAna->GetMainTask()->SetVerbose(iVerbose);
451 FairParRootFileIo* parOut =
new FairParRootFileIo(
kTRUE);
454 rtdb->setOutput(parOut);
456 rtdb->getContainer(
"FairGeoParSet")->setDescription(geometryTag.Data());
457 rtdb->writeContainer(rtdb->getContainer(
"FairGeoParSet"), rtdb->getCurrentRun());
463 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
472 cout << endl << endl;
473 cout <<
"Macro finished successfully." << endl;
474 cout <<
"Input file is " + inFileName << endl;
475 cout <<
"Output file is " + dstFileName << endl;
476 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;