5 if (fff.IsZombie()) fileok=
false;
6 TTree *
t=(TTree*)fff.Get(
"pndsim");
7 if (t==0
x0) fileok=
false;
9 if (!fileok) cout <<
"Skipping broken file '"<<fn<<
"'"<<endl;
17 cout <<
"Example analysis macro using PndSimpleCombiner(Task). !! MODIFY for your purpose !!\n\n";
19 cout <<
"prod_myana.C( <pref>, <from>, <to>, [nevt] )\n\n";
20 cout <<
" <pref> : output file names prefix\n";
21 cout <<
" <from> : first run number\n";
22 cout <<
" <to> : last run number\n";
23 cout <<
" [mode] : arbitrary mode number; default: 0\n";
24 cout <<
" [nevt] : number of events; default: 0 = all\n\n";
33 TString pidalgo =
"PidAlgoEmcBayes;PidAlgoDrc;PidAlgoDisc;PidAlgoStt;PidAlgoMdtHardCuts;PidAlgoRich;PidAlgoSciT";
34 if (fastsim) pidalgo =
"PidChargedProbability";
39 TString suffix = fastsim ?
"fsim" :
"pid";
41 TString outFile = TString::Format(
"%s_ana_%d_%d.root",prefix.Data(), from, to);
42 TString firstFile = TString::Format(
"%s_%d_%s.root",prefix.Data(),from,suffix.Data());
45 if (prefix.EndsWith(
".root"))
48 outFile = prefix; outFile.ReplaceAll(
".root",
"_ana.root");
53 else if (from==to) outFile = TString::Format(
"%s_%d_ana.root", prefix.Data(), from);
65 FairRunAna *
fRun =
new FairRunAna();
66 FairFileSource *fSrc =
new FairFileSource(firstFile);
69 for (
int i=from+1;
i<=to;++
i)
71 TString fname = TString::Format(
"%s_%d_%s.root",prefix.Data(),
i,suffix.Data());
72 if (
checkfile(fname) ) fSrc->AddFile(fname);
75 fRun->SetSource(fSrc);
78 TString pidParFile =
TString(gSystem->Getenv(
"VMCWORKDIR"))+
"/macro/params/all.par";
81 FairLogger::GetLogger()->SetLogToFile(kFALSE);
82 fRun->SetOutputFile(outFile);
93 fRun->AddTask(prodTask);
104 FairSystemInfo sysInfo;
105 Float_t maxMemory=sysInfo.GetMaxMemory();
109 Float_t cpuUsage=ctime/
rtime;
112 cout <<
"[INFO ] Macro call : prod_fsim.C(\""<<prefix<<
"\", "<<from<<
", "<<to<<
", "<<
mode<<
", "<<nevts<<
")" <<endl;
113 cout <<
"[INFO ] Output file : " << outFile << endl;
114 cout <<
"[INFO ] Real time : " << rtime <<
" s, CPU time " << ctime <<
"s" << endl;
115 cout <<
"[INFO ] CPU usage : " << cpuUsage*100. <<
"%" << endl;
116 cout <<
"[INFO ] Max Memory : " << maxMemory <<
" MB" << endl;
117 cout <<
"[INFO ] Macro finished successfully." << endl<<endl;
int prod_myana(TString prefix="", int from=1, int to=1, int mode=0, int nevts=0)
bool checkfile(TString fn)