ATLAS Offline Software
Loading...
Searching...
No Matches
TrkValidationNtupleRIOs.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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>
19using namespace std;
20
21#ifdef __CINT__
22#pragma link C++ class vector< int >;
23#pragma link C++ class vector< float >;
24#endif
25
27public :
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
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
83Int_t TrkValidationNtupleRIOs::GetEntry(Long64_t entry)
84{
85// Read contents of entry.
86 if (!fChain) return 0;
87 return fChain->GetEntry(entry);
88}
89Long64_t TrkValidationNtupleRIOs::LoadTree(Long64_t entry)
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 = static_cast<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
145void TrkValidationNtupleRIOs::Show(Long64_t entry)
146{
147// Print contents of entry.
148// If entry is not specified, print current entry
149 if (!fChain) return;
150 fChain->Show(entry);
151}
152Int_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
Int_t TRT_EventNumber
current Tree number in a TChain
virtual Long64_t LoadTree(Long64_t entry)
virtual void Show(Long64_t entry=-1)
virtual Int_t GetEntry(Long64_t entry)
virtual Int_t Cut(Long64_t entry)
Int_t fCurrent
pointer to the analyzed TTree or TChain
virtual Bool_t Notify()
virtual void Init(TTree *tree)
TrkValidationNtupleRIOs(TTree *tree=0)
virtual ~TrkValidationNtupleRIOs()
STL namespace.
TChain * tree