ATLAS Offline Software
TrkValidationNtupleRIOs.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // This class has been automatically generated on
7 // Sat Mar 29 16:22:45 2008 by ROOT version 5.18/00
8 // from TTree TRT_RIOs/TRT_DriftCircles
9 // found on file: TrkValidation2.root
11 
12 #ifndef TrkValidationNtupleRIOs_h
13 #define TrkValidationNtupleRIOs_h
14 
15 #include <TROOT.h>
16 #include <TChain.h>
17 #include <TFile.h>
18 #include <vector>
19 using namespace std;
20 
21 #ifdef __CINT__
22 #pragma link C++ class vector< int >;
23 #pragma link C++ class vector< float >;
24 #endif
25 
27 public :
28  TTree *fChain;
29  Int_t fCurrent;
30 
31  // Declaration of leaf types
33  Int_t TRT_nRIOs;
34  vector<float> *TRT_DriftRadius;
35  vector<float> *TRT_SurfaceX;
36  vector<float> *TRT_SurfaceY;
37  vector<float> *TRT_SurfaceZ;
38 
39  // List of branches
40  TBranch *b_TRT_event_number;
41  TBranch *b_Number_of_RIOs;
42  TBranch *b_TRT_DriftRadius;
43  TBranch *b_TRT_SurfaceX;
44  TBranch *b_TRT_SurfaceY;
45  TBranch *b_TRT_SurfaceZ;
46 
49  virtual Int_t Cut(Long64_t entry);
50  virtual Int_t GetEntry(Long64_t entry);
51  virtual Long64_t LoadTree(Long64_t entry);
52  virtual void Init(TTree *tree);
53  virtual void Loop();
54  virtual Bool_t Notify();
55  virtual void Show(Long64_t entry = -1);
56 };
57 
58 #endif
59 
60 #ifdef TrkValidationNtupleRIOs_cxx
62 {
63 // if parameter tree is not specified (or zero), connect the file
64 // used to generate this class and read the Tree.
65  if (tree == 0) {
66  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("TrkValidation2.root");
67  if (!f) {
68  f = new TFile("TrkValidation2.root");
69  f->cd("TrkValidation2.root:/Validation");
70  }
71  tree = (TTree*)gDirectory->Get("TRT_RIOs");
72 
73  }
75 }
76 
78 {
79  if (!fChain) return;
80  delete fChain->GetCurrentFile();
81 }
82 
84 {
85 // Read contents of entry.
86  if (!fChain) return 0;
87  return fChain->GetEntry(entry);
88 }
90 {
91 // Set the environment to read one entry
92  if (!fChain) return -5;
93  Long64_t centry = fChain->LoadTree(entry);
94  if (centry < 0) return centry;
95  if (!fChain->InheritsFrom(TChain::Class())) return centry;
96  TChain *chain = (TChain*)fChain;
97  if (chain->GetTreeNumber() != fCurrent) {
98  fCurrent = chain->GetTreeNumber();
99  Notify();
100  }
101  return centry;
102 }
103 
105 {
106  // The Init() function is called when the selector needs to initialize
107  // a new tree or chain. Typically here the branch addresses and branch
108  // pointers of the tree will be set.
109  // It is normally not necessary to make changes to the generated
110  // code, but the routine can be extended by the user if needed.
111  // Init() will be called many times when running on PROOF
112  // (once per file to be processed).
113 
114  // Set object pointer
115  TRT_DriftRadius = 0;
116  TRT_SurfaceX = 0;
117  TRT_SurfaceY = 0;
118  TRT_SurfaceZ = 0;
119  // Set branch addresses and branch pointers
120  if (!tree) return;
121  fChain = tree;
122  fCurrent = -1;
123  fChain->SetMakeClass(1);
124 
125  fChain->SetBranchAddress("EventNumber", &TRT_EventNumber, &b_TRT_event_number);
126  fChain->SetBranchAddress("TRT_nRIOs", &TRT_nRIOs, &b_Number_of_RIOs);
127  fChain->SetBranchAddress("TRT_DriftRadius", &TRT_DriftRadius, &b_TRT_DriftRadius);
128  fChain->SetBranchAddress("TRT_SurfaceX", &TRT_SurfaceX, &b_TRT_SurfaceX);
129  fChain->SetBranchAddress("TRT_SurfaceY", &TRT_SurfaceY, &b_TRT_SurfaceY);
130  fChain->SetBranchAddress("TRT_SurfaceZ", &TRT_SurfaceZ, &b_TRT_SurfaceZ);
131  Notify();
132 }
133 
135 {
136  // The Notify() function is called when a new file is opened. This
137  // can be either for a new TTree in a TChain or when when a new TTree
138  // is started when using PROOF. It is normally not necessary to make changes
139  // to the generated code, but the routine can be extended by the
140  // user if needed. The return value is currently not used.
141 
142  return kTRUE;
143 }
144 
146 {
147 // Print contents of entry.
148 // If entry is not specified, print current entry
149  if (!fChain) return;
150  fChain->Show(entry);
151 }
152 Int_t TrkValidationNtupleRIOs::Cut(Long64_t entry)
153 {
154 // This function may be called from Loop.
155 // returns 1 if entry is accepted.
156 // returns -1 otherwise.
157  return 1;
158 }
159 #endif // #ifdef TrkValidationNtupleRIOs_cxx
TrkValidationNtupleRIOs::Init
virtual void Init(TTree *tree)
TrkValidationNtupleRIOs::TRT_SurfaceX
vector< float > * TRT_SurfaceX
Definition: TrkValidationNtupleRIOs.h:35
TrkValidationNtupleRIOs::b_TRT_SurfaceX
TBranch * b_TRT_SurfaceX
Definition: TrkValidationNtupleRIOs.h:43
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrkValidationNtupleRIOs::Cut
virtual Int_t Cut(Long64_t entry)
TrkValidationNtupleRIOs::LoadTree
virtual Long64_t LoadTree(Long64_t entry)
TrkValidationNtupleRIOs::b_TRT_SurfaceY
TBranch * b_TRT_SurfaceY
Definition: TrkValidationNtupleRIOs.h:44
TrkValidationNtupleRIOs::b_Number_of_RIOs
TBranch * b_Number_of_RIOs
Definition: TrkValidationNtupleRIOs.h:41
tree
TChain * tree
Definition: tile_monitor.h:30
TrkValidationNtupleRIOs
Definition: TrkValidationNtupleRIOs.h:26
TrkValidationNtupleRIOs::TRT_DriftRadius
vector< float > * TRT_DriftRadius
Definition: TrkValidationNtupleRIOs.h:34
TrkValidationNtupleRIOs::fCurrent
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: TrkValidationNtupleRIOs.h:29
TrkValidationNtupleRIOs::~TrkValidationNtupleRIOs
virtual ~TrkValidationNtupleRIOs()
TrkValidationNtupleRIOs::TRT_SurfaceY
vector< float > * TRT_SurfaceY
Definition: TrkValidationNtupleRIOs.h:36
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
TrkValidationNtupleRIOs::TRT_nRIOs
Int_t TRT_nRIOs
Definition: TrkValidationNtupleRIOs.h:33
TrkValidationNtupleRIOs::Show
virtual void Show(Long64_t entry=-1)
hist_file_dump.f
f
Definition: hist_file_dump.py:135
TrkValidationNtupleRIOs::b_TRT_SurfaceZ
TBranch * b_TRT_SurfaceZ
Definition: TrkValidationNtupleRIOs.h:45
TrkValidationNtupleRIOs::TRT_EventNumber
Int_t TRT_EventNumber
current Tree number in a TChain
Definition: TrkValidationNtupleRIOs.h:32
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TrkValidationNtupleRIOs::TRT_SurfaceZ
vector< float > * TRT_SurfaceZ
Definition: TrkValidationNtupleRIOs.h:37
TrkValidationNtupleRIOs::GetEntry
virtual Int_t GetEntry(Long64_t entry)
TrkValidationNtupleRIOs::fChain
TTree * fChain
Definition: TrkValidationNtupleRIOs.h:28
TrkValidationNtupleRIOs::Loop
virtual void Loop()
TrkValidationNtupleRIOs::TrkValidationNtupleRIOs
TrkValidationNtupleRIOs(TTree *tree=0)
TrkValidationNtupleRIOs::Notify
virtual Bool_t Notify()
TrkValidationNtupleRIOs::b_TRT_DriftRadius
TBranch * b_TRT_DriftRadius
Definition: TrkValidationNtupleRIOs.h:42
TrkValidationNtupleRIOs::b_TRT_event_number
TBranch * b_TRT_event_number
Definition: TrkValidationNtupleRIOs.h:40