gst.h
Go to the documentation of this file.
1 #ifndef GST_H
2 #define GST_H
3 
4 #include <TROOT.h>
5 #include <TChain.h>
6 #include <TFile.h>
7 
8 class gst {
9 public :
10  TTree *fChain; //!pointer to the analyzed TTree or TChain
11  Int_t fCurrent; //!current Tree number in a TChain
12 
13  // Declaration of leaf types
14  Int_t iev;
15  Int_t neu;
16  Int_t tgt;
17  Int_t Z;
18  Int_t A;
19  Int_t hitnuc;
20  Int_t hitqrk;
21  Int_t resid;
22  Bool_t sea;
23  Bool_t qel;
24  Bool_t res;
25  Bool_t dis;
26  Bool_t coh;
27  Bool_t dfr;
28  Bool_t imd;
29  Bool_t nuel;
30  Bool_t em;
31  Bool_t cc;
32  Bool_t nc;
33  Bool_t charm;
34  Int_t neut_code;
35  Int_t nuance_code;
36  Double_t wght;
37  Double_t xs;
38  Double_t ys;
39  Double_t ts;
40  Double_t Q2s;
41  Double_t Ws;
42  Double_t x;
43  Double_t y;
44  Double_t t;
45  Double_t Q2;
46  Double_t W;
47  Double_t Ev;
48  Double_t pxv;
49  Double_t pyv;
50  Double_t pzv;
51  Double_t En;
52  Double_t pxn;
53  Double_t pyn;
54  Double_t pzn;
55  Double_t El;
56  Double_t pxl;
57  Double_t pyl;
58  Double_t pzl;
59  Int_t nfp;
60  Int_t nfn;
61  Int_t nfpip;
62  Int_t nfpim;
63  Int_t nfpi0;
64  Int_t nfkp;
65  Int_t nfkm;
66  Int_t nfk0;
67  Int_t nfem;
68  Int_t nfother;
69  Int_t nip;
70  Int_t nin;
71  Int_t nipip;
72  Int_t nipim;
73  Int_t nipi0;
74  Int_t nikp;
75  Int_t nikm;
76  Int_t nik0;
77  Int_t niem;
78  Int_t niother;
79  Int_t ni;
80  Int_t pdgi[60]; //[ni]
81  Int_t resc[60]; //[ni]
82  Double_t Ei[60]; //[ni]
83  Double_t pxi[60]; //[ni]
84  Double_t pyi[60]; //[ni]
85  Double_t pzi[60]; //[ni]
86  Int_t nf;
87  Int_t pdgf[60]; //[nf]
88  Double_t Ef[60]; //[nf]
89  Double_t pxf[60]; //[nf]
90  Double_t pyf[60]; //[nf]
91  Double_t pzf[60]; //[nf]
92  Double_t vtxx;
93  Double_t vtxy;
94  Double_t vtxz;
95  Double_t vtxt;
96  Double_t calresp0;
97 
98  // List of branches
99  TBranch *b_iev; //!
100  TBranch *b_neu; //!
101  TBranch *b_tgt; //!
102  TBranch *b_Z; //!
103  TBranch *b_A; //!
104  TBranch *b_hitnuc; //!
105  TBranch *b_hitqrk; //!
106  TBranch *b_resid; //!
107  TBranch *b_sea; //!
108  TBranch *b_qel; //!
109  TBranch *b_res; //!
110  TBranch *b_dis; //!
111  TBranch *b_coh; //!
112  TBranch *b_dfr; //!
113  TBranch *b_imd; //!
114  TBranch *b_nuel; //!
115  TBranch *b_em; //!
116  TBranch *b_cc; //!
117  TBranch *b_nc; //!
118  TBranch *b_charm; //!
119  TBranch *b_neut_code; //!
120  TBranch *b_nuance_code; //!
121  TBranch *b_wght; //!
122  TBranch *b_xs; //!
123  TBranch *b_ys; //!
124  TBranch *b_ts; //!
125  TBranch *b_Q2s; //!
126  TBranch *b_Ws; //!
127  TBranch *b_x; //!
128  TBranch *b_y; //!
129  TBranch *b_t; //!
130  TBranch *b_Q2; //!
131  TBranch *b_W; //!
132  TBranch *b_Ev; //!
133  TBranch *b_pxv; //!
134  TBranch *b_pyv; //!
135  TBranch *b_pzv; //!
136  TBranch *b_En; //!
137  TBranch *b_pxn; //!
138  TBranch *b_pyn; //!
139  TBranch *b_pzn; //!
140  TBranch *b_El; //!
141  TBranch *b_pxl; //!
142  TBranch *b_pyl; //!
143  TBranch *b_pzl; //!
144  TBranch *b_nfp; //!
145  TBranch *b_nfn; //!
146  TBranch *b_nfpip; //!
147  TBranch *b_nfpim; //!
148  TBranch *b_nfpi0; //!
149  TBranch *b_nfkp; //!
150  TBranch *b_nfkm; //!
151  TBranch *b_nfk0; //!
152  TBranch *b_nfem; //!
153  TBranch *b_nfother; //!
154  TBranch *b_np; //!
155  TBranch *b_nn; //!
156  TBranch *b_npip; //!
157  TBranch *b_npim; //!
158  TBranch *b_npi0; //!
159  TBranch *b_nkp; //!
160  TBranch *b_nkm; //!
161  TBranch *b_nk0; //!
162  TBranch *b_niem; //!
163  TBranch *b_niother; //!
164  TBranch *b_ni; //!
165  TBranch *b_pdgi; //!
166  TBranch *b_resc; //!
167  TBranch *b_Ei; //!
168  TBranch *b_pxi; //!
169  TBranch *b_pyi; //!
170  TBranch *b_pzi; //!
171  TBranch *b_nf; //!
172  TBranch *b_pdgf; //!
173  TBranch *b_Ef; //!
174  TBranch *b_pxf; //!
175  TBranch *b_pyf; //!
176  TBranch *b_pzf; //!
177  TBranch *b_vtxx; //!
178  TBranch *b_vtxy; //!
179  TBranch *b_vtxz; //!
180  TBranch *b_vtxt; //!
181  TBranch *b_calresp0; //!
182 
183  gst(char* fname);
184  virtual ~gst();
185  virtual Int_t GetEntry(Long64_t entry);
186  virtual void Init(TTree *tree);
187 };
188 
190 {
191 // if parameter tree is not specified (or zero), connect the file
192 // used to generate this class and read the Tree.
193  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject(fname);
194  if (!f || !f->IsOpen()) {
195  f = new TFile(fname);
196  }
197  f->GetObject("gst",fChain);
198  Init(fChain);
199 }
201 {
202  if (!fChain) return;
203  delete fChain->GetCurrentFile();
204 }
205 
206 Int_t gst::GetEntry(Long64_t entry)
207 {
208 // Read contents of entry.
209  if (!fChain) return 0;
210  return fChain->GetEntry(entry);
211 }
212 void gst::Init(TTree *tree)
213 {
214  // The Init() function is called when the selector needs to initialize
215  // a new tree or chain. Typically here the branch addresses and branch
216  // pointers of the tree will be set.
217  // It is normally not necessary to make changes to the generated
218  // code, but the routine can be extended by the user if needed.
219  // Init() will be called many times when running on PROOF
220  // (once per file to be processed).
221 
222  // Set branch addresses and branch pointers
223  if (!tree) return;
224  fChain = tree;
225  fCurrent = -1;
226  fChain->SetMakeClass(1);
227 
228  fChain->SetBranchAddress("iev", &iev, &b_iev);
229  fChain->SetBranchAddress("neu", &neu, &b_neu);
230  fChain->SetBranchAddress("tgt", &tgt, &b_tgt);
231  fChain->SetBranchAddress("Z", &Z, &b_Z);
232  fChain->SetBranchAddress("A", &A, &b_A);
233  fChain->SetBranchAddress("hitnuc", &hitnuc, &b_hitnuc);
234  fChain->SetBranchAddress("hitqrk", &hitqrk, &b_hitqrk);
235  fChain->SetBranchAddress("resid", &resid, &b_resid);
236  fChain->SetBranchAddress("sea", &sea, &b_sea);
237  fChain->SetBranchAddress("qel", &qel, &b_qel);
238  fChain->SetBranchAddress("res", &res, &b_res);
239  fChain->SetBranchAddress("dis", &dis, &b_dis);
240  fChain->SetBranchAddress("coh", &coh, &b_coh);
241  fChain->SetBranchAddress("dfr", &dfr, &b_dfr);
242  fChain->SetBranchAddress("imd", &imd, &b_imd);
243  fChain->SetBranchAddress("nuel", &nuel, &b_nuel);
244  fChain->SetBranchAddress("em", &em, &b_em);
245  fChain->SetBranchAddress("cc", &cc, &b_cc);
246  fChain->SetBranchAddress("nc", &nc, &b_nc);
247  fChain->SetBranchAddress("charm", &charm, &b_charm);
248  fChain->SetBranchAddress("neut_code", &neut_code, &b_neut_code);
249  fChain->SetBranchAddress("nuance_code", &nuance_code, &b_nuance_code);
250  fChain->SetBranchAddress("wght", &wght, &b_wght);
251  fChain->SetBranchAddress("xs", &xs, &b_xs);
252  fChain->SetBranchAddress("ys", &ys, &b_ys);
253  fChain->SetBranchAddress("ts", &ts, &b_ts);
254  fChain->SetBranchAddress("Q2s", &Q2s, &b_Q2s);
255  fChain->SetBranchAddress("Ws", &Ws, &b_Ws);
256  fChain->SetBranchAddress("x", &x, &b_x);
257  fChain->SetBranchAddress("y", &y, &b_y);
258  fChain->SetBranchAddress("t", &t, &b_t);
259  fChain->SetBranchAddress("Q2", &Q2, &b_Q2);
260  fChain->SetBranchAddress("W", &W, &b_W);
261  fChain->SetBranchAddress("Ev", &Ev, &b_Ev);
262  fChain->SetBranchAddress("pxv", &pxv, &b_pxv);
263  fChain->SetBranchAddress("pyv", &pyv, &b_pyv);
264  fChain->SetBranchAddress("pzv", &pzv, &b_pzv);
265  fChain->SetBranchAddress("En", &En, &b_En);
266  fChain->SetBranchAddress("pxn", &pxn, &b_pxn);
267  fChain->SetBranchAddress("pyn", &pyn, &b_pyn);
268  fChain->SetBranchAddress("pzn", &pzn, &b_pzn);
269  fChain->SetBranchAddress("El", &El, &b_El);
270  fChain->SetBranchAddress("pxl", &pxl, &b_pxl);
271  fChain->SetBranchAddress("pyl", &pyl, &b_pyl);
272  fChain->SetBranchAddress("pzl", &pzl, &b_pzl);
273  fChain->SetBranchAddress("nfp", &nfp, &b_nfp);
274  fChain->SetBranchAddress("nfn", &nfn, &b_nfn);
275  fChain->SetBranchAddress("nfpip", &nfpip, &b_nfpip);
276  fChain->SetBranchAddress("nfpim", &nfpim, &b_nfpim);
277  fChain->SetBranchAddress("nfpi0", &nfpi0, &b_nfpi0);
278  fChain->SetBranchAddress("nfkp", &nfkp, &b_nfkp);
279  fChain->SetBranchAddress("nfkm", &nfkm, &b_nfkm);
280  fChain->SetBranchAddress("nfk0", &nfk0, &b_nfk0);
281  fChain->SetBranchAddress("nfem", &nfem, &b_nfem);
282  fChain->SetBranchAddress("nfother", &nfother, &b_nfother);
283  fChain->SetBranchAddress("nip", &nip, &b_np);
284  fChain->SetBranchAddress("nin", &nin, &b_nn);
285  fChain->SetBranchAddress("nipip", &nipip, &b_npip);
286  fChain->SetBranchAddress("nipim", &nipim, &b_npim);
287  fChain->SetBranchAddress("nipi0", &nipi0, &b_npi0);
288  fChain->SetBranchAddress("nikp", &nikp, &b_nkp);
289  fChain->SetBranchAddress("nikm", &nikm, &b_nkm);
290  fChain->SetBranchAddress("nik0", &nik0, &b_nk0);
291  fChain->SetBranchAddress("niem", &niem, &b_niem);
292  fChain->SetBranchAddress("niother", &niother, &b_niother);
293  fChain->SetBranchAddress("ni", &ni, &b_ni);
294  fChain->SetBranchAddress("pdgi", pdgi, &b_pdgi);
295  fChain->SetBranchAddress("resc", resc, &b_resc);
296  fChain->SetBranchAddress("Ei", Ei, &b_Ei);
297  fChain->SetBranchAddress("pxi", pxi, &b_pxi);
298  fChain->SetBranchAddress("pyi", pyi, &b_pyi);
299  fChain->SetBranchAddress("pzi", pzi, &b_pzi);
300  fChain->SetBranchAddress("nf", &nf, &b_nf);
301  fChain->SetBranchAddress("pdgf", pdgf, &b_pdgf);
302  fChain->SetBranchAddress("Ef", Ef, &b_Ef);
303  fChain->SetBranchAddress("pxf", pxf, &b_pxf);
304  fChain->SetBranchAddress("pyf", pyf, &b_pyf);
305  fChain->SetBranchAddress("pzf", pzf, &b_pzf);
306  fChain->SetBranchAddress("vtxx", &vtxx, &b_vtxx);
307  fChain->SetBranchAddress("vtxy", &vtxy, &b_vtxy);
308  fChain->SetBranchAddress("vtxz", &vtxz, &b_vtxz);
309  fChain->SetBranchAddress("vtxt", &vtxt, &b_vtxt);
310  fChain->SetBranchAddress("calresp0", &calresp0, &b_calresp0);
311 }
312 
313 
314 #endif // GST_H
virtual ~gst()
Definition: gst.h:200
TBranch * b_tgt
Definition: gst.h:101
TBranch * b_vtxx
Definition: gst.h:177
TBranch * b_cc
Definition: gst.h:116
Int_t nik0
Definition: gst.h:76
Int_t nuance_code
Definition: gst.h:35
TBranch * b_xs
Definition: gst.h:122
Int_t nfp
Definition: gst.h:59
Bool_t cc
Definition: gst.h:31
Int_t nfother
Definition: gst.h:68
Double_t calresp0
Definition: gst.h:96
TBranch * b_En
Definition: gst.h:136
Bool_t imd
Definition: gst.h:28
TBranch * b_nkm
Definition: gst.h:160
Bool_t charm
Definition: gst.h:33
Double_t pzv
Definition: gst.h:50
TBranch * b_Ei
Definition: gst.h:167
TBranch * b_sea
Definition: gst.h:107
Int_t Z
Definition: gst.h:17
Bool_t qel
Definition: gst.h:23
Double_t pzn
Definition: gst.h:54
TBranch * b_Q2s
Definition: gst.h:125
TBranch * b_pyn
Definition: gst.h:138
TBranch * b_hitnuc
Definition: gst.h:104
TBranch * b_qel
Definition: gst.h:108
TBranch * b_ys
Definition: gst.h:123
Int_t nipip
Definition: gst.h:71
Double_t vtxx
Definition: gst.h:92
TBranch * b_vtxz
Definition: gst.h:179
Int_t tgt
Definition: gst.h:16
TBranch * b_coh
Definition: gst.h:111
TBranch * b_niem
Definition: gst.h:162
TBranch * b_pyi
Definition: gst.h:169
Int_t A
Definition: gst.h:18
Bool_t nc
Definition: gst.h:32
TBranch * b_Ev
Definition: gst.h:132
TBranch * b_nn
Definition: gst.h:155
TBranch * b_nuance_code
Definition: gst.h:120
Int_t nipim
Definition: gst.h:72
Double_t ts
Definition: gst.h:39
Double_t pxf[60]
Definition: gst.h:89
Bool_t dis
Definition: gst.h:25
Int_t hitqrk
Definition: gst.h:20
Bool_t nuel
Definition: gst.h:29
Int_t nfn
Definition: gst.h:60
TBranch * b_vtxt
Definition: gst.h:180
Double_t Ev
Definition: gst.h:47
TBranch * b_nc
Definition: gst.h:117
TBranch * b_t
Definition: gst.h:129
Int_t nfpip
Definition: gst.h:61
Int_t nip
Definition: gst.h:69
Double_t pyv
Definition: gst.h:49
Int_t hitnuc
Definition: gst.h:19
Int_t nf
Definition: gst.h:86
TBranch * b_nfem
Definition: gst.h:152
Double_t pxv
Definition: gst.h:48
Int_t ni
Definition: gst.h:79
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: gst.h:11
TBranch * b_pyv
Definition: gst.h:134
Double_t pyi[60]
Definition: gst.h:84
TBranch * b_y
Definition: gst.h:128
Double_t pxi[60]
Definition: gst.h:83
TBranch * b_neu
Definition: gst.h:100
TBranch * b_pxl
Definition: gst.h:141
TBranch * b_em
Definition: gst.h:115
Bool_t em
Definition: gst.h:30
TBranch * b_npip
Definition: gst.h:156
virtual void Init(TTree *tree)
Definition: gst.h:212
Bool_t coh
Definition: gst.h:26
TBranch * b_Q2
Definition: gst.h:130
Double_t x
Definition: gst.h:42
Double_t pxl
Definition: gst.h:56
TBranch * b_np
Definition: gst.h:154
Int_t niem
Definition: gst.h:77
TBranch * b_nuel
Definition: gst.h:114
Int_t resc[60]
Definition: gst.h:81
TBranch * b_pzf
Definition: gst.h:176
TBranch * b_pzi
Definition: gst.h:170
Int_t nfkm
Definition: gst.h:65
Double_t W
Definition: gst.h:46
Int_t nikp
Definition: gst.h:74
Double_t En
Definition: gst.h:51
TBranch * b_dfr
Definition: gst.h:112
Int_t resid
Definition: gst.h:21
TBranch * b_ni
Definition: gst.h:164
TBranch * b_pxf
Definition: gst.h:174
TBranch * b_nk0
Definition: gst.h:161
TBranch * b_dis
Definition: gst.h:110
TBranch * b_niother
Definition: gst.h:163
TBranch * b_nfp
Definition: gst.h:144
TBranch * b_hitqrk
Definition: gst.h:105
Double_t t
Definition: gst.h:44
TBranch * b_pzn
Definition: gst.h:139
Double_t pyf[60]
Definition: gst.h:90
TBranch * b_nfk0
Definition: gst.h:151
TBranch * b_Z
Definition: gst.h:102
Double_t pxn
Definition: gst.h:52
TBranch * b_A
Definition: gst.h:103
TBranch * b_resc
Definition: gst.h:166
TBranch * b_nfkp
Definition: gst.h:149
TBranch * b_charm
Definition: gst.h:118
Double_t El
Definition: gst.h:55
Double_t vtxt
Definition: gst.h:95
TBranch * b_iev
Definition: gst.h:99
TBranch * b_pzl
Definition: gst.h:143
TTree * fChain
Definition: gst.h:10
Double_t pyl
Definition: gst.h:57
TBranch * b_nf
Definition: gst.h:171
Int_t nfpi0
Definition: gst.h:63
Double_t Ws
Definition: gst.h:41
TBranch * b_pxi
Definition: gst.h:168
Double_t Q2s
Definition: gst.h:40
gst(char *fname)
Definition: gst.h:189
Double_t Ef[60]
Definition: gst.h:88
TBranch * b_Ws
Definition: gst.h:126
TBranch * b_pdgi
Definition: gst.h:165
TBranch * b_imd
Definition: gst.h:113
TBranch * b_resid
Definition: gst.h:106
TBranch * b_pxv
Definition: gst.h:133
TBranch * b_npi0
Definition: gst.h:158
Int_t niother
Definition: gst.h:78
Int_t nipi0
Definition: gst.h:73
Definition: gst.h:8
TBranch * b_wght
Definition: gst.h:121
Double_t xs
Definition: gst.h:37
TBranch * b_nkp
Definition: gst.h:159
Bool_t dfr
Definition: gst.h:27
Double_t vtxy
Definition: gst.h:93
TBranch * b_nfkm
Definition: gst.h:150
Int_t neut_code
Definition: gst.h:34
Double_t Q2
Definition: gst.h:45
Bool_t res
Definition: gst.h:24
TBranch * b_W
Definition: gst.h:131
Int_t pdgf[60]
Definition: gst.h:87
TBranch * b_res
Definition: gst.h:109
Int_t nikm
Definition: gst.h:75
Bool_t sea
Definition: gst.h:22
Int_t nfem
Definition: gst.h:67
TBranch * b_calresp0
Definition: gst.h:181
TBranch * b_x
Definition: gst.h:127
TBranch * b_El
Definition: gst.h:140
Int_t iev
current Tree number in a TChain
Definition: gst.h:14
TBranch * b_pdgf
Definition: gst.h:172
TBranch * b_vtxy
Definition: gst.h:178
TBranch * b_nfpim
Definition: gst.h:147
Double_t y
Definition: gst.h:43
TBranch * b_npim
Definition: gst.h:157
TBranch * b_nfpip
Definition: gst.h:146
Double_t pzl
Definition: gst.h:58
Double_t ys
Definition: gst.h:38
Int_t nfpim
Definition: gst.h:62
TBranch * b_pzv
Definition: gst.h:135
Double_t Ei[60]
Definition: gst.h:82
virtual Int_t GetEntry(Long64_t entry)
Definition: gst.h:206
Int_t nfkp
Definition: gst.h:64
TBranch * b_nfpi0
Definition: gst.h:148
Int_t pdgi[60]
Definition: gst.h:80
Double_t vtxz
Definition: gst.h:94
TBranch * b_pyf
Definition: gst.h:175
Double_t wght
Definition: gst.h:36
def entry(str)
Definition: HTMLTools.py:26
Double_t pzi[60]
Definition: gst.h:85
TBranch * b_pxn
Definition: gst.h:137
TBranch * b_nfother
Definition: gst.h:153
TBranch * b_ts
Definition: gst.h:124
TBranch * b_pyl
Definition: gst.h:142
Int_t nin
Definition: gst.h:70
TBranch * b_Ef
Definition: gst.h:173
Double_t pzf[60]
Definition: gst.h:91
Double_t pyn
Definition: gst.h:53
TBranch * b_neut_code
Definition: gst.h:119
Int_t nfk0
Definition: gst.h:66
Int_t neu
Definition: gst.h:15
TBranch * b_nfn
Definition: gst.h:145