ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPerfNtuple.cxx
Go to the documentation of this file.
1#include "InDetPerfNtuple.h"
2
3InDetPerfNtuple::InDetPerfNtuple(InDetPlotBase* pParent, const std::string & dirName, const std::string & treeName):
4 InDetPlotBase(pParent, dirName),
5 m_treeName{treeName} {
6}
7
9
10 ATH_MSG_DEBUG("Booking Tree");
12
13 ATH_MSG_DEBUG("Attaching all "<<m_mapBranches.size()<<" branches");
14 for (auto & branch : m_mapBranches){
15 auto outcome = branch.second->attach(m_tree);
16 switch (outcome){
18 ATH_MSG_ERROR("Failed to create the output tree with name "<<m_sDirectory<<"/"<<m_treeName);
19 return;
20 break;
22 ATH_MSG_ERROR("Failed to book branch "<<branch.first<<" in tree "<<m_sDirectory<<"/"<<m_treeName);
23 break;
25 ATH_MSG_DEBUG("Successfully attached a branch "<<branch.first<<" in tree "<<m_sDirectory<<"/"<<m_treeName);
26 }
27
28 }
29 ATH_MSG_DEBUG("Setting branches to defaults");
31 ATH_MSG_DEBUG("Done booking branches");
32}
33
35
36 auto res = m_mapBranches.emplace(theBranch->getName(), theBranch);
37 if (res.second){
38 ATH_MSG_DEBUG("Registered a new branch "<<theBranch->getName());
39 }
40 else{
41 ATH_MSG_WARNING("The branch "<<theBranch->getName()<<" already exists in tree "<<m_sDirectory<<"/"<<m_treeName<<" - not overwriting.");
42 }
43}
44
46 for (auto & b : m_mapBranches){
47 b.second->setDummy();
48 }
49}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
std::pair< std::vector< unsigned int >, bool > res
const std::string & getName() const
std::string m_treeName
virtual void initializePlots()
std::map< std::string, InDetPerfNtupleBranchBase * > m_mapBranches
void addBranch(InDetPerfNtupleBranchBase *theBranch)
InDetPerfNtuple(InDetPlotBase *pParent, const std::string &dirName, const std::string &treeName)
InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName)
Constructor taking parent node and directory name for plots.
TTree * BookTree(const std::string &name, bool prependDir=true)
Book a TTree.
Definition PlotBase.cxx:281
std::string m_sDirectory
Definition PlotBase.h:100