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

TMarEvent.h

Go to the documentation of this file.
00001 
00002 // Class TMarEvent
00003 //
00004 // Author     : Emmanuel Sauvan/Matti Peez/F. Cassol Brunner
00005 // Created    : 02/2002
00006 // Last update: $Date: 2005/06/30 17:08:00 $
00007 //          by: $Author: sauvan $
00008 // Comment: Contains definition of event class
00010 
00011 #ifndef __TMAREVENT
00012 #define __TMAREVENT
00013 
00014 #include <string>
00015 #include <vector>
00016 
00017 // Include ROOT libs
00018 #include <TTree.h>
00019 #include <TBenchmark.h>
00020 #include <TLorentzVector.h>
00021 
00022 
00023 //------ H1 OO includes ------------
00024 // Access general oo objects
00025 #include "H1Skeleton/H1Tree.h"
00026 #include "H1Skeleton/H1EventList.h"
00027 #include "H1Skeleton/H1PointerManager.h"
00028 #include "H1Pointers/H1ObjectPtr.h"
00029 #include "H1Pointers/H1FloatPtr.h"
00030 #include "H1Pointers/H1IntPtr.h"
00031 #include "H1Pointers/H1BytePtr.h"
00032 #include "H1JetCalibration/H1JetCalibration.h"
00033 #include "H1HfsCalibration/H1HfsCalibEmHad.h"
00034 #include "Marana/TMarH1ElecCalibration.h" 
00035 #include "Marana/TTriggerReweight.h"
00036 #include "Marana/TMCXSectionReweight.h"
00037 #include "H1ElecCalibration/H1ElecCalibration.h"
00038 
00039 // Access ODS
00040   
00041 
00042 #include "H1OOBanks/H1BankPtr.h"
00043 
00044 
00045 // Access mods
00046 #include "H1Mods/H1PartCand.h"
00047 #include "H1Mods/H1PartCandArrayPtr.h"
00048 #include "H1Mods/H1PartEmArrayPtr.h"
00049 #include "H1Mods/H1PartEm.h"
00050 #include "H1Mods/H1PartMuonArrayPtr.h"
00051 #include "H1Mods/H1PartMuon.h"
00052 #include "H1Mods/H1PartJetArrayPtr.h"
00053 #include "H1Mods/H1PartJet.h"
00054 #include "H1Mods/H1PartSelTrackArrayPtr.h"
00055 #include "H1Mods/H1PartSelTrack.h"
00056 #include "H1Mods/H1PartCandArrayPtr.h"
00057 #include "H1Mods/H1PartCand.h"
00058 
00059 
00060 #include "H1Mods/H1ExclHfsIterator.h"
00061 #include "H1Mods/H1PartMCArrayPtr.h"
00062 #include "H1Mods/H1PartMC.h"
00063 
00064 
00065 // Access tracks
00066 #include "H1Tracks/H1VertexFittedTrack.h"
00067 #include "H1Tracks/H1Vertex.h"
00068 #include "H1Tracks/H1Track.h"
00069 #include "H1Tracks/H1ReconstructedVertex.h"
00070 #include "H1Steering/h1debug.h"
00071 
00072 // Include Body definition
00073 #include "Marana/TMarBody.h"
00074 
00075 
00076 #include "Marana/TTools.h"
00077 #include "Marana/TMarLumi.h"
00078 #include "Marana/TRunHisto.h"
00079 #include "Marana/TMarCutMC.h"
00080 #include "Marana/TMarSyst.h" 
00081 
00082 // Rad => Deg 
00083 #define MYR2D 180.0/3.14159265359
00084 
00085 class TMarEvent :  public TTools
00086 {
00088 //     class for useful event variables 
00090 public :
00091 
00092 //... which particles to define 
00093   Bool_t find_ElePho;
00094   Bool_t find_Muon;
00095   Bool_t find_Jet;
00096   Bool_t find_NP;
00097 
00098 
00099 
00100 //--- pointer to Mods Particles
00101   H1PartCandArrayPtr ModsPartCand; 
00102   H1PartEmArrayPtr   ModsPartEm;
00103   H1PartMuonArrayPtr ModsPartMuon;
00104   H1ExclHfsIterator ModsPartHFS;
00105   H1PartJetArrayPtr  ModsPartJet;
00106   H1PartSelTrackArrayPtr ModsPartSelTrack;
00107   H1PartMCArrayPtr ModsPartMC;
00108 
00109 //... Access user tree
00110   H1PartJetArrayPtr ModsGenKtJets;
00111   H1PartSelTrackArrayPtr ModsDTRATracks;
00112   H1PartSelTrackArrayPtr ModsDTNVTracks;
00113 
00114 //...mods particles after calibrations
00115 
00116   vector<TMarBody> PartCalEm;
00117   vector<TMarBody> PartCalMuon;
00118   vector<TMarBody> PartCalJet;
00119   TLorentzVector HadCalJetVec;  
00120   TLorentzVector HadCalNoJetVec;
00121 
00122 //...mods particles after calibrations and systematics
00123   vector<TMarBody>  PartScaled[3];
00124   vector<TMarBody>* PartEm;
00125   vector<TMarBody>* PartMuon;
00126   vector<TMarBody>* PartJet;
00127   TLorentzVector HadNoJetVec;
00128   TLorentzVector HadJetVec;
00129   TLorentzVector TotalVec;
00130 
00131 //...List of selected particles
00132 
00133   TClonesArray *electron;
00134   TClonesArray *photon;
00135   TClonesArray *muon;
00136   TClonesArray *jet;
00137   TClonesArray *np;
00138 
00139 
00140 //... List of generated particles
00141   TClonesArray *GenElectron;
00142   TClonesArray *GenPhoton;
00143   TClonesArray *GenMuon;
00144   TClonesArray *GenTau;
00145   TClonesArray *GenNp;
00146   TClonesArray *GenHfs;
00147   TLorentzVector GenScatEle;
00148 
00149   Float_t GenVtxZ;
00150   Double_t yhgen;
00151   Short_t  GenRad; // flag pour les photons rad
00152  
00153 //... to cut MC on generated quantities
00154   list<TMarCutMCList> genCut;
00155 
00156 //... type of systematic to apply (see TMarSyst)
00157   Int_t Syst_Type;
00158   Short_t Syst_Num;
00159   Short_t Syst_Sign;
00160  
00161 //... class for the calibration of jets 
00162   H1JetCalibration* JetCalib;
00163 //... class for the calibration of hfs (low Q2, h1oo test module) 
00164   H1HfsCalibEmHad* HfsCalib;
00165 //... class for the calibration of electrons 
00166   TMarH1ElecCalibration* ElecCalib;
00167   H1ElecCalibration* H1ElecCalib;
00168   
00169 //... Type and year of data
00170   
00171   enum Type {Data=0,  NC_Djo, NC_Rap, CC_Djo, EE_Grape,  MM_Grape,
00172               TT_Grape, EG_Wabgen, GP_Pythia, W_Epvec, QCD_Ins, Htm, Anotop, PsCC, POUDS, RAPD_UDS, UNKNOWN } RunType;
00173   enum Year {Y9497 = 3, Y9899 = 4 , Y9900 = 5, Y0203 = 6, Y0304 = 7, Y05 = 8} RunYear;
00174   
00175 //... lumi object 
00176   TMarLumi* lumi;    
00177   Double_t polar;
00178   
00179 //... general quantities 
00180   Double_t Vertex[3]; 
00181   Double_t Epz;         //total E-Pz    
00182   Double_t Ptmiss;      //total Ptmiss
00183   Double_t Et;
00184 
00185 //... scattered electron
00186 
00187   Int_t IndexElScat;  //scattered electron =higest Pt electron if filled from MODS 
00188   Double_t Pte;   // == caracteristics of scattered electron, independant of TMARBody electronR
00189   Double_t Ee;
00190   Double_t Pze;
00191   Double_t The;
00192   Double_t Phe;
00193   Double_t Q2e;
00194   Double_t ye;
00195   Double_t xe;
00196   
00197 
00198 //... hfs quantities  
00199   Double_t EtotCalo;  // energy sums in LAr + Spacal
00200 
00201   Double_t Pth;    // Pt of all hadronic final state
00202   Double_t Thh;
00203   Double_t Phh; 
00204   Double_t Eh;
00205   Double_t Pzh;
00206   Double_t Q2h;
00207   Double_t yh;
00208   Double_t xh;
00209   Double_t Gammah;
00210 
00211 //... Calorimeter quantities ....
00212   Double_t ptIronfrac;
00213   Double_t EIronfrac;
00214   Double_t ptSpacalfrac;
00215   Double_t ESpacalfrac;
00216 
00217 
00218 //... Kinematic variables (recalculated from all Particles candidate on Mods)
00219   Double_t Ptda;  //da method
00220   Double_t Q2da;
00221   Double_t yda;
00222   Double_t xda;
00223   Double_t Eda;
00224 
00225   Double_t Pts;  //sigma method
00226   Double_t Q2s;
00227   Double_t ys;
00228   Double_t xs;
00229 
00230   Double_t Q2es;  //electron-sigma method
00231   Double_t xes;
00232   Double_t yes;
00233 
00234 
00235 //... Timing variables
00236   Double_t tCJC;  // timing CJC  
00237   Double_t tLAr;  // timing tLAr
00238 
00239 //... Weigths to apply to events
00240   Double_t MCWeight; // total MC Weight
00241   Double_t LumiWeight; // Weight to sum MC
00242   Double_t fTriggerWeight; // Weight from triggers
00243   Double_t fQCDWeight; // Weight from QCD (pdf's) or LO->NLO MC reweigthing
00244 
00245 //... Vap/Vp calculation
00246   Float_t Vparl;
00247   Float_t Vanti;
00248 
00249 //... Triggers arrays
00250   Byte_t Il1ac[128]; // array of 128 l1 actual subtrigger numbers
00251   Byte_t Il1rw[128]; // array of 128 l1 raw subtrigger numbers
00252   Byte_t Il1te[192]; // array of 192 l1 trigger elements
00253 
00254 
00255 //... cuts for the definition of selected particles (TMarBody)
00256 //...Cuts for electron definition  
00257   Float_t PtMinEle;
00258   Float_t ThetaMinEle;  
00259   Float_t ThetaMaxEle;  
00260   Float_t ConeEle;
00261 
00262 //...Cuts for muon definition 
00263   Float_t PtMinMu;
00264   Float_t ThetaMinMu;  
00265   Float_t ThetaMaxMu;  
00266   Float_t DTrTrMinMu;
00267 
00268 //...Cuts for jets definition 
00269   Float_t PtMinJet;
00270   Float_t ThetaMinJet;  
00271   Float_t ThetaMaxJet;
00272   Float_t RMinJet;
00273   Float_t EmFracJet;
00274 
00275 //...Cuts for Neutral particle definition 
00276   Float_t PtMinNp;
00277   Float_t ThetaMinNp;  
00278   Float_t ThetaMaxNp;
00279 
00280 
00281 //... Rejection handler: 
00282    list<string> RejectReason;
00283 
00284 //... Trigger efficiencies class
00285   TTriggerReweight* fTrigReweight;
00286   
00287 //... MC reweight class
00288   TMCXSectionReweight* fMCReweight;  
00289 
00290 //... Clear up lists
00291   virtual void Clear(void);
00292   virtual void ClearSelectedParticles(void);
00293 
00294 
00295 //... Calibrate/copy mods particles
00296   virtual void DefineInputParticles();
00297 
00298 //... Apply the systematic shifts 
00299   virtual void ApplySystematicShifts(TMarSyst &);
00300 
00301 //... Calculate all Derived Variables after caliabration ans scaling
00302   virtual void CalculateDerivedVariables();
00303 
00304 //... Fill event information
00305   virtual Bool_t FillFromMods(){return kTRUE;};
00306   virtual Bool_t FillFromHat();
00307   virtual Bool_t FillGeneratedParticlesAndCut();
00308   virtual Bool_t MCGenSelection(TMarCutMCList& List);
00309 
00310 //... initialize the event
00311   virtual Bool_t Init();  
00312 
00313 //... next event 
00314   virtual Bool_t Next(TRunHisto& run);  
00315 
00316 //... Find ele/pho 
00317   virtual Int_t FindElePho();
00318 
00319 //... Find muon
00320   virtual Int_t FindMuon();
00321  
00322 //... Find np
00323   virtual Int_t FindNP();
00324 
00325 //... Find jet
00326   virtual Int_t FindJet();
00327 
00328 //... retrieve generated particles
00329   virtual void FindGeneratedParticles();
00330 
00331 
00332 //... apply hfs calibrations
00333   virtual void ApplyHfsCalibration();
00334  virtual void ApplyLowQ2HfsCalibration();
00335  
00336 //...select particles
00337   virtual void SelectParticles();
00338 
00339 //... return Cluster/Tracks Pth and Eh
00340   void GetPthEhTracksClusters(double&,double&,double&,double&);
00341 
00342 
00343 //... print event informations
00344   virtual void PrintEventInfo();
00345 
00346 
00347 //... Calulate min distance to jets
00348   Float_t MinDisttoJets(Float_t Theta,Float_t Phi);
00349   Float_t MinDisttoTracks(Float_t Theta,Float_t Phi);
00350 
00351 //... matching tracks-clusters
00352   Float_t CalcDistTracks(H1PartSelTrackArrayPtr Tracks,const H1PartEm* EMParticle);
00353   Float_t CalcDistDTNV(const H1PartEm* EMParticle);
00354   void CalcDCA(TVector3 ClusStart, TVector3 TrackEnd,
00355         Float_t Theta, Float_t Phi,Float_t &Dca,Float_t &Alpha,Float_t &Dlon) const;
00356 
00357 
00358 //... Some anti-background cut for CC
00359   virtual Float_t ApplyCCBackgroundCuts();
00360 
00361 
00362 //... Functions for trigger efficiency
00363   virtual Float_t CCTriggerEfficiency();
00364   virtual Float_t JJTriggerEfficiency();
00365   virtual Float_t MuTriggerEfficiency();
00366   virtual Float_t CCAndLeptonTriggerEfficiency();
00367   virtual void ApplyTriggerEfficiencies();
00368   
00369 //... for MC xsection reweighting
00370   virtual void ApplyMCXSectionReweight();
00371 
00372 //... Add particle to list of preselected bodies
00373   Int_t AddParticleToList(TClonesArray *List,Int_t IndexCand,Int_t ID,Float_t E,Float_t Pt,Float_t Eta,Float_t Phi);
00374   Int_t AddParticleToList(TClonesArray *List,TMarBody *body);
00375 
00376 //...sort particle list in Pt
00377   void SortPt(TClonesArray *list);
00378 
00379 //... Standard constructor and destructor
00380    TMarEvent(const TRun *run);
00381   virtual ~TMarEvent();
00382 
00383 //  ClassDef(TMarEvent,1) // Make class known to root 
00384 
00385 };
00386 
00387 #endif
00388 

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