Analyze.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////
2 // This class has been automatically generated on
3 // Tue Nov 15 08:40:44 2016 by ROOT version 5.34/32
4 // from TTree CVNTrainTree/Training records
5 // found on file: cvn_event_dump_r20000001_s101_hist.root
6 //////////////////////////////////////////////////////////
7 
8 #ifndef Analyze_h
9 #define Analyze_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 // Fixed size dimensions of array or collections stored in the TTree if any.
18 
19 class Analyze {
20 public :
21  TTree *fChain; //!pointer to the analyzed TTree or TChain
22  Int_t fCurrent; //!current Tree number in a TChain
23 
24  // Declaration of leaf types
25  //cvn::TrainingData *train;
26  Int_t fInt;
27  Float_t fNuEnergy;
28  Float_t fLepEnergy;
29  UInt_t fPMap_fNWire;
30  UInt_t fPMap_fNTdc;
39  //vector<cvn::HType> fPMap_fLab;
40  //vector<cvn::HType> fPMap_fLabX;
41  //vector<cvn::HType> fPMap_fLabY;
42  //vector<cvn::HType> fPMap_fLabZ;
46  Double_t fPMap_fBound_fLastTDC[3];
47 
48  // List of branches
49  TBranch *b_train_fInt; //!
50  TBranch *b_train_fNuEnergy; //!
51  TBranch *b_train_fLepEnergy; //!
52  TBranch *b_train_fPMap_fNWire; //!
53  TBranch *b_train_fPMap_fNTdc; //!
54  TBranch *b_train_fPMap_fPE; //!
55  TBranch *b_train_fPMap_fPEX; //!
56  TBranch *b_train_fPMap_fPEY; //!
57  TBranch *b_train_fPMap_fPEZ; //!
58  TBranch *b_train_fPMap_fPur; //!
59  TBranch *b_train_fPMap_fPurX; //!
60  TBranch *b_train_fPMap_fPurY; //!
61  TBranch *b_train_fPMap_fPurZ; //!
66 
67  Analyze(TTree *tree=0);
68  virtual ~Analyze();
69  virtual Int_t Cut(Long64_t entry);
70  virtual Int_t GetEntry(Long64_t entry);
71  virtual Long64_t LoadTree(Long64_t entry);
72  virtual void Init(TTree *tree);
73  virtual void Loop();
74  virtual Bool_t Notify();
75  virtual void Show(Long64_t entry = -1);
76 };
77 
78 #endif
79 
80 #ifdef Analyze_cxx
81 Analyze::Analyze(TTree *tree) : fChain(0)
82 {
83 // if parameter tree is not specified (or zero), connect the file
84 // used to generate this class and read the Tree.
85  if (tree == 0) {
86  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("cvn_event_dump_r20000001_s101_hist.root");
87  if (!f || !f->IsOpen()) {
88  f = new TFile("cvn_event_dump_r20000001_s101_hist.root");
89  }
90  TDirectory * dir = (TDirectory*)f->Get("cvn_event_dump_r20000001_s101_hist.root:/cvndump");
91  dir->GetObject("CVNTrainTree",tree);
92 
93  }
94  Init(tree);
95 }
96 
98 {
99  if (!fChain) return;
100  delete fChain->GetCurrentFile();
101 }
102 
103 Int_t Analyze::GetEntry(Long64_t entry)
104 {
105 // Read contents of entry.
106  if (!fChain) return 0;
107  return fChain->GetEntry(entry);
108 }
109 Long64_t Analyze::LoadTree(Long64_t entry)
110 {
111 // Set the environment to read one entry
112  if (!fChain) return -5;
113  Long64_t centry = fChain->LoadTree(entry);
114  if (centry < 0) return centry;
115  if (fChain->GetTreeNumber() != fCurrent) {
116  fCurrent = fChain->GetTreeNumber();
117  Notify();
118  }
119  return centry;
120 }
121 
122 void Analyze::Init(TTree *tree)
123 {
124  // The Init() function is called when the selector needs to initialize
125  // a new tree or chain. Typically here the branch addresses and branch
126  // pointers of the tree will be set.
127  // It is normally not necessary to make changes to the generated
128  // code, but the routine can be extended by the user if needed.
129  // Init() will be called many times when running on PROOF
130  // (once per file to be processed).
131 
132  // Set branch addresses and branch pointers
133  if (!tree) return;
134  fChain = tree;
135  fCurrent = -1;
136  fChain->SetMakeClass(1);
137 
138  fChain->SetBranchAddress("fInt", &fInt, &b_train_fInt);
139  fChain->SetBranchAddress("fNuEnergy", &fNuEnergy, &b_train_fNuEnergy);
140  fChain->SetBranchAddress("fLepEnergy", &fLepEnergy, &b_train_fLepEnergy);
141  fChain->SetBranchAddress("fPMap.fNWire", &fPMap_fNWire, &b_train_fPMap_fNWire);
142  fChain->SetBranchAddress("fPMap.fNTdc", &fPMap_fNTdc, &b_train_fPMap_fNTdc);
143  fChain->SetBranchAddress("fPMap.fPE", &fPMap_fPE, &b_train_fPMap_fPE);
144  fChain->SetBranchAddress("fPMap.fPEX", &fPMap_fPEX, &b_train_fPMap_fPEX);
145  fChain->SetBranchAddress("fPMap.fPEY", &fPMap_fPEY, &b_train_fPMap_fPEY);
146  fChain->SetBranchAddress("fPMap.fPEZ", &fPMap_fPEZ, &b_train_fPMap_fPEZ);
147  fChain->SetBranchAddress("fPMap.fPur", &fPMap_fPur, &b_train_fPMap_fPur);
148  fChain->SetBranchAddress("fPMap.fPurX", &fPMap_fPurX, &b_train_fPMap_fPurX);
149  fChain->SetBranchAddress("fPMap.fPurY", &fPMap_fPurY, &b_train_fPMap_fPurY);
150  fChain->SetBranchAddress("fPMap.fPurZ", &fPMap_fPurZ, &b_train_fPMap_fPurZ);
151  fChain->SetBranchAddress("fPMap.fBound.fFirstWire[3]", fPMap_fBound_fFirstWire, &b_train_fPMap_fBound_fFirstWire);
152  fChain->SetBranchAddress("fPMap.fBound.fLastWire[3]", fPMap_fBound_fLastWire, &b_train_fPMap_fBound_fLastWire);
153  fChain->SetBranchAddress("fPMap.fBound.fFirstTDC[3]", fPMap_fBound_fFirstTDC, &b_train_fPMap_fBound_fFirstTDC);
154  fChain->SetBranchAddress("fPMap.fBound.fLastTDC[3]", fPMap_fBound_fLastTDC, &b_train_fPMap_fBound_fLastTDC);
155  Notify();
156 }
157 
158 Bool_t Analyze::Notify()
159 {
160  // The Notify() function is called when a new file is opened. This
161  // can be either for a new TTree in a TChain or when when a new TTree
162  // is started when using PROOF. It is normally not necessary to make changes
163  // to the generated code, but the routine can be extended by the
164  // user if needed. The return value is currently not used.
165 
166  return kTRUE;
167 }
168 
169 void Analyze::Show(Long64_t entry)
170 {
171 // Print contents of entry.
172 // If entry is not specified, print current entry
173  if (!fChain) return;
174  fChain->Show(entry);
175 }
176 Int_t Analyze::Cut(Long64_t entry)
177 {
178 // This function may be called from Loop.
179 // returns 1 if entry is accepted.
180 // returns -1 otherwise.
181  return 1;
182 }
183 #endif // #ifdef Analyze_cxx
Double_t fPMap_fBound_fLastTDC[3]
Definition: Analyze.h:46
UInt_t fPMap_fNTdc
Definition: Analyze.h:30
TBranch * b_train_fPMap_fBound_fLastWire
Definition: Analyze.h:63
virtual ~Analyze()
Int_t fPMap_fBound_fFirstWire[3]
Definition: Analyze.h:43
QList< Entry > entry
vector< double > fPMap_fPurZ
Definition: Analyze.h:38
UInt_t fPMap_fNWire
Definition: Analyze.h:29
TBranch * b_train_fNuEnergy
Definition: Analyze.h:50
TBranch * b_train_fPMap_fPEY
Definition: Analyze.h:56
TBranch * b_train_fPMap_fBound_fLastTDC
Definition: Analyze.h:65
TBranch * b_train_fPMap_fPE
Definition: Analyze.h:54
virtual void Show(Long64_t entry=-1)
vector< double > fPMap_fPurX
Definition: Analyze.h:36
virtual Bool_t Notify()
vector< float > fPMap_fPEZ
Definition: Analyze.h:34
vector< double > fPMap_fPurY
Definition: Analyze.h:37
Float_t fNuEnergy
Definition: Analyze.h:27
Double_t fPMap_fBound_fFirstTDC[3]
Definition: Analyze.h:45
TBranch * b_train_fPMap_fPur
Definition: Analyze.h:58
string dir
TBranch * b_train_fInt
Definition: Analyze.h:49
TBranch * b_train_fPMap_fNWire
Definition: Analyze.h:52
TBranch * b_train_fPMap_fPurZ
Definition: Analyze.h:61
TBranch * b_train_fPMap_fNTdc
Definition: Analyze.h:53
vector< float > fPMap_fPEY
Definition: Analyze.h:33
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: Analyze.h:22
TBranch * b_train_fLepEnergy
Definition: Analyze.h:51
Float_t fLepEnergy
Definition: Analyze.h:28
virtual Int_t Cut(Long64_t entry)
virtual void Init(TTree *tree)
virtual Int_t GetEntry(Long64_t entry)
TBranch * b_train_fPMap_fPurX
Definition: Analyze.h:59
TBranch * b_train_fPMap_fPEX
Definition: Analyze.h:55
Int_t fInt
current Tree number in a TChain
Definition: Analyze.h:26
Int_t fPMap_fBound_fLastWire[3]
Definition: Analyze.h:44
virtual Long64_t LoadTree(Long64_t entry)
vector< double > fPMap_fPur
Definition: Analyze.h:35
TTree * fChain
Definition: Analyze.h:21
Analyze(TTree *tree=0)
virtual void Loop()
TBranch * b_train_fPMap_fBound_fFirstWire
Definition: Analyze.h:62
vector< float > fPMap_fPEX
Definition: Analyze.h:32
vector< float > fPMap_fPE
Definition: Analyze.h:31
TBranch * b_train_fPMap_fBound_fFirstTDC
Definition: Analyze.h:64
TBranch * b_train_fPMap_fPurY
Definition: Analyze.h:60
TBranch * b_train_fPMap_fPEZ
Definition: Analyze.h:57