NAGASH 0.9.8
Next Generation Analysis System
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
NAGASH::LoopEvent Class Referenceabstract

Virtual base class for event loops. More...

#include "NAGASH/LoopEvent.h"

Inheritance diagram for NAGASH::LoopEvent:
NAGASH::Job

Public Member Functions

 LoopEvent (const ConfigTool &c)
 Constructor.
 
virtual ~LoopEvent ()
 
virtual StatusCode Execute ()=0
 Execute this function for each event.
 
virtual StatusCode Finalize ()=0
 you can do something here after the loop for this file.
 
virtual StatusCode InitializeData ()=0
 Initialize the input data. Most times, this function can be automatically generated using NAGASHMakeClass command.
 
virtual StatusCode InitializeUser ()=0
 Initialize user-defined variables.
 
StatusCode OpenRootFile (const TString &)
 open the ROOT file with the given filename
 
StatusCode Run ()
 
void SetEventVector (std::shared_ptr< EventVector > ev)
 
- Public Member Functions inherited from NAGASH::Job
 Job ()=delete
 
 Job (const ConfigTool &c)
 Constructor.
 
 Job (const Job &)=delete
 
 Job (Job &&)=delete
 
virtual ~Job ()=default
 
Joboperator= (const Job &)=delete
 
Joboperator= (Job &&)=delete
 
std::shared_ptr< ResultGroupResultGroupUser ()
 get the ResultGroup.
 

Static Public Member Functions

template<typename LE >
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.
 

Protected Member Functions

int CurrentEntry ()
 Get the current entry number in the Root TTree.
 
std::shared_ptr< EventVectorEventVectorUser ()
 
const TString & InputRootFileName ()
 Get the input root file name.
 
TFile * RootFileUser ()
 Get the pointer to the used Root TFile.
 
TTree *& RootTreeUser ()
 Get the pointer to the used Root TTree.
 
- Protected Member Functions inherited from NAGASH::Job
std::shared_ptr< ConfigToolConfigUser ()
 get the ConfigTool.
 
int JobNumber ()
 get the number of job inside Analysis.
 
std::shared_ptr< MSGToolMSGUser ()
 get the MSGTool.
 
std::shared_ptr< TimerTimerUser ()
 get the Timer.
 
std::shared_ptr< ToolkitToolkitUser ()
 get the Toolkit.
 

Private Attributes

int entry = -1
 
std::shared_ptr< EventVectoreventvector
 
TTree * fChain = nullptr
 
TFile * infile = nullptr
 
TString inputrootfilename
 
int NEventsToLoop = 0
 

Additional Inherited Members

- Static Protected Attributes inherited from NAGASH::Job
static std::recursive_mutex DefaultMutex = std::recursive_mutex()
 Default mutex, for multi-thread usage.
 

Detailed Description

Virtual base class for event loops.

Example of usage of LoopEvent can be found in topic Analysis Classes.

Definition at line 25 of file LoopEvent.h.

Constructor & Destructor Documentation

◆ LoopEvent()

NAGASH::LoopEvent::LoopEvent ( const ConfigTool c)
inline

Constructor.

Parameters
cinput ConfigTool.

Definition at line 30 of file LoopEvent.h.

◆ ~LoopEvent()

LoopEvent::~LoopEvent ( )
virtual

Definition at line 97 of file LoopEvent.cxx.

Member Function Documentation

◆ CurrentEntry()

int NAGASH::LoopEvent::CurrentEntry ( )
inlineprotected

Get the current entry number in the Root TTree.

Definition at line 68 of file LoopEvent.h.

◆ EventVectorUser()

std::shared_ptr< EventVector > NAGASH::LoopEvent::EventVectorUser ( )
inlineprotected

Definition at line 70 of file LoopEvent.h.

◆ Execute()

virtual StatusCode NAGASH::LoopEvent::Execute ( )
pure virtual

Execute this function for each event.

◆ Finalize()

virtual StatusCode NAGASH::LoopEvent::Finalize ( )
pure virtual

you can do something here after the loop for this file.

◆ InitializeData()

virtual StatusCode NAGASH::LoopEvent::InitializeData ( )
pure virtual

Initialize the input data. Most times, this function can be automatically generated using NAGASHMakeClass command.

◆ InitializeUser()

virtual StatusCode NAGASH::LoopEvent::InitializeUser ( )
pure virtual

Initialize user-defined variables.

◆ InputRootFileName()

const TString & NAGASH::LoopEvent::InputRootFileName ( )
inlineprotected

Get the input root file name.

Definition at line 72 of file LoopEvent.h.

◆ OpenRootFile()

StatusCode LoopEvent::OpenRootFile ( const TString &  filename)

open the ROOT file with the given filename

Definition at line 12 of file LoopEvent.cxx.

◆ Process()

template<typename LE >
StatusCode NAGASH::LoopEvent::Process ( const ConfigTool config_child,
std::shared_ptr< ResultGroup result,
std::shared_ptr< ResultGroup wholeresult,
const TString &  inputfilename 
)
static

The function used by Analysis to process the event loop.

Template Parameters
LEthe type of the user-defined LoopEvent.
Parameters
config_childthe ConfigTool, given by Analysis.
resultthe ResultGroup to be saved, handed by Analysis.
wholeresultthe ResultGroup to be merged together for each sub event loop, handleed by Analysis.
inputfilenamethe input root file name.
Returns
the status of this event loop.

Definition at line 82 of file LoopEvent.h.

◆ RootFileUser()

TFile * NAGASH::LoopEvent::RootFileUser ( )
inlineprotected

Get the pointer to the used Root TFile.

Definition at line 66 of file LoopEvent.h.

◆ RootTreeUser()

TTree *& NAGASH::LoopEvent::RootTreeUser ( )
inlineprotected

Get the pointer to the used Root TTree.

Definition at line 64 of file LoopEvent.h.

◆ Run()

StatusCode LoopEvent::Run ( )

Definition at line 38 of file LoopEvent.cxx.

◆ SetEventVector()

void NAGASH::LoopEvent::SetEventVector ( std::shared_ptr< EventVector ev)
inline

Definition at line 69 of file LoopEvent.h.

Member Data Documentation

◆ entry

int NAGASH::LoopEvent::entry = -1
private

Definition at line 60 of file LoopEvent.h.

◆ eventvector

std::shared_ptr<EventVector> NAGASH::LoopEvent::eventvector
private

Definition at line 58 of file LoopEvent.h.

◆ fChain

TTree* NAGASH::LoopEvent::fChain = nullptr
private

Definition at line 55 of file LoopEvent.h.

◆ infile

TFile* NAGASH::LoopEvent::infile = nullptr
private

Definition at line 57 of file LoopEvent.h.

◆ inputrootfilename

TString NAGASH::LoopEvent::inputrootfilename
private

Definition at line 59 of file LoopEvent.h.

◆ NEventsToLoop

int NAGASH::LoopEvent::NEventsToLoop = 0
private

Definition at line 56 of file LoopEvent.h.


The documentation for this class was generated from the following files: