56void eventdisplay(
const char* sim_run_info =
"$VMCWORKDIR/macro/run/bmnsim.root",
57 const char* reco_file =
"$VMCWORKDIR/macro/run/bmndst.root",
59 bool is_online =
false)
64 FairRunAna* fRunAna =
new FairRunAna();
66 int run_period = -1, run_number = -1;
67 bool isTarget =
false, isField =
true;
68 FairSource* fFileSource = NULL;
70 TString strSimRunInfo(sim_run_info), strRecoFile(reco_file);
72 if (data_source == 0) {
75 cout << endl <<
"ERROR: Simulation file with detector geometry wasn't found!" << endl;
79 fFileSource =
new FairFileSource(strSimRunInfo);
82 FairRuntimeDb* rtdb = fRunAna->GetRuntimeDb();
83 FairParRootFileIo* parIo1 =
new FairParRootFileIo();
84 parIo1->open(strSimRunInfo.Data());
85 rtdb->setFirstInput(parIo1);
86 rtdb->setOutput(parIo1);
91 ((FairFileSource*)fFileSource)->AddFriend(strRecoFile);
93 cout << endl <<
"Warning: File with reconstructed data wasn't found!" << endl;
99 Ssiz_t indDash = strSimRunInfo.First(
'-');
100 if ((indDash > 0) && (strSimRunInfo.BeginsWith(
"run"))) {
102 run_period = TString(strSimRunInfo(3, indDash - 3)).Atoi();
104 run_number = TString(strSimRunInfo(indDash + 1, strSimRunInfo.Length() - indDash - 1)).Atoi();
107 TString root_file_path =
"current_geo_file.root";
110 cout <<
"\nGeometry couldn't' be read from the database" << endl;
115 TFile* geoFile =
new TFile(root_file_path,
"READ");
116 if (!geoFile->IsOpen()) {
117 cout <<
"Error: could not open ROOT file with geometry!" << endl;
120 TList* keyList = geoFile->GetListOfKeys();
122 TKey* key = (TKey*)next();
123 TString className(key->GetClassName());
124 if (className.BeginsWith(
"TGeoManager"))
127 cout <<
"Error: TGeoManager isn't top element in geometry file " << root_file_path << endl;
133 if (pCurrentRun == 0)
136 Double_t fieldScale = 0.0;
137 Double_t map_current = 55.87;
139 if ((field_voltage == NULL) || (*field_voltage < 10)) {
143 fieldScale = (*field_voltage) / map_current;
147 fRunAna->SetField(magField);
156 cout <<
"\n\n|||||||||||||||| EXPERIMENTAL RUN SUMMARY ||||||||||||||||" << endl;
157 cout <<
"||\t\tPeriod:\t\t" << run_period <<
"\t\t\t||" << endl;
158 cout <<
"||\t\tNumber:\t\t" << run_number <<
"\t\t\t||" << endl;
159 cout <<
"||\t\tBeam:\t\t" << beam <<
"\t\t\t||" << endl;
160 cout <<
"||\t\tTarget:\t\t" << targ <<
"\t\t\t||" << endl;
161 cout <<
"||\t\tField scale:\t" << setprecision(4) << fieldScale <<
"\t\t\t||" << endl;
162 cout <<
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n" << endl;
164 cout <<
"Error: run info wasn't found!" << endl;
172 if (data_source == 1)
175 if (data_source == 2) {
177 gSystem->Load(
"libemon");
178 gSystem->Load(
"libemon-dal");
179 gSystem->Load(
"libcmdline");
180 gSystem->Load(
"libipc");
181 gSystem->Load(
"libowl");
182 gSystem->Load(
"libomniORB4");
183 gSystem->Load(
"libomnithread");
184 gSystem->Load(
"libers");
190 if (fFileSource != NULL)
191 fRunAna->SetSource(fFileSource);
199 fRunAna->SetSink(
new FairRootFileSink(
"ed_out.root"));
202 SetTasks(fMan, data_source, run_period, run_number, isField, isTarget);
215 Style_t pointMarker = kFullDotSmall;
216 Color_t mcPointColor = kRed, recoPointColor = kBlack, expPointColor = kRed;
219 if (data_source == 0) {
265 "BmnGemStripHit", recoPointColor, pointMarker);
296 if (data_source == 1) {
void SetTasks(MpdEventManager *fMan, int data_source, int run_period, int run_number, bool isField, bool isTarget)