protoDUNE_validate_calib.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////
2 // This class has been automatically generated on
3 // Mon Sep 9 15:17:32 2019 by ROOT version 6.16/00
4 // from TTree Event/Event Tree from Reco
5 // found on file: /dune/data2/users/apaudel/prod2_calib/r5387_sce.root
6 //////////////////////////////////////////////////////////
7 
8 #ifndef protoDUNE_validate_calib_h
9 #define protoDUNE_validate_calib_h
10 
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14 #include <TString.h>
15 
16 // Header file for the classes stored in the TTree if any.
17 
19 public :
20  TTree *fChain; //!pointer to the analyzed TTree or TChain
21  Int_t fCurrent; //!current Tree number in a TChain
22 
23 // Fixed size dimensions of array or collections stored in the TTree if any.
24 
25  // Declaration of leaf types
26  Int_t event;
27  Double_t evttime;
28  Int_t run;
29  Int_t subrun;
31  Int_t hour_min_sec;
32  Int_t cross_trks;
34  Int_t all_trks;
36  Float_t trackthetaxz[30]; //[cross_trks]
37  Float_t trackthetayz[30]; //[cross_trks]
38  Float_t trkstartx[30]; //[cross_trks]
39  Float_t trkstarty[30]; //[cross_trks]
40  Float_t trkstartz[30]; //[cross_trks]
41  Float_t trkendx[30]; //[cross_trks]
42  Float_t trkendy[30]; //[cross_trks]
43  Float_t trkendz[30]; //[cross_trks]
44  Float_t trklen[30]; //[cross_trks]
45  Float_t peakT_max[30]; //[cross_trks]
46  Float_t peakT_min[30]; //[cross_trks]
47  Int_t TrkID[30]; //[cross_trks]
48  Float_t trkstartcosxyz[30][3]; //[cross_trks]
49  Float_t trkendcosxyz[30][3]; //[cross_trks]
50  Int_t ntrkhits[30][3]; //[cross_trks]
51  Float_t trkdqdx[30][3][3000]; //[cross_trks]
52  Float_t trkdedx[30][3][3000]; //[cross_trks]
53  Float_t trkresrange[30][3][3000]; //[cross_trks]
54  Float_t trkhitx[30][3][3000]; //[cross_trks]
55  Float_t trkhity[30][3][3000]; //[cross_trks]
56  Float_t trkhitz[30][3][3000]; //[cross_trks]
57  Float_t trkpitch[30][3][3000]; //[cross_trks]
58  Float_t dist_min[30]; //[cross_trks]
59  Int_t adjacent_hits[30]; //[cross_trks]
60  Int_t lastwire[30]; //[cross_trks]
61  Float_t lastpeakt[30]; //[cross_trks]
62  Int_t endtpc[30]; //[cross_trks]
63 
64  // List of branches
65  TBranch *b_event; //!
66  TBranch *b_evttime; //!
67  TBranch *b_run; //!
68  TBranch *b_surbrun; //!
69  TBranch *b_year_month_date; //!
70  TBranch *b_hour_min_sec; //!
71  TBranch *b_cross_trks; //!
72  TBranch *b_stopping_trks; //!
73  TBranch *b_all_trks; //!
74  TBranch *b_unbroken_trks; //!
75  TBranch *b_trackthetaxz; //!
76  TBranch *b_trackthetayz; //!
77  TBranch *b_trkstartx; //!
78  TBranch *b_trkstarty; //!
79  TBranch *b_trkstartz; //!
80  TBranch *b_trkendx; //!
81  TBranch *b_trkendy; //!
82  TBranch *b_trkendz; //!
83  TBranch *b_trklen; //!
84  TBranch *b_peakT_max; //!
85  TBranch *b_peakT_min; //!
86  TBranch *b_TrkID; //!
87  TBranch *b_trkstartcosxyz; //!
88  TBranch *b_trkendcosxyz; //!
89  TBranch *b_ntrkhits; //!
90  TBranch *b_trkdqdx; //!
91  TBranch *b_trkdedx; //!
92  TBranch *b_trkresrange; //!
93  TBranch *b_trkhitx; //!
94  TBranch *b_trkhity; //!
95  TBranch *b_trkhitz; //!
96  TBranch *b_trkpitch; //!
97  TBranch *b_dist_min; //!
98  TBranch *b_adjacent_hits; //!
99  TBranch *b_lastwire; //!
100  TBranch *b_lastpeakt; //!
101  TBranch *b_endtpc; //!
102 
103  protoDUNE_validate_calib(TTree *tree=0);
104  virtual ~protoDUNE_validate_calib();
105  virtual Int_t Cut(Long64_t entry);
106  virtual Int_t GetEntry(Long64_t entry);
107  virtual Long64_t LoadTree(Long64_t entry);
108  virtual void Init(TTree *tree);
109  virtual void Loop(TString mn);
110  virtual Bool_t Notify();
111  virtual void Show(Long64_t entry = -1);
112 };
113 
114 #endif
115 
116 #ifdef protoDUNE_validate_calib_cxx
118 {
119 // if parameter tree is not specified (or zero), connect the file
120 // used to generate this class and read the Tree.
121  if (tree == 0) {
122  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("/dune/data2/users/apaudel/prod2_calib/r5387_sce.root");
123  if (!f || !f->IsOpen()) {
124  f = new TFile("/dune/data2/users/apaudel/prod2_calib/r5387_sce.root");
125  }
126  TDirectory * dir = (TDirectory*)f->Get("/dune/data2/users/apaudel/prod2_calib/r5387_sce.root:/michelremoving");
127  dir->GetObject("Event",tree);
128 
129  }
130  Init(tree);
131 }
132 
134 {
135  if (!fChain) return;
136  delete fChain->GetCurrentFile();
137 }
138 
140 {
141 // Read contents of entry.
142  if (!fChain) return 0;
143  return fChain->GetEntry(entry);
144 }
145 Long64_t protoDUNE_validate_calib::LoadTree(Long64_t entry)
146 {
147 // Set the environment to read one entry
148  if (!fChain) return -5;
149  Long64_t centry = fChain->LoadTree(entry);
150  if (centry < 0) return centry;
151  if (fChain->GetTreeNumber() != fCurrent) {
152  fCurrent = fChain->GetTreeNumber();
153  Notify();
154  }
155  return centry;
156 }
157 
158 void protoDUNE_validate_calib::Init(TTree *tree)
159 {
160  // The Init() function is called when the selector needs to initialize
161  // a new tree or chain. Typically here the branch addresses and branch
162  // pointers of the tree will be set.
163  // It is normally not necessary to make changes to the generated
164  // code, but the routine can be extended by the user if needed.
165  // Init() will be called many times when running on PROOF
166  // (once per file to be processed).
167 
168  // Set branch addresses and branch pointers
169  if (!tree) return;
170  fChain = tree;
171  fCurrent = -1;
172  fChain->SetMakeClass(1);
173 
174  fChain->SetBranchAddress("event", &event, &b_event);
175  fChain->SetBranchAddress("evttime", &evttime, &b_evttime);
176  fChain->SetBranchAddress("run", &run, &b_run);
177  fChain->SetBranchAddress("subrun", &subrun, &b_surbrun);
178  fChain->SetBranchAddress("year_month_date", &year_month_date, &b_year_month_date);
179  fChain->SetBranchAddress("hour_min_sec", &hour_min_sec, &b_hour_min_sec);
180  fChain->SetBranchAddress("cross_trks", &cross_trks, &b_cross_trks);
181  fChain->SetBranchAddress("stopping_trks", &stopping_trks, &b_stopping_trks);
182  fChain->SetBranchAddress("all_trks", &all_trks, &b_all_trks);
183  fChain->SetBranchAddress("unbroken_trks", &unbroken_trks, &b_unbroken_trks);
184  fChain->SetBranchAddress("trackthetaxz", trackthetaxz, &b_trackthetaxz);
185  fChain->SetBranchAddress("trackthetayz", trackthetayz, &b_trackthetayz);
186  fChain->SetBranchAddress("trkstartx", trkstartx, &b_trkstartx);
187  fChain->SetBranchAddress("trkstarty", trkstarty, &b_trkstarty);
188  fChain->SetBranchAddress("trkstartz", trkstartz, &b_trkstartz);
189  fChain->SetBranchAddress("trkendx", trkendx, &b_trkendx);
190  fChain->SetBranchAddress("trkendy", trkendy, &b_trkendy);
191  fChain->SetBranchAddress("trkendz", trkendz, &b_trkendz);
192  fChain->SetBranchAddress("trklen", trklen, &b_trklen);
193  fChain->SetBranchAddress("peakT_max", peakT_max, &b_peakT_max);
194  fChain->SetBranchAddress("peakT_min", peakT_min, &b_peakT_min);
195  fChain->SetBranchAddress("TrkID", TrkID, &b_TrkID);
196  fChain->SetBranchAddress("trkstartcosxyz", trkstartcosxyz, &b_trkstartcosxyz);
197  fChain->SetBranchAddress("trkendcosxyz", trkendcosxyz, &b_trkendcosxyz);
198  fChain->SetBranchAddress("ntrkhits", ntrkhits, &b_ntrkhits);
199  fChain->SetBranchAddress("trkdqdx", trkdqdx, &b_trkdqdx);
200  fChain->SetBranchAddress("trkdedx", trkdedx, &b_trkdedx);
201  fChain->SetBranchAddress("trkresrange", trkresrange, &b_trkresrange);
202  fChain->SetBranchAddress("trkhitx", trkhitx, &b_trkhitx);
203  fChain->SetBranchAddress("trkhity", trkhity, &b_trkhity);
204  fChain->SetBranchAddress("trkhitz", trkhitz, &b_trkhitz);
205  fChain->SetBranchAddress("trkpitch", trkpitch, &b_trkpitch);
206  fChain->SetBranchAddress("dist_min", dist_min, &b_dist_min);
207  fChain->SetBranchAddress("adjacent_hits", adjacent_hits, &b_adjacent_hits);
208  fChain->SetBranchAddress("lastwire", lastwire, &b_lastwire);
209  fChain->SetBranchAddress("lastpeakt", lastpeakt, &b_lastpeakt);
210  fChain->SetBranchAddress("endtpc", endtpc, &b_endtpc);
211  Notify();
212 }
213 
215 {
216  // The Notify() function is called when a new file is opened. This
217  // can be either for a new TTree in a TChain or when when a new TTree
218  // is started when using PROOF. It is normally not necessary to make changes
219  // to the generated code, but the routine can be extended by the
220  // user if needed. The return value is currently not used.
221 
222  return kTRUE;
223 }
224 
225 void protoDUNE_validate_calib::Show(Long64_t entry)
226 {
227 // Print contents of entry.
228 // If entry is not specified, print current entry
229  if (!fChain) return;
230  fChain->Show(entry);
231 }
232 Int_t protoDUNE_validate_calib::Cut(Long64_t entry)
233 {
234 // This function may be called from Loop.
235 // returns 1 if entry is accepted.
236 // returns -1 otherwise.
237  return 1;
238 }
239 #endif // #ifdef protoDUNE_validate_calib_cxx
QList< Entry > entry
virtual Int_t GetEntry(Long64_t entry)
virtual void Init(TTree *tree)
string dir
virtual ~protoDUNE_validate_calib()
virtual void Show(Long64_t entry=-1)
Float_t trkresrange[30][3][3000]
virtual Long64_t LoadTree(Long64_t entry)
virtual Int_t Cut(Long64_t entry)
Int_t fCurrent
pointer to the analyzed TTree or TChain
virtual void Loop(TString mn)
protoDUNE_validate_calib(TTree *tree=0)
virtual Bool_t Notify()
Int_t event
current Tree number in a TChain
Event finding and building.