ana.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////
2 // This class has been automatically generated on
3 // Tue Sep 1 23:54:29 2020 by ROOT version 6.18/04
4 // from TTree Event/Event
5 // found on file: signal2noise.root
6 //////////////////////////////////////////////////////////
7 
8 #ifndef ana_h
9 #define ana_h
10 
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14 
15 // Header file for the classes stored in the TTree if any.
16 
17 class ana {
18 public :
19  TTree *fChain; //!pointer to the analyzed TTree or TChain
20  Int_t fCurrent; //!current Tree number in a TChain
21 
22 // Fixed size dimensions of array or collections stored in the TTree if any.
23 
24  // Declaration of leaf types
25  Int_t event;
26  Int_t run;
27  Int_t subrun;
28  Double_t evttime;
30  Int_t hour_min_sec;
31  Int_t ntrks;
32  Int_t trkid[336]; //[ntrks]
33  Float_t trkstart[336][3]; //[ntrks]
34  Float_t trkend[336][3]; //[ntrks]
35  Float_t trklen[336]; //[ntrks]
36  Float_t trkthetaxz[336]; //[ntrks]
37  Float_t trkthetayz[336]; //[ntrks]
38  Float_t trkstartcosxyz[336][3]; //[ntrks]
39  Float_t trkendcosxyz[336][3]; //[ntrks]
40  Int_t ntrkhits[336][3]; //[ntrks]
41  Float_t trkdqdx[336][3][1000]; //[ntrks]
42  Float_t trkx[336][3][1000]; //[ntrks]
43  Float_t trkt[336][3][1000]; //[ntrks]
44  Double_t trkhitx[336][3][1000]; //[ntrks]
45  Double_t trkhity[336][3][1000]; //[ntrks]
46  Double_t trkhitz[336][3][1000]; //[ntrks]
47  Int_t wireid[336][1000]; //[ntrks]
48  Int_t chid[336][1000]; //[ntrks]
49  Int_t tpcid[336][1000]; //[ntrks]
50  Float_t hit_plane[336][1000]; //[ntrks]
51  Float_t ped[336][1000]; //[ntrks]
52  Float_t amp[336][1000]; //[ntrks]
53  Int_t tamp[336][1000]; //[ntrks]
54  Double_t cosgma[336][1000]; //[ntrks]
55  Float_t noiserms[336][1000]; //[ntrks]
56  Float_t noisermsfit[336][1000]; //[ntrks]
57 
58  // List of branches
59  TBranch *b_event; //!
60  TBranch *b_run; //!
61  TBranch *b_subrun; //!
62  TBranch *b_evttime; //!
63  TBranch *b_year_month_date; //!
64  TBranch *b_hour_min_sec; //!
65  TBranch *b_ntrks; //!
66  TBranch *b_trkid; //!
67  TBranch *b_trkstart; //!
68  TBranch *b_trkend; //!
69  TBranch *b_trklen; //!
70  TBranch *b_trkthetaxz; //!
71  TBranch *b_trkthetayz; //!
72  TBranch *b_trkstartcosxyz; //!
73  TBranch *b_trkendcosxyz; //!
74  TBranch *b_ntrkhits; //!
75  TBranch *b_trkdqdx; //!
76  TBranch *b_trkx; //!
77  TBranch *b_trkt; //!
78  TBranch *b_trkhitx; //!
79  TBranch *b_trkhity; //!
80  TBranch *b_trkhitz; //!
81  TBranch *b_wireid; //!
82  TBranch *b_chid; //!
83  TBranch *b_tpcid; //!
84  TBranch *b_hit_plane; //!
85  TBranch *b_ped; //!
86  TBranch *b_amp; //!
87  TBranch *b_tamp; //!
88  TBranch *b_cosgma; //!
89  TBranch *b_noiserms; //!
90  TBranch *b_noisermsfit; //!
91 
92  ana(TTree *tree=0);
93  virtual ~ana();
94  virtual Int_t Cut(Long64_t entry);
95  virtual Int_t GetEntry(Long64_t entry);
96  virtual Long64_t LoadTree(Long64_t entry);
97  virtual void Init(TTree *tree);
98  virtual void Loop();
99  virtual Bool_t Notify();
100  virtual void Show(Long64_t entry = -1);
101 };
102 
103 #endif
104 
105 #ifdef ana_cxx
106 ana::ana(TTree *tree) : fChain(0)
107 {
108 // if parameter tree is not specified (or zero), connect the file
109 // used to generate this class and read the Tree.
110  if (tree == 0) {
111  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("signal2noise.root");
112  if (!f || !f->IsOpen()) {
113  f = new TFile("signal2noise.root");
114  }
115  TDirectory * dir = (TDirectory*)f->Get("signal2noise.root:/signal2noise");
116  dir->GetObject("Event",tree);
117 
118  }
119  Init(tree);
120 }
121 
122 ana::~ana()
123 {
124  if (!fChain) return;
125  delete fChain->GetCurrentFile();
126 }
127 
128 Int_t ana::GetEntry(Long64_t entry)
129 {
130 // Read contents of entry.
131  if (!fChain) return 0;
132  return fChain->GetEntry(entry);
133 }
134 Long64_t ana::LoadTree(Long64_t entry)
135 {
136 // Set the environment to read one entry
137  if (!fChain) return -5;
138  Long64_t centry = fChain->LoadTree(entry);
139  if (centry < 0) return centry;
140  if (fChain->GetTreeNumber() != fCurrent) {
141  fCurrent = fChain->GetTreeNumber();
142  Notify();
143  }
144  return centry;
145 }
146 
147 void ana::Init(TTree *tree)
148 {
149  // The Init() function is called when the selector needs to initialize
150  // a new tree or chain. Typically here the branch addresses and branch
151  // pointers of the tree will be set.
152  // It is normally not necessary to make changes to the generated
153  // code, but the routine can be extended by the user if needed.
154  // Init() will be called many times when running on PROOF
155  // (once per file to be processed).
156 
157  // Set branch addresses and branch pointers
158  if (!tree) return;
159  fChain = tree;
160  fCurrent = -1;
161  fChain->SetMakeClass(1);
162 
163  fChain->SetBranchAddress("event", &event, &b_event);
164  fChain->SetBranchAddress("run", &run, &b_run);
165  fChain->SetBranchAddress("subrun", &subrun, &b_subrun);
166  fChain->SetBranchAddress("evttime", &evttime, &b_evttime);
167  fChain->SetBranchAddress("year_month_date", &year_month_date, &b_year_month_date);
168  fChain->SetBranchAddress("hour_min_sec", &hour_min_sec, &b_hour_min_sec);
169  fChain->SetBranchAddress("ntrks", &ntrks, &b_ntrks);
170  fChain->SetBranchAddress("trkid", trkid, &b_trkid);
171  fChain->SetBranchAddress("trkstart", trkstart, &b_trkstart);
172  fChain->SetBranchAddress("trkend", trkend, &b_trkend);
173  fChain->SetBranchAddress("trklen", trklen, &b_trklen);
174  fChain->SetBranchAddress("trkthetaxz", trkthetaxz, &b_trkthetaxz);
175  fChain->SetBranchAddress("trkthetayz", trkthetayz, &b_trkthetayz);
176  fChain->SetBranchAddress("trkstartcosxyz", trkstartcosxyz, &b_trkstartcosxyz);
177  fChain->SetBranchAddress("trkendcosxyz", trkendcosxyz, &b_trkendcosxyz);
178  fChain->SetBranchAddress("ntrkhits", ntrkhits, &b_ntrkhits);
179  fChain->SetBranchAddress("trkdqdx", trkdqdx, &b_trkdqdx);
180  fChain->SetBranchAddress("trkx", trkx, &b_trkx);
181  fChain->SetBranchAddress("trkt", trkt, &b_trkt);
182  fChain->SetBranchAddress("trkhitx", trkhitx, &b_trkhitx);
183  fChain->SetBranchAddress("trkhity", trkhity, &b_trkhity);
184  fChain->SetBranchAddress("trkhitz", trkhitz, &b_trkhitz);
185  fChain->SetBranchAddress("wireid", wireid, &b_wireid);
186  fChain->SetBranchAddress("chid", chid, &b_chid);
187  fChain->SetBranchAddress("tpcid", tpcid, &b_tpcid);
188  fChain->SetBranchAddress("hit_plane", hit_plane, &b_hit_plane);
189  fChain->SetBranchAddress("ped", ped, &b_ped);
190  fChain->SetBranchAddress("amp", amp, &b_amp);
191  fChain->SetBranchAddress("tamp", tamp, &b_tamp);
192  fChain->SetBranchAddress("cosgma", cosgma, &b_cosgma);
193  fChain->SetBranchAddress("noiserms", noiserms, &b_noiserms);
194  fChain->SetBranchAddress("noisermsfit", noisermsfit, &b_noisermsfit);
195  Notify();
196 }
197 
198 Bool_t ana::Notify()
199 {
200  // The Notify() function is called when a new file is opened. This
201  // can be either for a new TTree in a TChain or when when a new TTree
202  // is started when using PROOF. It is normally not necessary to make changes
203  // to the generated code, but the routine can be extended by the
204  // user if needed. The return value is currently not used.
205 
206  return kTRUE;
207 }
208 
209 void ana::Show(Long64_t entry)
210 {
211 // Print contents of entry.
212 // If entry is not specified, print current entry
213  if (!fChain) return;
214  fChain->Show(entry);
215 }
216 Int_t ana::Cut(Long64_t entry)
217 {
218 // This function may be called from Loop.
219 // returns 1 if entry is accepted.
220 // returns -1 otherwise.
221  return 1;
222 }
223 #endif // #ifdef ana_cxx
TBranch * b_hit_plane
Definition: ana.h:84
Float_t amp[336][1000]
Definition: ana.h:52
Double_t trkhitz[336][3][1000]
Definition: ana.h:46
Double_t trkhitx[336][3][1000]
Definition: ana.h:44
TBranch * b_trkstart
Definition: ana.h:67
TBranch * b_trkhitz
Definition: ana.h:80
TBranch * b_trklen
Definition: ana.h:69
Int_t chid[336][1000]
Definition: ana.h:48
Int_t hour_min_sec
Definition: ana.h:30
QList< Entry > entry
ana(TTree *tree=0)
TBranch * b_trkhitx
Definition: ana.h:78
Int_t trkid[336]
Definition: ana.h:32
Int_t event
current Tree number in a TChain
Definition: ana.h:25
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: ana.h:20
TBranch * b_run
Definition: ana.h:60
Float_t trkthetayz[336]
Definition: ana.h:37
TBranch * b_evttime
Definition: ana.h:62
Int_t ntrks
Definition: ana.h:31
TBranch * b_wireid
Definition: ana.h:81
Int_t year_month_date
Definition: ana.h:29
string dir
virtual void Init(TTree *tree)
TBranch * b_trkt
Definition: ana.h:77
virtual ~ana()
Int_t tamp[336][1000]
Definition: ana.h:53
Double_t evttime
Definition: ana.h:28
Float_t trklen[336]
Definition: ana.h:35
TBranch * b_trkthetayz
Definition: ana.h:71
Float_t hit_plane[336][1000]
Definition: ana.h:50
virtual void Loop()
virtual Bool_t Notify()
Float_t noisermsfit[336][1000]
Definition: ana.h:56
TBranch * b_tamp
Definition: ana.h:87
TBranch * b_year_month_date
Definition: ana.h:63
TBranch * b_trkendcosxyz
Definition: ana.h:73
virtual void Show(Long64_t entry=-1)
Double_t cosgma[336][1000]
Definition: ana.h:54
Int_t run
Definition: ana.h:26
TBranch * b_event
Definition: ana.h:59
Double_t trkhity[336][3][1000]
Definition: ana.h:45
TBranch * b_chid
Definition: ana.h:82
TTree * fChain
Definition: ana.h:19
virtual Int_t Cut(Long64_t entry)
TBranch * b_tpcid
Definition: ana.h:83
TBranch * b_trkthetaxz
Definition: ana.h:70
TBranch * b_trkhity
Definition: ana.h:79
Float_t trkthetaxz[336]
Definition: ana.h:36
TBranch * b_ntrkhits
Definition: ana.h:74
TBranch * b_trkx
Definition: ana.h:76
Int_t wireid[336][1000]
Definition: ana.h:47
Float_t ped[336][1000]
Definition: ana.h:51
Float_t trkstart[336][3]
Definition: ana.h:33
TBranch * b_subrun
Definition: ana.h:61
TBranch * b_trkid
Definition: ana.h:66
Int_t tpcid[336][1000]
Definition: ana.h:49
virtual Int_t GetEntry(Long64_t entry)
TBranch * b_amp
Definition: ana.h:86
TBranch * b_trkdqdx
Definition: ana.h:75
Float_t trkstartcosxyz[336][3]
Definition: ana.h:38
TBranch * b_trkend
Definition: ana.h:68
Float_t trkend[336][3]
Definition: ana.h:34
Float_t trkendcosxyz[336][3]
Definition: ana.h:39
Int_t subrun
Definition: ana.h:27
TBranch * b_noisermsfit
Definition: ana.h:90
Float_t trkdqdx[336][3][1000]
Definition: ana.h:41
Float_t trkt[336][3][1000]
Definition: ana.h:43
Float_t noiserms[336][1000]
Definition: ana.h:55
TBranch * b_trkstartcosxyz
Definition: ana.h:72
TBranch * b_hour_min_sec
Definition: ana.h:64
TBranch * b_noiserms
Definition: ana.h:89
TBranch * b_ped
Definition: ana.h:85
Definition: ana.h:17
virtual Long64_t LoadTree(Long64_t entry)
Int_t ntrkhits[336][3]
Definition: ana.h:40
TBranch * b_ntrks
Definition: ana.h:65
Event finding and building.
Float_t trkx[336][3][1000]
Definition: ana.h:42
TBranch * b_cosgma
Definition: ana.h:88