AnalysisTree
Loading...
Searching...
No Matches
AnalysisTree::TaskManager Class Reference
Collaboration diagram for AnalysisTree::TaskManager:
Collaboration graph

Public Member Functions

 TaskManager (TaskManager &other)=delete
void operator= (const TaskManager &)=delete
void SetOwnsTasks (bool owns_flag=true)
 If TaskManager owns its tasks, they will be deleted on TaskManager' destruction.
virtual void Init (const std::vector< std::string > &filelists, const std::vector< std::string > &in_trees)
virtual void Init ()
void Run (long long nEventFrom, long long nEvents)
void Run (long long nEvents=-1)
virtual void Finish ()
void AddTask (Task *task)
template<class BranchPtr>
void AddBranch (BranchPtr *&ptr, const BranchConfig &config)
void AddBranch (Branch *branch)
void AddMatching (const std::string &br1, const std::string &br2, Matching *&match)
ANALYSISTREE_ATTR_NODISCARD const ConfigurationGetConfig () const
ANALYSISTREE_ATTR_NODISCARD const DataHeaderGetDataHeader () const
ANALYSISTREE_ATTR_NODISCARD ChainGetChain () const
ANALYSISTREE_ATTR_NODISCARD const ConfigurationGetOutConfig () const
ANALYSISTREE_ATTR_NODISCARD const DataHeaderGetOutDataHeader () const
void SetOutputDataHeader (DataHeader *dh)
void FillOutput ()
void Exec ()
std::vector< Task * > & Tasks ()
void SetOutputName (std::string file, std::string tree="aTree")
void SetWriteMode (eBranchWriteMode mode)
void SetBranchesExclude (std::vector< std::string > brex)
void SetVerbosityPeriod (int value)
void SetVerbosityFrequency (int value)
void SetIsWriteHashInfo (bool is=true)
void SetIsUpdateEntryInExec (bool is=true)
void ClearTasks ()

Static Public Member Functions

static TaskManager * GetInstance ()

Protected Member Functions

void InitOutChain ()
void InitTasks ()
 ClassDef (TaskManager, 0)

Static Protected Member Functions

static void WriteCommitInfo ()
static void PrintCommitInfo ()

Protected Attributes

Chainchain_ {nullptr}
std::vector< Task * > tasks_ {}
TFile * out_file_ {nullptr}
TTree * out_tree_ {nullptr}
Configurationconfiguration_ {nullptr}
 output
DataHeaderdata_header_ {nullptr}
 output
std::string out_tree_name_ {"aTree"}
std::string out_file_name_ {"analysis_tree.root"}
std::vector< std::string > branches_exclude_ {}
int verbosity_period_ {-1}
int verbosity_frequency_ {-1}
eBranchWriteMode write_mode_ {eBranchWriteMode::kCreateNewTree}
bool is_init_ {false}
bool fill_out_tree_ {false}
bool is_update_entry_in_exec_ {true}
bool read_in_tree_ {false}
bool is_owns_tasks_ {true}
bool is_write_hash_info_ {true}

Static Protected Attributes

static TaskManager * manager_ = nullptr

Member Function Documentation

◆ AddBranch()

template<class BranchPtr>
void AnalysisTree::TaskManager::AddBranch ( BranchPtr *& ptr,
const BranchConfig & config )
inline

Adding a new branch

Parameters
namename of the branch
ptrreference to a pointer to the branch object. Pointer should be initialized with nullprt, function will allocate the space, but used still needs delete it in the end of the program

◆ AddMatching()

void AnalysisTree::TaskManager::AddMatching ( const std::string & br1,
const std::string & br2,
Matching *& match )
inline

Adding a new Matching branch

Parameters
br1name of the first branch
br2name of the second branch
matchreference to a pointer to the Matching object. Pointer shoulb be initialized with nullprt, function will allocate the space, but used still needs delete it in the end of the program

◆ GetInstance()

TaskManager * AnalysisTree::TaskManager::GetInstance ( )
static

This is a safer way to create an instance. instance = new Singleton is dangerous in case two instance threads wants to access at the same time

◆ Init() [1/2]

void AnalysisTree::TaskManager::Init ( )
virtual

Initialization in case of only creating AnalysisTree

◆ Init() [2/2]

void AnalysisTree::TaskManager::Init ( const std::vector< std::string > & filelists,
const std::vector< std::string > & in_trees )
virtual

Initialization in case of reading AnalysisTree (or reading + creating)

Parameters
filelistsvector of filelists -> text files with paths to all root files
in_treesvector ot TTree names

◆ SetOwnsTasks()

void AnalysisTree::TaskManager::SetOwnsTasks ( bool owns_flag = true)
inline

If TaskManager owns its tasks, they will be deleted on TaskManager' destruction.

Parameters
owns_flag

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