Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeAmpToolsFlat_mcthrown.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////
2 // This class has been automatically generated on
3 // Mon May 21 17:46:25 2018 by ROOT version 6.08/06
4 // from TTree Thrown_Tree/Thrown_Tree
5 // found on file: tree_hd_root_Z2pi_trees_sw1pw1000_NOTAG_flat_100000_gen.root
6 //////////////////////////////////////////////////////////
7 
8 #ifndef MakeAmpToolsFlat_mcthrown_h
9 #define MakeAmpToolsFlat_mcthrown_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 #include "TLorentzVector.h"
17 #include "TClonesArray.h"
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  UInt_t RunNumber;
28  ULong64_t EventNumber;
30  TLorentzVector *ThrownBeam__X4;
31  TLorentzVector *ThrownBeam__P4;
34  ULong64_t PIDThrown_Decaying;
35  Float_t MCWeight;
36  UInt_t NumThrown;
37  Int_t Thrown__ParentIndex[3]; //[NumThrown]
38  Int_t Thrown__PID[3]; //[NumThrown]
39  TClonesArray *Thrown__X4;
40  TClonesArray *Thrown__P4;
41 
42  // List of branches
43  TBranch *b_RunNumber; //!
44  TBranch *b_EventNumber; //!
45  TBranch *b_ThrownBeam__PID; //!
46  TBranch *b_ThrownBeam__X4; //!
47  TBranch *b_ThrownBeam__P4; //!
50  TBranch *b_PIDThrown_Decaying; //!
51  TBranch *b_MCWeight; //!
52  TBranch *b_NumThrown; //!
53  TBranch *b_Thrown__ParentIndex; //!
54  TBranch *b_Thrown__PID; //!
55  TBranch *b_Thrown__X4; //!
56  TBranch *b_Thrown__P4; //!
57 
58  MakeAmpToolsFlat_mcthrown(TTree *tree=0);
60  virtual Int_t Cut(Long64_t entry);
61  virtual Int_t GetEntry(Long64_t entry);
62  virtual Long64_t LoadTree(Long64_t entry);
63  virtual void Init(TTree *tree);
64  virtual void Loop();
65  virtual Bool_t Notify();
66  virtual void Show(Long64_t entry = -1);
67 
68 
69  int m_nPart;
70  int m_PID[3];
71  float m_e[3];
72  float m_px[3];
73  float m_py[3];
74  float m_pz[3];
75  float m_eBeam;
76  float m_pxBeam;
77  float m_pyBeam;
78  float m_pzBeam;
79  float m_weight;
80  float m_TargetMass;
81 
82  TTree *m_OutTree;
83  TFile *outFile;
84 
85 
86 
87 };
88 
89 #endif
90 
91 #ifdef MakeAmpToolsFlat_mcthrown_cxx
93 {
94 // if parameter tree is not specified (or zero), connect the file
95 // used to generate this class and read the Tree.
96  if (_file0) {
97  tree = (TTree *) _file0->Get("Thrown_Tree"); // require input file if provided!
98  }
99  if (tree == 0) {
100  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("tree_hd_root_Z2pi_trees_sw1pw1000_NOTAG_flat_100000_gen.root");
101  if (!f || !f->IsOpen()) {
102  f = new TFile("tree_hd_root_Z2pi_trees_sw1pw1000_NOTAG_flat_100000_gen.root");
103  }
104  f->GetObject("Thrown_Tree",tree);
105 
106  }
107  Init(tree);
108 }
109 
111 {
112  if (!fChain) return;
113  delete fChain->GetCurrentFile();
114 }
115 
116 Int_t MakeAmpToolsFlat_mcthrown::GetEntry(Long64_t entry)
117 {
118 // Read contents of entry.
119  if (!fChain) return 0;
120  return fChain->GetEntry(entry);
121 }
122 Long64_t MakeAmpToolsFlat_mcthrown::LoadTree(Long64_t entry)
123 {
124 // Set the environment to read one entry
125  if (!fChain) return -5;
126  Long64_t centry = fChain->LoadTree(entry);
127  if (centry < 0) return centry;
128  if (fChain->GetTreeNumber() != fCurrent) {
129  fCurrent = fChain->GetTreeNumber();
130  Notify();
131  }
132  return centry;
133 }
134 
135 void MakeAmpToolsFlat_mcthrown::Init(TTree *tree)
136 {
137  // The Init() function is called when the selector needs to initialize
138  // a new tree or chain. Typically here the branch addresses and branch
139  // pointers of the tree will be set.
140  // It is normally not necessary to make changes to the generated
141  // code, but the routine can be extended by the user if needed.
142  // Init() will be called many times when running on PROOF
143  // (once per file to be processed).
144 
145  // Set object pointer
146  ThrownBeam__X4 = 0;
147  ThrownBeam__P4 = 0;
148  Thrown__X4 = 0;
149  Thrown__P4 = 0;
150  // Set branch addresses and branch pointers
151  if (!tree) return;
152  fChain = tree;
153  fCurrent = -1;
154  fChain->SetMakeClass(1);
155 
156  fChain->SetBranchAddress("RunNumber", &RunNumber, &b_RunNumber);
157  fChain->SetBranchAddress("EventNumber", &EventNumber, &b_EventNumber);
158  fChain->SetBranchAddress("ThrownBeam__PID", &ThrownBeam__PID, &b_ThrownBeam__PID);
159  fChain->SetBranchAddress("ThrownBeam__X4", &ThrownBeam__X4, &b_ThrownBeam__X4);
160  fChain->SetBranchAddress("ThrownBeam__P4", &ThrownBeam__P4, &b_ThrownBeam__P4);
161  fChain->SetBranchAddress("ThrownBeam__GeneratedEnergy", &ThrownBeam__GeneratedEnergy, &b_ThrownBeam__GeneratedEnergy);
162  fChain->SetBranchAddress("NumPIDThrown_FinalState", &NumPIDThrown_FinalState, &b_NumPIDThrown_FinalState);
163  fChain->SetBranchAddress("PIDThrown_Decaying", &PIDThrown_Decaying, &b_PIDThrown_Decaying);
164  fChain->SetBranchAddress("MCWeight", &MCWeight, &b_MCWeight);
165  fChain->SetBranchAddress("NumThrown", &NumThrown, &b_NumThrown);
166  fChain->SetBranchAddress("Thrown__ParentIndex", Thrown__ParentIndex, &b_Thrown__ParentIndex);
167  fChain->SetBranchAddress("Thrown__PID", Thrown__PID, &b_Thrown__PID);
168  fChain->SetBranchAddress("Thrown__X4", &Thrown__X4, &b_Thrown__X4);
169  fChain->SetBranchAddress("Thrown__P4", &Thrown__P4, &b_Thrown__P4);
170  Notify();
171 }
172 
174 {
175  // The Notify() function is called when a new file is opened. This
176  // can be either for a new TTree in a TChain or when when a new TTree
177  // is started when using PROOF. It is normally not necessary to make changes
178  // to the generated code, but the routine can be extended by the
179  // user if needed. The return value is currently not used.
180 
181  return kTRUE;
182 }
183 
184 void MakeAmpToolsFlat_mcthrown::Show(Long64_t entry)
185 {
186 // Print contents of entry.
187 // If entry is not specified, print current entry
188  if (!fChain) return;
189  fChain->Show(entry);
190 }
191 Int_t MakeAmpToolsFlat_mcthrown::Cut(Long64_t entry)
192 {
193 // This function may be called from Loop.
194 // returns 1 if entry is accepted.
195 // returns -1 otherwise.
196  return 1;
197 }
198 #endif // #ifdef MakeAmpToolsFlat_mcthrown_cxx
UInt_t RunNumber
current Tree number in a TChain
virtual ~MakeAmpToolsFlat_mcthrown()
TF1 * f
Definition: FitGains.C:21
virtual void Show(Long64_t entry=-1)
virtual Int_t Cut(Long64_t entry)
MakeAmpToolsFlat_mcthrown(TTree *tree=0)
Int_t fCurrent
pointer to the analyzed TTree or TChain
virtual Bool_t Notify()
virtual Long64_t LoadTree(Long64_t entry)
virtual Int_t GetEntry(Long64_t entry)
virtual void Init(TTree *tree)