17 TString dstFileName =
"/home/igor/data.cache/Run9compare/rc_default.run_Top_9555_ev0_p0.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;
89 if (magField ==
nullptr)
90 LOG(fatal) <<
"no magnetic field was found for the '" << geometryTag <<
"' geometry" << endl;
93 if (map_voltage <= 0) {
94 map_voltage = (run_period < 8) ? 55.87 : 112.0;
95 LOG(warning) <<
"No reference voltage of the magnetic field in the Geometry Database, " << map_voltage
99 if (field_voltage < 10) {
102 fieldScale = (field_voltage) / map_voltage;
105 if (beam_energy ==
nullptr)
106 LOG(warning) <<
"no beam energy was found for run " << run_period <<
":" << run_number
107 <<
", the field map scale is not corrected";
115 LOG(fatal) <<
"the scale of the magnetic field cannot be set" << endl;
117 fRunAna->SetField(magField);
129 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
130 cout <<
"||\t\t\t\t\t\t\t||" << endl;
131 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
132 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
133 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
134 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
135 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
136 cout <<
"||\t\t\t\t\t\t\t||" << endl;
137 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
141 fRunAna->SetSource(fFileSource);
143 if (dstFileName ==
"")
144 dstFileName =
"bmndst.root";
148 fRunAna->SetSink(
new FairRootFileSink(dstFileName));
149 fRunAna->SetGenerateRunInfo(
false);
162 if (run_period == 8 && isExp) {
164 eventSelector->
SetRunId(run_number);
165 eventSelector->
SetInputFileName(
"$VMCWORKDIR/input/eventSelector_calib_run8.root");
166 fRunAna->AddTask(eventSelector);
173 fRunAna->AddTask(trig);
178 if (run_period >= 8) {
181 fRunAna->AddTask(sibtHM);
186 fRunAna->AddTask(mwpcHP);
189 fRunAna->AddTask(mwpcHM);
198 fRunAna->AddTask(vspHM);
206 fRunAna->AddTask(siliconHM);
214 fRunAna->AddTask(gemHM);
222 fRunAna->AddTask(cscHM);
229 fRunAna->AddTask(tof400HP);
236 fRunAna->AddTask(tof700HP);
241 bool IsGlobalCoordinates =
true;
242 if (run_period >= 8) {
246 fRunAna->AddTask(fhcalReco);
249 fRunAna->AddTask(zdcAna);
255 IsGlobalCoordinates =
true;
258 fRunAna->AddTask(scwallReco);
266 fRunAna->AddTask(hodoReco);
273 fRunAna->AddTask(ndetReco);
280 fRunAna->AddTask(vacReco);
290 innerTrackBranchName =
"StsTrack";
292 innerTrackBranchName =
"StsVector";
293 if (run_period >= 8) {
299 if (run_period > 8) {
305 fRunAna->AddTask(hitConverter);
308 fRunAna->AddTask(kalman);
317 fRunAna->AddTask(stsFindTracks);
323 if (run_period > 8) {
326 fRunAna->AddTask(vf);
331 fRunAna->AddTask(stsMatchTracks);
339 fRunAna->AddTask(beamTF);
349 fRunAna->AddTask(findVertex);
353 fRunAna->AddTask(pvMPD);
356 fRunAna->AddTask(combPV);
364 fRunAna->AddTask(glTF);
372 fRunAna->AddTask(mcMatching);
378 if (run_period == 8) {
380 fRunAna->AddTask(dedx);
386 if (run_period < 8) {
388 fRunAna->AddTask(res);
395 fRunAna->AddTask(cclusterizer);
399 fRunAna->AddTask(dst_task);
402 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
403 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
405 parIo1->open(inFileName.Data());
407 rtdb->setFirstInput(parIo1);
412 fRunAna->GetMainTask()->SetVerbose(iVerbose);
417 FairParRootFileIo* parOut =
new FairParRootFileIo(
kTRUE);
420 rtdb->setOutput(parOut);
422 rtdb->getContainer(
"FairGeoParSet")->setDescription(geometryTag.Data());
423 rtdb->writeContainer(rtdb->getContainer(
"FairGeoParSet"), rtdb->getCurrentRun());
429 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
438 cout << endl << endl;
439 cout <<
"Macro finished successfully." << endl;
440 cout <<
"Input file is " + inFileName << endl;
441 cout <<
"Output file is " + dstFileName << endl;
442 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;