garana.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////
2 // This class has been automatically generated on
3 // Mon Oct 22 17:38:47 2018 by ROOT version 6.12/06
4 // from TTree GArAnaTree/GArAnaTree
5 // found on file: anatree.root
6 //////////////////////////////////////////////////////////
7 
8 #ifndef garana_h
9 #define garana_h
10 
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14 
15 // Header file for the classes stored in the TTree if any.
16 #include "vector"
17 #include "vector"
18 
19 class garana {
20 public :
21  TTree *fChain; //!pointer to the analyzed TTree or TChain
22  Int_t fCurrent; //!current Tree number in a TChain
23 
24 // Fixed size dimensions of array or collections stored in the TTree if any.
25 
26  // Declaration of leaf types
27  Int_t Event;
28  Int_t SubRun;
29  Int_t Run;
60 
61  // List of branches
62  TBranch *b_Event; //!
63  TBranch *b_SubRun; //!
64  TBranch *b_Run; //!
65  TBranch *b_NType; //!
66  TBranch *b_CCNC; //!
67  TBranch *b_PDG; //!
68  TBranch *b_MCPStartX; //!
69  TBranch *b_MCPStartY; //!
70  TBranch *b_MCPStartZ; //!
71  TBranch *b_MCPPX; //!
72  TBranch *b_MCPPY; //!
73  TBranch *b_MCPPZ; //!
74  TBranch *b_HitX; //!
75  TBranch *b_HitY; //!
76  TBranch *b_HitZ; //!
77  TBranch *b_HitSig; //!
78  TBranch *b_HitRMS; //!
79  TBranch *b_TrackStartX; //!
80  TBranch *b_TrackStartY; //!
81  TBranch *b_TrackStartZ; //!
82  TBranch *b_TrackStartPX; //!
83  TBranch *b_TrackStartPY; //!
84  TBranch *b_TrackStartPZ; //!
85  TBranch *b_TrackEndX; //!
86  TBranch *b_TrackEndY; //!
87  TBranch *b_TrackEndZ; //!
88  TBranch *b_TrackEndPX; //!
89  TBranch *b_TrackEndPY; //!
90  TBranch *b_TrackEndPZ; //!
91  TBranch *b_VertX; //!
92  TBranch *b_VertY; //!
93  TBranch *b_VertZ; //!
94  TBranch *b_VertN; //!
95 
96  garana(TTree *tree=0);
97  virtual ~garana();
98  virtual Int_t Cut(Long64_t entry);
99  virtual Int_t GetEntry(Long64_t entry);
100  virtual Long64_t LoadTree(Long64_t entry);
101  virtual void Init(TTree *tree);
102  virtual void Loop();
103  virtual Bool_t Notify();
104  virtual void Show(Long64_t entry = -1);
105 };
106 
107 #endif
108 
109 #ifdef garana_cxx
110 garana::garana(TTree *tree) : fChain(0)
111 {
112 // if parameter tree is not specified (or zero), connect the file
113 // used to generate this class and read the Tree.
114  if (tree == 0) {
115  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("anatree.root");
116  if (!f || !f->IsOpen()) {
117  f = new TFile("anatree.root");
118  }
119  TDirectory * dir = (TDirectory*)f->Get("anatree.root:/anatree");
120  dir->GetObject("GArAnaTree",tree);
121 
122  }
123  Init(tree);
124 }
125 
127 {
128  if (!fChain) return;
129  delete fChain->GetCurrentFile();
130 }
131 
132 Int_t garana::GetEntry(Long64_t entry)
133 {
134 // Read contents of entry.
135  if (!fChain) return 0;
136  return fChain->GetEntry(entry);
137 }
138 Long64_t garana::LoadTree(Long64_t entry)
139 {
140 // Set the environment to read one entry
141  if (!fChain) return -5;
142  Long64_t centry = fChain->LoadTree(entry);
143  if (centry < 0) return centry;
144  if (fChain->GetTreeNumber() != fCurrent) {
145  fCurrent = fChain->GetTreeNumber();
146  Notify();
147  }
148  return centry;
149 }
150 
151 void garana::Init(TTree *tree)
152 {
153  // The Init() function is called when the selector needs to initialize
154  // a new tree or chain. Typically here the branch addresses and branch
155  // pointers of the tree will be set.
156  // It is normally not necessary to make changes to the generated
157  // code, but the routine can be extended by the user if needed.
158  // Init() will be called many times when running on PROOF
159  // (once per file to be processed).
160 
161  // Set object pointer
162  NType = 0;
163  CCNC = 0;
164  PDG = 0;
165  MCPStartX = 0;
166  MCPStartY = 0;
167  MCPStartZ = 0;
168  MCPPX = 0;
169  MCPPY = 0;
170  MCPPZ = 0;
171  HitX = 0;
172  HitY = 0;
173  HitZ = 0;
174  HitSig = 0;
175  HitRMS = 0;
176  TrackStartX = 0;
177  TrackStartY = 0;
178  TrackStartZ = 0;
179  TrackStartPX = 0;
180  TrackStartPY = 0;
181  TrackStartPZ = 0;
182  TrackEndX = 0;
183  TrackEndY = 0;
184  TrackEndZ = 0;
185  TrackEndPX = 0;
186  TrackEndPY = 0;
187  TrackEndPZ = 0;
188  VertX = 0;
189  VertY = 0;
190  VertZ = 0;
191  VertN = 0;
192  // Set branch addresses and branch pointers
193  if (!tree) return;
194  fChain = tree;
195  fCurrent = -1;
196  fChain->SetMakeClass(1);
197 
198  fChain->SetBranchAddress("Event", &Event, &b_Event);
199  fChain->SetBranchAddress("SubRun", &SubRun, &b_SubRun);
200  fChain->SetBranchAddress("Run", &Run, &b_Run);
201  fChain->SetBranchAddress("NType", &NType, &b_NType);
202  fChain->SetBranchAddress("CCNC", &CCNC, &b_CCNC);
203  fChain->SetBranchAddress("PDG", &PDG, &b_PDG);
204  fChain->SetBranchAddress("MCPStartX", &MCPStartX, &b_MCPStartX);
205  fChain->SetBranchAddress("MCPStartY", &MCPStartY, &b_MCPStartY);
206  fChain->SetBranchAddress("MCPStartZ", &MCPStartZ, &b_MCPStartZ);
207  fChain->SetBranchAddress("MCPPX", &MCPPX, &b_MCPPX);
208  fChain->SetBranchAddress("MCPPY", &MCPPY, &b_MCPPY);
209  fChain->SetBranchAddress("MCPPZ", &MCPPZ, &b_MCPPZ);
210  fChain->SetBranchAddress("HitX", &HitX, &b_HitX);
211  fChain->SetBranchAddress("HitY", &HitY, &b_HitY);
212  fChain->SetBranchAddress("HitZ", &HitZ, &b_HitZ);
213  fChain->SetBranchAddress("HitSig", &HitSig, &b_HitSig);
214  fChain->SetBranchAddress("HitRMS", &HitRMS, &b_HitRMS);
215  fChain->SetBranchAddress("TrackStartX", &TrackStartX, &b_TrackStartX);
216  fChain->SetBranchAddress("TrackStartY", &TrackStartY, &b_TrackStartY);
217  fChain->SetBranchAddress("TrackStartZ", &TrackStartZ, &b_TrackStartZ);
218  fChain->SetBranchAddress("TrackStartPX", &TrackStartPX, &b_TrackStartPX);
219  fChain->SetBranchAddress("TrackStartPY", &TrackStartPY, &b_TrackStartPY);
220  fChain->SetBranchAddress("TrackStartPZ", &TrackStartPZ, &b_TrackStartPZ);
221  fChain->SetBranchAddress("TrackEndX", &TrackEndX, &b_TrackEndX);
222  fChain->SetBranchAddress("TrackEndY", &TrackEndY, &b_TrackEndY);
223  fChain->SetBranchAddress("TrackEndZ", &TrackEndZ, &b_TrackEndZ);
224  fChain->SetBranchAddress("TrackEndPX", &TrackEndPX, &b_TrackEndPX);
225  fChain->SetBranchAddress("TrackEndPY", &TrackEndPY, &b_TrackEndPY);
226  fChain->SetBranchAddress("TrackEndPZ", &TrackEndPZ, &b_TrackEndPZ);
227  fChain->SetBranchAddress("VertX", &VertX, &b_VertX);
228  fChain->SetBranchAddress("VertY", &VertY, &b_VertY);
229  fChain->SetBranchAddress("VertZ", &VertZ, &b_VertZ);
230  fChain->SetBranchAddress("VertN", &VertN, &b_VertN);
231  Notify();
232 }
233 
234 Bool_t garana::Notify()
235 {
236  // The Notify() function is called when a new file is opened. This
237  // can be either for a new TTree in a TChain or when when a new TTree
238  // is started when using PROOF. It is normally not necessary to make changes
239  // to the generated code, but the routine can be extended by the
240  // user if needed. The return value is currently not used.
241 
242  return kTRUE;
243 }
244 
245 void garana::Show(Long64_t entry)
246 {
247 // Print contents of entry.
248 // If entry is not specified, print current entry
249  if (!fChain) return;
250  fChain->Show(entry);
251 }
252 Int_t garana::Cut(Long64_t entry)
253 {
254 // This function may be called from Loop.
255 // returns 1 if entry is accepted.
256 // returns -1 otherwise.
257  return 1;
258 }
259 #endif // #ifdef garana_cxx
virtual void Init(TTree *tree)
vector< float > * TrackStartY
Definition: garana.h:45
virtual Int_t GetEntry(Long64_t entry)
Int_t SubRun
Definition: garana.h:28
TTree * fChain
Definition: garana.h:21
vector< float > * MCPPY
Definition: garana.h:37
vector< float > * VertX
Definition: garana.h:56
TBranch * b_TrackEndZ
Definition: garana.h:87
QList< Entry > entry
Int_t Run
Definition: garana.h:29
TBranch * b_CCNC
Definition: garana.h:66
Int_t Event
current Tree number in a TChain
Definition: garana.h:27
TBranch * b_VertN
Definition: garana.h:94
TBranch * b_Run
Definition: garana.h:64
virtual void Show(Long64_t entry=-1)
TBranch * b_HitZ
Definition: garana.h:76
virtual Bool_t Notify()
vector< float > * TrackStartZ
Definition: garana.h:46
TBranch * b_MCPStartX
Definition: garana.h:68
vector< float > * TrackStartPZ
Definition: garana.h:49
TBranch * b_MCPStartY
Definition: garana.h:69
TBranch * b_TrackEndX
Definition: garana.h:85
vector< float > * TrackEndPY
Definition: garana.h:54
TBranch * b_MCPStartZ
Definition: garana.h:70
vector< float > * VertZ
Definition: garana.h:58
vector< float > * TrackEndY
Definition: garana.h:51
vector< float > * TrackEndPX
Definition: garana.h:53
string dir
TBranch * b_MCPPZ
Definition: garana.h:73
TBranch * b_HitSig
Definition: garana.h:77
vector< float > * TrackEndPZ
Definition: garana.h:55
vector< int > * CCNC
Definition: garana.h:31
TBranch * b_HitRMS
Definition: garana.h:78
TBranch * b_HitY
Definition: garana.h:75
vector< float > * HitSig
Definition: garana.h:42
vector< float > * MCPStartY
Definition: garana.h:34
TBranch * b_VertY
Definition: garana.h:92
vector< float > * HitRMS
Definition: garana.h:43
TBranch * b_TrackEndPX
Definition: garana.h:88
vector< float > * TrackStartX
Definition: garana.h:44
vector< float > * TrackStartPX
Definition: garana.h:47
vector< float > * VertY
Definition: garana.h:57
virtual Int_t Cut(Long64_t entry)
TBranch * b_TrackEndY
Definition: garana.h:86
TBranch * b_TrackStartPX
Definition: garana.h:82
TBranch * b_TrackStartPY
Definition: garana.h:83
virtual void Loop()
vector< float > * HitX
Definition: garana.h:39
TBranch * b_HitX
Definition: garana.h:74
TBranch * b_Event
Definition: garana.h:62
TBranch * b_MCPPY
Definition: garana.h:72
TBranch * b_TrackStartZ
Definition: garana.h:81
vector< float > * MCPStartZ
Definition: garana.h:35
TBranch * b_MCPPX
Definition: garana.h:71
vector< int > * PDG
Definition: garana.h:32
virtual ~garana()
TBranch * b_TrackStartPZ
Definition: garana.h:84
TBranch * b_TrackEndPY
Definition: garana.h:89
vector< float > * MCPPZ
Definition: garana.h:38
vector< float > * TrackEndZ
Definition: garana.h:52
TBranch * b_VertX
Definition: garana.h:91
TBranch * b_NType
Definition: garana.h:65
TBranch * b_TrackStartY
Definition: garana.h:80
vector< float > * TrackEndX
Definition: garana.h:50
garana(TTree *tree=0)
virtual Long64_t LoadTree(Long64_t entry)
TBranch * b_VertZ
Definition: garana.h:93
TBranch * b_TrackEndPZ
Definition: garana.h:90
TBranch * b_TrackStartX
Definition: garana.h:79
TBranch * b_PDG
Definition: garana.h:67
vector< float > * TrackStartPY
Definition: garana.h:48
vector< int > * NType
Definition: garana.h:30
TBranch * b_SubRun
Definition: garana.h:63
vector< float > * HitY
Definition: garana.h:40
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: garana.h:22
vector< float > * MCPStartX
Definition: garana.h:33
vector< float > * HitZ
Definition: garana.h:41
vector< float > * MCPPX
Definition: garana.h:36
vector< int > * VertN
Definition: garana.h:59