ATLAS Offline Software
Loading...
Searching...
No Matches
PixelNtupleTracks.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// This class has been automatically generated on
7// Sat Apr 12 18:26:46 2008 by ROOT version 5.18/00a
8// from TTree PixelNtupleTracks/Track Validation
9// found on file: castor:///castor/cern.ch/user/s/smontesa/FDR2/SErun3076_PixelCalibration.root
11
12#ifndef PixelNtupleTracks_h
13#define PixelNtupleTracks_h
14
15#include <vector>
16#include <string>
17#include <cmath>
18#include <fstream>
19#include <iostream>
20#include <TROOT.h>
21#include <TChain.h>
22
24
25 public :
26 TTree *fChain{};
27 Int_t fCurrent{};
28
29 // Declaration of leaf types
30 //Int_t RunNumber{};
31 //Int_t EventNumber{};
32 //Int_t TrackID{};
33 //Int_t IterationIndex{};
34 //Int_t nHits{};
35 //Int_t TrackStatesUnbiased{};
36 //Float_t RecD0{};
37 //Float_t RecZ0{};
38 //Float_t RecPhi0{};
39 Float_t RecTheta{};
40 //Float_t RecEta{};
41 Float_t RecQoverP{};
42 //Float_t RecErrD0{};
43 //Float_t RecErrZ0{};
44 //Float_t RecErrPhi0{};
45 //Float_t RecErrTheta{};
46 //Float_t RecErrQoverP{};
47 //Float_t Chi2overNdof{};
48 //Int_t Ndof{};
49 //Int_t nHoles{};
50 //std::vector<int> *HoleDetectorType{};
51 //std::vector<float> *pullLocX{};
52 //std::vector<float> *pullLocY{};
53 //std::vector<float> *residualLocX{};
54 //std::vector<float> *residualLocY{};
55 //std::vector<int> *DetectorType{};
56 //std::vector<int> *outlierFlag{};
57 //Int_t FitterStatusCode{};
58 Int_t nPixelHits{};
59 Int_t nSCTHits{};
60 Int_t nTRTHits{};
61 //Int_t nMDTHits{};
62 //Int_t nCSCHits{};
63 //Int_t nRPCHits{};
64 //Int_t nTGCHits{};
65 std::vector<float> *PixPullPhi{};
66 std::vector<float> *PixPullEta{};
67 std::vector<float> *PixResPhi{};
68 std::vector<float> *PixResEta{};
69 std::vector<int> *PixDetType{};
70 //std::vector<int> *PixHasGanged{};
71 //std::vector<int> *PixIsFake{};
72 //std::vector<int> *PixToT{};
73 std::vector<float> *PixCharge{};
74 std::vector<float> *PixTLorPhi{};
75 //std::vector<float> *PixTLorEta{};
76 std::vector<float> *PixBiasVolt{};
77 //std::vector<float> *PixDepVolt{};
78 std::vector<float> *PixDigResPhi{};
79 std::vector<float> *PixDigResEta{};
80 std::vector<float> *PixErrPhi{};
81 std::vector<float> *PixErrEta{};
82 //std::vector<float> *PixLocX{};
83 //std::vector<float> *PixLocY{};
84 std::vector<int> *PixEtaModule{};
85 std::vector<int> *PixPhiModule{};
86 //std::vector<float> *PixGloX{};
87 //std::vector<float> *PixGloY{};
88 //std::vector<float> *PixGloZ{};
89 //std::vector<float> *PixEta{};
90 //std::vector<float> *PixFirstRow{};
91 //std::vector<float> *PixFirstCol{};
92 std::vector<int> *PixDeltaRow{};
93 std::vector<int> *PixDeltaCol{};
94 //std::vector<float> *PixDeltaPhi{};
95 //std::vector<float> *PixDeltaEta{};
96 std::vector<float> *PixOmegaPhi{};
97 std::vector<float> *PixOmegaEta{};
98 std::vector<float> *PixTrkAngle{};
99 std::vector<float> *PixTrkEta{};
100 std::vector<float> *PixTrkPt{};
101 //std::vector<float> *PixTrkQ{};
102 //std::vector<float> *PixHoleGloX{};
103 //std::vector<float> *PixHoleGloY{};
104 //std::vector<float> *PixHoleGloZ{};
105 //std::vector<float> *PixHoleLocX{};
106 //std::vector<float> *PixHoleLocY{};
107 //std::vector<int> *PixHoleEtaModule{};
108 //std::vector<int> *PixHolePhiModule{};
109 //std::vector<float> *PixHoleLayer{};
110 //std::vector<float> *PixHoleECBarrel{};
111 //std::vector<int> *PixHoleClNearstSize{};
112 //std::vector<float> *PixHoleLocXClNearst{};
113 //std::vector<float> *PixHoleLocYClNearst{};
114 //std::vector<float> *PixHoleClRowClNearst{};
115 //std::vector<float> *PixHoleClColClNearst{};
116 //std::vector<float> *PixHoleGloZNearst{};
117 //std::vector<float> *PixHoleDeltaRowNearst{};
118 //std::vector<float> *PixHoleDeltaColNearst{};
119 //std::vector<float> *SCTPull{};
120 //std::vector<float> *SCTRes{};
121 //std::vector<int> *SctDetType{};
122 //std::vector<float> *SctTLorPhi{};
123 //std::vector<float> *SctTLorEta{};
124 //std::vector<float> *SctEta{};
125 //std::vector<float> *SctDeltaPhi{};
126 //std::vector<float> *SctTrkAngle{};
127 //std::vector<float> *SctTrkQ{};
128 //std::vector<float> *TRTPull{};
129 //std::vector<float> *TRTRes{};
130 //std::vector<float> *HitX{};
131 //std::vector<float> *HitY{};
132 //std::vector<float> *HitZ{};
133 //std::vector<float> *HitRadius{};
134 //std::vector<float> *HitPhi{};
135 //std::vector<float> *HitLocal1{};
136 //std::vector<float> *HitLocal2{};
137 //std::vector<float> *HitSurfaceX{};
138 //std::vector<float> *HitSurfaceY{};
139 //std::vector<float> *HitSurfaceZ{};
140 //std::vector<float> *HitSurfaceRadius{};
141 //std::vector<float> *HitSurfacePhi{};
142 //std::vector<float> *HitSurfaceTheta{};
143 //std::vector<float> *TrackX{};
144 //std::vector<float> *TrackY{};
145 //std::vector<float> *TrackZ{};
146 //std::vector<float> *TrackMomentumX{};
147 //std::vector<float> *TrackMomentumY{};
148 //std::vector<float> *TrackMomentumZ{};
149 //std::vector<float> *TrackLocal1{};
150 //std::vector<float> *TrackLocal2{};
151
152 // List of branches
153 //TBranch *b_run_number{}; //!
154 //TBranch *b_event_number{}; //!
155 //TBranch *b_ID_of_track_in_event{}; //!
156 //TBranch *b_Iteration_of_a_track{}; //!
157 //TBranch *b_Number_of_measurements_on_track{}; //!
158 //TBranch *b_are_track_states_unbiased{}; //!
159 //TBranch *b_Reconstructed_d0{}; //!
160 //TBranch *b_Reconstructed_z0{}; //!
161 //TBranch *b_Reconstructed_phi0{}; //!
163 //TBranch *b_Reconstructed_eta{}; //!
165 //TBranch *b_err_d0{}; //!
166 //TBranch *b_err_z0{}; //!
167 //TBranch *b_err_phi0{}; //!
168 //TBranch *b_err_theta{}; //!
169 //TBranch *b_err_Q_over_p{}; //!
170 //TBranch *b_Reco_Chi2_over_Ndof{}; //!
171 //TBranch *b_Reco_Ndof{}; //!
172 //TBranch *b_Number_of_holes_on_track{}; //!
173 //TBranch *b_HoleDetectorType{}; //!
174 //TBranch *b_pullLocX{}; //!
175 //TBranch *b_pullLocY{}; //!
176 //TBranch *b_residualLocX{}; //!
177 //TBranch *b_residualLocY{}; //!
178 //TBranch *b_DetectorType{}; //!
179 //TBranch *b_outlierFlag{}; //!
180 //TBranch *b_FitterStatusCode{}; //!
184 //TBranch *b_number_MDT_measurements{}; //!
185 //TBranch *b_number_CSC_measurements{}; //!
186 //TBranch *b_number_RPC_measurements{}; //!
187 //TBranch *b_number_TGC_measurements{}; //!
188 TBranch *b_PixPullPhi{};
189 TBranch *b_PixPullEta{};
190 TBranch *b_PixResPhi{};
191 TBranch *b_PixResEta{};
192 TBranch *b_PixDetType{};
193 //TBranch *b_PixHasGanged{}; //!
194 //TBranch *b_PixIsFake{}; //!
195 //TBranch *b_PixToT{}; //!
196 TBranch *b_PixCharge{};
197 TBranch *b_PixTLorPhi{};
198 //TBranch *b_PixTLorEta{}; //!
199 TBranch *b_PixBiasVolt{};
200 //TBranch *b_PixDepVolt{}; //!
201 TBranch *b_PixDigResPhi{};
202 TBranch *b_PixDigResEta{};
203 TBranch *b_PixErrPhi{};
204 TBranch *b_PixErrEta{};
205 //TBranch *b_PixLocX{}; //!
206 //TBranch *b_PixLocY{}; //!
207 TBranch *b_PixEtaModule{};
208 TBranch *b_PixPhiModule{};
209 //TBranch *b_PixGloX{}; //!
210 //TBranch *b_PixGloY{}; //!
211 //TBranch *b_PixGloZ{}; //!
212 //TBranch *b_PixEta{}; //!
213 //TBranch *b_PixFirstRow{}; //!
214 //TBranch *b_PixFirstCol{}; //!
215 TBranch *b_PixDeltaRow{};
216 TBranch *b_PixDeltaCol{};
217 //TBranch *b_PixDeltaPhi{}; //!
218 //TBranch *b_PixDeltaEta{}; //!
219 TBranch *b_PixOmegaPhi{};
220 TBranch *b_PixOmegaEta{};
221 TBranch *b_PixTrkAngle{};
222 TBranch *b_PixTrkEta{};
223 TBranch *b_PixTrkPt{};
224 //TBranch *b_PixTrkQ{}; //!
225 //TBranch *b_PixHoleGloX{}; //!
226 //TBranch *b_PixHoleGloY{}; //!
227 //TBranch *b_PixHoleGloZ{}; //!
228 //TBranch *b_PixHoleLocX{}; //!
229 //TBranch *b_PixHoleLocY{}; //!
230 //TBranch *b_PixHoleEtaModule{}; //!
231 //TBranch *b_PixHolePhiModule{}; //!
232 //TBranch *b_PixHoleLayer{}; //!
233 //TBranch *b_PixHoleECBarrel{}; //!
234 //TBranch *b_PixHoleClNearstSize{}; //!
235 //TBranch *b_PixHoleLocXClNearst{}; //!
236 //TBranch *b_PixHoleLocYClNearst{}; //!
237 //TBranch *b_PixHoleClRowClNearst{}; //!
238 //TBranch *b_PixHoleClColClNearst{}; //!
239 //TBranch *b_PixHoleGloZNearst{}; //!
240 //TBranch *b_PixHoleDeltaRowNearst{}; //!
241 //TBranch *b_PixHoleDeltaColNearst{}; //!
242 //TBranch *b_SCTPull{}; //!
243 //TBranch *b_SCTRes{}; //!
244 //TBranch *b_SctDetType{}; //!
245 //TBranch *b_SctTLorPhi{}; //!
246 //TBranch *b_SctTLorEta{}; //!
247 //TBranch *b_SctEta{}; //!
248 //TBranch *b_SctDeltaPhi{}; //!
249 //TBranch *b_SctTrkAngle{}; //!
250 //TBranch *b_SctTrkQ{}; //!
251 //TBranch *b_TRTPull{}; //!
252 //TBranch *b_TRTRes{}; //!
253 //TBranch *b_HitX{}; //!
254 //TBranch *b_HitY{}; //!
255 //TBranch *b_HitZ{}; //!
256 //TBranch *b_HitRadius{}; //!
257 //TBranch *b_HitPhi{}; //!
258 //TBranch *b_HitLocal1{}; //!
259 //TBranch *b_HitLocal2{}; //!
260 //TBranch *b_HitSurfaceX{}; //!
261 //TBranch *b_HitSurfaceY{}; //!
262 //TBranch *b_HitSurfaceZ{}; //!
263 //TBranch *b_HitSurfaceRadius{}; //!
264 //TBranch *b_HitSurfacePhi{}; //!
265 //TBranch *b_HitSurfaceTheta{}; //!
266 //TBranch *b_TrackX{}; //!
267 //TBranch *b_TrackY{}; //!
268 //TBranch *b_TrackZ{}; //!
269 //TBranch *b_TrackMomentumX{}; //!
270 //TBranch *b_TrackMomentumY{}; //!
271 //TBranch *b_TrackMomentumZ{}; //!
272 //TBranch *b_TrackLocal1{}; //!
273 //TBranch *b_TrackLocal2{}; //!
274
275 PixelNtupleTracks(std::string input,std::string collection);
277 virtual Int_t GetEntry(Long64_t entry);
278 virtual Long64_t LoadTree(Long64_t entry);
279 void Init(TTree *tree);
280 virtual void Loop();
281 Bool_t Notify();
282 virtual void Show(Long64_t entry = -1);
283
284 // inline Functions to access variables: Maybe should be moved to PixelNtupleTracks??
285 inline double GetGeVpT(int ihit){
286 return (*PixTrkPt)[ihit] / 1000.;
287 }
288
289 inline double GetGeVGlobalpT(){ return fabs(sin(RecTheta)/RecQoverP)/1000;}
290
291 inline double GetLorAlpha(int ihit){
292 return 180. * atan((*PixTLorPhi)[ihit]) / M_PI;
293 /*double LorAngle = 0;
294 if( GetDetType(ihit) < 3) LorAngle = -180. * 0.224/ M_PI;
295 return LorAngle;*/
296 }
297
298 inline double GetRealAlpha(int ihit){
299 //return GetAlphaMeas(ihit) - GetLorAlpha(ihit);
300 double tan_angle = tan((*PixTrkAngle)[ihit]);
301 double tan_angle_corr = tan_angle - (*PixTLorPhi)[ihit];
302 return 180. * atan(tan_angle_corr) / M_PI;
303 }
304
305 inline double GetAlphaMeas(int ihit){
306 return 180. * (*PixTrkAngle)[ihit] / M_PI;
307 }
308
309 inline double GetTilt(){
310 return 180.*20.0 / M_PI;
311 }
312
313 inline int GetDetType(int ihit){
314 if( abs( (*PixDetType)[ihit]) < 100) return (*PixDetType)[ihit];
315 else return abs( (*PixDetType)[ihit] ) - 96;
316 }
317
318 inline double GetTrkEta(int ihit){ return (*PixTrkEta)[ihit]; }
319 inline double GetMicronDigResEta(int ihit){ return (*PixDigResEta)[ihit]*1000; }
320 inline double GetMicronDigResPhi(int ihit){ return (*PixDigResPhi)[ihit]*1000; }
321 inline double GetMicronResEta(int ihit){ return (*PixResEta)[ihit]*1000; }
322 inline double GetMicronResPhi(int ihit){ return (*PixResPhi)[ihit]*1000; }
323 inline double GetMicronErrEta(int ihit){ return (*PixErrEta)[ihit]*1000; }
324 inline double GetMicronErrPhi(int ihit){ return (*PixErrPhi)[ihit]*1000; }
325 inline double GetDeltaRow(int ihit){ return (*PixDeltaRow)[ihit]; }
326 inline double GetDeltaCol(int ihit){ return (*PixDeltaCol)[ihit]; }
327 inline double GetOmegaEta(int ihit){ return (*PixOmegaEta)[ihit]; }
328 inline double GetOmegaPhi(int ihit){ return (*PixOmegaPhi)[ihit]; }
329 inline double GetBiasVolt(int ihit){ return (*PixBiasVolt)[ihit]; }
330 inline int GetEtaModule(int ihit){ return (*PixEtaModule)[ihit]; }
331 inline int GetPhiModule(int ihit){ return (*PixPhiModule)[ihit]; }
332 inline Double_t GetPullPhi(int ihit){ return (*PixPullPhi)[ihit]; }
333 inline Double_t GetPullEta(int ihit){ return (*PixPullEta)[ihit]; }
334 inline float GetCharge(int ihit){ return (*PixCharge)[ihit]; }
335};
336
337#endif
338
339#ifdef PixelNtupleTracks_cxx
340PixelNtupleTracks::PixelNtupleTracks(std::string input,std::string collection){
341 TChain *mychain = 0;
342 if(input != "" ){
343 mychain = new TChain(collection.c_str());
344 if( input.find(".root") != std::string::npos ){
345 if(mychain->AddFile(input.c_str()) == 0){
346 std::cout << "Failing to add " << input <<
347 " to the chain..." << std::endl;
348 abort();
349 }
350 }else{
351 std::ifstream myfile(input.c_str());
352 if (myfile.is_open()){
353 for(;;){
354 getline(myfile,input);
355 if(myfile.eof()) break;
356 mychain->AddFile(input.c_str());
357 }
358 myfile.close();
359 }else{
360 std::cout << "Failing to open " << input << "..." << std::endl;
361 abort();
362 }
363 }
364 }
365
366 Init(mychain);
367}
368
370}
371
372
373Int_t PixelNtupleTracks::GetEntry(Long64_t entry)
374{
375// Read contents of entry.
376 if (!fChain) return 0;
377 return fChain->GetEntry(entry);
378}
379
380Long64_t PixelNtupleTracks::LoadTree(Long64_t entry)
381{
382// Set the environment to read one entry
383 if (!fChain) return -5;
384 Long64_t centry = fChain->LoadTree(entry);
385 if (centry < 0) return centry;
386 if (!fChain->InheritsFrom(TChain::Class())) return centry;
387 TChain *chain = (TChain*)fChain;
388 if (chain->GetTreeNumber() != fCurrent) {
389 fCurrent = chain->GetTreeNumber();
390 Notify();
391 }
392 return centry;
393}
394
395void PixelNtupleTracks::Init(TTree *tree)
396{
397 // The Init() function is called when the selector needs to initialize
398 // a new tree or chain. Typically here the branch addresses and branch
399 // pointers of the tree will be set.
400 // It is normally not necessary to make changes to the generated
401 // code, but the routine can be extended by the user if needed.
402 // Init() will be called many times when running on PROOF
403 // (once per file to be processed).
404
405 // Set object pointer
406 //HoleDetectorType = 0;
407 //pullLocX = 0;
408 //pullLocY = 0;
409 //residualLocX = 0;
410 //residualLocY = 0;
411 //DetectorType = 0;
412 //outlierFlag = 0;
413 PixPullPhi = 0;
414 PixPullEta = 0;
415 PixResPhi = 0;
416 PixResEta = 0;
417 PixDetType = 0;
418 //PixHasGanged = 0;
419 //PixIsFake = 0;
420 //PixToT = 0;
421 PixCharge = 0;
422 PixTLorPhi = 0;
423 //PixTLorEta = 0;
424 PixBiasVolt = 0;
425 //PixDepVolt = 0;
426 PixDigResPhi = 0;
427 PixDigResEta = 0;
428 PixErrPhi = 0;
429 PixErrEta = 0;
430 //PixLocX = 0;
431 //PixLocY = 0;
432 PixEtaModule = 0;
433 PixPhiModule = 0;
434 //PixGloX = 0;
435 //PixGloY = 0;
436 //PixGloZ = 0;
437 //PixEta = 0;
438 //PixFirstRow = 0;
439 //PixFirstCol = 0;
440 PixDeltaRow = 0;
441 PixDeltaCol = 0;
442 //PixDeltaPhi = 0;
443 //PixDeltaEta = 0;
444 PixOmegaPhi = 0;
445 PixOmegaEta = 0;
446 PixTrkAngle = 0;
447 PixTrkEta = 0;
448 PixTrkPt = 0;
449 //PixTrkQ = 0;
450 //PixHoleGloX = 0;
451 //PixHoleGloY = 0;
452 //PixHoleGloZ = 0;
453 //PixHoleLocX = 0;
454 //PixHoleLocY = 0;
455 //PixHoleEtaModule = 0;
456 //PixHolePhiModule = 0;
457 //PixHoleLayer = 0;
458 //PixHoleECBarrel = 0;
459 //PixHoleClNearstSize = 0;
460 //PixHoleLocXClNearst = 0;
461 //PixHoleLocYClNearst = 0;
462 //PixHoleClRowClNearst = 0;
463 //PixHoleClColClNearst = 0;
464 //PixHoleGloZNearst = 0;
465 //PixHoleDeltaRowNearst = 0;
466 //PixHoleDeltaColNearst = 0;
467 //SCTPull = 0;
468 //SCTRes = 0;
469 //SctDetType = 0;
470 //SctTLorPhi = 0;
471 //SctTLorEta = 0;
472 //SctEta = 0;
473 //SctDeltaPhi = 0;
474 //SctTrkAngle = 0;
475 //SctTrkQ = 0;
476 //TRTPull = 0;
477 //TRTRes = 0;
478 //HitX = 0;
479 //HitY = 0;
480 //HitZ = 0;
481 //HitRadius = 0;
482 //HitPhi = 0;
483 //HitLocal1 = 0;
484 //HitLocal2 = 0;
485 //HitSurfaceX = 0;
486 //HitSurfaceY = 0;
487 //HitSurfaceZ = 0;
488 //HitSurfaceRadius = 0;
489 //HitSurfacePhi = 0;
490 //HitSurfaceTheta = 0;
491 //TrackX = 0;
492 //TrackY = 0;
493 //TrackZ = 0;
494 //TrackMomentumX = 0;
495 //TrackMomentumY = 0;
496 //TrackMomentumZ = 0;
497 //TrackLocal1 = 0;
498 //TrackLocal2 = 0;
499
500 fChain = nullptr;
501 b_Reconstructed_theta = nullptr;
502 b_Reconstructed_Q_over_p = nullptr;
506 b_PixPullPhi = nullptr;
507 b_PixPullEta = nullptr;
508 b_PixResPhi = nullptr;
509 b_PixResEta = nullptr;
510 b_PixDetType = nullptr;
511 b_PixCharge = nullptr;
512 b_PixTLorPhi = nullptr;
513 b_PixBiasVolt = nullptr;
514 b_PixDigResPhi = nullptr;
515 b_PixDigResEta = nullptr;
516 b_PixErrPhi = nullptr;
517 b_PixErrEta = nullptr;
518 b_PixEtaModule = nullptr;
519 b_PixPhiModule = nullptr;
520 b_PixDeltaRow = nullptr;
521 b_PixDeltaCol = nullptr;
522 b_PixOmegaPhi = nullptr;
523 b_PixOmegaEta = nullptr;
524 b_PixTrkAngle = nullptr;
525 b_PixTrkEta = nullptr;
526 b_PixTrkPt = nullptr;
527
528 // Set branch addresses and branch pointers
529 if (!tree) return;
530 fChain = tree;
531 fCurrent = -1;
532 fChain->SetMakeClass(1);
533
534// fChain->SetBranchAddress("RunNumber", &RunNumber, &b_run_number);
535// fChain->SetBranchAddress("EventNumber", &EventNumber, &b_event_number);
536// fChain->SetBranchAddress("TrackID", &TrackID, &b_ID_of_track_in_event);
537// fChain->SetBranchAddress("IterationIndex", &IterationIndex, &b_Iteration_of_a_track);
538// fChain->SetBranchAddress("nHits", &nHits, &b_Number_of_measurements_on_track);
539// fChain->SetBranchAddress("TrackStatesUnbiased", &TrackStatesUnbiased, &b_are_track_states_unbiased);
540// fChain->SetBranchAddress("RecD0", &RecD0, &b_Reconstructed_d0);
541// fChain->SetBranchAddress("RecZ0", &RecZ0, &b_Reconstructed_z0);
542// fChain->SetBranchAddress("RecPhi0", &RecPhi0, &b_Reconstructed_phi0);
543 fChain->SetBranchAddress("RecTheta", &RecTheta, &b_Reconstructed_theta);
544// fChain->SetBranchAddress("RecEta", &RecEta, &b_Reconstructed_eta);
545 fChain->SetBranchAddress("RecQoverP", &RecQoverP, &b_Reconstructed_Q_over_p);
546// fChain->SetBranchAddress("RecErrD0", &RecErrD0, &b_err_d0);
547// fChain->SetBranchAddress("RecErrZ0", &RecErrZ0, &b_err_z0);
548// fChain->SetBranchAddress("RecErrPhi0", &RecErrPhi0, &b_err_phi0);
549// fChain->SetBranchAddress("RecErrTheta", &RecErrTheta, &b_err_theta);
550// fChain->SetBranchAddress("RecErrQoverP", &RecErrQoverP, &b_err_Q_over_p);
551// fChain->SetBranchAddress("Chi2overNdof", &Chi2overNdof, &b_Reco_Chi2_over_Ndof);
552// fChain->SetBranchAddress("Ndof", &Ndof, &b_Reco_Ndof);
553// fChain->SetBranchAddress("nHoles", &nHoles, &b_Number_of_holes_on_track);
554// fChain->SetBranchAddress("HoleDetectorType", &HoleDetectorType, &b_HoleDetectorType);
555// fChain->SetBranchAddress("pullLocX", &pullLocX, &b_pullLocX);
556// fChain->SetBranchAddress("pullLocY", &pullLocY, &b_pullLocY);
557// fChain->SetBranchAddress("residualLocX", &residualLocX, &b_residualLocX);
558// fChain->SetBranchAddress("residualLocY", &residualLocY, &b_residualLocY);
559// fChain->SetBranchAddress("DetectorType", &DetectorType, &b_DetectorType);
560// fChain->SetBranchAddress("outlierFlag", &outlierFlag, &b_outlierFlag);
561// fChain->SetBranchAddress("FitterStatusCode", &FitterStatusCode, &b_FitterStatusCode);
562 fChain->SetBranchAddress("nPixelHits", &nPixelHits, &b_number_Pixel_measurements);
563 fChain->SetBranchAddress("nSCTHits", &nSCTHits, &b_number_SCT_measurements);
564 fChain->SetBranchAddress("nTRTHits", &nTRTHits, &b_number_TRT_measurements);
565// fChain->SetBranchAddress("nMDTHits", &nMDTHits, &b_number_MDT_measurements);
566// fChain->SetBranchAddress("nCSCHits", &nCSCHits, &b_number_CSC_measurements);
567// fChain->SetBranchAddress("nRPCHits", &nRPCHits, &b_number_RPC_measurements);
568// fChain->SetBranchAddress("nTGCHits", &nTGCHits, &b_number_TGC_measurements);
569 fChain->SetBranchAddress("PixPullPhi", &PixPullPhi, &b_PixPullPhi);
570 fChain->SetBranchAddress("PixPullEta", &PixPullEta, &b_PixPullEta);
571 fChain->SetBranchAddress("PixResPhi", &PixResPhi, &b_PixResPhi);
572 fChain->SetBranchAddress("PixResEta", &PixResEta, &b_PixResEta);
573 fChain->SetBranchAddress("PixDetType", &PixDetType, &b_PixDetType);
574// fChain->SetBranchAddress("PixHasGanged", &PixHasGanged, &b_PixHasGanged);
575// fChain->SetBranchAddress("PixIsFake", &PixIsFake, &b_PixIsFake);
576// fChain->SetBranchAddress("PixToT", &PixToT, &b_PixToT);
577 fChain->SetBranchAddress("PixCharge", &PixCharge, &b_PixCharge);
578 fChain->SetBranchAddress("PixTLorPhi", &PixTLorPhi, &b_PixTLorPhi);
579// fChain->SetBranchAddress("PixTLorEta", &PixTLorEta, &b_PixTLorEta);
580 fChain->SetBranchAddress("PixBiasVolt", &PixBiasVolt, &b_PixBiasVolt);
581// fChain->SetBranchAddress("PixDepVolt", &PixDepVolt, &b_PixDepVolt);
582 fChain->SetBranchAddress("PixDigResPhi", &PixDigResPhi, &b_PixDigResPhi);
583 fChain->SetBranchAddress("PixDigResEta", &PixDigResEta, &b_PixDigResEta);
584 fChain->SetBranchAddress("PixErrPhi", &PixErrPhi, &b_PixErrPhi);
585 fChain->SetBranchAddress("PixErrEta", &PixErrEta, &b_PixErrEta);
586// fChain->SetBranchAddress("PixLocX", &PixLocX, &b_PixLocX);
587// fChain->SetBranchAddress("PixLocY", &PixLocY, &b_PixLocY);
588 fChain->SetBranchAddress("PixEtaModule", &PixEtaModule, &b_PixEtaModule);
589 fChain->SetBranchAddress("PixPhiModule", &PixPhiModule, &b_PixPhiModule);
590// fChain->SetBranchAddress("PixGloX", &PixGloX, &b_PixGloX);
591// fChain->SetBranchAddress("PixGloY", &PixGloY, &b_PixGloY);
592// fChain->SetBranchAddress("PixGloZ", &PixGloZ, &b_PixGloZ);
593// fChain->SetBranchAddress("PixEta", &PixEta, &b_PixEta);
594// fChain->SetBranchAddress("PixFirstRow", &PixFirstRow, &b_PixFirstRow);
595// fChain->SetBranchAddress("PixFirstCol", &PixFirstCol, &b_PixFirstCol);
596 fChain->SetBranchAddress("PixDeltaRow", &PixDeltaRow, &b_PixDeltaRow);
597 fChain->SetBranchAddress("PixDeltaCol", &PixDeltaCol, &b_PixDeltaCol);
598// fChain->SetBranchAddress("PixDeltaPhi", &PixDeltaPhi, &b_PixDeltaPhi);
599// fChain->SetBranchAddress("PixDeltaEta", &PixDeltaEta, &b_PixDeltaEta);
600 fChain->SetBranchAddress("PixOmegaPhi", &PixOmegaPhi, &b_PixOmegaPhi);
601 fChain->SetBranchAddress("PixOmegaEta", &PixOmegaEta, &b_PixOmegaEta);
602 fChain->SetBranchAddress("PixTrkAngle", &PixTrkAngle, &b_PixTrkAngle);
603 fChain->SetBranchAddress("PixTrkEta", &PixTrkEta, &b_PixTrkEta);
604 fChain->SetBranchAddress("PixTrkPt", &PixTrkPt, &b_PixTrkPt);
605// fChain->SetBranchAddress("PixTrkQ", &PixTrkQ, &b_PixTrkQ);
606// fChain->SetBranchAddress("PixHoleGloX", &PixHoleGloX, &b_PixHoleGloX);
607// fChain->SetBranchAddress("PixHoleGloY", &PixHoleGloY, &b_PixHoleGloY);
608// fChain->SetBranchAddress("PixHoleGloZ", &PixHoleGloZ, &b_PixHoleGloZ);
609// fChain->SetBranchAddress("PixHoleLocX", &PixHoleLocX, &b_PixHoleLocX);
610// fChain->SetBranchAddress("PixHoleLocY", &PixHoleLocY, &b_PixHoleLocY);
611// fChain->SetBranchAddress("PixHoleEtaModule", &PixHoleEtaModule, &b_PixHoleEtaModule);
612// fChain->SetBranchAddress("PixHolePhiModule", &PixHolePhiModule, &b_PixHolePhiModule);
613// fChain->SetBranchAddress("PixHoleLayer", &PixHoleLayer, &b_PixHoleLayer);
614// fChain->SetBranchAddress("PixHoleECBarrel", &PixHoleECBarrel, &b_PixHoleECBarrel);
615// fChain->SetBranchAddress("PixHoleClNearstSize", &PixHoleClNearstSize, &b_PixHoleClNearstSize);
616// fChain->SetBranchAddress("PixHoleLocXClNearst", &PixHoleLocXClNearst, &b_PixHoleLocXClNearst);
617// fChain->SetBranchAddress("PixHoleLocYClNearst", &PixHoleLocYClNearst, &b_PixHoleLocYClNearst);
618// fChain->SetBranchAddress("PixHoleClRowClNearst", &PixHoleClRowClNearst, &b_PixHoleClRowClNearst);
619// fChain->SetBranchAddress("PixHoleClColClNearst", &PixHoleClColClNearst, &b_PixHoleClColClNearst);
620// fChain->SetBranchAddress("PixHoleGloZNearst", &PixHoleGloZNearst, &b_PixHoleGloZNearst);
621// fChain->SetBranchAddress("PixHoleDeltaRowNearst", &PixHoleDeltaRowNearst, &b_PixHoleDeltaRowNearst);
622// fChain->SetBranchAddress("PixHoleDeltaColNearst", &PixHoleDeltaColNearst, &b_PixHoleDeltaColNearst);
623// fChain->SetBranchAddress("SCTPull", &SCTPull, &b_SCTPull);
624// fChain->SetBranchAddress("SCTRes", &SCTRes, &b_SCTRes);
625// fChain->SetBranchAddress("SctDetType", &SctDetType, &b_SctDetType);
626// fChain->SetBranchAddress("SctTLorPhi", &SctTLorPhi, &b_SctTLorPhi);
627// fChain->SetBranchAddress("SctTLorEta", &SctTLorEta, &b_SctTLorEta);
628// fChain->SetBranchAddress("SctEta", &SctEta, &b_SctEta);
629// fChain->SetBranchAddress("SctDeltaPhi", &SctDeltaPhi, &b_SctDeltaPhi);
630// fChain->SetBranchAddress("SctTrkAngle", &SctTrkAngle, &b_SctTrkAngle);
631// fChain->SetBranchAddress("SctTrkQ", &SctTrkQ, &b_SctTrkQ);
632// fChain->SetBranchAddress("TRTPull", &TRTPull, &b_TRTPull);
633// fChain->SetBranchAddress("TRTRes", &TRTRes, &b_TRTRes);
634// fChain->SetBranchAddress("HitX", &HitX, &b_HitX);
635// fChain->SetBranchAddress("HitY", &HitY, &b_HitY);
636// fChain->SetBranchAddress("HitZ", &HitZ, &b_HitZ);
637// fChain->SetBranchAddress("HitRadius", &HitRadius, &b_HitRadius);
638// fChain->SetBranchAddress("HitPhi", &HitPhi, &b_HitPhi);
639// fChain->SetBranchAddress("HitLocal1", &HitLocal1, &b_HitLocal1);
640// fChain->SetBranchAddress("HitLocal2", &HitLocal2, &b_HitLocal2);
641// fChain->SetBranchAddress("HitSurfaceX", &HitSurfaceX, &b_HitSurfaceX);
642// fChain->SetBranchAddress("HitSurfaceY", &HitSurfaceY, &b_HitSurfaceY);
643// fChain->SetBranchAddress("HitSurfaceZ", &HitSurfaceZ, &b_HitSurfaceZ);
644// fChain->SetBranchAddress("HitSurfaceRadius", &HitSurfaceRadius, &b_HitSurfaceRadius);
645// fChain->SetBranchAddress("HitSurfacePhi", &HitSurfacePhi, &b_HitSurfacePhi);
646// fChain->SetBranchAddress("HitSurfaceTheta", &HitSurfaceTheta, &b_HitSurfaceTheta);
647// fChain->SetBranchAddress("TrackX", &TrackX, &b_TrackX);
648// fChain->SetBranchAddress("TrackY", &TrackY, &b_TrackY);
649// fChain->SetBranchAddress("TrackZ", &TrackZ, &b_TrackZ);
650// fChain->SetBranchAddress("TrackMomentumX", &TrackMomentumX, &b_TrackMomentumX);
651// fChain->SetBranchAddress("TrackMomentumY", &TrackMomentumY, &b_TrackMomentumY);
652// fChain->SetBranchAddress("TrackMomentumZ", &TrackMomentumZ, &b_TrackMomentumZ);
653// fChain->SetBranchAddress("TrackLocal1", &TrackLocal1, &b_TrackLocal1);
654// fChain->SetBranchAddress("TrackLocal2", &TrackLocal2, &b_TrackLocal2);
655 Notify();
656}
657
659{
660 // The Notify() function is called when a new file is opened. This
661 // can be either for a new TTree in a TChain or when when a new TTree
662 // is started when using PROOF. It is normally not necessary to make changes
663 // to the generated code, but the routine can be extended by the
664 // user if needed. The return value is currently not used.
665
666 return kTRUE;
667}
668
669void PixelNtupleTracks::Show(Long64_t entry)
670{
671// Print contents of entry.
672// If entry is not specified, print current entry
673 if (!fChain) return;
674 fChain->Show(entry);
675}
676
678{
679// In a ROOT session, you can do:
680// Root > .L PixelNtupleTracks.C
681// Root > PixelNtupleTracks t
682// Root > t.GetEntry(12); // Fill t data members with entry number 12
683// Root > t.Show(); // Show values of entry 12
684// Root > t.Show(16); // Read and show values of entry 16
685// Root > t.Loop(); // Loop on all entries
686//
687
688// This is the loop skeleton where:
689// jentry is the global entry number in the chain
690// ientry is the entry number in the current Tree
691// Note that the argument to GetEntry must be:
692// jentry for TChain::GetEntry
693// ientry for TTree::GetEntry and TBranch::GetEntry
694//
695// To read only selected branches, Insert statements like:
696// METHOD1:
697// fChain->SetBranchStatus("*",0); // disable all branches
698// fChain->SetBranchStatus("branchname",1); // activate branchname
699// METHOD2: replace line
700// fChain->GetEntry(jentry); //read all branches
701//by b_branchname->GetEntry(ientry); //read only this branch
702 if (fChain == 0) return;
703
704 Long64_t nentries = fChain->GetEntriesFast();
705
706 for (Long64_t jentry=0; jentry<nentries;jentry++) {
707 Long64_t ientry = LoadTree(jentry);
708 if (ientry < 0) break;
709 fChain->GetEntry(jentry);
710 // if (Cut(ientry) < 0) continue;
711 }
712}
713
714
715#endif // #ifdef PixelNtupleTracks_cxx
#define M_PI
double GetMicronErrPhi(int ihit)
std::vector< int > * PixDeltaCol
double GetOmegaEta(int ihit)
std::vector< float > * PixCharge
Int_t fCurrent
pointer to the analyzed TTree or TChain
std::vector< float > * PixPullPhi
std::vector< int > * PixPhiModule
double GetMicronErrEta(int ihit)
TBranch * b_number_Pixel_measurements
std::vector< float > * PixOmegaEta
double GetMicronDigResPhi(int ihit)
std::vector< float > * PixTrkPt
double GetMicronResEta(int ihit)
std::vector< float > * PixPullEta
std::vector< float > * PixTLorPhi
std::vector< int > * PixDeltaRow
double GetOmegaPhi(int ihit)
std::vector< float > * PixBiasVolt
Float_t RecTheta
current Tree number in a TChain
int GetDetType(int ihit)
Double_t GetPullPhi(int ihit)
float GetCharge(int ihit)
virtual void Show(Long64_t entry=-1)
double GetTrkEta(int ihit)
std::vector< float > * PixResEta
double GetLorAlpha(int ihit)
int GetPhiModule(int ihit)
std::vector< float > * PixTrkEta
virtual Long64_t LoadTree(Long64_t entry)
double GetGeVpT(int ihit)
TBranch * b_Reconstructed_theta
std::vector< float > * PixErrPhi
double GetAlphaMeas(int ihit)
double GetMicronDigResEta(int ihit)
int GetEtaModule(int ihit)
PixelNtupleTracks(std::string input, std::string collection)
TBranch * b_number_SCT_measurements
double GetDeltaRow(int ihit)
Double_t GetPullEta(int ihit)
std::vector< float > * PixErrEta
std::vector< float > * PixDigResPhi
TBranch * b_Reconstructed_Q_over_p
TBranch * b_number_TRT_measurements
double GetRealAlpha(int ihit)
std::vector< int > * PixEtaModule
virtual ~PixelNtupleTracks()
double GetBiasVolt(int ihit)
double GetMicronResPhi(int ihit)
void Init(TTree *tree)
std::vector< int > * PixDetType
virtual void Loop()
std::vector< float > * PixTrkAngle
std::vector< float > * PixResPhi
std::vector< float > * PixOmegaPhi
double GetDeltaCol(int ihit)
virtual Int_t GetEntry(Long64_t entry)
std::vector< float > * PixDigResEta
TChain * tree