77 TString srcdstFileName =
"$VMCWORKDIR/macro/run/srcdst.root",
78 Int_t nStartEvent = 0,
94 FairRunAna* fRunAna =
new FairRunAna();
98 (inputFileName.Contains(
"noField")) ?
kFALSE :
kTRUE;
108 Int_t run_period = 7, run_number = -2;
111 fFileSource =
new FairFileSource(inputFileName);
115 fFileSource =
new BmnFileSource(inputFileName, run_period, run_number);
122 cout <<
"ERROR: could not load geometry '" << setupTag <<
"' from the Geometry Database" << endl;
128 if (pCurrentRun == 0)
131 if (field_voltage == NULL) {
132 cout <<
"ERROR: no field voltage was found for run " << run_period <<
":" << run_number << endl;
136 if (*field_voltage < 10) {
140 fieldScale = (*field_voltage) / map_current;
145 fRunAna->SetField(magField);
157 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
158 cout <<
"||\t\t\t\t\t\t\t||" << endl;
159 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
160 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
161 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
162 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
163 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
164 cout <<
"||\t\t\t\t\t\t\t||" << endl;
165 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
166 remove(geoFileName.Data());
169 fRunAna->SetSource(fFileSource);
173 fRunAna->SetSink(
new FairRootFileSink(srcdstFileName));
174 fRunAna->SetGenerateRunInfo(
false);
191 fRunAna->AddTask(mwpcHP);
194 fRunAna->AddTask(mwpcHM);
202 fRunAna->AddTask(siliconHM);
211 fRunAna->AddTask(gemHM);
220 fRunAna->AddTask(cscHM);
227 fRunAna->AddTask(tof1HP);
242 fRunAna->AddTask(tof2HP);
249 fRunAna->AddTask(armTrigHitProducer);
257 fRunAna->AddTask(bcHitProducer);
270 fRunAna->AddTask(mwpcTF);
277 fRunAna->AddTask(siHP);
280 fRunAna->AddTask(siTF);
286 fRunAna->AddTask(upTF);
292 fRunAna->AddTask(innerTF);
300 fRunAna->AddTask(dchHP);
305 fRunAna->AddTask(dchTF);
309 fRunAna->AddTask(res);
312 glTF->SetSrcSetup(
kTRUE);
313 glTF->SetRunNumber(run_number);
314 fRunAna->AddTask(glTF);
320 fRunAna->AddTask(VF);
326 fRunAna->AddTask(dst_task);
328 BmnPidSRC* pid =
new BmnPidSRC();
329 fRunAna->AddTask(pid);
332 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
333 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
334 FairParAsciiFileIo* parIo2 =
new FairParAsciiFileIo();
335 parIo1->open(inputFileName.Data());
336 parIo2->open(parFileNameList,
"in");
337 rtdb->setFirstInput(parIo1);
338 rtdb->setSecondInput(parIo2);
339 rtdb->setOutput(parIo1);
343 fRunAna->GetMainTask()->SetVerbose(iVerbose);
345 cout <<
"Starting run" << endl;
346 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
352 cout << endl << endl;
353 cout <<
"Macro finished successfully." << endl;
354 cout <<
"Input file is " + inputFileName << endl;
355 cout <<
"Output file is " + srcdstFileName << endl;
356 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;