Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ntuple_variables.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ntuple_variables.C
1 
2 
3  //===================================
4  // access the event ntuple variables
5  //===================================
6 
7 // int nevents = ntp_vertex->GetEntries();
8 //cout << "Number of events " << nevents << endl;
9 
10 //int num_g4hits = ntp_g4hit->GetEntries();
11 //cout << "Number of g4hits " << num_g4hits << endl;
12 
13 //int num_clusters = ntp_cluster->GetEntries();
14 //cout << "Number of clusters " << num_clusters << endl;
15 
16  Float_t event;
17  Float_t ntracks;
18  Float_t ngtracks;
19  Float_t ng4hits;
20  Float_t nhittpcin;
21 //Float_t nclusters;
22  Float_t evx;
23  Float_t evy;
24  Float_t evz;
25  Float_t egvx;
26  Float_t egvy;
27  Float_t egvz;
28  Float_t egvt;
35 //Float_t hit_occupancy_layer6;
36 
37  TBranch* b_event;
38  TBranch* b_ntracks;
39  TBranch* b_ngtracks;
40  TBranch* b_ng4hits;
41  TBranch* b_nhittpcin;
42 // TBranch* b_nclusters;
43  TBranch* b_evx;
44  TBranch* b_evy;
45  TBranch* b_evz;
46  TBranch* b_egvx;
47  TBranch* b_egvy;
48  TBranch* b_egvz;
49  TBranch* b_egvt;
50 //TBranch* b_hit_occupancy_layer0;
51 //TBranch* b_hit_occupancy_layer1;
52 //TBranch* b_hit_occupancy_layer2;
53 //TBranch* b_hit_occupancy_layer3;
54 //TBranch* b_hit_occupancy_layer4;
55 //TBranch* b_hit_occupancy_layer5;
56 //TBranch* b_hit_occupancy_layer6;
57 
58  ntp_vertex->SetBranchAddress("event", &event);
59 //ntp_vertex->SetBranchAddress("gnhits", &ng4hits);
60  ntp_vertex->SetBranchAddress("ntracks", &ntracks);
61  ntp_vertex->SetBranchAddress("gntracks", &ngtracks);
62  ntp_vertex->SetBranchAddress("nhittpcin", &nhittpcin);
63 //ntp_vertex->SetBranchAddress("nclusters", &nclusters);
64  ntp_vertex->SetBranchAddress("vx", &evx);
65  ntp_vertex->SetBranchAddress("vy", &evy);
66  ntp_vertex->SetBranchAddress("vz", &evz);
67  ntp_vertex->SetBranchAddress("gvx", &egvx);
68  ntp_vertex->SetBranchAddress("gvy", &egvy);
69  ntp_vertex->SetBranchAddress("gvz", &egvz);
70  ntp_vertex->SetBranchAddress("gvt", &egvt);
71 //ntp_vertex->SetBranchAddress("hit_occupancy_layer0", &hit_occupancy_layer0);
72 //ntp_vertex->SetBranchAddress("hit_occupancy_layer1", &hit_occupancy_layer1);
73 //ntp_vertex->SetBranchAddress("hit_occupancy_layer2", &hit_occupancy_layer2);
74 //ntp_vertex->SetBranchAddress("hit_occupancy_layer3", &hit_occupancy_layer3);
75 //ntp_vertex->SetBranchAddress("hit_occupancy_layer4", &hit_occupancy_layer4);
76 //ntp_vertex->SetBranchAddress("hit_occupancy_layer5", &hit_occupancy_layer5);
77 //ntp_event->SetBranchAddress("hit_occupancy_layer6", &hit_occupancy_layer6);
78 
79  b_event = ntp_vertex->GetBranch("event");
80  b_ntracks = ntp_vertex->GetBranch("ntracks");
81  b_ngtracks = ntp_vertex->GetBranch("gntracks");
82  b_nhittpcin = ntp_vertex->GetBranch("nhittpcin");
83 //b_ng4hits = ntp_vertex->GetBranch("gnhits");
84 //b_nclusters = ntp_vertex->GetBranch("nclusters");
85  b_evx = ntp_vertex->GetBranch("vx");
86  b_evy = ntp_vertex->GetBranch("vy");
87  b_evz = ntp_vertex->GetBranch("vz");
88  b_egvx = ntp_vertex->GetBranch("gvx");
89  b_egvy = ntp_vertex->GetBranch("gvy");
90  b_egvz = ntp_vertex->GetBranch("gvz");
91  b_egvt = ntp_vertex->GetBranch("gvt");
92 //b_hit_occupancy_layer0 = ntp_vertex->GetBranch("hit_occupancy_layer0");
93 //b_hit_occupancy_layer1 = ntp_vertex->GetBranch("hit_occupancy_layer1");
94 //b_hit_occupancy_layer2 = ntp_vertex->GetBranch("hit_occupancy_layer2");
95 //b_hit_occupancy_layer3 = ntp_vertex->GetBranch("hit_occupancy_layer3");
96 //b_hit_occupancy_layer4 = ntp_vertex->GetBranch("hit_occupancy_layer4");
97 //b_hit_occupancy_layer5 = ntp_vertex->GetBranch("hit_occupancy_layer5");
98 //b_hit_occupancy_layer6 = ntp_vertex->GetBranch("hit_occupancy_layer6");
99 
100  //=====================================
101  // Access ntp_track (reco'd) variables
102  //=====================================
103 
104 //cout << "set up ntp_track access" << endl;
105 
106  Float_t rpx;
107  Float_t rpy;
108  Float_t rpz;
109  Float_t rpt;
110  Float_t rgfx;
111  Float_t rgfy;
112  Float_t rgfz;
113  Float_t rgpx;
114  Float_t rgpy;
115  Float_t rgpz;
116  Float_t rgpt;
117  Float_t rquality;
118  Float_t rchisq;
119 //Float_t rchisqv;
120  Float_t rcharge;
121  Float_t revent;
122  Float_t rtrackid;
123  Float_t rgtrackid;
124  Float_t rgflavor;
125  Float_t rprimary;
126  Float_t rnfromtruth;
127  Float_t rvz;
128  Float_t rpcax;
129  Float_t rpcay;
130  Float_t rpcaz;
131  Float_t rdca2d;
132  Float_t rdca2dsigma;
133  Float_t rnhits;
134  Float_t rgnhits;
135  Float_t rgembed;
136 
137  Float_t rnlmaps;
138  Float_t rgnlmaps;
139  Float_t rnlintt;
140  Float_t rgnlintt;
141  Float_t rnltpc;
142  Float_t rgnltpc;
143 
144  Float_t rnmaps;
145  Float_t rgnmaps;
146  Float_t rnintt;
147  Float_t rgnintt;
148  Float_t rntpc;
149  Float_t rgntpc;
150 
151  // Calorimeter matching variables
152 Float_t cemc_e;
153 Float_t cemc3x3_e;
154 Float_t cemc_dphi;
155 Float_t cemc_deta;
156 
157  TBranch* b_px;
158  TBranch* b_py;
159  TBranch* b_pz;
160  TBranch* b_pt;
161  TBranch* b_gpx;
162  TBranch* b_gpy;
163  TBranch* b_gpz;
164  TBranch* b_gpt;
165  TBranch* b_gfx;
166  TBranch* b_gfy;
167  TBranch* b_gfz;
168  TBranch* b_quality;
169  TBranch* b_chisq;
170 //TBranch* b_chisqv;
171  TBranch* b_charge;
172  TBranch* b_revent;
173  TBranch* b_trackid;
174  TBranch* b_gtrackid;
175  TBranch* b_gflavor;
176  TBranch* b_primary;
177  TBranch* b_nfromtruth;
178  TBranch* b_gvz;
179  TBranch* b_pcax;
180  TBranch* b_pcay;
181  TBranch* b_pcaz;
182  TBranch* b_dca2d;
183  TBranch* b_dca2dsigma;
184  TBranch* b_rnhits;
185  TBranch* b_rgnhits;
186  TBranch* b_rgembed;
187 
188  TBranch* b_rnlmaps;
189  TBranch* b_rgnlmaps;
190  TBranch* b_rnlintt;
191  TBranch* b_rgnlintt;
192  TBranch* b_rnltpc;
193  TBranch* b_rgnltpc;
194 
195  TBranch* b_rnmaps;
196  TBranch* b_rgnmaps;
197  TBranch* b_rnintt;
198  TBranch* b_rgnintt;
199  TBranch* b_rntpc;
200  TBranch* b_rgntpc;
201 
202 // calorimeter
203  TBranch* b_cem_e;
204  TBranch* b_cem3x3_e;
205  TBranch* b_cem_dphi;
206  TBranch* b_cem_deta;
207 
208  //set branches
209  ntp_track->SetBranchAddress("px", &rpx);
210  ntp_track->SetBranchAddress("py", &rpy);
211  ntp_track->SetBranchAddress("pz", &rpz);
212  ntp_track->SetBranchAddress("pt", &rpt);
213  ntp_track->SetBranchAddress("gpx", &rgpx);
214  ntp_track->SetBranchAddress("gpy", &rgpy);
215  ntp_track->SetBranchAddress("gpz", &rgpz);
216  ntp_track->SetBranchAddress("gpt", &rgpt);
217  ntp_track->SetBranchAddress("gfx", &rgfx);
218  ntp_track->SetBranchAddress("gfy", &rgfy);
219  ntp_track->SetBranchAddress("gfz", &rgfz);
220  ntp_track->SetBranchAddress("charge", &rcharge);
221  ntp_track->SetBranchAddress("quality", &rquality);
222  ntp_track->SetBranchAddress("chisq", &rchisq);
223 //ntp_track->SetBranchAddress("chisqv", &rchisqv);
224  ntp_track->SetBranchAddress("event", &revent);
225  ntp_track->SetBranchAddress("trackID", &rtrackid);
226  ntp_track->SetBranchAddress("gtrackID", &rgtrackid);
227  ntp_track->SetBranchAddress("gflavor", &rgflavor);
228  ntp_track->SetBranchAddress("gprimary", &rprimary);
229  ntp_track->SetBranchAddress("nfromtruth", &rnfromtruth);
230  ntp_track->SetBranchAddress("gvz", &rvz);
231  ntp_track->SetBranchAddress("pcax", &rpcax);
232  ntp_track->SetBranchAddress("pcay", &rpcay);
233  ntp_track->SetBranchAddress("pcaz", &rpcaz);
234  ntp_track->SetBranchAddress("dca2d", &rdca2d);
235  ntp_track->SetBranchAddress("dca2dsigma", &rdca2dsigma);
236  ntp_track->SetBranchAddress("nhits", &rnhits);
237  ntp_track->SetBranchAddress("gnhits", &rgnhits);
238  ntp_track->SetBranchAddress("gembed", &rgembed);
239 
240  ntp_track->SetBranchAddress("nlmaps", &rnlmaps);
241  ntp_track->SetBranchAddress("gnlmaps", &rgnlmaps);
242  ntp_track->SetBranchAddress("nlintt", &rnlintt);
243  ntp_track->SetBranchAddress("gnlintt", &rgnlintt);
244  ntp_track->SetBranchAddress("nltpc", &rnltpc);
245  ntp_track->SetBranchAddress("gnltpc", &rgnltpc);
246 
247  ntp_track->SetBranchAddress("nmaps", &rnmaps);
248  ntp_track->SetBranchAddress("gnmaps", &rgnmaps);
249  ntp_track->SetBranchAddress("nintt", &rnintt);
250  ntp_track->SetBranchAddress("gnintt", &rgnintt);
251  ntp_track->SetBranchAddress("ntpc", &rntpc);
252  ntp_track->SetBranchAddress("gntpc", &rgntpc);
253 
254 // calorimeter
255  ntp_track->SetBranchAddress("cemce", &cemc_e);
256  ntp_track->SetBranchAddress("cemce3x3", &cemc3x3_e);
257  ntp_track->SetBranchAddress("cemcdphi", &cemc_dphi);
258  ntp_track->SetBranchAddress("cemcdeta", &cemc_deta);
259 
260  //get Branches
261  b_px = ntp_track->GetBranch("px");
262  b_py = ntp_track->GetBranch("py");
263  b_pz = ntp_track->GetBranch("pz");
264  b_pt = ntp_track->GetBranch("pt");
265  b_gpx = ntp_track->GetBranch("gpx");
266  b_gpy = ntp_track->GetBranch("gpy");
267  b_gpz = ntp_track->GetBranch("gpz");
268  b_gpt = ntp_track->GetBranch("gpt");
269  b_gfx = ntp_track->GetBranch("gfx");
270  b_gfy = ntp_track->GetBranch("gfy");
271  b_gfz = ntp_track->GetBranch("gfz");
272  b_charge = ntp_track->GetBranch("charge");
273  b_quality = ntp_track->GetBranch("quality");
274 //b_chisqv = ntp_track->GetBranch("chisqv");
275  b_revent = ntp_track->GetBranch("event");
276  b_trackid = ntp_track->GetBranch("trackID");
277  b_gtrackid = ntp_track->GetBranch("gtrackID");
278  b_gflavor = ntp_track->GetBranch("gflavor");
279  b_primary = ntp_track->GetBranch("gprimary");
280  b_nfromtruth = ntp_track->GetBranch("nfromtruth");
281  b_gvz = ntp_track->GetBranch("gvz");
282  b_pcax = ntp_track->GetBranch("pcax");
283  b_pcay = ntp_track->GetBranch("pcay");
284  b_pcaz = ntp_track->GetBranch("pcaz");
285  b_dca2d = ntp_track->GetBranch("dca2d");
286  b_dca2dsigma = ntp_track->GetBranch("dca2dsigma");
287  b_rnhits = ntp_track->GetBranch("nhits");
288  b_rnhits = ntp_track->GetBranch("gnhits");
289  b_rgembed = ntp_track->GetBranch("gembed");
290 
291  b_rnlmaps = ntp_track->GetBranch("nlmaps");
292  b_rgnlmaps = ntp_track->GetBranch("gnlmaps");
293  b_rnlintt = ntp_track->GetBranch("nlintt");
294  b_rgnlintt = ntp_track->GetBranch("gnlintt");
295  b_rnltpc = ntp_track->GetBranch("nltpc");
296  b_rgnltpc = ntp_track->GetBranch("gnltpc");
297 
298  b_rnmaps = ntp_track->GetBranch("nmaps");
299  b_rgnmaps = ntp_track->GetBranch("gnmaps");
300  b_rnintt = ntp_track->GetBranch("nintt");
301  b_rgnintt = ntp_track->GetBranch("gnintt");
302  b_rntpc = ntp_track->GetBranch("ntpc");
303  b_rgntpc = ntp_track->GetBranch("gntpc");
304 
305 // calorimeter
306  b_rgembed = ntp_track->GetBranch("cemce");
307  b_rgembed = ntp_track->GetBranch("cemce3x3");
308  b_rgembed = ntp_track->GetBranch("cemcdphi");
309  b_rgembed = ntp_track->GetBranch("cemcdeta");
310 
311  //================================
312  // Access the g4track ntuple variables
313  //================================
314 
315 //cout << "set up ntp_gtrack access" << endl;
316 
317  Float_t tpx;
318  Float_t tpy;
319  Float_t tpz;
320  Float_t tpt;
321  Float_t trpt;
322  Float_t trdca2d;
323  Float_t trdca3dz;
324  Float_t tfpx;
325  Float_t tfpy;
326  Float_t tfpz;
327  Float_t tevent;
328  Float_t tgtrackid;
329  Float_t ttrackid;
330  Float_t tflavor;
331  Float_t tvx;
332  Float_t tvy;
333  Float_t tvz;
334  Float_t tgnhits;
335  Float_t tnhits;
336  Float_t tnfromtruth;
337  Float_t tchisq;
338  Float_t tquality;
339  Float_t tprimary;
340  Float_t tbestpurity;
341  Float_t tembed;
342  Float_t teta;
343 
344  TBranch* b_tpx;
345  TBranch* b_tpy;
346  TBranch* b_tpz;
347  TBranch* b_tpt;
348  TBranch* b_trdca2d;
349  TBranch* b_trdca3dz;
350  TBranch* b_trpt;
351  TBranch* b_tfpx;
352  TBranch* b_tfpy;
353  TBranch* b_tfpz;
354  TBranch* b_tevent;
355  TBranch* b_tgtrackid;
356  TBranch* b_ttrackid;
357  TBranch* b_tflavor;
358  TBranch* b_tvx;
359  TBranch* b_tvy;
360  TBranch* b_tvz;
361  TBranch* b_tgnhits;
362  TBranch* b_tnhits;
363  TBranch* b_tnfromtruth;
364  TBranch* b_tchisq;
365  TBranch* b_tquality;
366  TBranch* b_tprimary;
367  TBranch* b_tbestpurity;
368  TBranch* b_tembed;
369  TBranch* b_teta;
370 
371  //set branches
372  ntp_gtrack->SetBranchAddress("gpx", &tpx);
373  ntp_gtrack->SetBranchAddress("gpy", &tpy);
374  ntp_gtrack->SetBranchAddress("gpz", &tpz);
375  ntp_gtrack->SetBranchAddress("gpt", &tpt);
376  ntp_gtrack->SetBranchAddress("pt", &trpt);
377  ntp_gtrack->SetBranchAddress("dca2d", &trdca2d);
378  ntp_gtrack->SetBranchAddress("dca3dz", &trdca3dz);
379  ntp_gtrack->SetBranchAddress("gfpx", &tfpx);
380  ntp_gtrack->SetBranchAddress("gfpy", &tfpy);
381  ntp_gtrack->SetBranchAddress("gfpz", &tfpz);
382  ntp_gtrack->SetBranchAddress("event", &tevent);
383  ntp_gtrack->SetBranchAddress("gtrackID", &tgtrackid);
384  ntp_gtrack->SetBranchAddress("trackID", &ttrackid);
385  ntp_gtrack->SetBranchAddress("gflavor", &tflavor);
386  ntp_gtrack->SetBranchAddress("gvx", &tvx);
387  ntp_gtrack->SetBranchAddress("gvy", &tvy);
388  ntp_gtrack->SetBranchAddress("gvz", &tvz);
389  ntp_gtrack->SetBranchAddress("gnhits", &tgnhits);
390  ntp_gtrack->SetBranchAddress("nhits", &tnhits);
391  ntp_gtrack->SetBranchAddress("nfromtruth", &tnfromtruth);
392  ntp_gtrack->SetBranchAddress("chisq", &tchisq);
393  ntp_gtrack->SetBranchAddress("quality", &tquality);
394  ntp_gtrack->SetBranchAddress("gprimary", &tprimary);
395  ntp_gtrack->SetBranchAddress("gembed", &tembed);
396  ntp_gtrack->SetBranchAddress("geta", &teta);
397 
398  //get Branches
399  b_tpx = ntp_gtrack->GetBranch("gpx");
400  b_tpy = ntp_gtrack->GetBranch("gpy");
401  b_tpz = ntp_gtrack->GetBranch("gpz");
402  b_tpt = ntp_gtrack->GetBranch("gpt");
403  b_trpt = ntp_gtrack->GetBranch("pt");
404  b_trdca2d = ntp_gtrack->GetBranch("dca2d");
405  b_trdca3dz = ntp_gtrack->GetBranch("dca3dz");
406  b_tfpx = ntp_gtrack->GetBranch("gfpx");
407  b_tfpy = ntp_gtrack->GetBranch("gfpy");
408  b_tfpz = ntp_gtrack->GetBranch("gfpz");
409  b_tevent = ntp_gtrack->GetBranch("event");
410  b_tgtrackid = ntp_gtrack->GetBranch("gtrackID");
411  b_tflavor = ntp_gtrack->GetBranch("gflavor");
412  b_tvx = ntp_gtrack->GetBranch("gvx");
413  b_tvy = ntp_gtrack->GetBranch("gvy");
414  b_tvz = ntp_gtrack->GetBranch("gvz");
415  b_tnhits = ntp_gtrack->GetBranch("gnhits");
416  b_tnhits = ntp_gtrack->GetBranch("quality");
417  b_tprimary = ntp_gtrack->GetBranch("gprimary");
418  b_tembed = ntp_gtrack->GetBranch("gembed");
419  b_teta = ntp_gtrack->GetBranch("geta");
420 
421  // ntp_cluster access variables
422 
423 //cout << "set up ntp_cluster access" << endl;
424 
425  float_t cevent;
426  Float_t hitID;
427  Float_t x;
428  Float_t y;
429  Float_t z;
430  Float_t gx;
431  Float_t gy;
432  Float_t gz;
433  Float_t r;
434  Float_t gr;
435  Float_t ephi;
436  Float_t tphi;
437  Float_t trphi;
438  Float_t geta;
439  float_t layer;
440  float_t g4hitID;
441  Float_t gtrackID;
442  Float_t trackID;
443  Float_t gflavor;
444  Float_t gprimary;
445  Float_t efromtruth;
446  Float_t gpx;
447  Float_t gpy;
448  Float_t gpz;
449  Float_t gvt;
450  Float_t glast;
451  Float_t size;
452  Float_t zsize;
453  Float_t phisize;
454  Float_t nparticles;
455  Float_t cgembed;
456 
457  TBranch* b_cevent;
458  TBranch* b_hitID;
459  TBranch* b_x;
460  TBranch* b_y;
461  TBranch* b_z;
462  TBranch* b_gx;
463  TBranch* b_gy;
464  TBranch* b_gz;
465  TBranch* b_r;
466  TBranch* b_gr;
467  TBranch* b_ephi;
468  TBranch* b_tphi;
469  TBranch* b_trphi;
470  TBranch* b_geta;
471  TBranch* b_layer;
472  TBranch* b_g4hitID;
473  TBranch* b_gtrackID;
474  TBranch* b_trackID;
475  TBranch* b_cgflavor;
476  TBranch* b_cgprimary;
477  TBranch* b_cefromtruth;
478  TBranch* b_cgpx;
479  TBranch* b_cgpy;
480  TBranch* b_cgpz;
481  TBranch* b_cgvt;
482  TBranch* b_size;
483  TBranch* b_zsize;
484  TBranch* b_phisize;
485  TBranch* b_nparticles;
486  TBranch* b_cgembed;
487 
488  //set branches
489 
490  ntp_cluster->SetBranchAddress("event", &cevent);
491  ntp_cluster->SetBranchAddress("hitID", &hitID);
492  ntp_cluster->SetBranchAddress("x", &x);
493  ntp_cluster->SetBranchAddress("y", &y);
494  ntp_cluster->SetBranchAddress("z", &z);
495  ntp_cluster->SetBranchAddress("gx", &gx);
496  ntp_cluster->SetBranchAddress("gy", &gy);
497  ntp_cluster->SetBranchAddress("gz", &gz);
498  ntp_cluster->SetBranchAddress("r", &r);
499  ntp_cluster->SetBranchAddress("gr", &gr);
500  ntp_cluster->SetBranchAddress("ephi", &ephi);
501  ntp_cluster->SetBranchAddress("gphi", &tphi);
502  ntp_cluster->SetBranchAddress("phi", &trphi);
503  ntp_cluster->SetBranchAddress("geta", &geta);
504  ntp_cluster->SetBranchAddress("layer", &layer);
505  ntp_cluster->SetBranchAddress("g4hitID", &g4hitID);
506  ntp_cluster->SetBranchAddress("gtrackID", &gtrackID);
507  ntp_cluster->SetBranchAddress("trackID", &trackID);
508  ntp_cluster->SetBranchAddress("gflavor", &gflavor);
509  ntp_cluster->SetBranchAddress("gprimary", &gprimary);
510  ntp_cluster->SetBranchAddress("efromtruth", &efromtruth);
511  ntp_cluster->SetBranchAddress("gpx", &gpx);
512  ntp_cluster->SetBranchAddress("gpy", &gpy);
513  ntp_cluster->SetBranchAddress("gpz", &gpz);
514  ntp_cluster->SetBranchAddress("gvt", &gvt);
515  ntp_cluster->SetBranchAddress("size", &size);
516  ntp_cluster->SetBranchAddress("zsize", &zsize);
517  ntp_cluster->SetBranchAddress("phisize", &phisize);
518  ntp_cluster->SetBranchAddress("nparticles", &nparticles);
519  ntp_cluster->SetBranchAddress("gembed", &cgembed);
520 
521  //get Branches
522  b_cevent = ntp_cluster->GetBranch("event");
523  b_hitID = ntp_cluster->GetBranch("hitID");
524  b_x = ntp_cluster->GetBranch("x");
525  b_y = ntp_cluster->GetBranch("y");
526  b_z = ntp_cluster->GetBranch("z");
527  b_gx = ntp_cluster->GetBranch("gx");
528  b_gy = ntp_cluster->GetBranch("gy");
529  b_gz = ntp_cluster->GetBranch("gz");
530  b_r = ntp_cluster->GetBranch("r");
531  b_gr = ntp_cluster->GetBranch("gr");
532  b_trphi = ntp_cluster->GetBranch("phi");
533  b_ephi = ntp_cluster->GetBranch("ephi");
534  b_tphi = ntp_cluster->GetBranch("gphi");
535  b_geta = ntp_cluster->GetBranch("geta");
536  b_layer = ntp_cluster->GetBranch("layer");
537  b_g4hitID = ntp_cluster->GetBranch("g4hitID");
538  b_gtrackID = ntp_cluster->GetBranch("gtrackID");
539  b_cgflavor = ntp_cluster->GetBranch("gflavor");
540  b_cgprimary = ntp_cluster->GetBranch("gprimary");
541  b_cefromtruth = ntp_cluster->GetBranch("efromtruth");
542  b_cgpx = ntp_cluster->GetBranch("gpx");
543  b_cgpy = ntp_cluster->GetBranch("gpy");
544  b_cgpz = ntp_cluster->GetBranch("gpz");
545  b_cgvt = ntp_cluster->GetBranch("gvt");
546  b_size = ntp_cluster->GetBranch("size");
547  b_zsize = ntp_cluster->GetBranch("zsize");
548  b_phisize = ntp_cluster->GetBranch("phisize");
549  b_nparticles = ntp_cluster->GetBranch("nparticles");
550  b_cgembed = ntp_cluster->GetBranch("gembed");
551 
552 // g4hit access
553 
554  Float_t hgpx;
555  Float_t hgpy;
556  Float_t hgpz;
557  Float_t hgx;
558  Float_t hgy;
559  Float_t hgz;
560  float_t hlayer;
561  float_t hgembed;
562  float_t hgprimary;
563  float_t hgflavor;
564  float_t hefromtruth;
565 
566  TBranch* b_hgpx;
567  TBranch* b_hgpy;
568  TBranch* b_hgpz;
569  TBranch* b_hgx;
570  TBranch* b_hgy;
571  TBranch* b_hgz;
572  TBranch* b_hlayer;
573  TBranch* b_hgembed;
574  TBranch* b_hgprimary;
575  TBranch* b_hgflavor;
576  TBranch* b_hefromtruth;
577 
578  ntp_g4hit->SetBranchAddress("gpx", &hgpx);
579  ntp_g4hit->SetBranchAddress("gpy", &hgpy);
580  ntp_g4hit->SetBranchAddress("gpz", &hgpz);
581  ntp_g4hit->SetBranchAddress("gx", &hgx);
582  ntp_g4hit->SetBranchAddress("gy", &hgy);
583  ntp_g4hit->SetBranchAddress("gz", &hgz);
584  ntp_g4hit->SetBranchAddress("layer", &hlayer);
585  ntp_g4hit->SetBranchAddress("gembed", &hgembed);
586  ntp_g4hit->SetBranchAddress("gprimary", &hgprimary);
587  ntp_g4hit->SetBranchAddress("gflavor", &hgflavor);
588  ntp_g4hit->SetBranchAddress("efromtruth", &hefromtruth);
589 
590  b_hgpx = ntp_g4hit->GetBranch("gpx");
591  b_hgpy = ntp_g4hit->GetBranch("gpy");
592  b_hgpz = ntp_g4hit->GetBranch("gpz");
593  b_hgx = ntp_g4hit->GetBranch("gx");
594  b_hgy = ntp_g4hit->GetBranch("gy");
595  b_hgz = ntp_g4hit->GetBranch("gz");
596  b_hlayer = ntp_g4hit->GetBranch("glayer");
597  b_hgembed = ntp_g4hit->GetBranch("gembed");
598  b_hgprimary = ntp_g4hit->GetBranch("gprimary");
599  b_hgflavor = ntp_g4hit->GetBranch("gflavor");
600  b_hefromtruth = ntp_g4hit->GetBranch("efromtruth");