ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPerfNtuple.h
Go to the documentation of this file.
1#ifndef INDET__PERF__NTUPLE__H
2#define INDET__PERF__NTUPLE__H
3
5#include "GaudiKernel/ITHistSvc.h"
6#include "InDetPlotBase.h"
7
10
12public:
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
31protected:
32 // reset all branches to their defaults.
33 void ResetBranches();
34
35private:
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
std::string m_treeName
TTree * getTree() const
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.