TreeManager.h
Go to the documentation of this file.
1 /*
2  * TreeManager.h
3  *
4  * Created on: Feb 9, 2021
5  * Author: chilgenb
6  */
7 
8 #ifndef GARANA_TREEMANAGER_H_
9 #define GARANA_TREEMANAGER_H_
10 
11 //garana includes
13 
19 
25 
26 using std::string;
27 
28 namespace garana {
29 
30  /*const string GenTree::treename = "genTree";
31  const string G4Tree::treename = "g4Tree";
32  const string DetTree::treename = "detTree";
33  const string RecoTree::treename = "recoTree";
34  const string DisplayTree::treename = "displayTree";*/
35 
36 
37 
38  class TreeManager {
39 
40  public :
41 
43  TreeManager(const string& infilename);//, bool onGen, bool onG4, bool onDet, bool onReco, bool onDis);
44 
45  HeaderTree* GetHeaderTree() const;
46  GenTree* GetGenTree() const;
47  G4Tree* GetG4Tree() const;
48  DetTree* GetDetTree() const;
49  RecoTree* GetRecoTree() const;
50  DisplayTree* GetDisplayTree() const;
51  void GetEntry(const UInt_t& ientry);
52 
53  UInt_t const& NEntries() const {return fNEntries;}
54 
55  void SetActiveGenTree(bool active=true) {fOnGen = active; }
56  void SetActiveG4Tree (bool active=true) {fOnG4 = active; }
57  void SetActiveDetTree(bool active=true) {fOnDet = active; }
58  void SetActiveRecTree(bool active=true) {fOnRec = active; }
59  void SetActiveDisTree(bool active=true) {fOnDis = active; }
60 
61  bool IsActiveGenTree() const {return fOnGen; }
62  bool IsActiveG4Tree () const {return fOnG4 ; }
63  bool IsActiveDetTree() const {return fOnDet; }
64  bool IsActiveRecTree() const {return fOnRec; }
65  bool IsActiveDisTree() const {return fOnDis; }
66 
67  // tree names
68  const string genName = "genTree"; //GenTree::treename;
69  const string g4Name = "g4Tree" ; //G4Tree::treename;
70  const string detName = "detTree";
71  const string recoName = "recoTree";
72  const string displayName = "displayTree";
73 
74  private:
75 
76  void Init();
77  bool CheckEntries();
78 
79  string fInFileName = "";
80  TFile* fInFile = nullptr;
81  string fTreeType = "";
82  UInt_t fNEntries = 0;
83 
84  bool fOnGen = true;
85  bool fOnG4 = true;
86  bool fOnDet = false;
87  bool fOnRec = true;
88  bool fOnDis = false;
89 
90  HeaderTree* fHeaderTree = nullptr;
91 
97 
99  FlatG4Tree* fFlatG4Tree = nullptr;
103 
104  };//class
105 }//namespace
106 
107 #endif /* TREEMANAGER_H_ */
DisplayTree * GetDisplayTree() const
StructuredRecoTree * fStructRecoTree
Definition: TreeManager.h:95
FlatGenTree * fFlatGenTree
Definition: TreeManager.h:98
std::string string
Definition: nybbler.cc:12
bool IsActiveDetTree() const
Definition: TreeManager.h:63
FlatDisplayTree * fFlatDisplayTree
Definition: TreeManager.h:102
void SetActiveRecTree(bool active=true)
Definition: TreeManager.h:58
bool IsActiveG4Tree() const
Definition: TreeManager.h:62
const string displayName
Definition: TreeManager.h:72
StructuredDisplayTree * fStructDisplayTree
Definition: TreeManager.h:96
StructuredGenTree * fStructGenTree
Definition: TreeManager.h:92
StructuredDetTree * fStructDetTree
Definition: TreeManager.h:94
const string detName
Definition: TreeManager.h:70
FlatG4Tree * fFlatG4Tree
Definition: TreeManager.h:99
FlatRecoTree * fFlatRecoTree
Definition: TreeManager.h:101
FlatDetTree * fFlatDetTree
Definition: TreeManager.h:100
bool IsActiveGenTree() const
Definition: TreeManager.h:61
HeaderTree * GetHeaderTree() const
DetTree * GetDetTree() const
StructuredG4Tree * fStructG4Tree
Definition: TreeManager.h:93
G4Tree * GetG4Tree() const
const string recoName
Definition: TreeManager.h:71
RecoTree * GetRecoTree() const
void SetActiveGenTree(bool active=true)
Definition: TreeManager.h:55
const string genName
Definition: TreeManager.h:68
void SetActiveG4Tree(bool active=true)
Definition: TreeManager.h:56
UInt_t const & NEntries() const
Definition: TreeManager.h:53
HeaderTree * fHeaderTree
Definition: TreeManager.h:90
void SetActiveDetTree(bool active=true)
Definition: TreeManager.h:57
bool IsActiveDisTree() const
Definition: TreeManager.h:65
bool IsActiveRecTree() const
Definition: TreeManager.h:64
GenTree * GetGenTree() const
const string g4Name
Definition: TreeManager.h:69
void SetActiveDisTree(bool active=true)
Definition: TreeManager.h:59
void GetEntry(const UInt_t &ientry)