44 template <
typename LE>
81 template <
typename LE>
84 static_assert(!std::is_pointer<LE>::value,
"LoopEvent::Process : type can not be a pointer");
85 static_assert(std::is_base_of<LoopEvent, LE>::value,
"LoopEvent::Process : Input type must be or be inherited from LoopEvent class");
88 auto childLE = std::make_shared<LE>(config_child);
95 auto msg_child = childLE->MSGUser();
97 if (childLE->JobNumber() >= 0)
98 threadsuffix.Form(
"(Job %d)", childLE->JobNumber());
100 msg_child->StartTitle(
"LE::InitializeData" + threadsuffix);
103 msg_child->EndTitle();
108 msg_child->EndTitle();
110 msg_child->StartTitle(
"LE::InitializeUser" + threadsuffix);
113 msg_child->EndTitle();
118 msg_child->EndTitle();
122 msg_child->StartTitle(
"LE::Run" + threadsuffix);
125 msg_child->EndTitle();
131 msg_child->EndTitle();
135 msg_child->StartTitle(
"LE::Finalize" + threadsuffix);
138 msg_child->EndTitle();
143 msg_child->EndTitle();
144 wholeresult->Merge(childLE->ResultGroupUser());
Virtual base class for all kinds of jobs inside NAGASH, handled by Analysis.
static std::recursive_mutex DefaultMutex
Default mutex, for multi-thread usage.
Virtual base class for event loops.
static StatusCode Process(const ConfigTool &, std::shared_ptr< ResultGroup >, std::shared_ptr< ResultGroup >, const TString &)
The function used by Analysis to process the event loop.
std::shared_ptr< EventVector > eventvector
LoopEvent(const ConfigTool &c)
Constructor.
const TString & InputRootFileName()
Get the input root file name.
virtual StatusCode InitializeUser()=0
Initialize user-defined variables.
void SetEventVector(std::shared_ptr< EventVector > ev)
int CurrentEntry()
Get the current entry number in the Root TTree.
virtual StatusCode Finalize()=0
you can do something here after the loop for this file.
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 InitializeData()=0
Initialize the input data. Most times, this function can be automatically generated using NAGASHMakeC...
std::shared_ptr< EventVector > EventVectorUser()
virtual StatusCode Execute()=0
Execute this function for each event.
TFile * RootFileUser()
Get the pointer to the used Root TFile.