ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonIDMod.h
Revision: 1.25
Committed: Fri Jan 13 15:27:29 2012 UTC (13 years, 4 months ago) by fabstoec
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_028, Mit_027, Mit_027a, Mit_025e, Mit_025d
Changes since 1.24: +23 -2 lines
Log Message:
added electron inversion to PhotonIDMod

File Contents

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