14 infile =
new TFile(filename,
"READ");
19 MSGUser()->StartTitle(
"OpenRootFile");
27 MSGUser()->StartTitle(
"OpenRootFile");
45 auto originlevel =
MSGUser()->OutputLevel;
48 bool EvtMaxExist =
true, EvtMinExist =
true;
49 EvtMax =
ConfigUser()->GetPar<
long>(
"EvtMax", &EvtMaxExist);
50 EvtMin =
ConfigUser()->GetPar<
long>(
"EvtMin", &EvtMinExist);
52 EvtMax = Nentries - 1;
55 MSGUser()->OutputLevel = originlevel;
58 std::swap(EvtMin, EvtMax);
60 EvtMax = std::min(EvtMax, Nentries - 1);
61 EvtMin = std::max(0L, EvtMin);
62 MSGUser()->MSG(
MSGLevel::INFO,
"Will loop from ", EvtMin,
" to ", EvtMax,
" entry in the file (", Nentries,
" entries in total)");
65 for (
int ie = EvtMin; ie <= EvtMax; ie++)
69 num.Form(
"(Execute Event %d)", ie);
70 auto titlegurad =
MSGUser()->StartTitleWithGuard(num);
86 TimerUser()->Duration(
"(Start Run)",
"(End Run)");
std::shared_ptr< ConfigTool > ConfigUser()
get the ConfigTool.
std::shared_ptr< MSGTool > MSGUser()
get the MSGTool.
static std::recursive_mutex DefaultMutex
Default mutex, for multi-thread usage.
std::shared_ptr< Timer > TimerUser()
get the Timer.
const TString & InputRootFileName()
Get the input root file name.
StatusCode OpenRootFile(const TString &)
open the ROOT file with the given filename
TTree *& RootTreeUser()
Get the pointer to the used Root TTree.
TString inputrootfilename
virtual StatusCode Execute()=0
Execute this function for each event.