showertree.h
Go to the documentation of this file.
1 // ***************************************************
2 // trajcluster debug viewer
3 //
4 // Rory Fitzpatrick
5 //
6 // ***************************************************
7 
8 #ifndef showertree_h
9 #define showertree_h
10 
11 // C++ STL includes
12 #include <string>
13 #include <vector>
14 
15 // ROOT includes
16 #include "RtypesCore.h"
17 #include "TTree.h"
18 class TBranch;
19 
20 class showertree {
21 public :
22  TTree *fChain; //!pointer to the analyzed TTree or TChain
23  Int_t fCurrent; //!current Tree number in a TChain
24 
25  // Declaration of leaf types
26  Int_t run;
27  Int_t subrun;
28  Int_t event;
29 
30  std::vector<float> *BeginWir;
31  std::vector<float> *BeginTim;
32  std::vector<float> *BeginAng;
33  std::vector<float> *BeginChg;
34  std::vector<short> *BeginVtx;
35  std::vector<float> *EndWir;
36  std::vector<float> *EndTim;
37  std::vector<float> *EndAng;
38  std::vector<float> *EndChg;
39  std::vector<short> *EndVtx;
40  std::vector<short> *MCSMom;
41  std::vector<short> *PlaneNum;
42  std::vector<int> *TjID;
43  std::vector<int> *IsShowerTj;
44  std::vector<int> *ShowerID;
45  std::vector<int> *IsShowerParent;
46  std::vector<int> *StageNum;
47  std::vector<std::string> *StageName;
48 
49  std::vector<float> *Envelope;
50  std::vector<int> *EnvPlane;
51  std::vector<int> *EnvStage;
52  std::vector<int> *EnvShowerID;
53 
54  Int_t nStages;
55  Int_t nPlanes;
56 
57  // List of branches
58  TBranch *b_run; //!
59  TBranch *b_subrun; //!
60  TBranch *b_event; //!
61 
62  TBranch *b_BeginWir; //!
63  TBranch *b_BeginTim; //!
64  TBranch *b_BeginAng; //!
65  TBranch *b_BeginChg; //!
66  TBranch *b_BeginVtx; //!
67  TBranch *b_EndWir; //!
68  TBranch *b_EndTim; //!
69  TBranch *b_EndAng; //!
70  TBranch *b_EndChg; //!
71  TBranch *b_EndVtx; //!
72  TBranch *b_MCSMom;
73  TBranch *b_PlaneNum; //!
74  TBranch *b_TjID; //!
75  TBranch *b_IsShowerTj; //!
76  TBranch *b_ShowerID; //!
77  TBranch *b_IsShowerParent; //!
78  TBranch *b_StageNum; //!
79  TBranch *b_StageName; //!
80  TBranch *b_Envelope;
81  TBranch *b_EnvPlane;
82  TBranch *b_EnvStage;
83  TBranch *b_EnvShowerID;
84  TBranch *b_nStages;
85  TBranch *b_nPlanes;
86 
87  showertree(TTree *tree=0);
88  virtual void Init(TTree *tree);
89  virtual void Loop();
90 };
91 
92 #endif
93 
95  Init(tree);
96 }
97 
98 void showertree::Init(TTree *tree) {
99  // Set object pointer
100  BeginWir = 0;
101  BeginTim = 0;
102  BeginAng = 0;
103  BeginChg = 0;
104  BeginVtx = 0;
105  EndWir = 0;
106  EndTim = 0;
107  EndAng = 0;
108  EndChg = 0;
109  EndVtx = 0;
110  MCSMom = 0;
111  PlaneNum = 0;
112  TjID = 0;
113  IsShowerTj = 0;
114  ShowerID = 0;
115  IsShowerParent = 0;
116  StageNum = 0;
117  StageName = 0;
118  Envelope = 0;
119  EnvPlane = 0;
120  EnvStage = 0;
121  EnvShowerID = 0;
122 
123  if (!tree) return;
124  fChain = tree;
125  fCurrent = -1;
126  fChain->SetMakeClass(1);
127 
128  fChain->SetBranchAddress("run", &run, &b_run);
129  fChain->SetBranchAddress("subrun", &subrun, &b_subrun);
130  fChain->SetBranchAddress("event", &event, &b_event);
131 
132  fChain->SetBranchAddress("BeginWir", &BeginWir, &b_BeginWir);
133  fChain->SetBranchAddress("BeginTim", &BeginTim, &b_BeginTim);
134  fChain->SetBranchAddress("BeginAng", &BeginAng, &b_BeginAng);
135  fChain->SetBranchAddress("BeginChg", &BeginChg, &b_BeginChg);
136  fChain->SetBranchAddress("BeginVtx", &BeginVtx, &b_BeginVtx);
137  fChain->SetBranchAddress("EndWir", &EndWir, &b_EndWir);
138  fChain->SetBranchAddress("EndTim", &EndTim, &b_EndTim);
139  fChain->SetBranchAddress("EndAng", &EndAng, &b_EndAng);
140  fChain->SetBranchAddress("EndChg", &EndChg, &b_EndChg);
141  fChain->SetBranchAddress("EndVtx", &EndVtx, &b_EndVtx);
142  fChain->SetBranchAddress("MCSMom", &MCSMom, &b_MCSMom);
143  fChain->SetBranchAddress("PlaneNum", &PlaneNum, &b_PlaneNum);
144  fChain->SetBranchAddress("TjID", &TjID, &b_TjID);
145  fChain->SetBranchAddress("IsShowerTj", &IsShowerTj, &b_IsShowerTj);
146  fChain->SetBranchAddress("ShowerID", &ShowerID, &b_ShowerID);
147  fChain->SetBranchAddress("IsShowerParent", &IsShowerParent, &b_IsShowerParent);
148  fChain->SetBranchAddress("StageNum", &StageNum, &b_StageNum);
149  fChain->SetBranchAddress("StageName", &StageName, &b_StageName);
150  fChain->SetBranchAddress("Envelope", &Envelope, &b_Envelope);
151  fChain->SetBranchAddress("EnvPlane", &EnvPlane, &b_EnvPlane);
152  fChain->SetBranchAddress("EnvStage", &EnvStage, &b_EnvStage);
153  fChain->SetBranchAddress("EnvShowerID", &EnvShowerID, &b_EnvShowerID);
154  fChain->SetBranchAddress("nStages", &nStages, &b_nStages);
155  fChain->SetBranchAddress("nPlanes", &nPlanes, &b_nPlanes);
156 }
virtual void Loop()
TBranch * b_TjID
Definition: showertree.h:74
TBranch * b_EndWir
Definition: showertree.h:67
std::vector< float > * EndWir
Definition: showertree.h:35
std::vector< float > * BeginChg
Definition: showertree.h:33
std::vector< short > * PlaneNum
Definition: showertree.h:41
TBranch * b_EndTim
Definition: showertree.h:68
Int_t subrun
Definition: showertree.h:27
std::vector< int > * EnvPlane
Definition: showertree.h:50
TBranch * b_run
Definition: showertree.h:58
std::vector< short > * EndVtx
Definition: showertree.h:39
TBranch * b_ShowerID
Definition: showertree.h:76
TBranch * b_StageName
Definition: showertree.h:79
TBranch * b_BeginAng
Definition: showertree.h:64
TBranch * b_subrun
Definition: showertree.h:59
Int_t nStages
Definition: showertree.h:54
std::vector< short > * BeginVtx
Definition: showertree.h:34
TBranch * b_EndVtx
Definition: showertree.h:71
TBranch * b_nPlanes
Definition: showertree.h:85
std::vector< short > * MCSMom
Definition: showertree.h:40
TBranch * b_IsShowerTj
Definition: showertree.h:75
TBranch * b_BeginVtx
Definition: showertree.h:66
std::vector< float > * EndTim
Definition: showertree.h:36
std::vector< int > * TjID
Definition: showertree.h:42
std::vector< int > * IsShowerParent
Definition: showertree.h:45
TBranch * b_IsShowerParent
Definition: showertree.h:77
std::vector< int > * StageNum
Definition: showertree.h:46
TBranch * b_BeginChg
Definition: showertree.h:65
std::vector< float > * BeginWir
Definition: showertree.h:30
std::vector< float > * BeginAng
Definition: showertree.h:32
TBranch * b_EndChg
Definition: showertree.h:70
std::vector< int > * EnvShowerID
Definition: showertree.h:52
std::vector< float > * BeginTim
Definition: showertree.h:31
TTree * fChain
Definition: showertree.h:22
TBranch * b_StageNum
Definition: showertree.h:78
TBranch * b_MCSMom
Definition: showertree.h:72
TBranch * b_Envelope
Definition: showertree.h:80
std::vector< int > * ShowerID
Definition: showertree.h:44
Int_t event
Definition: showertree.h:28
TBranch * b_EnvStage
Definition: showertree.h:82
Int_t nPlanes
Definition: showertree.h:55
std::vector< float > * EndChg
Definition: showertree.h:38
virtual void Init(TTree *tree)
Definition: showertree.h:98
std::vector< float > * Envelope
Definition: showertree.h:49
TBranch * b_PlaneNum
Definition: showertree.h:73
TBranch * b_EnvPlane
Definition: showertree.h:81
std::vector< int > * EnvStage
Definition: showertree.h:51
TBranch * b_EnvShowerID
Definition: showertree.h:83
TBranch * b_BeginWir
Definition: showertree.h:62
TBranch * b_EndAng
Definition: showertree.h:69
Int_t run
current Tree number in a TChain
Definition: showertree.h:26
TBranch * b_event
Definition: showertree.h:60
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: showertree.h:23
std::vector< float > * EndAng
Definition: showertree.h:37
TBranch * b_BeginTim
Definition: showertree.h:63
std::vector< std::string > * StageName
Definition: showertree.h:47
showertree(TTree *tree=0)
Definition: showertree.h:94
TBranch * b_nStages
Definition: showertree.h:84
Event finding and building.
std::vector< int > * IsShowerTj
Definition: showertree.h:43