Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeAmpToolsFlat_gen.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////
2 // This class has been automatically generated on
3 // Fri Apr 27 10:52:10 2018 by ROOT version 6.08/06
4 // from TTree kin/Kinematics
5 // found on file: tree_gen_2pi_primakoff_flat_100000.root
6 //////////////////////////////////////////////////////////
7 
8 #ifndef MakeAmpToolsFlat_gen_h
9 #define MakeAmpToolsFlat_gen_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 
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
26  Float_t E_FinalState[3]; //[NumFinalState]
27  Float_t Px_FinalState[3]; //[NumFinalState]
28  Float_t Py_FinalState[3]; //[NumFinalState]
29  Float_t Pz_FinalState[3]; //[NumFinalState]
30  Float_t E_Beam;
31  Float_t Px_Beam;
32  Float_t Py_Beam;
33  Float_t Pz_Beam;
34 
35  // List of branches
36  TBranch *b_NumFinalState; //!
37  TBranch *b_E_FinalState; //!
38  TBranch *b_Px_FinalState; //!
39  TBranch *b_Py_FinalState; //!
40  TBranch *b_Pz_FinalState; //!
41  TBranch *b_E_Beam; //!
42  TBranch *b_Px_Beam; //!
43  TBranch *b_Py_Beam; //!
44  TBranch *b_Pz_Beam; //!
45 
46  MakeAmpToolsFlat_gen(TTree *tree=0);
47  virtual ~MakeAmpToolsFlat_gen();
48  virtual Int_t Cut(Long64_t entry);
49  virtual Int_t GetEntry(Long64_t entry);
50  virtual Long64_t LoadTree(Long64_t entry);
51  virtual void Init(TTree *tree);
52  virtual void Loop();
53  virtual Bool_t Notify();
54  virtual void Show(Long64_t entry = -1);
55 
56  int m_nPart;
57  int m_PID[3];
58  float m_e[3];
59  float m_px[3];
60  float m_py[3];
61  float m_pz[3];
62  float m_eBeam;
63  float m_pxBeam;
64  float m_pyBeam;
65  float m_pzBeam;
66  float m_weight;
67  float m_TargetMass;
68 
69  TTree *m_OutTree;
70  TFile *outFile;
71 
72 };
73 
74 #endif
75 
76 #ifdef MakeAmpToolsFlat_gen_cxx
77 MakeAmpToolsFlat_gen::MakeAmpToolsFlat_gen(TTree *tree) : fChain(0)
78 {
79 // if parameter tree is not specified (or zero), connect the file
80 // used to generate this class and read the Tree.
81  if (_file0) {
82  tree = (TTree *) _file0->Get("pippimmisspb208_TreeFlat"); // require input file if provided!
83  }
84  if (tree == 0) {
85  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("tree_gen_2pi_primakoff_flat_100000.root");
86  if (!f || !f->IsOpen()) {
87  f = new TFile("tree_gen_2pi_primakoff_flat_100000.root");
88  }
89  f->GetObject("kin",tree);
90 
91  }
92  Init(tree);
93 }
94 
96 {
97  if (!fChain) return;
98  delete fChain->GetCurrentFile();
99 }
100 
101 Int_t MakeAmpToolsFlat_gen::GetEntry(Long64_t entry)
102 {
103 // Read contents of entry.
104  if (!fChain) return 0;
105  return fChain->GetEntry(entry);
106 }
107 Long64_t MakeAmpToolsFlat_gen::LoadTree(Long64_t entry)
108 {
109 // Set the environment to read one entry
110  if (!fChain) return -5;
111  Long64_t centry = fChain->LoadTree(entry);
112  if (centry < 0) return centry;
113  if (fChain->GetTreeNumber() != fCurrent) {
114  fCurrent = fChain->GetTreeNumber();
115  Notify();
116  }
117  return centry;
118 }
119 
120 void MakeAmpToolsFlat_gen::Init(TTree *tree)
121 {
122  // The Init() function is called when the selector needs to initialize
123  // a new tree or chain. Typically here the branch addresses and branch
124  // pointers of the tree will be set.
125  // It is normally not necessary to make changes to the generated
126  // code, but the routine can be extended by the user if needed.
127  // Init() will be called many times when running on PROOF
128  // (once per file to be processed).
129 
130  // Set branch addresses and branch pointers
131  if (!tree) return;
132  fChain = tree;
133  fCurrent = -1;
134  fChain->SetMakeClass(1);
135 
136  fChain->SetBranchAddress("NumFinalState", &NumFinalState, &b_NumFinalState);
137  fChain->SetBranchAddress("E_FinalState", E_FinalState, &b_E_FinalState);
138  fChain->SetBranchAddress("Px_FinalState", Px_FinalState, &b_Px_FinalState);
139  fChain->SetBranchAddress("Py_FinalState", Py_FinalState, &b_Py_FinalState);
140  fChain->SetBranchAddress("Pz_FinalState", Pz_FinalState, &b_Pz_FinalState);
141  fChain->SetBranchAddress("E_Beam", &E_Beam, &b_E_Beam);
142  fChain->SetBranchAddress("Px_Beam", &Px_Beam, &b_Px_Beam);
143  fChain->SetBranchAddress("Py_Beam", &Py_Beam, &b_Py_Beam);
144  fChain->SetBranchAddress("Pz_Beam", &Pz_Beam, &b_Pz_Beam);
145  Notify();
146 }
147 
149 {
150  // The Notify() function is called when a new file is opened. This
151  // can be either for a new TTree in a TChain or when when a new TTree
152  // is started when using PROOF. It is normally not necessary to make changes
153  // to the generated code, but the routine can be extended by the
154  // user if needed. The return value is currently not used.
155 
156  return kTRUE;
157 }
158 
159 void MakeAmpToolsFlat_gen::Show(Long64_t entry)
160 {
161 // Print contents of entry.
162 // If entry is not specified, print current entry
163  if (!fChain) return;
164  fChain->Show(entry);
165 }
166 Int_t MakeAmpToolsFlat_gen::Cut(Long64_t entry)
167 {
168 // This function may be called from Loop.
169 // returns 1 if entry is accepted.
170 // returns -1 otherwise.
171  return 1;
172 }
173 #endif // #ifdef MakeAmpToolsFlat_gen_cxx
virtual Int_t GetEntry(Long64_t entry)
MakeAmpToolsFlat_gen(TTree *tree=0)
virtual Long64_t LoadTree(Long64_t entry)
virtual void Show(Long64_t entry=-1)
virtual ~MakeAmpToolsFlat_gen()
TF1 * f
Definition: FitGains.C:21
virtual Bool_t Notify()
Int_t fCurrent
pointer to the analyzed TTree or TChain
virtual Int_t Cut(Long64_t entry)
virtual void Init(TTree *tree)
Int_t NumFinalState
current Tree number in a TChain