11 TString bmndstFileName =
"$VMCWORKDIR/macro/run/bmndst.root",
12 Int_t nStartEvent = 0,
24 FairRunAna* fRunAna =
new FairRunAna();
28 (inputFileName.Contains(
"noField")) ?
kFALSE :
kTRUE;
38 Int_t run_period = 7, run_number = -1;
42 cout <<
"ERROR: digi file " + inputFileName +
" does not exist!" << endl;
47 fFileSource =
new BmnFileSource(inputFileName, run_period, run_number);
54 cout <<
"ERROR: could not load geometry '" << setupTag <<
"' from the Geometry Database" << endl;
59 TFile* geoFile =
new TFile(geoFileName,
"READ");
61 cout <<
"ERROR: could not open ROOT file with geometry: " + geoFileName << endl;
67 TString className(key->GetClassName());
71 cout <<
"ERROR: TGeoManager is not top element in geometry file " + geoFileName << endl;
80 if (field_voltage == NULL) {
81 cout <<
"ERROR: no field voltage was found for run " << run_period <<
":" << run_number << endl;
85 if (*field_voltage < 10) {
89 fieldScale = (*field_voltage) / map_current;
94 fRunAna->SetField(magField);
106 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
107 cout <<
"||\t\t\t\t\t\t\t||" << endl;
108 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
109 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
110 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
111 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
112 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
113 cout <<
"||\t\t\t\t\t\t\t||" << endl;
114 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
118 fFileSource =
new FairFileSource(inputFileName);
120 fRunAna->SetSource(fFileSource);
121 fRunAna->SetSink(
new FairRootFileSink(bmndstFileName));
122 fRunAna->SetGenerateRunInfo(
false);
134 TObjString stsDigiFile =
"$VMCWORKDIR/parameters/sts_v1_BMN_SI_GEM.digi.par";
135 parFileNameList->
Add(&stsDigiFile);
137 TObjString tofDigiFile =
"$VMCWORKDIR/parameters/tof_standard.geom.par";
138 parFileNameList->
Add(&tofDigiFile);
149 fRunAna->AddTask(mwpcHM);
156 stsDigitize->
SetGeoFile(
"$VMCWORKDIR/geometry/SIGEMS_r7.root");
157 fRunAna->AddTask(stsDigitize);
163 fRunAna->AddTask(stsClusterFinder);
169 fRunAna->AddTask(stsFindHits);
175 fRunAna->AddTask(kalman);
181 fRunAna->AddTask(l1);
185 fRunAna->AddTask(stsFindTracks);
192 fRunAna->AddTask(findVertex);
200 fRunAna->AddTask(siliconHM);
209 fRunAna->AddTask(gemHM);
218 fRunAna->AddTask(cscHM);
224 fRunAna->AddTask(gemTF);
230 fRunAna->AddTask(gemVF);
238 fRunAna->AddTask(tof1HP);
253 fRunAna->AddTask(tof2HP);
259 fRunAna->AddTask(mwpcTF);
267 fRunAna->AddTask(dchHP);
272 fRunAna->AddTask(dchTF);
276 fRunAna->AddTask(res);
279 fRunAna->AddTask(glTF);
284 fRunAna->AddTask(dst_task);
287 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
288 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
289 FairParAsciiFileIo* parIo2 =
new FairParAsciiFileIo();
290 parIo1->open(inputFileName.Data());
291 parIo2->open(parFileNameList,
"in");
292 gSystem->Unlink(parIo2->getFilename());
293 rtdb->setFirstInput(parIo1);
294 rtdb->setSecondInput(parIo2);
295 rtdb->setOutput(parIo1);
299 fRunAna->GetMainTask()->SetVerbose(iVerbose);
301 cout <<
"Starting run" << endl;
302 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
308 cout << endl << endl;
309 cout <<
"Macro finished successfully." << endl;
310 cout <<
"Input file is " + inputFileName << endl;
311 cout <<
"Output file is " + bmndstFileName << endl;
312 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;