17 TString dstFileName =
"$VMCWORKDIR/macro/run/bmndst.root",
18 Int_t nStartEvent = 0,
29 FairLogger::GetLogger()->SetLogScreenLevel(
"info");
41 FairRunAna* fRunAna =
new FairRunAna();
50 Int_t run_period = -1, run_number = -1;
52 fFileSource =
new FairFileSource(inFileName);
59 fFileSource =
new BmnFileSource(inFileName, run_period, run_number);
67 LOG(fatal) <<
"Geometry '" << geometryTag <<
"' not loaded. Error status: " << errStatus << endl;
68 LOG(info) <<
"Geometry with '" << geometryTag <<
"' tag is chosen";
80 int prev_mag_period = run_period, prev_mag_run = run_number;
82 if ((field_voltage == 0) and (prev_mag_run == run_number) and (prev_mag_period == run_period))
83 LOG(fatal) <<
"no any field voltage was found for run " << run_period <<
":" << run_number << endl;
85 LOG(fatal) <<
"no field voltage was found for run " << run_period <<
":" << run_number << endl;
87 Double_t map_voltage = (run_period < 8) ? 55.87 : 112.0;
89 if (field_voltage < 10) {
92 fieldScale = (field_voltage) / map_voltage;
95 if (beam_energy ==
nullptr)
96 LOG(warning) <<
"no beam energy was found for run " << run_period <<
":" << run_number
97 <<
", the field map scale is not corrected";
108 fRunAna->SetField(magField);
120 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
121 cout <<
"||\t\t\t\t\t\t\t||" << endl;
122 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
123 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
124 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
125 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
126 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
127 cout <<
"||\t\t\t\t\t\t\t||" << endl;
128 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
132 fRunAna->SetSource(fFileSource);
134 if (dstFileName ==
"")
135 dstFileName =
"bmndst.root";
139 fRunAna->SetSink(
new FairRootFileSink(dstFileName));
140 fRunAna->SetGenerateRunInfo(
false);
153 if (run_period == 8 && isExp) {
155 eventSelector->
SetRunId(run_number);
156 eventSelector->
SetInputFileName(
"$VMCWORKDIR/input/eventSelector_calib_run8.root");
157 fRunAna->AddTask(eventSelector);
164 fRunAna->AddTask(trig);
169 if (run_period >= 8) {
172 fRunAna->AddTask(sibtHM);
177 fRunAna->AddTask(mwpcHP);
180 fRunAna->AddTask(mwpcHM);
189 fRunAna->AddTask(vspHM);
197 fRunAna->AddTask(siliconHM);
205 fRunAna->AddTask(gemHM);
213 fRunAna->AddTask(cscHM);
220 fRunAna->AddTask(tof400HP);
227 fRunAna->AddTask(tof700HP);
232 bool IsGlobalCoordinates =
true;
233 if (run_period >= 8) {
237 fRunAna->AddTask(fhcalReco);
240 fRunAna->AddTask(zdcAna);
246 IsGlobalCoordinates =
true;
249 fRunAna->AddTask(scwallReco);
257 fRunAna->AddTask(hodoReco);
264 fRunAna->AddTask(ndetReco);
271 fRunAna->AddTask(vacReco);
281 innerTrackBranchName =
"StsTrack";
283 innerTrackBranchName =
"StsVector";
284 if (run_period >= 8) {
290 if (run_period > 8) {
296 fRunAna->AddTask(hitConverter);
299 fRunAna->AddTask(kalman);
308 fRunAna->AddTask(stsFindTracks);
314 if (run_period > 8) {
317 fRunAna->AddTask(vf);
322 fRunAna->AddTask(stsMatchTracks);
328 if (run_period >= 8) {
331 fRunAna->AddTask(beamTF);
335 fRunAna->AddTask(mwpcTF);
345 fRunAna->AddTask(findVertex);
349 fRunAna->AddTask(pvMPD);
352 fRunAna->AddTask(combPV);
360 fRunAna->AddTask(glTF);
368 fRunAna->AddTask(mcMatching);
377 if (run_period == 8) {
379 fRunAna->AddTask(dedx);
385 if (run_period < 8) {
387 fRunAna->AddTask(res);
394 fRunAna->AddTask(cclusterizer);
398 fRunAna->AddTask(dst_task);
401 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
402 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
404 parIo1->open(inFileName.Data());
406 rtdb->setFirstInput(parIo1);
411 fRunAna->GetMainTask()->SetVerbose(iVerbose);
416 FairParRootFileIo* parOut =
new FairParRootFileIo(
kTRUE);
419 rtdb->setOutput(parOut);
421 rtdb->getContainer(
"FairGeoParSet")->setDescription(geometryTag.Data());
422 rtdb->writeContainer(rtdb->getContainer(
"FairGeoParSet"), rtdb->getCurrentRun());
428 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
437 cout << endl << endl;
438 cout <<
"Macro finished successfully." << endl;
439 cout <<
"Input file is " + inFileName << endl;
440 cout <<
"Output file is " + dstFileName << endl;
441 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;