101void run8_reco_bmn(TString inputFileName =
"$VMCWORKDIR/macro/run8/bmnsim.root",
102 TString bmndstFileName =
"$VMCWORKDIR/macro/run8/bmndst.root",
103 Int_t nStartEvent = 0,
119 FairRunAna* fRunAna =
new FairRunAna();
123 (inputFileName.Contains(
"noField")) ? kFALSE : kTRUE;
124 Bool_t isTarget = kTRUE;
129 FairSource* fFileSource;
133 Int_t run_period = 8, run_number = -1;
134 Double_t fieldScale = 0.;
136 fFileSource =
new FairFileSource(inputFileName);
140 fFileSource =
new BmnFileSource(inputFileName, run_period, run_number);
144 TString geoFileName = Form(
"current_geo_file_%d.root", UInt_t(gRandom->Integer(UINT32_MAX)));
147 cout <<
"ERROR: could not read geometry file from the database" << endl;
152 TFile* geoFile =
new TFile(geoFileName,
"READ");
153 if (!geoFile->IsOpen()) {
154 cout <<
"ERROR: could not open ROOT file with geometry: " + geoFileName << endl;
157 TList* keyList = geoFile->GetListOfKeys();
159 TKey* key = (TKey*)next();
160 TString className(key->GetClassName());
161 if (className.BeginsWith(
"TGeoManager"))
164 cout <<
"ERROR: TGeoManager is not top element in geometry file " + geoFileName << endl;
170 if (pCurrentRun == 0)
173 if (field_voltage == NULL) {
174 cout <<
"ERROR: no field voltage was found for run " << run_period <<
":" << run_number << endl;
177 Double_t map_current = 55.87;
178 if (*field_voltage < 10) {
182 fieldScale = (*field_voltage) / map_current;
187 fRunAna->SetField(magField);
199 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
200 cout <<
"||\t\t\t\t\t\t\t||" << endl;
201 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
202 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
203 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
204 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
205 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
206 cout <<
"||\t\t\t\t\t\t\t||" << endl;
207 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
208 remove(geoFileName.Data());
211 fRunAna->SetSource(fFileSource);
215 fRunAna->SetSink(
new FairRootFileSink(bmndstFileName));
216 fRunAna->SetGenerateRunInfo(
false);
226 TList* parFileNameList =
new TList();
242 fRunAna->AddTask(sibtHM);
248 fRunAna->AddTask(siliconHM);
255 fRunAna->AddTask(gemHM);
264 fRunAna->AddTask(cscHM);
271 fRunAna->AddTask(tof1HP);
286 fRunAna->AddTask(tof2HP);
300 fRunAna->AddTask(zdcAna);
304 fRunAna->AddTask(hitConverter);
310 fRunAna->AddTask(kalman);
313 TString stsMatBudgetFile =
316 fRunAna->AddTask(l1);
320 fRunAna->AddTask(stsFindTracks);
327 fRunAna->AddTask(innerTF);
334 fRunAna->AddTask(beamTF);
340 fRunAna->AddTask(mwpcTF);
347 fRunAna->AddTask(dchTF);
352 Bool_t doAlign = kTRUE;
356 fRunAna->AddTask(glTF);
364 fRunAna->AddTask(findVertex);
367 fRunAna->AddTask(gemVF);
374 fRunAna->AddTask(pid_analyser);
385 fRunAna->AddTask(dst_task);
388 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
389 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
390 FairParAsciiFileIo* parIo2 =
new FairParAsciiFileIo();
391 parIo1->open(inputFileName.Data());
392 parIo2->open(parFileNameList,
"in");
393 rtdb->setFirstInput(parIo1);
394 rtdb->setSecondInput(parIo2);
395 rtdb->setOutput(parIo1);
399 fRunAna->GetMainTask()->SetVerbose(iVerbose);
401 cout <<
"Starting run" << endl;
402 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
406 Double_t rtime = timer.RealTime();
407 Double_t ctime = timer.CpuTime();
408 cout << endl << endl;
409 cout <<
"Macro finished successfully." << endl;
410 cout <<
"Input file is " + inputFileName << endl;
411 cout <<
"Output file is " + bmndstFileName << endl;
412 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;