KaliVeda
Toolkit for HIC analysis
KVTreeVectorBranchHandler Class Reference

Detailed Description

Facilitate use of std::vector branches in data analysis.

Definition at line 14 of file KVTreeVectorBranchHandler.h.

#include <KVTreeVectorBranchHandler.h>

Inheritance diagram for KVTreeVectorBranchHandler:

Public Member Functions

template<typename VarType >
void AddVectorBranch (TTree *t, const std::string &var)
 
void ClearVectorBranches ()
 
template<typename VarType >
void FillVectorBranch (const std::string &var, VarType val)
 

Member Function Documentation

◆ AddVectorBranch()

template<typename VarType >
void KVTreeVectorBranchHandler::AddVectorBranch ( TTree t,
const std::string &  var 
)
inline

Add a branch to the tree in order to store a vector of values

Template Parameters
VarTypetype of variable in vector (int, float and double can be used)
Parameters
[in]tpointer to the TTree
[in]varname to be used for the new branch

Example of use:

AddVectorBranch<int>(t, "Z");
AddVectorBranch<double>(t, "E");

Definition at line 67 of file KVTreeVectorBranchHandler.h.

◆ ClearVectorBranches()

void KVTreeVectorBranchHandler::ClearVectorBranches ( )
inline

Clear all vectors contained in branches, ready to treat a new event

Definition at line 75 of file KVTreeVectorBranchHandler.h.

◆ FillVectorBranch()

template<typename VarType >
void KVTreeVectorBranchHandler::FillVectorBranch ( const std::string &  var,
VarType  val 
)
inline

Add a value to the vector contained in the named branch

Template Parameters
VarTypetype of variable in vector (int, float and double can be used)
Parameters
[in]varname of branch
[in]valvalue to add to vector

Example of use:

KVNucleus& nuc; // reference to a nucleus in an event
FillVectorBranch("Z", nuc.GetZ());
FillVectorBranch("E", nuc.GetE());
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:767
Double_t GetE() const
Definition: KVParticle.h:655
void FillVectorBranch(const std::string &var, VarType val)

Definition at line 96 of file KVTreeVectorBranchHandler.h.