ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonIDMod.h
Revision: 1.24
Committed: Sun Dec 11 00:03:04 2011 UTC (13 years, 4 months ago) by bendavid
Content type: text/plain
Branch: MAIN
Changes since 1.23: +2 -1 lines
Log Message:
more photon updates for mva plus id analysis

File Contents

# User Rev Content
1 sixie 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.24 // $Id: PhotonIDMod.h,v 1.23 2011/10/18 11:27:19 fabstoec Exp $
3 sixie 1.1 //
4     // PhotonIDMod
5     //
6     // This module applies photon identification criteria and exports a pointer to a collection
7     // of "good photons" according to the specified identification scheme.
8     //
9     // Authors: S.Xie, C.Loizides
10     //--------------------------------------------------------------------------------------------------
11    
12     #ifndef MITPHYSICS_MODS_PHOTONIDMOD_H
13     #define MITPHYSICS_MODS_PHOTONIDMOD_H
14    
15     #include "MitAna/TreeMod/interface/BaseMod.h"
16 loizides 1.10 #include "MitAna/DataTree/interface/PhotonFwd.h"
17 fabstoec 1.15 #include "MitAna/DataTree/interface/TrackCol.h"
18     #include "MitAna/DataTree/interface/BeamSpotCol.h"
19     #include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
20 bendavid 1.16 #include "MitAna/DataTree/interface/DecayParticleCol.h"
21     #include "MitAna/DataTree/interface/ElectronCol.h"
22 fabstoec 1.20 #include "MitAna/DataTree/interface/VertexCol.h"
23 bendavid 1.22 #include "MitAna/DataTree/interface/DecayParticleCol.h"
24     #include "MitAna/DataTree/interface/PileupInfoCol.h"
25     #include "MitAna/DataTree/interface/MCParticleCol.h"
26 sixie 1.1
27 fabstoec 1.23 #include "MitPhysics/Utils/interface/MVATools.h"
28    
29 sixie 1.1 namespace mithep
30     {
31     class PhotonIDMod : public BaseMod
32     {
33     public:
34     PhotonIDMod(const char *name="PhotonIDMod",
35 loizides 1.3 const char *title="Photon identification module");
36 sixie 1.1
37 sixie 1.13 Bool_t GetApplySpikeRemoval() const { return fApplySpikeRemoval; }
38 loizides 1.6 Bool_t GetApplyPixelSeed() const { return fApplyPixelSeed; }
39     const char *GetGoodName() const { return GetGoodPhotonsName(); }
40     const char *GetGoodPhotonsName() const { return fGoodPhotonsName; }
41     Double_t GetHadOverEmMax() const { return fHadOverEmMax; }
42     const char *GetIDType() const { return fPhotonIDType; }
43     const char *GetInputName() const { return fPhotonBranchName; }
44     const char *GetIsoType() const { return fPhotonIsoType; }
45     const char *GetOutputName() const { return GetGoodPhotonsName(); }
46     Double_t GetPtMin() const { return fPhotonPtMin; }
47 ceballos 1.11 Bool_t GetApplyFiduciality() const { return fFiduciality; }
48     Double_t GetEtaWidthEB() const { return fEtaWidthEB; }
49     Double_t GetEtaWidthEE() const { return fEtaWidthEE; }
50 ceballos 1.12 Double_t GetAbsEtaMax() const { return fAbsEtaMax; }
51 sixie 1.13 void SetApplySpikeRemoval(Bool_t b) { fApplySpikeRemoval = b; }
52 loizides 1.6 void SetApplyPixelSeed(Bool_t b) { fApplyPixelSeed = b; }
53 bendavid 1.16 void SetApplyElectronVeto(Bool_t b) { fApplyElectronVeto = b; }
54 bendavid 1.22 void SetInvertElectronVeto(Bool_t b) { fInvertElectronVeto = b; }
55 bendavid 1.16 void SetApplyElectronVetoConvRecovery(Bool_t b) { fApplyElectronVetoConvRecovery = b; }
56     void SetApplyConversionId(Bool_t b) { fApplyConversionId = b; }
57     void SetApplyTriggerMatching(Bool_t b) { fApplyTriggerMatching = b; }
58 loizides 1.6 void SetGoodName(const char *n) { SetGoodPhotonsName(n); }
59     void SetGoodPhotonsName(const char *n) { fGoodPhotonsName = n; }
60     void SetHadOverEmMax(Double_t hoe) { fHadOverEmMax = hoe; }
61     void SetIDType(const char *type) { fPhotonIDType = type; }
62     void SetInputName(const char *n) { fPhotonBranchName= n; }
63 fabstoec 1.15 void SetTrackName(const char *n) { fTrackBranchName = n; }
64     void SetBeamspotName(const char *n) { fBeamspotBranchName = n; }
65 loizides 1.6 void SetIsoType(const char *type) { fPhotonIsoType = type; }
66     void SetOutputName(const char *n) { SetGoodPhotonsName(n); }
67     void SetPtMin(Double_t pt) { fPhotonPtMin = pt; }
68 ceballos 1.11 void SetR9Min(Double_t x) { fPhotonR9Min = x; }
69     void SetEtaWidthEB(Double_t x) { fEtaWidthEB = x; }
70     void SetEtaWidthEE(Double_t x) { fEtaWidthEE = x; }
71 ceballos 1.12 void SetAbsEtaMax(Double_t x) { fAbsEtaMax = x; }
72 bendavid 1.14 void SetApplyR9Min(Bool_t b) { fApplyR9Min = b; }
73 bendavid 1.18 void SetApplyFiduciality(Bool_t b) { fFiduciality = b; }
74 fabstoec 1.15 void SetEffAreas(Double_t ecal, Double_t hcal, Double_t track) {
75 fabstoec 1.17 fEffAreaEcalEE = ecal; fEffAreaHcalEE = hcal; fEffAreaTrackEE = track;
76     fEffAreaEcalEB = ecal; fEffAreaHcalEB = hcal; fEffAreaTrackEB = track;
77     }
78     void SetEffAreasEEEB(Double_t ecalEE, Double_t hcalEE, Double_t trackEE,
79     Double_t ecalEB, Double_t hcalEB, Double_t trackEB) {
80     fEffAreaEcalEE = ecalEE; fEffAreaHcalEE = hcalEE; fEffAreaTrackEE = trackEE;
81     fEffAreaEcalEB = ecalEB; fEffAreaHcalEB = hcalEB; fEffAreaTrackEB = trackEB;
82     }
83 bendavid 1.16 void SetTriggerObjectsName(const char *n) { fTrigObjectsName = n; }
84 fabstoec 1.15
85 fabstoec 1.20 void SetPVName(const char *n) { fPVName = n; }
86     void SetPVFromBranch(bool b) { fPVFromBranch = b; }
87 bendavid 1.21 void SetIsData (Bool_t b) { fIsData = b;};
88 bendavid 1.22 void SetGoodElectronsFromBranch(Bool_t b) { fGoodElectronsFromBranch = b; }
89     void SetGoodElectronName(TString name) { fGoodElectronName = name; }
90 fabstoec 1.20
91 fabstoec 1.23 void SetBdtCutBarrel(double a) {fbdtCutBarrel = a; }
92     void SetBdtCutEndcap(double a) {fbdtCutEndcap = a; }
93    
94    
95 sixie 1.1 enum EPhIdType {
96     kIdUndef = 0, //not defined
97     kTight, //"Tight"
98     kLoose, //"Loose"
99 ceballos 1.2 kLooseEM, //"LooseEM"
100 fabstoec 1.20 kBaseLineCiC, //"2011" Hgg BaseLine CiC
101 fabstoec 1.23 kMITMVAId, // MingMing MVA ID
102 bendavid 1.24 kMITPhSelection, //MIT loose preselection (for mva)
103 sixie 1.1 kCustomId //"Custom"
104     };
105 fabstoec 1.19
106 sixie 1.1 enum EPhIsoType {
107     kIsoUndef = 0, //not defined
108     kNoIso, //"NoIso"
109 ceballos 1.2 kCombinedIso, //"CombinedIso"
110 fabstoec 1.15 kCustomIso, //"Custom"
111     kMITPUCorrected //PileUp Corrected Hgg Isolation
112 sixie 1.1 };
113    
114     protected:
115 loizides 1.5 void Process();
116     void SlaveBegin();
117    
118 loizides 1.6 TString fPhotonBranchName; //name of photon collection (input)
119     TString fGoodPhotonsName; //name of exported "good photon" collection
120 fabstoec 1.15 TString fTrackBranchName; // name of the track collection (only needed for PU corrected isolation)
121     TString fBeamspotBranchName; //name of the Beamspot collection (only needed for PU corrected isolation)
122 bendavid 1.16 TString fPileUpDenName; //name of the PU density collection
123     TString fConversionName; //name of conversion branch
124     TString fElectronName;
125 bendavid 1.22 TString fGoodElectronName;
126 fabstoec 1.20 TString fTrigObjectsName; //name of trigger object collection
127     TString fPVName;
128 bendavid 1.21 TString fMCParticleName;
129     TString fPileUpName;
130 loizides 1.6 TString fPhotonIDType; //type of photon identification we impose
131     TString fPhotonIsoType; //type of photon isolation we impose
132 loizides 1.4 Double_t fPhotonPtMin; //min pt cut
133 loizides 1.6 Double_t fHadOverEmMax; //maximum of hadronic/em energy
134 sixie 1.13 Bool_t fApplySpikeRemoval; //whether apply spike removal
135 loizides 1.6 Bool_t fApplyPixelSeed; //=true then apply pixel seed constraint
136 bendavid 1.16 Bool_t fApplyElectronVeto; //=true then apply electron veto (with no conversion recovery)
137 bendavid 1.22 Bool_t fInvertElectronVeto; //=true then invert electron veto (for cic selection only atm)
138 bendavid 1.16 Bool_t fApplyElectronVetoConvRecovery; //=true then apply electron veto with conversion recovery
139     Bool_t fApplyConversionId; //=true then apply conversion id cuts
140     Bool_t fApplyTriggerMatching; //match to hlt photon (default=0)
141 ceballos 1.8 Double_t fPhotonR9Min; //min R9 value
142 loizides 1.4 EPhIdType fPhIdType; //!identification scheme
143     EPhIsoType fPhIsoType; //!isolation scheme
144 ceballos 1.11 Bool_t fFiduciality; //=true then apply fiducual requirement
145     Double_t fEtaWidthEB; //max Eta Width in ECAL Barrel
146     Double_t fEtaWidthEE; //max Eta Width in ECAL End Cap
147 ceballos 1.12 Double_t fAbsEtaMax; //max Abs Eta
148 bendavid 1.14 Bool_t fApplyR9Min; //apply R9 min
149 fabstoec 1.17 Double_t fEffAreaEcalEE;
150     Double_t fEffAreaHcalEE;
151     Double_t fEffAreaTrackEE;
152     Double_t fEffAreaEcalEB;
153     Double_t fEffAreaHcalEB;
154     Double_t fEffAreaTrackEB;
155 loizides 1.10 const PhotonCol *fPhotons; //!photon branch
156 fabstoec 1.15 const TrackCol *fTracks; //!track branch
157     const BeamSpotCol *fBeamspots; //!beamspot branch
158 bendavid 1.16 const PileupEnergyDensityCol *fPileUpDen; //!rho branch
159     const DecayParticleCol *fConversions; //!conversion branch
160     const ElectronCol *fElectrons; //!electron branch
161 bendavid 1.22 const ElectronCol *fGoodElectrons; //!electron branch
162 bendavid 1.21 const VertexCol* fPV; //!
163     const MCParticleCol *fMCParticles;//!
164     const PileupInfoCol *fPileUp; //!
165 fabstoec 1.23
166     Double_t fbdtCutBarrel;
167     Double_t fbdtCutEndcap;
168     int fVariableType;
169     TString fEndcapWeights;
170     TString fBarrelWeights;
171     MVATools fTool;
172    
173 fabstoec 1.20 bool fPVFromBranch;
174 bendavid 1.22 Bool_t fGoodElectronsFromBranch;
175 bendavid 1.21 Bool_t fIsData;
176    
177    
178 fabstoec 1.15
179 loizides 1.6 ClassDef(PhotonIDMod, 1) // Photon identification module
180 sixie 1.1 };
181     }
182     #endif