00001
00002
00003
00004
00005
00006
00007 #ifndef mollerClass_h
00008 #define mollerClass_h
00009
00010 #include <TROOT.h>
00011 #include <TChain.h>
00012 #include <TFile.h>
00013
00014 class mollerClass {
00015 public :
00016 TTree *fChain;
00017 Int_t fCurrent;
00018
00019
00020 Float_t ion;
00021 Float_t x;
00022 Float_t y;
00023 Float_t z;
00024 Float_t x0;
00025 Float_t y0;
00026 Float_t z0;
00027 Float_t kineE;
00028 Float_t px;
00029 Float_t py;
00030 Float_t pz;
00031 Float_t kineE0;
00032 Float_t px0;
00033 Float_t py0;
00034 Float_t pz0;
00035 Float_t kineE1;
00036 Float_t px1;
00037 Float_t py1;
00038 Float_t pz1;
00039 Float_t kineE2;
00040 Float_t px2;
00041 Float_t py2;
00042 Float_t pz2;
00043 Float_t type;
00044 Float_t volume;
00045 Float_t theta0;
00046 Float_t theta1;
00047 Float_t theta2;
00048 Float_t ev_num;
00049 Float_t process;
00050 Float_t event;
00051 Float_t creator;
00052 Float_t hit;
00053 Float_t kineE_org;
00054 Float_t theta_org;
00055 Float_t track;
00056 Float_t diffXS;
00057 Float_t totXS;
00058 Float_t rate;
00059
00060
00061 TBranch *b_ion;
00062 TBranch *b_x;
00063 TBranch *b_y;
00064 TBranch *b_z;
00065 TBranch *b_x0;
00066 TBranch *b_y0;
00067 TBranch *b_z0;
00068 TBranch *b_kineE;
00069 TBranch *b_px;
00070 TBranch *b_py;
00071 TBranch *b_pz;
00072 TBranch *b_kineE0;
00073 TBranch *b_px0;
00074 TBranch *b_py0;
00075 TBranch *b_pz0;
00076 TBranch *b_kineE1;
00077 TBranch *b_px1;
00078 TBranch *b_py1;
00079 TBranch *b_pz1;
00080 TBranch *b_kineE2;
00081 TBranch *b_px2;
00082 TBranch *b_py2;
00083 TBranch *b_pz2;
00084 TBranch *b_type;
00085 TBranch *b_volume;
00086 TBranch *b_theta0;
00087 TBranch *b_theta1;
00088 TBranch *b_theta2;
00089 TBranch *b_ev_num;
00090 TBranch *b_process;
00091 TBranch *b_event;
00092 TBranch *b_creator;
00093 TBranch *b_hit;
00094 TBranch *b_kineE_org;
00095 TBranch *b_theta_org;
00096 TBranch *b_track;
00097 TBranch *b_diffXS;
00098 TBranch *b_totXS;
00099 TBranch *b_rate;
00100
00101 mollerClass(TTree *tree=0);
00102 virtual ~mollerClass();
00103 virtual Int_t Cut(Long64_t entry);
00104 virtual Int_t GetEntry(Long64_t entry);
00105 virtual Long64_t LoadTree(Long64_t entry);
00106 virtual void Init(TTree *tree);
00107 virtual void Loop();
00108 virtual Bool_t Notify();
00109 virtual void Show(Long64_t entry = -1);
00110 };
00111
00112 #endif
00113
00114 #ifdef mollerClass_cxx
00115 mollerClass::mollerClass(TTree *tree)
00116 {
00117
00118
00119 if (tree == 0) {
00120
00121 #ifdef SINGLE_TREE
00122
00123
00124 TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("Memory Directory");
00125 if (!f) {
00126 f = new TFile("Memory Directory");
00127 f->cd("Rint:/");
00128 }
00129 tree = (TTree*)gDirectory->Get("geant");
00130
00131 #else // SINGLE_TREE
00132
00133
00134
00135 TChain * chain = new TChain("geant","");
00136 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_1.root/geant");
00137 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_2.root/geant");
00138 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_3.root/geant");
00139 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_4.root/geant");
00140 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_5.root/geant");
00141 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_6.root/geant");
00142 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_7.root/geant");
00143 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_8.root/geant");
00144 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_9.root/geant");
00145 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_10.root/geant");
00146 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_11.root/geant");
00147 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_12.root/geant");
00148 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_13.root/geant");
00149 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_14.root/geant");
00150 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_100k_15.root/geant");
00151 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_50k_1.root/geant");
00152 chain->Add("~/scratch/ROOTfiles/prod_Nov6_Nov17coll_widcoll10m_50k_2.root/geant");
00153 tree = chain;
00154 #endif // SINGLE_TREE
00155
00156 }
00157 Init(tree);
00158 }
00159
00160 mollerClass::~mollerClass()
00161 {
00162 if (!fChain) return;
00163 delete fChain->GetCurrentFile();
00164 }
00165
00166 Int_t mollerClass::GetEntry(Long64_t entry)
00167 {
00168
00169 if (!fChain) return 0;
00170 return fChain->GetEntry(entry);
00171 }
00172 Long64_t mollerClass::LoadTree(Long64_t entry)
00173 {
00174
00175 if (!fChain) return -5;
00176 Long64_t centry = fChain->LoadTree(entry);
00177 if (centry < 0) return centry;
00178 if (!fChain->InheritsFrom(TChain::Class())) return centry;
00179 TChain *chain = (TChain*)fChain;
00180 if (chain->GetTreeNumber() != fCurrent) {
00181 fCurrent = chain->GetTreeNumber();
00182 Notify();
00183 }
00184 return centry;
00185 }
00186
00187 void mollerClass::Init(TTree *tree)
00188 {
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198 if (!tree) return;
00199 fChain = tree;
00200 fCurrent = -1;
00201 fChain->SetMakeClass(1);
00202
00203 fChain->SetBranchAddress("ion", &ion, &b_ion);
00204 fChain->SetBranchAddress("x", &x, &b_x);
00205 fChain->SetBranchAddress("y", &y, &b_y);
00206 fChain->SetBranchAddress("z", &z, &b_z);
00207 fChain->SetBranchAddress("x0", &x0, &b_x0);
00208 fChain->SetBranchAddress("y0", &y0, &b_y0);
00209 fChain->SetBranchAddress("z0", &z0, &b_z0);
00210 fChain->SetBranchAddress("kineE", &kineE, &b_kineE);
00211 fChain->SetBranchAddress("px", &px, &b_px);
00212 fChain->SetBranchAddress("py", &py, &b_py);
00213 fChain->SetBranchAddress("pz", &pz, &b_pz);
00214 fChain->SetBranchAddress("kineE0", &kineE0, &b_kineE0);
00215 fChain->SetBranchAddress("px0", &px0, &b_px0);
00216 fChain->SetBranchAddress("py0", &py0, &b_py0);
00217 fChain->SetBranchAddress("pz0", &pz0, &b_pz0);
00218 fChain->SetBranchAddress("kineE1", &kineE1, &b_kineE1);
00219 fChain->SetBranchAddress("px1", &px1, &b_px1);
00220 fChain->SetBranchAddress("py1", &py1, &b_py1);
00221 fChain->SetBranchAddress("pz1", &pz1, &b_pz1);
00222 fChain->SetBranchAddress("kineE2", &kineE2, &b_kineE2);
00223 fChain->SetBranchAddress("px2", &px2, &b_px2);
00224 fChain->SetBranchAddress("py2", &py2, &b_py2);
00225 fChain->SetBranchAddress("pz2", &pz2, &b_pz2);
00226 fChain->SetBranchAddress("type", &type, &b_type);
00227 fChain->SetBranchAddress("volume", &volume, &b_volume);
00228 fChain->SetBranchAddress("theta0", &theta0, &b_theta0);
00229 fChain->SetBranchAddress("theta1", &theta1, &b_theta1);
00230 fChain->SetBranchAddress("theta2", &theta2, &b_theta2);
00231 fChain->SetBranchAddress("ev_num", &ev_num, &b_ev_num);
00232 fChain->SetBranchAddress("process", &process, &b_process);
00233 fChain->SetBranchAddress("event", &event, &b_event);
00234 fChain->SetBranchAddress("creator", &creator, &b_creator);
00235 fChain->SetBranchAddress("hit", &hit, &b_hit);
00236 fChain->SetBranchAddress("kineE_org", &kineE_org, &b_kineE_org);
00237 fChain->SetBranchAddress("theta_org", &theta_org, &b_theta_org);
00238 fChain->SetBranchAddress("track", &track, &b_track);
00239 fChain->SetBranchAddress("diffXS", &diffXS, &b_diffXS);
00240 fChain->SetBranchAddress("totXS", &totXS, &b_totXS);
00241 fChain->SetBranchAddress("rate", &rate, &b_rate);
00242 Notify();
00243 }
00244
00245 Bool_t mollerClass::Notify()
00246 {
00247
00248
00249
00250
00251
00252
00253 return kTRUE;
00254 }
00255
00256 void mollerClass::Show(Long64_t entry)
00257 {
00258
00259
00260 if (!fChain) return;
00261 fChain->Show(entry);
00262 }
00263 Int_t mollerClass::Cut(Long64_t entry)
00264 {
00265
00266
00267
00268 return 1;
00269 }
00270 #endif // #ifdef mollerClass_cxx