8 TString anaFileName =
"$VMCWORKDIR/macro/run/bmnana.root",
17 FairLogger::GetLogger()->SetLogScreenLevel(
"info");
24 vector<TString> dstFileList;
28 TString firstFileName = dstFileList[0];
31 FairRunAna* fRunAna =
new FairRunAna();
39 Double_t fieldScale = 0., beam_energy = 0.;
43 if (magField !=
nullptr)
44 fRunAna->SetField(magField);
47 Int_t run_period = -1, run_number = -1;
50 for (
size_t i = 1;
i < dstFileList.size();
i++)
51 fFileSource->
AddFile(dstFileList[
i]);
52 fRunAna->SetSource(fFileSource);
54 if (dstFileList.size() > 1)
55 fRunAna->SetContainerStatic(
kTRUE);
58 TString title = isExp ?
"EXPERIMENTAL RUN SUMMARY" :
"SIMULATION RUN SUMMARY";
61 << string(nSideBars,
'|') <<
" " << title <<
" " << string(58 - nSideBars - title.
Length() - 2,
'|') << endl;
62 cout <<
"||\t\t\t\t\t\t\t||" << endl;
64 cout <<
"||\t\tPeriod:\t\t" << setw(24) << run_period <<
"||" << endl;
66 cout <<
"||\t\tNumber:\t\t" << setw(24) << run_number <<
"||" << endl;
67 cout <<
"||\t\tBeam:\t\t" << setw(24) << (beam ==
"" ?
"-" : beam.
Data()) <<
"||" << endl;
68 cout <<
"||\t\tEnergy:\t\t" << setw(24)
69 << ((beam_energy > 0) ?
TString::Format(
"%.2f AGeV", beam_energy).
Data() :
"-") <<
"||" << endl;
70 cout <<
"||\t\tTarget:\t\t" << setw(24) << (target ==
"" ?
"-" : target.Data()) <<
"||" << endl;
71 cout <<
"||\t\tField scale:\t" << setw(24) << setprecision(4) << fieldScale <<
"||" << endl;
72 if (dstFileList.size() > 1)
73 cout <<
"||\t\tInput files:\t" << setw(24) << dstFileList.size() <<
"||" << endl;
74 cout <<
"||\t\t\t\t\t\t\t||" << endl;
75 cout << string(58,
'|') <<
"\n\n" << endl;
80 fRunAna->SetSink(
new FairRootFileSink(anaFileName));
81 fRunAna->SetGenerateRunInfo(
false);
85 for (
auto& fileName : dstFileList) {
89 nEvents += nFileEvents;
91 nEvents -= nStartEvent;
102 fRunAna->AddTask(kalman_filter);
105 fRunAna->AddTask(ana_task);
108 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
109 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
111 parIo1->open(firstFileName.
Data());
113 rtdb->setFirstInput(parIo1);
118 fRunAna->GetMainTask()->SetVerbose(iVerbose);
123 FairParRootFileIo* parOut =
new FairParRootFileIo(
kTRUE);
125 rtdb->setOutput(parOut);
126 rtdb->writeContainer(rtdb->getContainer(
"FairGeoParSet"), rtdb->getCurrentRun());
132 fRunAna->Run(nStartEvent, nStartEvent + nEvents);
140 cout << endl << endl;
141 cout <<
"Macro finished successfully." << endl;
142 if (dstFileList.size() > 1)
143 cout <<
"Input file list is " << dstFileName <<
" (" << dstFileList.size() <<
" files)" << endl;
145 cout <<
"Input file is " + firstFileName << endl;
146 cout <<
"Output file is " + anaFileName << endl;
147 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;
static FairField * GetDSTField(TString fileName, Double_t &fieldScale, Int_t &fieldType, TString *beam=nullptr, TString *target=nullptr, Double_t *beam_energy=nullptr, Int_t *beam_a=nullptr, Int_t *beam_z=nullptr, Int_t *target_a=nullptr, Int_t *target_z=nullptr)
void run_ana_bmn(TString dstFileName="$VMCWORKDIR/macro/run/bmndst.root", TString anaFileName="$VMCWORKDIR/macro/run/bmnana.root", Int_t nStartEvent=0, Int_t nEvents=10)