ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonIDMod.h
Revision: 1.26
Committed: Sun May 27 17:02:19 2012 UTC (12 years, 11 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_028a
Changes since 1.25: +6 -1 lines
Log Message:
implement option for 2012 photon selections

File Contents

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