ATLAS Offline Software
InDetPerfNtuple.h
Go to the documentation of this file.
1 #ifndef INDET__PERF__NTUPLE__H
2 #define INDET__PERF__NTUPLE__H
3 
4 #include "InDetPerfNtupleBranch.h"
5 #include "GaudiKernel/ITHistSvc.h"
6 #include "InDetPlotBase.h"
7 
10 
12 public:
13  // t: TTree to write to
14  InDetPerfNtuple(InDetPlotBase* pParent, const std::string & dirName, const std::string & treeName);
15 
16  // attaches an NtupleBranch to this object.
17  // No smart pointer used since these objects are members
18  // in the scope of derived classes and not should not be memory-managed as pointers
19  void addBranch(InDetPerfNtupleBranchBase* theBranch);
20 
21  // Fill an entry into the tree. Following this, will reset all branches.
22  void Fill(){ m_tree->Fill(); ResetBranches(); }
23 
24  // get the underlying ROOT TTree object
25  // tree is returned by
26  TTree* getTree() const { return m_tree; }
27 
28  // we use this to book the tree and attach branches to it
29  virtual void initializePlots();
30 
31 protected:
32  // reset all branches to their defaults.
33  void ResetBranches();
34 
35 private:
36  // data members
37  std::string m_treeName;
38  std::map<std::string, InDetPerfNtupleBranchBase*> m_mapBranches;
39  TTree* m_tree{nullptr};
40 };
41 
42 #endif // INDET__PERF__NTUPLE__H
InDetPerfNtuple
This class is a base class for the actual ntuples used when writing IDPVM ntuples.
Definition: InDetPerfNtuple.h:11
InDetPerfNtuple::getTree
TTree * getTree() const
Definition: InDetPerfNtuple.h:26
InDetPerfNtuple::InDetPerfNtuple
InDetPerfNtuple(InDetPlotBase *pParent, const std::string &dirName, const std::string &treeName)
Definition: InDetPerfNtuple.cxx:3
InDetPerfNtupleBranch.h
InDetPerfNtuple::initializePlots
virtual void initializePlots()
Definition: InDetPerfNtuple.cxx:8
InDetPerfNtuple::m_tree
TTree * m_tree
Definition: InDetPerfNtuple.h:39
InDetPlotBase
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
Definition: InDetPlotBase.h:33
InDetPlotBase.h
InDetPerfNtupleBranchBase
Definition: InDetPerfNtupleBranch.h:17
InDetPerfNtuple::ResetBranches
void ResetBranches()
Definition: InDetPerfNtuple.cxx:45
dumpFileToPlots.treeName
string treeName
Definition: dumpFileToPlots.py:20
InDetPerfNtuple::Fill
void Fill()
Definition: InDetPerfNtuple.h:22
InDetPerfNtuple::m_mapBranches
std::map< std::string, InDetPerfNtupleBranchBase * > m_mapBranches
Definition: InDetPerfNtuple.h:38
InDetPerfNtuple::m_treeName
std::string m_treeName
Definition: InDetPerfNtuple.h:37
InDetPerfNtuple::addBranch
void addBranch(InDetPerfNtupleBranchBase *theBranch)
Definition: InDetPerfNtuple.cxx:34