Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

SFHMarEvent.C

Go to the documentation of this file.
00001 #include "SFHMarana/SFHMarEvent.h"
00002 #include "SFHMarana/UserTreeParts.h"
00003 #include "SFHMarana/Funs.h"
00004 #include "Marana/TMarBody.h"
00005 #include "jbltools/sfh/NTFloatFun.h"
00006 #include "jbltools/sfh/FloatFun.h"
00007 #include "jbltools/sfh/NTIntFun.h"
00008 #include "jbltools/sfh/FillIterators.h"
00009 #include "jbltools/sfh/h1/H1Funs.h"
00010 
00011 //#include "jbltools/sfh/h1/H1ModsVariables.h"
00012 #include "jbltools/sfh/h1/H1ModsJPsis.h"
00013 #include "jbltools/sfh/h1/H1ModsEms.h"
00014 #include "jbltools/sfh/h1/H1ModsMuons.h"
00015 #include "jbltools/sfh/h1/H1ModsJets.h"
00016 #include "jbltools/sfh/h1/H1ModsSelTracks.h"
00017 #include "jbltools/sfh/h1/H1ModsMCs.h"
00018 
00019 #include "jbltools/sfh/VectorIterator.h"
00020 #include "H1Mods/H1PartJPsi.h"
00021 #include "H1Mods/H1PartJPsiArrayPtr.h"
00022 
00023 template<class H1SomeArrayPtr>
00024 static void generateObjects (JBLH1SomeArrayIterator<H1SomeArrayPtr>& particles) {
00025   particles.GetP();
00026   particles.GetPt();
00027   particles.GetPz();
00028   particles.GetE();
00029   particles.GetPhi();
00030   particles.GetTheta();
00031   particles.GetMass();
00032   particles.GetCharge();
00033 }
00034 
00035 static void generateObjects (VectorIterator<TMarBody>& particles) {
00036   particles.Float (&TMarBody::GetE, "E");
00037   particles.Float (&TMarBody::GetPt, "Pt");
00038   particles.Float (&TMarBody::GetEta, "Eta");
00039   particles.Float (&TMarBody::GetTheta, "Theta");
00040   particles.Float (&TMarBody::GetPhi, "Phi");
00041   particles.Float (&TMarBody::GetP, "P");
00042   particles.Float (&TMarBody::GetPx, "Px");
00043   particles.Float (&TMarBody::GetPy, "Py");
00044   particles.Float (&TMarBody::GetPz, "Pz");
00045 }
00046 
00047 // static void generateJpsi (JBLH1SomeArrayIterator<H1PartJPsiArrayPtr>& jpsi) {
00048 //   jpsi.IsElastic();
00049 //   jpsi.IsTrackTrack();
00050 //   jpsi.IsCosmic();
00051 // //   jpsi.();
00052 // //   jpsi.();
00053 // //   jpsi.();
00054 // //   jpsi.();
00055 // //   jpsi.();
00056 // }
00057 
00058 SFHMarEvent::SFHMarEvent(const TRun *run) 
00059 : TMarEvent (run),
00060 //... which particles to define 
00061   fffind_ElePho(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::find_ElePho, "find_ElePho")),
00062   fffind_Muon(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::find_Muon, "find_Muon")),
00063   fffind_Jet(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::find_Jet, "find_Jet")),
00064   fffind_NP(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::find_NP, "find_NP")),
00065 
00066   ffGenVtxZ(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::GenVtxZ, "GenVtxZ")),
00067   ffyhgen(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::yhgen, "yhgen")),
00068   ffGenRad(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::GenRad, "GenRad")),
00069   
00070 //... type of systematic to apply (see TMarSyst)
00071   ffSyst_Type(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Syst_Type, "Syst_Type")),
00072   ffSyst_Num(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Syst_Num, "Syst_Num")),
00073   ffSyst_Sign(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Syst_Sign, "Syst_Sign")),
00074 
00075 //... lumi object 
00076   ffpolar(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::polar, "polar")),
00077   
00078 //... general quantities 
00079   ffVertex_x(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Vertex, "Vertex_x", 0)),
00080   ffVertex_y(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Vertex, "Vertex_y", 1)),
00081   ffVertex_z(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Vertex, "Vertex_z", 2)),
00082   ffEpz(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Epz, "Epz")),
00083   ffPtmiss(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Ptmiss, "Ptmiss")),
00084   ffEt(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Et, "Et")),
00085   ffIndexElScat(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::IndexElScat, "IndexElScat")),
00086   ffPte(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Pte, "Pte")),
00087   ffEe(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Ee, "Ee")),
00088   ffPze(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Pze, "Pze")),
00089   ffThe(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::The, "The")),
00090   ffPhe(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Phe, "Phe")),
00091   ffQ2e(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Q2e, "Q2e")),
00092   ffye(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ye, "ye")),
00093   ffxe(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::xe, "xe")),
00094 
00095 //... hfs quantities  
00096   // energy sums in LAr + Spacal
00097   ffEtotCalo(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::EtotCalo, "EtotCalo")),
00098   // Pt of all hadronic final state
00099   ffPth(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Pth, "Pth")),
00100   ffThh(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Thh, "Thh")),
00101   ffPhh(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Phh, "Phh")),
00102   ffEh(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Eh, "Eh")),
00103   ffPzh(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Pzh, "Pzh")),
00104   ffQ2h(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Q2h, "Q2h")),
00105   ffyh(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::yh, "yh")),
00106   ffxh(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::xh, "xh")),
00107   ffGammah(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Gammah, "Gammah")),
00108 
00109 //... Calorimeter quantities ....
00110   ffptIronfrac(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ptIronfrac, "ptIronfrac")),
00111   ffEIronfrac(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::EIronfrac, "EIronfrac")),
00112   ffptSpacalfrac(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ptSpacalfrac, "ptSpacalfrac")),
00113   ffESpacalfrac(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ESpacalfrac, "ESpacalfrac")),
00114 
00115 //... Kinematic variables (recalculated from all Particles candidate on Mods)
00116   //da method
00117   ffPtda(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Ptda, "Ptda")),
00118   ffQ2da(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Q2da, "Q2da")),
00119   ffyda(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::yda, "yda")),
00120   ffxda(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::xda, "xda")),
00121   ffEda(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Eda, "Eda")),
00122   //sigma method
00123   ffPts(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Pts, "Pts")),
00124   ffQ2s(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Q2s, "Q2s")),
00125   ffys(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ys, "ys")),
00126   ffxs(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::xs, "xs")),
00127   //electron-sigma method
00128   ffQ2es(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Q2es, "Q2es")),
00129   ffxes(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::xes, "xes")),
00130   ffyes(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::yes, "yes")),
00131   
00132 //... Timing variables
00133   fftCJC(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::tCJC, "tCJC")),
00134   fftLAr(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::tLAr, "tLAr")),
00135 
00136 //... Weigths to apply to events
00137   ffMCWeight(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::MCWeight, "MCWeight")),
00138   ffLumiWeight(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::LumiWeight, "LumiWeight")),
00139   fffTriggerWeight(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::fTriggerWeight, "fTriggerWeight")),
00140   fffQCDWeight(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::fQCDWeight, "fQCDWeight")),
00141 
00142 //... Vap/Vp calculation
00143   ffVparl(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Vparl, "Vparl")),
00144   ffVanti(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Vanti, "Vanti")),
00145 
00146 //... cuts for the definition of selected particles (TMarBody)
00147 //...Cuts for electron definition  
00148   ffPtMinEle(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::PtMinEle, "PtMinEle")),
00149   ffThetaMinEle(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMinEle, "ThetaMinEle")),
00150   ffThetaMaxEle(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMaxEle, "ThetaMaxEle")),
00151   ffConeEle(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ConeEle, "ConeEle")),
00152 
00153 //...Cuts for muon definition 
00154   ffPtMinMu(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::PtMinMu, "PtMinMu")),
00155   ffThetaMinMu(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMinMu, "ThetaMinMu")),
00156   ffThetaMaxMu(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMaxMu, "ThetaMaxMu")),
00157   ffDTrTrMinMu(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::DTrTrMinMu, "DTrTrMinMu")),
00158 
00159 //...Cuts for jets definition 
00160   ffPtMinJet(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::PtMinJet, "PtMinJet")),
00161   ffThetaMinJet(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMinJet, "ThetaMinJet")),
00162   ffThetaMaxJet(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMaxJet, "ThetaMaxJet")),
00163   ffRMinJet(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::RMinJet, "RMinJet")),
00164   ffEmFracJet(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::EmFracJet, "EmFracJet")),
00165 
00166 //...Cuts for Neutral particle definition 
00167   ffPtMinNp(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::PtMinNp, "PtMinNp")),
00168   ffThetaMinNp(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMinNp, "ThetaMinNp")),
00169   ffThetaMaxNp(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::ThetaMaxNp, "ThetaMaxNp")),
00170 
00171 // .... MY stuff
00172   ffNSelJets (*new NSelJetsFun(jet,"NSelJets")),    // jet is a TClonesArray* containing the selected jets 
00173   ffPtSelJet1 (*new PtSelJet1Fun(jet,"PtSelJet1")),    // jet is a TClonesArray* containing the selected jets 
00174   ffThSelJet1 (*new ThSelJet1Fun(jet,"ThSelJet1")),    // jet is a TClonesArray* containing the selected jets 
00175   bcTimingOK (*new TimimgCut(this,"TimingOK"))    
00176 
00177 
00178 //  ff(ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::, "")),
00179 
00180 {
00181   cout << "SFHMarEvent::SFHMarEvent: starting" << endl;
00182   
00183 //--- pointer to Mods Particles 
00184 //     THIS ACCESSES DIRECTLY MODS - NOT the TMarEvent copies!!!!
00185   cout << "SFHMarEvent::SFHMarEvent: generating Jpsi stuff" << endl;
00186   generateObjects (mods_JPsis);
00187 //   generateJpsi (mods_JPsis);
00188   generateObjects (mods_Ems);
00189   generateObjects (mods_Muons);
00190   //generateObjects (ModsPartHFS);
00191   generateObjects (mods_KtJets);
00192   generateObjects (mods_SelTracks);
00193   generateObjects (mods_MCs);
00194   
00195 //... Access user tree
00196 //  generateObjects (user_GenKtJets);
00197 //  generateObjects (user_DTRATracks);
00198 //  generateObjects (user_DTNVTracks);
00199 
00200   //... Triggers arrays
00201   cout << "SFHMarEvent::SFHMarEvent: generating trigger stuff" << endl;
00202   for (int i = 0; i < 128; ++i) {
00203     ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Il1ac, "Il1ac", i);
00204     ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Il1rw, "Il1rw", i);
00205   }
00206   for (int i = 0; i < 192; ++i) {
00207     ntfloatfun (static_cast<TMarEvent&>(*this), &TMarEvent::Il1te, "Il1te", i);
00208   }
00209   
00210   RangeIterator *trigIt = new RangeIterator (0, 127); // name is "0...127"
00211   FloatFun &ffTrigIt = trigIt->Float();
00212   ffTrigIt.setName("ff_iter128");
00213   ntintfun (static_cast<TMarEvent&>(*this), &TMarEvent::Il1ac, "l1rw_128", *trigIt);
00214   ntintfun (static_cast<TMarEvent&>(*this), &TMarEvent::Il1rw, "l1ac_128", *trigIt);
00215   //ntintfun (static_cast<TMarEvent&>(*this), &TMarEvent::Il4ve, "l4ve", *trigIt);
00216   
00217   
00218   cout << "SFHMarEvent::SFHMarEvent: creating PartCalEm" << endl;
00219   VectorIterator<TMarBody>& PartCalEm_it = *new VectorIterator<TMarBody> (PartCalEm, "PartCalEm");
00220   generateObjects (PartCalEm_it);
00221   
00222   VectorIterator<TMarBody>& PartCalMuon_it = *new VectorIterator<TMarBody> (PartCalMuon, "PartCalMuon");
00223   generateObjects (PartCalMuon_it);
00224   
00225   VectorIterator<TMarBody>& PartCalJet_it = *new VectorIterator<TMarBody> (PartCalJet, "PartCalJet");
00226   generateObjects (PartCalJet_it);
00227   
00228 //   VectorIterator<TMarBody>& PartEm_it = *new VectorIterator<TMarBody> (PartEm, "PartEm");
00229 //   generateObjects (PartEm_it);
00230 //   
00231 //   VectorIterator<TMarBody>& PartMuon_it = *new VectorIterator<TMarBody> (PartMuon, "PartMuon");
00232 //   generateObjects (PartMuon_it);
00233 //   
00234 //   VectorIterator<TMarBody>& PartJet_it = *new VectorIterator<TMarBody> (PartJet, "PartJet");
00235 //   generateObjects (PartJet_it);
00236   
00237 
00238   cout << "SFHMarEvent::SFHMarEvent:\n";
00239   NamedO::listObjects (std::cout);
00240   
00241 }   
00242 SFHMarEvent::~SFHMarEvent() {}

Generated on Thu Jul 28 11:48:52 2005 for SFHMarana by doxygen 1.3.2