RAPIDO
Repeatable Analysis Programming for Interpretability, Durability, and Organization
|
#include <looper.h>
Public Member Functions | |
Looper (TChain *new_tchain) | |
Looper (HEPCLI &cli) | |
virtual | ~Looper () |
void | run (std::function< void(TTree *ttree)> init, std::function< void(int entry)> eval) |
void | stop () |
Public Attributes | |
TChain * | tchain |
TString | ttree_name |
unsigned int | current_entry |
unsigned int | n_events_processed |
unsigned int | n_events_total |
Protected Attributes | |
bool | keep_alive |
Object to handle looping over ROOT files
Looper::Looper | ( | TChain * | new_tchain | ) |
Looper object constructor
new_tchain | pointer to ROOT TChain of files to loop over |
|
virtual |
Looper object destructor
void Looper::run | ( | std::function< void(TTree *ttree)> | init, |
std::function< void(int entry)> | eval ) |
Run looper with file- and event-processing logic captured in void lambda functions.
The following example uses a class named "Selector" generated by ROOT::MakeSelector; this class requires certain file- and event-processing initialization steps:
init | file-level initialization steps captured in a void lambda function |
eval | event-level logic captured in a void lambda function |
void Looper::stop | ( | ) |
Stop event loop
unsigned int Looper::current_entry |
Current entry in TTree (i.e. current index of event loop)
|
protected |
Flag for continuing event loop
unsigned int Looper::n_events_processed |
Number of events that have been processed
unsigned int Looper::n_events_total |
Number of events in the TChain
TChain* Looper::tchain |
ROOT TChain of files to loop over
TString Looper::ttree_name |
ROOT TTree name