00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef __TMAREVENT
00012 #define __TMAREVENT
00013
00014 #include <string>
00015 #include <vector>
00016
00017
00018 #include <TTree.h>
00019 #include <TBenchmark.h>
00020 #include <TLorentzVector.h>
00021
00022
00023
00024
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
00040
00041
00042 #include "H1OOBanks/H1BankPtr.h"
00043
00044
00045
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
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
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
00083 #define MYR2D 180.0/3.14159265359
00084
00085 class TMarEvent : public TTools
00086 {
00088
00090 public :
00091
00092
00093 Bool_t find_ElePho;
00094 Bool_t find_Muon;
00095 Bool_t find_Jet;
00096 Bool_t find_NP;
00097
00098
00099
00100
00101 H1PartCandArrayPtr ModsPartCand;
00102 H1PartEmArrayPtr ModsPartEm;
00103 H1PartMuonArrayPtr ModsPartMuon;
00104 H1ExclHfsIterator ModsPartHFS;
00105 H1PartJetArrayPtr ModsPartJet;
00106 H1PartSelTrackArrayPtr ModsPartSelTrack;
00107 H1PartMCArrayPtr ModsPartMC;
00108
00109
00110 H1PartJetArrayPtr ModsGenKtJets;
00111 H1PartSelTrackArrayPtr ModsDTRATracks;
00112 H1PartSelTrackArrayPtr ModsDTNVTracks;
00113
00114
00115
00116 vector<TMarBody> PartCalEm;
00117 vector<TMarBody> PartCalMuon;
00118 vector<TMarBody> PartCalJet;
00119 TLorentzVector HadCalJetVec;
00120 TLorentzVector HadCalNoJetVec;
00121
00122
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
00132
00133 TClonesArray *electron;
00134 TClonesArray *photon;
00135 TClonesArray *muon;
00136 TClonesArray *jet;
00137 TClonesArray *np;
00138
00139
00140
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;
00152
00153
00154 list<TMarCutMCList> genCut;
00155
00156
00157 Int_t Syst_Type;
00158 Short_t Syst_Num;
00159 Short_t Syst_Sign;
00160
00161
00162 H1JetCalibration* JetCalib;
00163
00164 H1HfsCalibEmHad* HfsCalib;
00165
00166 TMarH1ElecCalibration* ElecCalib;
00167 H1ElecCalibration* H1ElecCalib;
00168
00169
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
00176 TMarLumi* lumi;
00177 Double_t polar;
00178
00179
00180 Double_t Vertex[3];
00181 Double_t Epz;
00182 Double_t Ptmiss;
00183 Double_t Et;
00184
00185
00186
00187 Int_t IndexElScat;
00188 Double_t Pte;
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
00199 Double_t EtotCalo;
00200
00201 Double_t Pth;
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
00212 Double_t ptIronfrac;
00213 Double_t EIronfrac;
00214 Double_t ptSpacalfrac;
00215 Double_t ESpacalfrac;
00216
00217
00218
00219 Double_t Ptda;
00220 Double_t Q2da;
00221 Double_t yda;
00222 Double_t xda;
00223 Double_t Eda;
00224
00225 Double_t Pts;
00226 Double_t Q2s;
00227 Double_t ys;
00228 Double_t xs;
00229
00230 Double_t Q2es;
00231 Double_t xes;
00232 Double_t yes;
00233
00234
00235
00236 Double_t tCJC;
00237 Double_t tLAr;
00238
00239
00240 Double_t MCWeight;
00241 Double_t LumiWeight;
00242 Double_t fTriggerWeight;
00243 Double_t fQCDWeight;
00244
00245
00246 Float_t Vparl;
00247 Float_t Vanti;
00248
00249
00250 Byte_t Il1ac[128];
00251 Byte_t Il1rw[128];
00252 Byte_t Il1te[192];
00253
00254
00255
00256
00257 Float_t PtMinEle;
00258 Float_t ThetaMinEle;
00259 Float_t ThetaMaxEle;
00260 Float_t ConeEle;
00261
00262
00263 Float_t PtMinMu;
00264 Float_t ThetaMinMu;
00265 Float_t ThetaMaxMu;
00266 Float_t DTrTrMinMu;
00267
00268
00269 Float_t PtMinJet;
00270 Float_t ThetaMinJet;
00271 Float_t ThetaMaxJet;
00272 Float_t RMinJet;
00273 Float_t EmFracJet;
00274
00275
00276 Float_t PtMinNp;
00277 Float_t ThetaMinNp;
00278 Float_t ThetaMaxNp;
00279
00280
00281
00282 list<string> RejectReason;
00283
00284
00285 TTriggerReweight* fTrigReweight;
00286
00287
00288 TMCXSectionReweight* fMCReweight;
00289
00290
00291 virtual void Clear(void);
00292 virtual void ClearSelectedParticles(void);
00293
00294
00295
00296 virtual void DefineInputParticles();
00297
00298
00299 virtual void ApplySystematicShifts(TMarSyst &);
00300
00301
00302 virtual void CalculateDerivedVariables();
00303
00304
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
00311 virtual Bool_t Init();
00312
00313
00314 virtual Bool_t Next(TRunHisto& run);
00315
00316
00317 virtual Int_t FindElePho();
00318
00319
00320 virtual Int_t FindMuon();
00321
00322
00323 virtual Int_t FindNP();
00324
00325
00326 virtual Int_t FindJet();
00327
00328
00329 virtual void FindGeneratedParticles();
00330
00331
00332
00333 virtual void ApplyHfsCalibration();
00334 virtual void ApplyLowQ2HfsCalibration();
00335
00336
00337 virtual void SelectParticles();
00338
00339
00340 void GetPthEhTracksClusters(double&,double&,double&,double&);
00341
00342
00343
00344 virtual void PrintEventInfo();
00345
00346
00347
00348 Float_t MinDisttoJets(Float_t Theta,Float_t Phi);
00349 Float_t MinDisttoTracks(Float_t Theta,Float_t Phi);
00350
00351
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
00359 virtual Float_t ApplyCCBackgroundCuts();
00360
00361
00362
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
00370 virtual void ApplyMCXSectionReweight();
00371
00372
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
00377 void SortPt(TClonesArray *list);
00378
00379
00380 TMarEvent(const TRun *run);
00381 virtual ~TMarEvent();
00382
00383
00384
00385 };
00386
00387 #endif
00388