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