22 TString dstFileName =
"/home/igor/data.cache/Run9compare/rc_aln.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;
94 if (magField ==
nullptr)
95 LOG(fatal) <<
"no magnetic field was found for the '" << geometryTag <<
"' geometry" << endl;
98 if (map_voltage <= 0) {
99 map_voltage = (run_period < 8) ? 55.87 : 112.0;
100 LOG(warning) <<
"No reference voltage of the magnetic field in the Geometry Database, " << map_voltage
104 if (field_voltage < 10) {
107 fieldScale = (field_voltage) / map_voltage;
110 if (beam_energy ==
nullptr)
111 LOG(warning) <<
"no beam energy was found for run " << run_period <<
":" << run_number
112 <<
", the field map scale is not corrected";
120 LOG(fatal) <<
"the scale of the magnetic field cannot be set" << endl;
122 fRunAna->SetField(magField);
134 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
135 cout <<
"||\t\t\t\t\t\t\t||" << endl;
136 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
137 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
138 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
139 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
140 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
141 cout <<
"||\t\t\t\t\t\t\t||" << endl;
142 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
146 fRunAna->SetSource(fFileSource);
148 if (dstFileName ==
"")
149 dstFileName =
"bmndst.root";
153 fRunAna->SetSink(
new FairRootFileSink(dstFileName));
154 fRunAna->SetGenerateRunInfo(
false);
167 if (run_period == 8 && isExp) {
169 eventSelector->
SetRunId(run_number);
170 eventSelector->
SetInputFileName(
"$VMCWORKDIR/input/eventSelector_calib_run8.root");
171 fRunAna->AddTask(eventSelector);
178 fRunAna->AddTask(trig);
183 if (run_period >= 8) {
186 fRunAna->AddTask(sibtHM);
191 fRunAna->AddTask(mwpcHP);
194 fRunAna->AddTask(mwpcHM);
203 fRunAna->AddTask(vspHM);
211 fRunAna->AddTask(siliconHM);
219 fRunAna->AddTask(gemHM);
227 fRunAna->AddTask(cscHM);
234 fRunAna->AddTask(tof400HP);
241 fRunAna->AddTask(tof700HP);
246 bool IsGlobalCoordinates =
true;
247 if (run_period >= 8) {
251 fRunAna->AddTask(fhcalReco);
254 fRunAna->AddTask(zdcAna);
260 IsGlobalCoordinates =
true;
263 fRunAna->AddTask(scwallReco);
271 fRunAna->AddTask(hodoReco);
278 fRunAna->AddTask(ndetReco);
285 fRunAna->AddTask(vacReco);
295 innerTrackBranchName =
"StsTrack";
297 innerTrackBranchName =
"StsVector";
298 if (run_period >= 8) {
308 if (run_period > 8) {
314 fRunAna->AddTask(hitConverter);
319 if (run_period == 9) {
323 detModel->
Init(
"/scratch/polev/target_Sn.geo");
326 new BmnAlignerApply(meModel, detModel,
"/scratch/polev/sl9555.112e_lin3.01.json");
327 fRunAna->AddTask(newAligner);
331 fRunAna->AddTask(kalman);
340 fRunAna->AddTask(stsFindTracks);
346 if (run_period > 8) {
349 fRunAna->AddTask(vf);
354 fRunAna->AddTask(stsMatchTracks);
362 fRunAna->AddTask(beamTF);
372 fRunAna->AddTask(findVertex);
376 fRunAna->AddTask(pvMPD);
379 fRunAna->AddTask(combPV);
387 fRunAna->AddTask(glTF);
395 fRunAna->AddTask(mcMatching);
401 if (run_period == 8) {
403 fRunAna->AddTask(dedx);
409 if (run_period < 8) {
411 fRunAna->AddTask(res);
418 fRunAna->AddTask(cclusterizer);
422 fRunAna->AddTask(dst_task);
425 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
426 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
428 parIo1->open(inFileName.Data());
430 rtdb->setFirstInput(parIo1);
435 fRunAna->GetMainTask()->SetVerbose(iVerbose);
440 FairParRootFileIo* parOut =
new FairParRootFileIo(
kTRUE);
443 rtdb->setOutput(parOut);
445 rtdb->getContainer(
"FairGeoParSet")->setDescription(geometryTag.Data());
446 rtdb->writeContainer(rtdb->getContainer(
"FairGeoParSet"), rtdb->getCurrentRun());
452 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
461 cout << endl << endl;
462 cout <<
"Macro finished successfully." << endl;
463 cout <<
"Input file is " + inFileName << endl;
464 cout <<
"Output file is " + dstFileName << endl;
465 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;