1 |
fabstoec |
1.132 |
// $Id: ElectronIDMod.cc,v 1.131 2012/10/26 17:40:17 mingyang Exp $
|
2 |
loizides |
1.1 |
|
3 |
|
|
#include "MitPhysics/Mods/interface/ElectronIDMod.h"
|
4 |
loizides |
1.26 |
#include "MitAna/DataTree/interface/StableData.h"
|
5 |
ceballos |
1.76 |
#include "MitAna/DataTree/interface/ElectronFwd.h"
|
6 |
|
|
#include "MitAna/DataTree/interface/MuonFwd.h"
|
7 |
loizides |
1.26 |
#include "MitAna/DataTree/interface/VertexCol.h"
|
8 |
bendavid |
1.62 |
#include "MitAna/DataTree/interface/TriggerObjectCol.h"
|
9 |
loizides |
1.26 |
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
10 |
ceballos |
1.118 |
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
11 |
loizides |
1.5 |
#include "MitPhysics/Init/interface/ModNames.h"
|
12 |
sixie |
1.102 |
#include "TMVA/Tools.h"
|
13 |
|
|
#include "TMVA/Reader.h"
|
14 |
loizides |
1.1 |
|
15 |
|
|
using namespace mithep;
|
16 |
|
|
|
17 |
|
|
ClassImp(mithep::ElectronIDMod)
|
18 |
|
|
|
19 |
|
|
//--------------------------------------------------------------------------------------------------
|
20 |
loizides |
1.5 |
ElectronIDMod::ElectronIDMod(const char *name, const char *title) :
|
21 |
loizides |
1.1 |
BaseMod(name,title),
|
22 |
sixie |
1.112 |
fPrintMVADebugInfo(kFALSE),
|
23 |
loizides |
1.5 |
fElectronBranchName(Names::gkElectronBrn),
|
24 |
ceballos |
1.12 |
fConversionBranchName(Names::gkMvfConversionBrn),
|
25 |
loizides |
1.5 |
fGoodElectronsName(ModNames::gkGoodElectronsName),
|
26 |
ceballos |
1.78 |
fNonIsolatedMuonsName("random"),
|
27 |
|
|
fNonIsolatedElectronsName("random"),
|
28 |
ceballos |
1.68 |
fVertexName(ModNames::gkGoodVertexesName),
|
29 |
bendavid |
1.75 |
fBeamSpotName(Names::gkBeamSpotBrn),
|
30 |
ceballos |
1.76 |
fTrackName(Names::gkTrackBrn),
|
31 |
|
|
fPFCandidatesName(Names::gkPFCandidatesBrn),
|
32 |
fabstoec |
1.126 |
fPFNoPileUpName("PFNoPileUp"),
|
33 |
ceballos |
1.31 |
fElectronIDType("CustomTight"),
|
34 |
sixie |
1.87 |
fElectronIsoType("PFIso"),
|
35 |
bendavid |
1.62 |
fTrigObjectsName("HLTModTrigObjs"),
|
36 |
loizides |
1.1 |
fElectronPtMin(10),
|
37 |
bendavid |
1.67 |
fElectronEtMin(0.0),
|
38 |
ceballos |
1.64 |
fElectronEtaMax(2.5),
|
39 |
ceballos |
1.95 |
fIDLikelihoodCut(-999.0),
|
40 |
loizides |
1.1 |
fTrackIsolationCut(5.0),
|
41 |
|
|
fCaloIsolationCut(5.0),
|
42 |
loizides |
1.5 |
fEcalJuraIsoCut(5.0),
|
43 |
|
|
fHcalIsolationCut(5.0),
|
44 |
fabstoec |
1.97 |
fCombIsolationCut(0.1),
|
45 |
sixie |
1.99 |
fCombRelativeIsolationCut(0.10),
|
46 |
fabstoec |
1.115 |
fCombRelativeIsolationCut_EE(0.10),
|
47 |
fabstoec |
1.97 |
fPFIsolationCut(-1.0),
|
48 |
ceballos |
1.60 |
fApplyConvFilterType1(kTRUE),
|
49 |
|
|
fApplyConvFilterType2(kFALSE),
|
50 |
bendavid |
1.82 |
fNWrongHitsMax(0),
|
51 |
ceballos |
1.60 |
fNExpectedHitsInnerCut(999),
|
52 |
ceballos |
1.98 |
fInvertNExpectedHitsInnerCut(kFALSE),
|
53 |
ceballos |
1.59 |
fCombinedIdCut(kFALSE),
|
54 |
sixie |
1.58 |
fApplySpikeRemoval(kTRUE),
|
55 |
ceballos |
1.18 |
fApplyD0Cut(kTRUE),
|
56 |
ceballos |
1.81 |
fApplyDZCut(kTRUE),
|
57 |
ceballos |
1.45 |
fChargeFilter(kTRUE),
|
58 |
ceballos |
1.60 |
fD0Cut(0.020),
|
59 |
ceballos |
1.89 |
fDZCut(0.10),
|
60 |
ceballos |
1.81 |
fWhichVertex(-1),
|
61 |
bendavid |
1.62 |
fApplyTriggerMatching(kFALSE),
|
62 |
bendavid |
1.67 |
fApplyEcalSeeded(kFALSE),
|
63 |
|
|
fApplyCombinedIso(kTRUE),
|
64 |
|
|
fApplyEcalFiducial(kFALSE),
|
65 |
ceballos |
1.76 |
fElectronsFromBranch(kTRUE),
|
66 |
sixie |
1.56 |
fElIdType(ElectronTools::kIdUndef),
|
67 |
|
|
fElIsoType(ElectronTools::kIsoUndef),
|
68 |
loizides |
1.14 |
fElectrons(0),
|
69 |
|
|
fConversions(0),
|
70 |
bendavid |
1.75 |
fVertices(0),
|
71 |
ceballos |
1.76 |
fBeamSpot(0),
|
72 |
|
|
fTracks(0),
|
73 |
|
|
fPFCandidates(0),
|
74 |
ceballos |
1.118 |
fPFNoPileUpCands(0),
|
75 |
ceballos |
1.101 |
fIntRadius(0.0),
|
76 |
ceballos |
1.78 |
fNonIsolatedMuons(0),
|
77 |
|
|
fNonIsolatedElectrons(0),
|
78 |
ceballos |
1.80 |
fLH(0),
|
79 |
|
|
fPileupEnergyDensityName(Names::gkPileupEnergyDensityBrn),
|
80 |
sixie |
1.102 |
fPileupEnergyDensity(0),
|
81 |
|
|
fElectronIDMVA(0),
|
82 |
|
|
fElectronMVAWeights_Subdet0Pt10To20(""),
|
83 |
|
|
fElectronMVAWeights_Subdet1Pt10To20(""),
|
84 |
|
|
fElectronMVAWeights_Subdet2Pt10To20(""),
|
85 |
|
|
fElectronMVAWeights_Subdet0Pt20ToInf(""),
|
86 |
|
|
fElectronMVAWeights_Subdet1Pt20ToInf(""),
|
87 |
fabstoec |
1.119 |
fElectronMVAWeights_Subdet2Pt20ToInf(""),
|
88 |
fabstoec |
1.120 |
fTheRhoType(RhoUtilities::DEFAULT)
|
89 |
loizides |
1.1 |
{
|
90 |
|
|
// Constructor.
|
91 |
|
|
}
|
92 |
|
|
|
93 |
|
|
//--------------------------------------------------------------------------------------------------
|
94 |
sixie |
1.102 |
Bool_t ElectronIDMod::PassLikelihoodID(const Electron *ele) const
|
95 |
ceballos |
1.77 |
{
|
96 |
sixie |
1.102 |
|
97 |
|
|
Double_t LikelihoodValue = ElectronTools::Likelihood(fLH, ele);
|
98 |
ceballos |
1.96 |
|
99 |
ceballos |
1.95 |
double likCut = fIDLikelihoodCut;
|
100 |
|
|
if(likCut > -900){
|
101 |
|
|
if(ele->Pt() > 20){
|
102 |
|
|
if(ele->SCluster()->AbsEta() < 1.479){
|
103 |
ceballos |
1.101 |
if(ele->NumberOfClusters() - 1 == 0) likCut = 3.5;
|
104 |
|
|
else likCut = 4.0;
|
105 |
ceballos |
1.95 |
}
|
106 |
|
|
else {
|
107 |
ceballos |
1.101 |
if(ele->NumberOfClusters() - 1 == 0) likCut = 4.0;
|
108 |
|
|
else likCut = 4.0;
|
109 |
ceballos |
1.95 |
}
|
110 |
|
|
}
|
111 |
|
|
else {
|
112 |
|
|
if(ele->SCluster()->AbsEta() < 1.479){
|
113 |
ceballos |
1.101 |
if(ele->NumberOfClusters() - 1 == 0) likCut = 4.0;
|
114 |
|
|
else likCut = 4.5;
|
115 |
ceballos |
1.95 |
}
|
116 |
|
|
else {
|
117 |
ceballos |
1.101 |
if(ele->NumberOfClusters() - 1 == 0) likCut = 4.0;
|
118 |
|
|
else likCut = 4.0;
|
119 |
ceballos |
1.95 |
}
|
120 |
|
|
}
|
121 |
|
|
}
|
122 |
sixie |
1.102 |
if (LikelihoodValue > likCut) return kTRUE;
|
123 |
ceballos |
1.77 |
return kFALSE;
|
124 |
|
|
}
|
125 |
|
|
|
126 |
|
|
//--------------------------------------------------------------------------------------------------
|
127 |
sixie |
1.102 |
Bool_t ElectronIDMod::PassMVAID(const Electron *el, ElectronTools::EElIdType idType,
|
128 |
sixie |
1.110 |
const Vertex *vertex, const PFCandidateCol *PFCands,
|
129 |
|
|
const PileupEnergyDensityCol *PileupEnergyDensity) const
|
130 |
ceballos |
1.116 |
{
|
131 |
ceballos |
1.123 |
Bool_t isDebug = kFALSE;
|
132 |
sixie |
1.110 |
Double_t MVAValue = 0;
|
133 |
ceballos |
1.116 |
if (idType == ElectronTools::kMVAID_BDTG_IDIsoCombined) {
|
134 |
sixie |
1.113 |
MVAValue = fElectronIDMVA->MVAValue(el, vertex, PFCands, PileupEnergyDensity, fIntRadius);
|
135 |
ceballos |
1.116 |
}
|
136 |
ceballos |
1.117 |
else if(idType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0) {
|
137 |
ceballos |
1.116 |
ElectronOArr *tempElectrons = new ElectronOArr;
|
138 |
|
|
MuonOArr *tempMuons = new MuonOArr;
|
139 |
ceballos |
1.122 |
MVAValue = fElectronIDMVA->MVAValue(el, vertex, PFCands, PileupEnergyDensity, ElectronTools::kEleEANoCorr,
|
140 |
ceballos |
1.123 |
tempElectrons, tempMuons, isDebug);
|
141 |
ceballos |
1.116 |
delete tempElectrons;
|
142 |
|
|
delete tempMuons;
|
143 |
|
|
}
|
144 |
sixie |
1.127 |
else if(idType == ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4) {
|
145 |
|
|
MVAValue = fElectronIDMVA->MVAValue(el, vertex, fVertices, PFCands,
|
146 |
|
|
PileupEnergyDensity, ElectronTools::kEleEANoCorr,
|
147 |
|
|
isDebug);
|
148 |
|
|
}
|
149 |
ceballos |
1.116 |
else {
|
150 |
sixie |
1.110 |
MVAValue = fElectronIDMVA->MVAValue(el, vertex);
|
151 |
|
|
}
|
152 |
|
|
|
153 |
ceballos |
1.118 |
Double_t eta = el->SCluster()->AbsEta();
|
154 |
sixie |
1.102 |
Int_t MVABin = -1;
|
155 |
sixie |
1.127 |
if(idType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0
|
156 |
|
|
|| idType == ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4
|
157 |
mingyang |
1.129 |
|| idType == ElectronTools::kHggLeptonTagId2012HCP
|
158 |
sixie |
1.127 |
) {
|
159 |
ceballos |
1.118 |
if (el->Pt() < 20 && eta < 0.800 ) MVABin = 0;
|
160 |
|
|
if (el->Pt() < 20 && eta >= 0.800 && fabs(eta) < 1.479 ) MVABin = 1;
|
161 |
|
|
if (el->Pt() < 20 && eta >= 1.479 ) MVABin = 2;
|
162 |
|
|
if (el->Pt() >= 20 && eta < 0.800 ) MVABin = 3;
|
163 |
|
|
if (el->Pt() >= 20 && eta >= 0.800 && fabs(eta) < 1.479 ) MVABin = 4;
|
164 |
|
|
if (el->Pt() >= 20 && eta >= 1.479 ) MVABin = 5;
|
165 |
|
|
} else {
|
166 |
|
|
if (el->Pt() < 20 && eta < 1.000 ) MVABin = 0;
|
167 |
|
|
if (el->Pt() < 20 && eta >= 1.000 && fabs(eta) < 1.479 ) MVABin = 1;
|
168 |
|
|
if (el->Pt() < 20 && eta >= 1.479 ) MVABin = 2;
|
169 |
|
|
if (el->Pt() >= 20 && eta < 1.000 ) MVABin = 3;
|
170 |
|
|
if (el->Pt() >= 20 && eta >= 1.000 && fabs(eta) < 1.479 ) MVABin = 4;
|
171 |
|
|
if (el->Pt() >= 20 && eta >= 1.479 ) MVABin = 5;
|
172 |
|
|
}
|
173 |
|
|
if(MVABin == -1) assert(0);
|
174 |
sixie |
1.102 |
|
175 |
|
|
Double_t MVACut = -9999;
|
176 |
sixie |
1.110 |
if (idType == ElectronTools::kMVAID_BDTG_NoIPInfo) {
|
177 |
ceballos |
1.114 |
if (MVABin == 0) MVACut = 0.133;
|
178 |
|
|
else if (MVABin == 1) MVACut = 0.465;
|
179 |
|
|
else if (MVABin == 2) MVACut = 0.518;
|
180 |
|
|
else if (MVABin == 3) MVACut = 0.942;
|
181 |
|
|
else if (MVABin == 4) MVACut = 0.947;
|
182 |
|
|
else if (MVABin == 5) MVACut = 0.878 ;
|
183 |
sixie |
1.110 |
} else if (idType == ElectronTools::kMVAID_BDTG_WithIPInfo) {
|
184 |
ceballos |
1.114 |
if (MVABin == 0) MVACut = 0.139;
|
185 |
|
|
else if (MVABin == 1) MVACut = 0.525;
|
186 |
|
|
else if (MVABin == 2) MVACut = 0.543;
|
187 |
|
|
else if (MVABin == 3) MVACut = 0.947;
|
188 |
|
|
else if (MVABin == 4) MVACut = 0.950;
|
189 |
|
|
else if (MVABin == 5) MVACut = 0.884;
|
190 |
sixie |
1.110 |
} else if (idType == ElectronTools::kMVAID_BDTG_IDIsoCombined) {
|
191 |
ceballos |
1.114 |
if (MVABin == 0) MVACut = 0.4202;
|
192 |
|
|
else if (MVABin == 1) MVACut = 0.6206;
|
193 |
|
|
else if (MVABin == 2) MVACut = 0.6190;
|
194 |
|
|
else if (MVABin == 3) MVACut = 0.9590;
|
195 |
|
|
else if (MVABin == 4) MVACut = 0.9586;
|
196 |
|
|
else if (MVABin == 5) MVACut = 0.9278;
|
197 |
ceballos |
1.117 |
} else if (idType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0) {
|
198 |
ceballos |
1.121 |
if (MVABin == 0) MVACut = 0.000;
|
199 |
|
|
else if (MVABin == 1) MVACut = 0.100;
|
200 |
|
|
else if (MVABin == 2) MVACut = 0.620;
|
201 |
|
|
else if (MVABin == 3) MVACut = 0.940;
|
202 |
|
|
else if (MVABin == 4) MVACut = 0.850;
|
203 |
|
|
else if (MVABin == 5) MVACut = 0.920;
|
204 |
sixie |
1.127 |
} else if (idType == ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4) {
|
205 |
ceballos |
1.130 |
if (MVABin == 0) MVACut = 0.123;
|
206 |
|
|
else if (MVABin == 1) MVACut = 0.219;
|
207 |
|
|
else if (MVABin == 2) MVACut = 0.509;
|
208 |
|
|
else if (MVABin == 3) MVACut = 0.935;
|
209 |
|
|
else if (MVABin == 4) MVACut = 0.889;
|
210 |
|
|
else if (MVABin == 5) MVACut = 0.871;
|
211 |
mingyang |
1.129 |
} else if (idType == ElectronTools::kHggLeptonTagId2012HCP) {
|
212 |
fabstoec |
1.132 |
if (MVABin == 0) MVACut = -100.8;
|
213 |
|
|
else if (MVABin == 1) MVACut = -100.8;
|
214 |
|
|
else if (MVABin == 2) MVACut = -100.8;
|
215 |
|
|
else if (MVABin == 3) MVACut = -100.8;
|
216 |
|
|
else if (MVABin == 4) MVACut = -100.8;
|
217 |
|
|
else if (MVABin == 5) MVACut = -100.8;
|
218 |
sixie |
1.107 |
}
|
219 |
|
|
|
220 |
fabstoec |
1.132 |
if(isDebug == kTRUE || true ){
|
221 |
ceballos |
1.123 |
printf("PassElMVAID(%d): %d, pt, eta = %f, %f, rho = %f(%f) : MVA = %f, bin: %d\n",
|
222 |
|
|
(MVAValue > MVACut),GetEventHeader()->EvtNum(),el->Pt(), eta,
|
223 |
ceballos |
1.122 |
fPileupEnergyDensity->At(0)->Rho(),fPileupEnergyDensity->At(0)->RhoKt6PFJets(),MVAValue,MVABin);
|
224 |
|
|
}
|
225 |
|
|
|
226 |
sixie |
1.102 |
if (MVAValue > MVACut) return kTRUE;
|
227 |
|
|
return kFALSE;
|
228 |
|
|
}
|
229 |
|
|
|
230 |
mingyang |
1.129 |
Double_t ElectronIDMod::EvaluateMVAID(const Electron *el, ElectronTools::EElIdType idType,
|
231 |
|
|
const Vertex *vertex, const PFCandidateCol *PFCands,
|
232 |
|
|
const PileupEnergyDensityCol *PileupEnergyDensity) const
|
233 |
|
|
{
|
234 |
|
|
Bool_t isDebug = kFALSE;
|
235 |
|
|
Double_t MVAValue = 0;
|
236 |
|
|
if (idType == ElectronTools::kMVAID_BDTG_IDIsoCombined) {
|
237 |
|
|
MVAValue = fElectronIDMVA->MVAValue(el, vertex, PFCands, PileupEnergyDensity, fIntRadius);
|
238 |
|
|
}
|
239 |
|
|
else if(idType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0) {
|
240 |
|
|
ElectronOArr *tempElectrons = new ElectronOArr;
|
241 |
|
|
MuonOArr *tempMuons = new MuonOArr;
|
242 |
|
|
MVAValue = fElectronIDMVA->MVAValue(el, vertex, PFCands, PileupEnergyDensity, ElectronTools::kEleEANoCorr,
|
243 |
|
|
tempElectrons, tempMuons, isDebug);
|
244 |
|
|
delete tempElectrons;
|
245 |
|
|
delete tempMuons;
|
246 |
|
|
}
|
247 |
|
|
else if(idType == ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4) {
|
248 |
|
|
|
249 |
|
|
MVAValue = fElectronIDMVA->MVAValue(el, vertex, fVertices, PFCands,
|
250 |
|
|
PileupEnergyDensity, ElectronTools::kEleEANoCorr,
|
251 |
|
|
isDebug);
|
252 |
|
|
}
|
253 |
|
|
else {
|
254 |
|
|
MVAValue = fElectronIDMVA->MVAValue(el, vertex);
|
255 |
|
|
}
|
256 |
|
|
|
257 |
|
|
return MVAValue;
|
258 |
|
|
|
259 |
|
|
}
|
260 |
|
|
|
261 |
sixie |
1.102 |
//--------------------------------------------------------------------------------------------------
|
262 |
|
|
Bool_t ElectronIDMod::PassIDCut(const Electron *ele, ElectronTools::EElIdType idType,
|
263 |
|
|
const Vertex *vertex) const
|
264 |
sixie |
1.42 |
{
|
265 |
|
|
Bool_t idcut = kFALSE;
|
266 |
|
|
switch (idType) {
|
267 |
ceballos |
1.130 |
case ElectronTools::kTight:
|
268 |
sixie |
1.42 |
idcut = ele->PassTightID();
|
269 |
|
|
break;
|
270 |
sixie |
1.56 |
case ElectronTools::kLoose:
|
271 |
sixie |
1.42 |
idcut = ele->PassLooseID();
|
272 |
|
|
break;
|
273 |
sixie |
1.56 |
case ElectronTools::kLikelihood:
|
274 |
ceballos |
1.101 |
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId) &&
|
275 |
sixie |
1.102 |
PassLikelihoodID(ele);
|
276 |
sixie |
1.42 |
break;
|
277 |
sixie |
1.56 |
case ElectronTools::kNoId:
|
278 |
sixie |
1.42 |
idcut = kTRUE;
|
279 |
|
|
break;
|
280 |
sixie |
1.56 |
case ElectronTools::kCustomIdLoose:
|
281 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kCustomIdLoose);
|
282 |
sixie |
1.42 |
break;
|
283 |
sixie |
1.56 |
case ElectronTools::kCustomIdTight:
|
284 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kCustomIdTight);
|
285 |
sixie |
1.42 |
break;
|
286 |
ceballos |
1.86 |
case ElectronTools::kVBTFWorkingPointFakeableId:
|
287 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
|
288 |
|
|
break;
|
289 |
sixie |
1.56 |
case ElectronTools::kVBTFWorkingPoint95Id:
|
290 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint95Id);
|
291 |
ceballos |
1.54 |
break;
|
292 |
sixie |
1.56 |
case ElectronTools::kVBTFWorkingPoint90Id:
|
293 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint90Id);
|
294 |
ceballos |
1.54 |
break;
|
295 |
ceballos |
1.60 |
case ElectronTools::kVBTFWorkingPoint85Id:
|
296 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint85Id);
|
297 |
|
|
break;
|
298 |
sixie |
1.56 |
case ElectronTools::kVBTFWorkingPoint80Id:
|
299 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint80Id);
|
300 |
|
|
break;
|
301 |
ceballos |
1.83 |
case ElectronTools::kVBTFWorkingPointLowPtId:
|
302 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointLowPtId);
|
303 |
ceballos |
1.81 |
break;
|
304 |
sixie |
1.56 |
case ElectronTools::kVBTFWorkingPoint70Id:
|
305 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint70Id);
|
306 |
ceballos |
1.54 |
break;
|
307 |
fabstoec |
1.115 |
case ElectronTools::kHggLeptonTagId:
|
308 |
|
|
idcut = ElectronTools::PassHggLeptonTagID(ele);
|
309 |
|
|
break;
|
310 |
fabstoec |
1.126 |
case ElectronTools::kHggLeptonTagId2012:
|
311 |
|
|
idcut = ElectronTools::PassHggLeptonTagID2012(ele);
|
312 |
|
|
break;
|
313 |
mingyang |
1.129 |
case ElectronTools::kHggLeptonTagId2012HCP:
|
314 |
fabstoec |
1.132 |
{
|
315 |
|
|
idcut = PassMVAID(ele, ElectronTools::kHggLeptonTagId2012HCP,
|
316 |
|
|
vertex, fPFCandidates, fPileupEnergyDensity);
|
317 |
|
|
}
|
318 |
mingyang |
1.129 |
break;
|
319 |
sixie |
1.110 |
case ElectronTools::kMVAID_BDTG_NoIPInfo:
|
320 |
sixie |
1.111 |
{
|
321 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
|
322 |
|
|
if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_NoIPInfo,
|
323 |
|
|
vertex, fPFCandidates, fPileupEnergyDensity);
|
324 |
|
|
}
|
325 |
ceballos |
1.130 |
break;
|
326 |
sixie |
1.110 |
case ElectronTools::kMVAID_BDTG_WithIPInfo:
|
327 |
sixie |
1.111 |
{
|
328 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
|
329 |
|
|
if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_WithIPInfo,
|
330 |
|
|
vertex, fPFCandidates, fPileupEnergyDensity);
|
331 |
|
|
}
|
332 |
ceballos |
1.130 |
break;
|
333 |
sixie |
1.110 |
case ElectronTools::kMVAID_BDTG_IDIsoCombined:
|
334 |
sixie |
1.111 |
{
|
335 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
|
336 |
|
|
if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_IDIsoCombined,
|
337 |
|
|
vertex, fPFCandidates, fPileupEnergyDensity );
|
338 |
|
|
}
|
339 |
ceballos |
1.130 |
break;
|
340 |
ceballos |
1.117 |
case ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0:
|
341 |
ceballos |
1.116 |
{
|
342 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
|
343 |
ceballos |
1.117 |
if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0,
|
344 |
ceballos |
1.116 |
vertex, fPFCandidates, fPileupEnergyDensity );
|
345 |
|
|
}
|
346 |
ceballos |
1.130 |
break;
|
347 |
sixie |
1.127 |
case ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4:
|
348 |
|
|
{
|
349 |
|
|
idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
|
350 |
|
|
if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4,
|
351 |
|
|
vertex, fPFCandidates, fPileupEnergyDensity );
|
352 |
|
|
}
|
353 |
ceballos |
1.130 |
break;
|
354 |
sixie |
1.42 |
default:
|
355 |
|
|
break;
|
356 |
|
|
}
|
357 |
|
|
|
358 |
|
|
return idcut;
|
359 |
|
|
}
|
360 |
|
|
|
361 |
|
|
//--------------------------------------------------------------------------------------------------
|
362 |
ceballos |
1.76 |
Bool_t ElectronIDMod::PassIsolationCut(const Electron *ele, ElectronTools::EElIsoType isoType,
|
363 |
ceballos |
1.80 |
const TrackCol *tracks, const Vertex *vertex,
|
364 |
ceballos |
1.124 |
const Double_t rho, ElectronTools::EElIdType idType) const
|
365 |
sixie |
1.42 |
{
|
366 |
|
|
|
367 |
|
|
Bool_t isocut = kFALSE;
|
368 |
|
|
switch (isoType) {
|
369 |
sixie |
1.56 |
case ElectronTools::kTrackCalo:
|
370 |
sixie |
1.42 |
isocut = (ele->TrackIsolationDr03() < fTrackIsolationCut) &&
|
371 |
|
|
(ele->CaloIsolation() < fCaloIsolationCut);
|
372 |
|
|
break;
|
373 |
sixie |
1.56 |
case ElectronTools::kTrackJura:
|
374 |
ceballos |
1.85 |
isocut = (ele->TrackIsolationDr03() < ele->Pt()*fTrackIsolationCut) &&
|
375 |
|
|
(ele->EcalRecHitIsoDr03() < ele->Pt()*fEcalJuraIsoCut) &&
|
376 |
|
|
(ele->HcalTowerSumEtDr03() < ele->Pt()*fHcalIsolationCut);
|
377 |
sixie |
1.42 |
break;
|
378 |
sixie |
1.56 |
case ElectronTools::kTrackJuraCombined:
|
379 |
ceballos |
1.60 |
isocut = (ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03()
|
380 |
ceballos |
1.49 |
- 1.5 < fCombIsolationCut);
|
381 |
|
|
break;
|
382 |
sixie |
1.56 |
case ElectronTools::kTrackJuraSliding:
|
383 |
sixie |
1.42 |
{
|
384 |
ceballos |
1.80 |
Double_t totalIso = ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03() - rho * TMath::Pi() * 0.3 * 0.3, 0.0);
|
385 |
|
|
if(ele->SCluster()->AbsEta() < 1.479) totalIso = ele->TrackIsolationDr03() + TMath::Max(TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) + ele->HcalTowerSumEtDr03() - rho * TMath::Pi() * 0.3 * 0.3, 0.0);
|
386 |
ceballos |
1.79 |
if (totalIso < (ele->Pt()*fCombIsolationCut) )
|
387 |
|
|
isocut = kTRUE;
|
388 |
|
|
}
|
389 |
|
|
break;
|
390 |
ceballos |
1.80 |
case ElectronTools::kTrackJuraSlidingNoCorrection:
|
391 |
ceballos |
1.79 |
{
|
392 |
ceballos |
1.80 |
Double_t totalIso = ele->TrackIsolationDr03() + (ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03());
|
393 |
|
|
if(ele->SCluster()->AbsEta() < 1.479) totalIso = ele->TrackIsolationDr03() + (TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) + ele->HcalTowerSumEtDr03());
|
394 |
ceballos |
1.76 |
if (totalIso < (ele->Pt()*fCombIsolationCut) )
|
395 |
|
|
isocut = kTRUE;
|
396 |
|
|
}
|
397 |
|
|
break;
|
398 |
sixie |
1.99 |
case ElectronTools::kCombinedRelativeConeAreaCorrected:
|
399 |
|
|
{
|
400 |
|
|
Double_t totalIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03() - rho * TMath::Pi() * 0.3 * 0.3;
|
401 |
fabstoec |
1.115 |
if (ele->SCluster()->AbsEta() < 1.5) { // Barrel
|
402 |
|
|
if (totalIso < (ele->Pt()*fCombRelativeIsolationCut) )
|
403 |
|
|
isocut = kTRUE;
|
404 |
|
|
} else {
|
405 |
|
|
if (totalIso < (ele->Pt()*fCombRelativeIsolationCut_EE) )
|
406 |
|
|
isocut = kTRUE;
|
407 |
|
|
}
|
408 |
sixie |
1.99 |
}
|
409 |
|
|
break;
|
410 |
ceballos |
1.76 |
case ElectronTools::kPFIso:
|
411 |
|
|
{
|
412 |
sixie |
1.87 |
Double_t pfIsoCutValue = 9999;
|
413 |
fabstoec |
1.97 |
if(fPFIsolationCut > 0){
|
414 |
|
|
pfIsoCutValue = fPFIsolationCut;
|
415 |
ceballos |
1.88 |
} else {
|
416 |
ceballos |
1.91 |
if (ele->SCluster()->AbsEta() < 1.479) {
|
417 |
ceballos |
1.88 |
if (ele->Pt() > 20) {
|
418 |
ceballos |
1.92 |
pfIsoCutValue = 0.13;
|
419 |
ceballos |
1.88 |
} else {
|
420 |
ceballos |
1.92 |
pfIsoCutValue = 0.13;
|
421 |
ceballos |
1.88 |
}
|
422 |
sixie |
1.87 |
} else {
|
423 |
ceballos |
1.91 |
if (ele->Pt() > 20) {
|
424 |
|
|
pfIsoCutValue = 0.09;
|
425 |
|
|
} else {
|
426 |
|
|
pfIsoCutValue = 0.09;
|
427 |
|
|
}
|
428 |
|
|
}
|
429 |
sixie |
1.87 |
}
|
430 |
ceballos |
1.101 |
Double_t totalIso = IsolationTools::PFElectronIsolation(ele, fPFCandidates, vertex, 0.1, 1.0, 0.4, fIntRadius);
|
431 |
sixie |
1.87 |
if (totalIso < (ele->Pt()*pfIsoCutValue) )
|
432 |
ceballos |
1.89 |
isocut = kTRUE;
|
433 |
ceballos |
1.76 |
}
|
434 |
|
|
break;
|
435 |
|
|
case ElectronTools::kPFIsoNoL:
|
436 |
|
|
{
|
437 |
ceballos |
1.109 |
Double_t pfIsoCutValue = 9999;
|
438 |
|
|
if(fPFIsolationCut > 0){
|
439 |
|
|
pfIsoCutValue = fPFIsolationCut;
|
440 |
|
|
} else {
|
441 |
|
|
if (ele->SCluster()->AbsEta() < 1.479) {
|
442 |
|
|
if (ele->Pt() > 20) {
|
443 |
|
|
pfIsoCutValue = 0.13;
|
444 |
|
|
} else {
|
445 |
|
|
pfIsoCutValue = 0.13;
|
446 |
|
|
}
|
447 |
|
|
} else {
|
448 |
|
|
if (ele->Pt() > 20) {
|
449 |
|
|
pfIsoCutValue = 0.09;
|
450 |
|
|
} else {
|
451 |
|
|
pfIsoCutValue = 0.09;
|
452 |
|
|
}
|
453 |
|
|
}
|
454 |
|
|
}
|
455 |
|
|
Double_t totalIso = IsolationTools::PFElectronIsolation(ele, fPFCandidates, fNonIsolatedMuons, fNonIsolatedElectrons, vertex, 0.1, 1.0, 0.4, fIntRadius);
|
456 |
|
|
if (totalIso < (ele->Pt()*pfIsoCutValue) )
|
457 |
sixie |
1.42 |
isocut = kTRUE;
|
458 |
|
|
}
|
459 |
|
|
break;
|
460 |
sixie |
1.56 |
case ElectronTools::kVBTFWorkingPoint95Iso:
|
461 |
bendavid |
1.67 |
isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint95Iso, fApplyCombinedIso);
|
462 |
sixie |
1.56 |
break;
|
463 |
|
|
case ElectronTools::kVBTFWorkingPoint90Iso:
|
464 |
bendavid |
1.67 |
isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint90Iso, fApplyCombinedIso);
|
465 |
sixie |
1.51 |
break;
|
466 |
ceballos |
1.60 |
case ElectronTools::kVBTFWorkingPoint85Iso:
|
467 |
bendavid |
1.67 |
isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint85Iso, fApplyCombinedIso);
|
468 |
ceballos |
1.60 |
break;
|
469 |
sixie |
1.56 |
case ElectronTools::kVBTFWorkingPoint80Iso:
|
470 |
bendavid |
1.67 |
isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint80Iso, fApplyCombinedIso);
|
471 |
sixie |
1.51 |
break;
|
472 |
sixie |
1.56 |
case ElectronTools::kVBTFWorkingPoint70Iso:
|
473 |
bendavid |
1.67 |
isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint70Iso, fApplyCombinedIso);
|
474 |
sixie |
1.51 |
break;
|
475 |
sixie |
1.110 |
case ElectronTools::kMVAIso_BDTG_IDIsoCombined:
|
476 |
|
|
isocut = (ele->TrackIsolationDr03() < ele->Pt()*0.2) &&
|
477 |
|
|
(ele->EcalRecHitIsoDr03() < ele->Pt()*0.2) &&
|
478 |
|
|
(ele->HcalTowerSumEtDr03() < ele->Pt()*0.2);
|
479 |
|
|
break;
|
480 |
ceballos |
1.118 |
case ElectronTools::kPFIso_HWW2012TrigV0:
|
481 |
|
|
{
|
482 |
ceballos |
1.122 |
Bool_t isDebug = kFALSE;
|
483 |
|
|
if(isDebug == kTRUE){
|
484 |
|
|
printf("PFIso_HWW2012TrigV0: %d, pt, eta = %f, %f, rho = %f(%f) : ",
|
485 |
|
|
GetEventHeader()->EvtNum(),ele->Pt(), ele->Eta(),
|
486 |
|
|
fPileupEnergyDensity->At(0)->Rho(),fPileupEnergyDensity->At(0)->RhoKt6PFJets());
|
487 |
|
|
}
|
488 |
ceballos |
1.125 |
ElectronOArr *tempIsoElectrons = new ElectronOArr;
|
489 |
|
|
MuonOArr *tempIsoMuons = new MuonOArr;
|
490 |
|
|
Double_t IsoOverPt = IsolationTools::PFElectronIsolation2012(ele, vertex, fPFNoPileUpCands,
|
491 |
|
|
fPileupEnergyDensity, ElectronTools::kEleEANoCorr, tempIsoElectrons, tempIsoMuons, 0.4, isDebug);
|
492 |
|
|
delete tempIsoElectrons;
|
493 |
|
|
delete tempIsoMuons;
|
494 |
|
|
Double_t eta = ele->SCluster()->AbsEta();
|
495 |
|
|
Double_t IsoCut = -1;
|
496 |
|
|
if (ele->Pt() < 20 && eta < 0.800 ) IsoCut = 0.150;
|
497 |
|
|
if (ele->Pt() < 20 && eta >= 0.800 && eta < 1.479 ) IsoCut = 0.150;
|
498 |
|
|
if (ele->Pt() < 20 && eta >= 1.479 ) IsoCut = 0.150;
|
499 |
|
|
if (ele->Pt() >= 20 && eta < 0.800 ) IsoCut = 0.150;
|
500 |
|
|
if (ele->Pt() >= 20 && eta >= 0.800 && eta < 1.479 ) IsoCut = 0.150;
|
501 |
|
|
if (ele->Pt() >= 20 && eta >= 1.479 ) IsoCut = 0.150;
|
502 |
|
|
if (IsoOverPt < IsoCut ) isocut = kTRUE;
|
503 |
ceballos |
1.118 |
}
|
504 |
fabstoec |
1.132 |
break;
|
505 |
|
|
case ElectronTools::kPFIso_HggLeptonTag2012:
|
506 |
fabstoec |
1.126 |
{
|
507 |
|
|
Bool_t isDebug = kFALSE;
|
508 |
|
|
if(isDebug == kTRUE){
|
509 |
|
|
printf("PFIso_HggLeptonTag2012: %d, pt, eta = %f, %f, rho = %f(%f) : ",
|
510 |
fabstoec |
1.132 |
GetEventHeader()->EvtNum(),ele->Pt(), ele->Eta(),
|
511 |
|
|
fPileupEnergyDensity->At(0)->Rho(),fPileupEnergyDensity->At(0)->RhoKt6PFJets());
|
512 |
fabstoec |
1.126 |
}
|
513 |
|
|
ElectronOArr *tempIsoElectrons = new ElectronOArr;
|
514 |
|
|
MuonOArr *tempIsoMuons = new MuonOArr;
|
515 |
|
|
Double_t IsoOverPt = IsolationTools::PFElectronIsolation2012LepTag(ele, vertex, fPFNoPileUpCands,
|
516 |
fabstoec |
1.132 |
fPileupEnergyDensity, ElectronTools::kEleEAData2012, tempIsoElectrons, tempIsoMuons, 0.3, isDebug);
|
517 |
fabstoec |
1.126 |
delete tempIsoElectrons;
|
518 |
|
|
delete tempIsoMuons;
|
519 |
|
|
Double_t eta = ele->SCluster()->AbsEta();
|
520 |
|
|
Double_t IsoCut = -1;
|
521 |
|
|
if (ele->Pt() < 20 && eta < 0.800 ) IsoCut = 0.150;
|
522 |
|
|
if (ele->Pt() < 20 && eta >= 0.800 && eta < 1.479 ) IsoCut = 0.150;
|
523 |
|
|
if (ele->Pt() < 20 && eta >= 1.479 ) IsoCut = 0.10;
|
524 |
|
|
if (ele->Pt() >= 20 && eta < 0.800 ) IsoCut = 0.150;
|
525 |
|
|
if (ele->Pt() >= 20 && eta >= 0.800 && eta < 1.479 ) IsoCut = 0.150;
|
526 |
|
|
if (ele->Pt() >= 20 && eta >= 1.479 ) IsoCut = 0.150;
|
527 |
|
|
if (IsoOverPt < IsoCut ) isocut = kTRUE;
|
528 |
|
|
}
|
529 |
fabstoec |
1.132 |
break;
|
530 |
|
|
case ElectronTools::kPFIso_HggLeptonTag2012HCP:
|
531 |
mingyang |
1.129 |
{
|
532 |
fabstoec |
1.132 |
|
533 |
mingyang |
1.129 |
Bool_t isDebug = kFALSE;
|
534 |
|
|
if(isDebug == kTRUE){
|
535 |
|
|
printf("PFIso_HggLeptonTag2012HCP: %d, pt, eta = %f, %f, rho = %f(%f) : ",
|
536 |
|
|
GetEventHeader()->EvtNum(),ele->Pt(), ele->Eta(),
|
537 |
|
|
fPileupEnergyDensity->At(0)->Rho(),fPileupEnergyDensity->At(0)->RhoKt6PFJets());
|
538 |
|
|
}
|
539 |
|
|
ElectronOArr *tempIsoElectrons = new ElectronOArr;
|
540 |
|
|
MuonOArr *tempIsoMuons = new MuonOArr;
|
541 |
|
|
Double_t IsoOverPt = IsolationTools::PFElectronIsolation2012LepTag(ele, vertex, fPFNoPileUpCands,fPileupEnergyDensity, ElectronTools::kEleEAData2012, tempIsoElectrons, tempIsoMuons, 0.3, isDebug);
|
542 |
|
|
delete tempIsoElectrons;
|
543 |
|
|
delete tempIsoMuons;
|
544 |
|
|
Double_t eta = ele->SCluster()->AbsEta();
|
545 |
|
|
Double_t IsoCut = -1;
|
546 |
|
|
if (ele->Pt() < 20 && eta < 0.800 ) IsoCut = 0.150;
|
547 |
|
|
if (ele->Pt() < 20 && eta >= 0.800 && eta < 1.479 ) IsoCut = 0.150;
|
548 |
|
|
if (ele->Pt() < 20 && eta >= 1.479 ) IsoCut = 0.150;
|
549 |
|
|
if (ele->Pt() >= 20 && eta < 0.800 ) IsoCut = 0.150;
|
550 |
|
|
if (ele->Pt() >= 20 && eta >= 0.800 && eta < 1.479 ) IsoCut = 0.150;
|
551 |
|
|
if (ele->Pt() >= 20 && eta >= 1.479 ) IsoCut = 0.150;
|
552 |
|
|
if (IsoOverPt < IsoCut ) isocut = kTRUE;
|
553 |
|
|
}
|
554 |
|
|
break;
|
555 |
sixie |
1.127 |
case ElectronTools::kMVAIso_BDTG_IDIsoCombinedHWW2012TrigV4:
|
556 |
|
|
{
|
557 |
|
|
if (fabs(ele->SCluster()->Eta()) < 1.479) {
|
558 |
|
|
isocut = ( (ele->TrackIsolationDr03() - 1.0) < ele->Pt()*0.2) &&
|
559 |
|
|
(ele->EcalRecHitIsoDr03() < ele->Pt()*0.2) &&
|
560 |
|
|
(ele->HcalTowerSumEtDr03() < ele->Pt()*0.2);
|
561 |
|
|
} else {
|
562 |
|
|
isocut = (ele->TrackIsolationDr03() < ele->Pt()*0.2) &&
|
563 |
|
|
(ele->EcalRecHitIsoDr03() < ele->Pt()*0.2) &&
|
564 |
|
|
(ele->HcalTowerSumEtDr03() < ele->Pt()*0.2);
|
565 |
|
|
}
|
566 |
|
|
}
|
567 |
|
|
break;
|
568 |
sixie |
1.56 |
case ElectronTools::kNoIso:
|
569 |
sixie |
1.42 |
isocut = kTRUE;
|
570 |
|
|
break;
|
571 |
sixie |
1.56 |
case ElectronTools::kCustomIso:
|
572 |
ceballos |
1.118 |
break;
|
573 |
sixie |
1.42 |
default:
|
574 |
|
|
break;
|
575 |
|
|
}
|
576 |
|
|
|
577 |
|
|
return isocut;
|
578 |
|
|
}
|
579 |
|
|
|
580 |
|
|
|
581 |
|
|
//--------------------------------------------------------------------------------------------------
|
582 |
loizides |
1.1 |
void ElectronIDMod::Process()
|
583 |
|
|
{
|
584 |
|
|
// Process entries of the tree.
|
585 |
|
|
|
586 |
ceballos |
1.76 |
if(fElIsoType != ElectronTools::kPFIsoNoL) {
|
587 |
|
|
LoadEventObject(fElectronBranchName, fElectrons);
|
588 |
|
|
}
|
589 |
|
|
else {
|
590 |
|
|
fElectrons = GetObjThisEvt<ElectronOArr>(fElectronBranchName);
|
591 |
ceballos |
1.78 |
fNonIsolatedMuons = GetObjThisEvt<MuonCol>(fNonIsolatedMuonsName);
|
592 |
|
|
fNonIsolatedElectrons = GetObjThisEvt<ElectronCol>(fNonIsolatedElectronsName);
|
593 |
ceballos |
1.76 |
}
|
594 |
bendavid |
1.75 |
LoadEventObject(fBeamSpotName, fBeamSpot);
|
595 |
ceballos |
1.76 |
LoadEventObject(fTrackName, fTracks);
|
596 |
|
|
LoadEventObject(fPFCandidatesName, fPFCandidates);
|
597 |
mingyang |
1.129 |
|
598 |
sixie |
1.100 |
if(fElIsoType == ElectronTools::kTrackJuraSliding ||
|
599 |
sixie |
1.110 |
fElIsoType == ElectronTools::kCombinedRelativeConeAreaCorrected ||
|
600 |
ceballos |
1.116 |
fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombined ||
|
601 |
ceballos |
1.118 |
fElIdType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0 ||
|
602 |
sixie |
1.128 |
fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombinedHWW2012TrigV4 ||
|
603 |
fabstoec |
1.126 |
fElIsoType == ElectronTools::kPFIso_HWW2012TrigV0 ||
|
604 |
mingyang |
1.129 |
fElIsoType == ElectronTools::kPFIso_HggLeptonTag2012 ||
|
605 |
|
|
fElIsoType == ElectronTools::kPFIso_HggLeptonTag2012HCP
|
606 |
|
|
) {
|
607 |
ceballos |
1.80 |
LoadEventObject(fPileupEnergyDensityName, fPileupEnergyDensity);
|
608 |
ceballos |
1.130 |
assert(fPileupEnergyDensity);
|
609 |
ceballos |
1.80 |
}
|
610 |
mingyang |
1.129 |
|
611 |
ceballos |
1.76 |
fVertices = GetObjThisEvt<VertexOArr>(fVertexName);
|
612 |
ceballos |
1.130 |
|
613 |
mingyang |
1.129 |
if(fElIsoType == ElectronTools::kPFIso_HWW2012TrigV0 || fElIsoType == ElectronTools::kPFIso_HggLeptonTag2012 || fElIsoType == ElectronTools::kPFIso_HggLeptonTag2012HCP) {
|
614 |
ceballos |
1.118 |
// Name is hardcoded, can be changed if someone feels to do it
|
615 |
fabstoec |
1.126 |
fPFNoPileUpCands = GetObjThisEvt<PFCandidateCol>(fPFNoPileUpName);
|
616 |
ceballos |
1.118 |
}
|
617 |
|
|
|
618 |
bendavid |
1.62 |
//get trigger object collection if trigger matching is enabled
|
619 |
|
|
const TriggerObjectCol *trigObjs = 0;
|
620 |
|
|
if (fApplyTriggerMatching) {
|
621 |
|
|
trigObjs = GetHLTObjects(fTrigObjectsName);
|
622 |
|
|
}
|
623 |
|
|
|
624 |
loizides |
1.6 |
ElectronOArr *GoodElectrons = new ElectronOArr;
|
625 |
|
|
GoodElectrons->SetName(fGoodElectronsName);
|
626 |
loizides |
1.1 |
|
627 |
mingyang |
1.129 |
Double_t MVAValue = -100;
|
628 |
|
|
Double_t MVAValueMax = -99;
|
629 |
|
|
int NElectronMVAValueMax = 0;
|
630 |
|
|
int NPass = 0;
|
631 |
|
|
|
632 |
fabstoec |
1.115 |
for (UInt_t i=0; i<fElectrons->GetEntries() && fVertices->GetEntries() > 0 ; ++i) {
|
633 |
loizides |
1.5 |
const Electron *e = fElectrons->At(i);
|
634 |
loizides |
1.1 |
|
635 |
ceballos |
1.66 |
if (e->SCluster() == 0)
|
636 |
|
|
continue;
|
637 |
|
|
|
638 |
ceballos |
1.65 |
if (e->Pt() < fElectronPtMin)
|
639 |
loizides |
1.5 |
continue;
|
640 |
loizides |
1.1 |
|
641 |
dkralph |
1.73 |
if (e->SCluster()->Et() < fElectronEtMin)
|
642 |
bendavid |
1.67 |
continue;
|
643 |
|
|
|
644 |
ceballos |
1.65 |
if (e->AbsEta() > fElectronEtaMax)
|
645 |
ceballos |
1.64 |
continue;
|
646 |
sixie |
1.112 |
|
647 |
ceballos |
1.130 |
if (fApplyEcalFiducial && ( (e->SCluster()->AbsEta()>1.4442 && e->SCluster()->AbsEta()<1.5666) || e->SCluster()->AbsEta()>2.5 )) {
|
648 |
bendavid |
1.67 |
continue;
|
649 |
|
|
}
|
650 |
|
|
|
651 |
|
|
if (fApplyEcalSeeded && !e->IsEcalDriven()) {
|
652 |
|
|
continue;
|
653 |
|
|
}
|
654 |
|
|
|
655 |
bendavid |
1.62 |
//apply trigger matching
|
656 |
|
|
Bool_t matchTrigger = fApplyTriggerMatching && ElectronTools::PassTriggerMatching(e,trigObjs);
|
657 |
|
|
if (fApplyTriggerMatching && !matchTrigger)
|
658 |
|
|
continue;
|
659 |
ceballos |
1.130 |
|
660 |
sixie |
1.55 |
//apply ECAL spike removal
|
661 |
sixie |
1.56 |
Bool_t spikecut = ElectronTools::PassSpikeRemovalFilter(e);
|
662 |
sixie |
1.57 |
if (fApplySpikeRemoval && !spikecut)
|
663 |
sixie |
1.55 |
continue;
|
664 |
ceballos |
1.130 |
|
665 |
sixie |
1.42 |
//apply Isolation Cut
|
666 |
ceballos |
1.80 |
Double_t Rho = 0.0;
|
667 |
sixie |
1.100 |
if( fElIsoType == ElectronTools::kTrackJuraSliding
|
668 |
sixie |
1.110 |
|| fElIsoType == ElectronTools::kCombinedRelativeConeAreaCorrected
|
669 |
|
|
|| fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombined
|
670 |
sixie |
1.111 |
) {
|
671 |
fabstoec |
1.119 |
switch(fTheRhoType) {
|
672 |
|
|
case RhoUtilities::MIT_RHO_VORONOI_HIGH_ETA:
|
673 |
|
|
Rho = fPileupEnergyDensity->At(0)->Rho();
|
674 |
|
|
break;
|
675 |
|
|
case RhoUtilities::MIT_RHO_VORONOI_LOW_ETA:
|
676 |
|
|
Rho = fPileupEnergyDensity->At(0)->RhoLowEta();
|
677 |
|
|
break;
|
678 |
|
|
case RhoUtilities::MIT_RHO_RANDOM_HIGH_ETA:
|
679 |
|
|
Rho = fPileupEnergyDensity->At(0)->RhoRandom();
|
680 |
|
|
break;
|
681 |
|
|
case RhoUtilities::MIT_RHO_RANDOM_LOW_ETA:
|
682 |
|
|
Rho = fPileupEnergyDensity->At(0)->RhoRandomLowEta();
|
683 |
|
|
break;
|
684 |
ceballos |
1.122 |
case RhoUtilities::CMS_RHO_RHOKT6PFJETS:
|
685 |
|
|
Rho = fPileupEnergyDensity->At(0)->RhoKt6PFJets();
|
686 |
|
|
break;
|
687 |
fabstoec |
1.119 |
default:
|
688 |
|
|
// use the old default
|
689 |
|
|
Rho = fPileupEnergyDensity->At(0)->Rho();
|
690 |
|
|
break;
|
691 |
|
|
}
|
692 |
ceballos |
1.80 |
}
|
693 |
ceballos |
1.130 |
|
694 |
mingyang |
1.129 |
Bool_t isocut = kFALSE;
|
695 |
|
|
if(fElIsoType == ElectronTools::kPFIso_HggLeptonTag2012HCP){
|
696 |
|
|
Double_t distVtx = 999.0;
|
697 |
|
|
Int_t closestVtx = 0;
|
698 |
|
|
for(UInt_t nv=0; nv<fVertices->GetEntries(); nv++){
|
699 |
|
|
double dz = TMath::Abs(e->GsfTrk()->DzCorrected(*fVertices->At(nv)));
|
700 |
|
|
if(dz < distVtx) {
|
701 |
|
|
distVtx = dz;
|
702 |
|
|
closestVtx = nv;
|
703 |
|
|
}
|
704 |
|
|
}
|
705 |
|
|
isocut = PassIsolationCut(e, fElIsoType, fTracks, fVertices->At(closestVtx), Rho, fElIdType);
|
706 |
|
|
}else{
|
707 |
|
|
isocut = PassIsolationCut(e, fElIsoType, fTracks, fVertices->At(0), Rho, fElIdType);
|
708 |
|
|
}
|
709 |
sixie |
1.42 |
if (!isocut)
|
710 |
loizides |
1.5 |
continue;
|
711 |
ceballos |
1.130 |
|
712 |
ceballos |
1.60 |
// apply conversion filters
|
713 |
|
|
Bool_t passConvVetoType1 = kFALSE;
|
714 |
|
|
if (fApplyConvFilterType1) {
|
715 |
sixie |
1.42 |
LoadEventObject(fConversionBranchName, fConversions);
|
716 |
ceballos |
1.60 |
passConvVetoType1 = ElectronTools::PassConversionFilter(e, fConversions,
|
717 |
bendavid |
1.82 |
fBeamSpot->At(0), 0, 1e-6, 2.0, kTRUE, kFALSE);
|
718 |
ceballos |
1.12 |
}
|
719 |
ceballos |
1.60 |
else {
|
720 |
|
|
passConvVetoType1 = kTRUE;
|
721 |
|
|
}
|
722 |
|
|
|
723 |
|
|
if (passConvVetoType1 == kFALSE) continue;
|
724 |
|
|
|
725 |
|
|
Bool_t passConvVetoType2 = kFALSE;
|
726 |
|
|
if (fApplyConvFilterType2) {
|
727 |
|
|
passConvVetoType2 = TMath::Abs(e->ConvPartnerDCotTheta()) >= 0.02 ||
|
728 |
|
|
TMath::Abs(e->ConvPartnerDist()) >= 0.02;
|
729 |
|
|
}
|
730 |
|
|
else {
|
731 |
|
|
passConvVetoType2 = kTRUE;
|
732 |
|
|
}
|
733 |
sixie |
1.42 |
|
734 |
ceballos |
1.60 |
if (passConvVetoType2 == kFALSE) continue;
|
735 |
ceballos |
1.130 |
|
736 |
ceballos |
1.60 |
// apply NExpectedHitsInner Cut
|
737 |
ceballos |
1.98 |
if(fInvertNExpectedHitsInnerCut == kFALSE && fNExpectedHitsInnerCut < 999 &&
|
738 |
ceballos |
1.69 |
e->CorrectedNExpectedHitsInner() > fNExpectedHitsInnerCut) continue;
|
739 |
ceballos |
1.60 |
|
740 |
ceballos |
1.98 |
// apply NExpectedHitsInner inverted Cut
|
741 |
|
|
if(fInvertNExpectedHitsInnerCut == kTRUE && fNExpectedHitsInnerCut < 999 &&
|
742 |
|
|
e->CorrectedNExpectedHitsInner() <= fNExpectedHitsInnerCut) continue;
|
743 |
|
|
|
744 |
sixie |
1.42 |
// apply d0 cut
|
745 |
ceballos |
1.15 |
if (fApplyD0Cut) {
|
746 |
ceballos |
1.81 |
Bool_t passD0cut = kTRUE;
|
747 |
|
|
if(fWhichVertex >= -1) passD0cut = ElectronTools::PassD0Cut(e, fVertices, fD0Cut, fWhichVertex);
|
748 |
|
|
else passD0cut = ElectronTools::PassD0Cut(e, fBeamSpot, fD0Cut);
|
749 |
sixie |
1.42 |
if (!passD0cut)
|
750 |
ceballos |
1.24 |
continue;
|
751 |
ceballos |
1.12 |
}
|
752 |
ceballos |
1.130 |
|
753 |
ceballos |
1.81 |
// apply dz cut
|
754 |
|
|
if (fApplyDZCut) {
|
755 |
ceballos |
1.83 |
Bool_t passDZcut = ElectronTools::PassDZCut(e, fVertices, fDZCut, fWhichVertex);
|
756 |
ceballos |
1.81 |
if (!passDZcut)
|
757 |
|
|
continue;
|
758 |
|
|
}
|
759 |
ceballos |
1.130 |
|
760 |
mingyang |
1.129 |
//apply id cut
|
761 |
|
|
Bool_t idcut = kFALSE;
|
762 |
|
|
if(fElIdType == ElectronTools::kHggLeptonTagId2012HCP){
|
763 |
|
|
Double_t distVtx = 999.0;
|
764 |
|
|
Int_t closestVtx = 0;
|
765 |
|
|
for(UInt_t nv=0; nv<fVertices->GetEntries(); nv++){
|
766 |
|
|
double dz = TMath::Abs(e->GsfTrk()->DzCorrected(*fVertices->At(nv)));
|
767 |
|
|
if(dz < distVtx) {
|
768 |
|
|
distVtx = dz;
|
769 |
|
|
closestVtx = nv;
|
770 |
|
|
}
|
771 |
|
|
}
|
772 |
fabstoec |
1.132 |
|
773 |
|
|
MVAValue = EvaluateMVAID(e, ElectronTools::kHggLeptonTagId2012HCP, fVertices->At(closestVtx), fPFCandidates, fPileupEnergyDensity);
|
774 |
|
|
|
775 |
mingyang |
1.129 |
idcut = PassIDCut(e, fElIdType, fVertices->At(closestVtx));
|
776 |
ceballos |
1.81 |
|
777 |
mingyang |
1.129 |
if(MVAValue>MVAValueMax){
|
778 |
|
|
MVAValueMax = MVAValue;
|
779 |
|
|
NElectronMVAValueMax = i;
|
780 |
|
|
}
|
781 |
ceballos |
1.130 |
} else {
|
782 |
mingyang |
1.129 |
idcut = PassIDCut(e, fElIdType, fVertices->At(0));
|
783 |
|
|
}
|
784 |
sixie |
1.102 |
if (!idcut)
|
785 |
|
|
continue;
|
786 |
ceballos |
1.130 |
|
787 |
fabstoec |
1.132 |
|
788 |
ceballos |
1.59 |
// apply charge filter
|
789 |
sixie |
1.42 |
if(fChargeFilter == kTRUE) {
|
790 |
sixie |
1.56 |
Bool_t passChargeFilter = ElectronTools::PassChargeFilter(e);
|
791 |
sixie |
1.42 |
if (!passChargeFilter) continue;
|
792 |
ceballos |
1.45 |
}
|
793 |
|
|
|
794 |
ceballos |
1.63 |
// apply full combined id, using Tight cuts
|
795 |
ceballos |
1.59 |
if(fCombinedIdCut == kTRUE) {
|
796 |
ceballos |
1.68 |
fVertices = GetObjThisEvt<VertexOArr>(fVertexName);
|
797 |
ceballos |
1.59 |
LoadEventObject(fConversionBranchName, fConversions);
|
798 |
ceballos |
1.63 |
Int_t result = ElectronTools::PassTightId(e, *&fVertices, fConversions, 2);
|
799 |
ceballos |
1.59 |
if(result != 15) continue;
|
800 |
|
|
}
|
801 |
|
|
|
802 |
loizides |
1.5 |
// add good electron
|
803 |
mingyang |
1.129 |
if(fElIdType!=ElectronTools::kHggLeptonTagId2012HCP){
|
804 |
|
|
GoodElectrons->Add(e);
|
805 |
|
|
}
|
806 |
|
|
|
807 |
|
|
NPass = NPass+1;
|
808 |
loizides |
1.5 |
}
|
809 |
loizides |
1.1 |
|
810 |
mingyang |
1.129 |
if((fElIdType==ElectronTools::kHggLeptonTagId2012HCP) && (NPass>0)){
|
811 |
|
|
GoodElectrons->Add(fElectrons->At(NElectronMVAValueMax));
|
812 |
|
|
}
|
813 |
|
|
|
814 |
loizides |
1.9 |
// sort according to pt
|
815 |
|
|
GoodElectrons->Sort();
|
816 |
|
|
|
817 |
loizides |
1.5 |
// add to event for other modules to use
|
818 |
loizides |
1.6 |
AddObjThisEvt(GoodElectrons);
|
819 |
loizides |
1.1 |
}
|
820 |
|
|
|
821 |
|
|
//--------------------------------------------------------------------------------------------------
|
822 |
|
|
void ElectronIDMod::SlaveBegin()
|
823 |
|
|
{
|
824 |
|
|
// Run startup code on the computer (slave) doing the actual analysis. Here,
|
825 |
loizides |
1.5 |
// we just request the electron collection branch.
|
826 |
loizides |
1.1 |
|
827 |
ceballos |
1.76 |
// In this case we cannot have a branch
|
828 |
|
|
if (fElectronIsoType.CompareTo("PFIsoNoL") != 0 ) {
|
829 |
|
|
ReqEventObject(fElectronBranchName, fElectrons,fElectronsFromBranch);
|
830 |
|
|
}
|
831 |
|
|
ReqEventObject(fBeamSpotName, fBeamSpot, kTRUE);
|
832 |
|
|
ReqEventObject(fTrackName, fTracks, kTRUE);
|
833 |
|
|
ReqEventObject(fPFCandidatesName, fPFCandidates, kTRUE);
|
834 |
sixie |
1.100 |
if (fElectronIsoType.CompareTo("TrackJuraSliding") == 0
|
835 |
sixie |
1.110 |
|| fElectronIsoType.CompareTo("CombinedRelativeConeAreaCorrected") == 0
|
836 |
|
|
|| fElectronIsoType.CompareTo("MVA_BDTG_IDIsoCombined") == 0
|
837 |
ceballos |
1.117 |
|| fElectronIDType.CompareTo("MVA_BDTG_IDHWW2012TrigV0") == 0
|
838 |
ceballos |
1.118 |
|| fElectronIsoType.CompareTo("PFIso_HWW2012TrigV0") == 0
|
839 |
fabstoec |
1.126 |
|| fElectronIsoType.CompareTo("PFIso_HggLeptonTag2012") == 0
|
840 |
sixie |
1.127 |
|| fElectronIDType.CompareTo("MVA_BDTG_IDIsoCombinedHWW2012TrigV4") == 0
|
841 |
|
|
|| fElectronIsoType.CompareTo("MVA_BDTG_IDIsoCombinedHWW2012TrigV4") == 0
|
842 |
mingyang |
1.129 |
|| fElectronIsoType.CompareTo("PFIso_HggLeptonTag2012HCP") == 0
|
843 |
|
|
) {
|
844 |
ceballos |
1.80 |
ReqEventObject(fPileupEnergyDensityName, fPileupEnergyDensity, kTRUE);
|
845 |
|
|
}
|
846 |
ceballos |
1.130 |
|
847 |
ceballos |
1.59 |
if(fCombinedIdCut == kTRUE) {
|
848 |
ceballos |
1.60 |
fElectronIDType = "NoId";
|
849 |
|
|
fElectronIsoType = "NoIso";
|
850 |
|
|
fApplyConvFilterType1 = kFALSE;
|
851 |
|
|
fApplyConvFilterType2 = kFALSE;
|
852 |
|
|
fApplyD0Cut = kFALSE;
|
853 |
ceballos |
1.81 |
fApplyDZCut = kFALSE;
|
854 |
ceballos |
1.59 |
}
|
855 |
|
|
|
856 |
ceballos |
1.60 |
if (fApplyConvFilterType1 || fCombinedIdCut == kTRUE)
|
857 |
loizides |
1.23 |
ReqEventObject(fConversionBranchName, fConversions, kTRUE);
|
858 |
loizides |
1.17 |
|
859 |
sixie |
1.42 |
Setup();
|
860 |
sixie |
1.102 |
|
861 |
sixie |
1.42 |
}
|
862 |
|
|
|
863 |
|
|
//--------------------------------------------------------------------------------------------------
|
864 |
|
|
void ElectronIDMod::Setup()
|
865 |
|
|
{
|
866 |
|
|
// Set all options properly before execution.
|
867 |
|
|
|
868 |
loizides |
1.5 |
if (fElectronIDType.CompareTo("Tight") == 0)
|
869 |
sixie |
1.56 |
fElIdType = ElectronTools::kTight;
|
870 |
loizides |
1.5 |
else if (fElectronIDType.CompareTo("Loose") == 0)
|
871 |
sixie |
1.56 |
fElIdType = ElectronTools::kLoose;
|
872 |
sixie |
1.93 |
else if (fElectronIDType.CompareTo("Likelihood") == 0) {
|
873 |
|
|
if (!fLH) { cout << "Error: Likelihood not initialized.\n"; assert(0); }
|
874 |
sixie |
1.56 |
fElIdType = ElectronTools::kLikelihood;
|
875 |
sixie |
1.93 |
} else if (fElectronIDType.CompareTo("NoId") == 0)
|
876 |
sixie |
1.56 |
fElIdType = ElectronTools::kNoId;
|
877 |
sixie |
1.42 |
else if (fElectronIDType.CompareTo("ZeeId") == 0)
|
878 |
sixie |
1.56 |
fElIdType = ElectronTools::kZeeId;
|
879 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("CustomLoose") == 0)
|
880 |
sixie |
1.56 |
fElIdType = ElectronTools::kCustomIdLoose;
|
881 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("CustomTight") == 0)
|
882 |
sixie |
1.56 |
fElIdType = ElectronTools::kCustomIdTight;
|
883 |
ceballos |
1.86 |
else if (fElectronIDType.CompareTo("VBTFWorkingPointFakeableId") == 0)
|
884 |
|
|
fElIdType = ElectronTools::kVBTFWorkingPointFakeableId;
|
885 |
sixie |
1.55 |
else if (fElectronIDType.CompareTo("VBTFWorkingPoint95Id") == 0)
|
886 |
sixie |
1.56 |
fElIdType = ElectronTools::kVBTFWorkingPoint95Id;
|
887 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("VBTFWorkingPoint90Id") == 0)
|
888 |
sixie |
1.56 |
fElIdType = ElectronTools::kVBTFWorkingPoint90Id;
|
889 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("VBTFWorkingPoint80Id") == 0)
|
890 |
sixie |
1.56 |
fElIdType = ElectronTools::kVBTFWorkingPoint80Id;
|
891 |
ceballos |
1.83 |
else if (fElectronIDType.CompareTo("VBTFWorkingPointLowPtId") == 0)
|
892 |
|
|
fElIdType = ElectronTools::kVBTFWorkingPointLowPtId;
|
893 |
ceballos |
1.60 |
else if (fElectronIDType.CompareTo("VBTFWorkingPoint85Id") == 0)
|
894 |
|
|
fElIdType = ElectronTools::kVBTFWorkingPoint85Id;
|
895 |
sixie |
1.51 |
else if (fElectronIDType.CompareTo("VBTFWorkingPoint70Id") == 0)
|
896 |
sixie |
1.56 |
fElIdType = ElectronTools::kVBTFWorkingPoint70Id;
|
897 |
sixie |
1.108 |
else if (fElectronIDType.CompareTo("MVA_BDTG_NoIPInfo") == 0)
|
898 |
sixie |
1.110 |
fElIdType = ElectronTools::kMVAID_BDTG_NoIPInfo;
|
899 |
sixie |
1.108 |
else if (fElectronIDType.CompareTo("MVA_BDTG_WithIPInfo") == 0)
|
900 |
sixie |
1.110 |
fElIdType = ElectronTools::kMVAID_BDTG_WithIPInfo;
|
901 |
|
|
else if (fElectronIDType.CompareTo("MVA_BDTG_IDIsoCombined") == 0)
|
902 |
|
|
fElIdType = ElectronTools::kMVAID_BDTG_IDIsoCombined;
|
903 |
ceballos |
1.117 |
else if (fElectronIDType.CompareTo("MVA_BDTG_IDHWW2012TrigV0") == 0)
|
904 |
|
|
fElIdType = ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0;
|
905 |
fabstoec |
1.115 |
else if (fElectronIDType.CompareTo("Hgg_LeptonTag_WP85Id") == 0)
|
906 |
|
|
fElIdType = ElectronTools::kHggLeptonTagId;
|
907 |
fabstoec |
1.126 |
else if (fElectronIDType.CompareTo("Hgg_LeptonTag_2012Id") == 0)
|
908 |
|
|
fElIdType = ElectronTools::kHggLeptonTagId2012;
|
909 |
mingyang |
1.129 |
else if (fElectronIDType.CompareTo("Hgg_LeptonTag_2012IdHCP") == 0)
|
910 |
|
|
fElIdType = ElectronTools::kHggLeptonTagId2012HCP;
|
911 |
sixie |
1.127 |
else if (fElectronIDType.CompareTo("MVA_BDTG_IDIsoCombinedHWW2012TrigV4") == 0)
|
912 |
|
|
fElIdType = ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4;
|
913 |
fabstoec |
1.115 |
|
914 |
sixie |
1.107 |
else {
|
915 |
loizides |
1.5 |
SendError(kAbortAnalysis, "SlaveBegin",
|
916 |
|
|
"The specified electron identification %s is not defined.",
|
917 |
|
|
fElectronIDType.Data());
|
918 |
|
|
return;
|
919 |
|
|
}
|
920 |
sixie |
1.51 |
|
921 |
loizides |
1.5 |
if (fElectronIsoType.CompareTo("TrackCalo") == 0 )
|
922 |
sixie |
1.56 |
fElIsoType = ElectronTools::kTrackCalo;
|
923 |
loizides |
1.5 |
else if (fElectronIsoType.CompareTo("TrackJura") == 0)
|
924 |
sixie |
1.56 |
fElIsoType = ElectronTools::kTrackJura;
|
925 |
ceballos |
1.49 |
else if(fElectronIsoType.CompareTo("TrackJuraCombined") == 0)
|
926 |
sixie |
1.56 |
fElIsoType = ElectronTools::kTrackJuraCombined;
|
927 |
loizides |
1.5 |
else if(fElectronIsoType.CompareTo("TrackJuraSliding") == 0)
|
928 |
sixie |
1.56 |
fElIsoType = ElectronTools::kTrackJuraSliding;
|
929 |
ceballos |
1.80 |
else if(fElectronIsoType.CompareTo("TrackJuraSlidingNoCorrection") == 0)
|
930 |
|
|
fElIsoType = ElectronTools::kTrackJuraSlidingNoCorrection;
|
931 |
sixie |
1.99 |
else if(fElectronIsoType.CompareTo("CombinedRelativeConeAreaCorrected") == 0)
|
932 |
|
|
fElIsoType = ElectronTools::kCombinedRelativeConeAreaCorrected;
|
933 |
ceballos |
1.76 |
else if (fElectronIsoType.CompareTo("PFIso") == 0 )
|
934 |
|
|
fElIsoType = ElectronTools::kPFIso;
|
935 |
|
|
else if (fElectronIsoType.CompareTo("PFIsoNoL") == 0 )
|
936 |
|
|
fElIsoType = ElectronTools::kPFIsoNoL;
|
937 |
loizides |
1.5 |
else if (fElectronIsoType.CompareTo("NoIso") == 0 )
|
938 |
sixie |
1.56 |
fElIsoType = ElectronTools::kNoIso;
|
939 |
sixie |
1.42 |
else if (fElectronIsoType.CompareTo("ZeeIso") == 0 )
|
940 |
sixie |
1.56 |
fElIsoType = ElectronTools::kZeeIso;
|
941 |
sixie |
1.55 |
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint95Iso") == 0 )
|
942 |
sixie |
1.56 |
fElIsoType = ElectronTools::kVBTFWorkingPoint95Iso;
|
943 |
sixie |
1.51 |
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint90Iso") == 0 )
|
944 |
sixie |
1.56 |
fElIsoType = ElectronTools::kVBTFWorkingPoint90Iso;
|
945 |
ceballos |
1.60 |
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint85Iso") == 0 )
|
946 |
|
|
fElIsoType = ElectronTools::kVBTFWorkingPoint85Iso;
|
947 |
sixie |
1.51 |
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint80Iso") == 0 )
|
948 |
sixie |
1.56 |
fElIsoType = ElectronTools::kVBTFWorkingPoint80Iso;
|
949 |
sixie |
1.51 |
else if (fElectronIsoType.CompareTo("VBTFWorkingPoint70Iso") == 0 )
|
950 |
sixie |
1.56 |
fElIsoType = ElectronTools::kVBTFWorkingPoint70Iso;
|
951 |
sixie |
1.110 |
else if (fElectronIsoType.CompareTo("MVA_BDTG_IDIsoCombined") == 0 )
|
952 |
|
|
fElIsoType = ElectronTools::kMVAIso_BDTG_IDIsoCombined;
|
953 |
ceballos |
1.118 |
else if (fElectronIsoType.CompareTo("PFIso_HWW2012TrigV0") == 0)
|
954 |
fabstoec |
1.126 |
fElIsoType = ElectronTools::kPFIso_HWW2012TrigV0;
|
955 |
mingyang |
1.129 |
else if (fElectronIsoType.CompareTo("PFIso_HggLeptonTag2012") == 0)
|
956 |
fabstoec |
1.126 |
fElIsoType = ElectronTools::kPFIso_HggLeptonTag2012;
|
957 |
mingyang |
1.129 |
else if (fElectronIsoType.CompareTo("PFIso_HggLeptonTag2012HCP") == 0)
|
958 |
|
|
fElIsoType = ElectronTools::kPFIso_HggLeptonTag2012HCP;
|
959 |
sixie |
1.127 |
else if (fElectronIsoType.CompareTo("MVA_BDTG_IDIsoCombinedHWW2012TrigV4") == 0 )
|
960 |
|
|
fElIsoType = ElectronTools::kMVAIso_BDTG_IDIsoCombinedHWW2012TrigV4;
|
961 |
loizides |
1.5 |
else if (fElectronIsoType.CompareTo("Custom") == 0 ) {
|
962 |
sixie |
1.56 |
fElIsoType = ElectronTools::kCustomIso;
|
963 |
loizides |
1.5 |
SendError(kWarning, "SlaveBegin",
|
964 |
|
|
"Custom electron isolation is not yet implemented.");
|
965 |
|
|
} else {
|
966 |
|
|
SendError(kAbortAnalysis, "SlaveBegin",
|
967 |
|
|
"The specified electron isolation %s is not defined.",
|
968 |
|
|
fElectronIsoType.Data());
|
969 |
|
|
return;
|
970 |
|
|
}
|
971 |
sixie |
1.42 |
|
972 |
sixie |
1.102 |
//If we use MVA ID, need to load MVA weights
|
973 |
sixie |
1.110 |
if (fElIdType == ElectronTools::kMVAID_BDTG_NoIPInfo) {
|
974 |
sixie |
1.107 |
fElectronIDMVA = new ElectronIDMVA();
|
975 |
|
|
fElectronIDMVA->Initialize("BDTG method",
|
976 |
|
|
fElectronMVAWeights_Subdet0Pt10To20,
|
977 |
|
|
fElectronMVAWeights_Subdet1Pt10To20,
|
978 |
|
|
fElectronMVAWeights_Subdet2Pt10To20,
|
979 |
|
|
fElectronMVAWeights_Subdet0Pt20ToInf,
|
980 |
|
|
fElectronMVAWeights_Subdet1Pt20ToInf,
|
981 |
|
|
fElectronMVAWeights_Subdet2Pt20ToInf,
|
982 |
ceballos |
1.122 |
ElectronIDMVA::kNoIPInfo,
|
983 |
|
|
fTheRhoType);
|
984 |
sixie |
1.107 |
}
|
985 |
sixie |
1.110 |
if (fElIdType == ElectronTools::kMVAID_BDTG_WithIPInfo) {
|
986 |
sixie |
1.102 |
fElectronIDMVA = new ElectronIDMVA();
|
987 |
|
|
fElectronIDMVA->Initialize("BDTG method",
|
988 |
|
|
fElectronMVAWeights_Subdet0Pt10To20,
|
989 |
|
|
fElectronMVAWeights_Subdet1Pt10To20,
|
990 |
|
|
fElectronMVAWeights_Subdet2Pt10To20,
|
991 |
|
|
fElectronMVAWeights_Subdet0Pt20ToInf,
|
992 |
|
|
fElectronMVAWeights_Subdet1Pt20ToInf,
|
993 |
|
|
fElectronMVAWeights_Subdet2Pt20ToInf,
|
994 |
ceballos |
1.122 |
ElectronIDMVA::kWithIPInfo,
|
995 |
|
|
fTheRhoType);
|
996 |
sixie |
1.102 |
}
|
997 |
sixie |
1.110 |
if (fElIdType == ElectronTools::kMVAID_BDTG_IDIsoCombined || fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombined ) {
|
998 |
|
|
fElectronIDMVA = new ElectronIDMVA();
|
999 |
|
|
fElectronIDMVA->Initialize("BDTG method",
|
1000 |
|
|
fElectronMVAWeights_Subdet0Pt10To20,
|
1001 |
|
|
fElectronMVAWeights_Subdet1Pt10To20,
|
1002 |
|
|
fElectronMVAWeights_Subdet2Pt10To20,
|
1003 |
|
|
fElectronMVAWeights_Subdet0Pt20ToInf,
|
1004 |
|
|
fElectronMVAWeights_Subdet1Pt20ToInf,
|
1005 |
|
|
fElectronMVAWeights_Subdet2Pt20ToInf,
|
1006 |
ceballos |
1.122 |
ElectronIDMVA::kIDIsoCombined,
|
1007 |
|
|
fTheRhoType);
|
1008 |
sixie |
1.110 |
}
|
1009 |
sixie |
1.102 |
|
1010 |
ceballos |
1.117 |
if (fElIdType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0 ) {
|
1011 |
ceballos |
1.116 |
fElectronIDMVA = new ElectronIDMVA();
|
1012 |
|
|
fElectronIDMVA->Initialize("BDTG method",
|
1013 |
|
|
fElectronMVAWeights_Subdet0Pt10To20,
|
1014 |
|
|
fElectronMVAWeights_Subdet1Pt10To20,
|
1015 |
|
|
fElectronMVAWeights_Subdet2Pt10To20,
|
1016 |
|
|
fElectronMVAWeights_Subdet0Pt20ToInf,
|
1017 |
|
|
fElectronMVAWeights_Subdet1Pt20ToInf,
|
1018 |
|
|
fElectronMVAWeights_Subdet2Pt20ToInf,
|
1019 |
ceballos |
1.122 |
ElectronIDMVA::kIDHWW2012TrigV0,
|
1020 |
|
|
fTheRhoType);
|
1021 |
ceballos |
1.116 |
}
|
1022 |
|
|
|
1023 |
sixie |
1.127 |
if (fElIdType == ElectronTools::kMVAID_BDTG_IDIsoCombinedHWW2012TrigV4
|
1024 |
|
|
|| fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombinedHWW2012TrigV4 ) {
|
1025 |
|
|
fElectronIDMVA = new ElectronIDMVA();
|
1026 |
|
|
fElectronIDMVA->Initialize("BDTG method",
|
1027 |
|
|
fElectronMVAWeights_Subdet0Pt10To20,
|
1028 |
|
|
fElectronMVAWeights_Subdet1Pt10To20,
|
1029 |
|
|
fElectronMVAWeights_Subdet2Pt10To20,
|
1030 |
|
|
fElectronMVAWeights_Subdet0Pt20ToInf,
|
1031 |
|
|
fElectronMVAWeights_Subdet1Pt20ToInf,
|
1032 |
|
|
fElectronMVAWeights_Subdet2Pt20ToInf,
|
1033 |
|
|
ElectronIDMVA::kIDIsoCombinedHWW2012TrigV4,
|
1034 |
|
|
fTheRhoType);
|
1035 |
|
|
}
|
1036 |
|
|
|
1037 |
mingyang |
1.129 |
if (fElIdType == ElectronTools::kHggLeptonTagId2012HCP) {
|
1038 |
|
|
fElectronIDMVA = new ElectronIDMVA();
|
1039 |
|
|
fElectronIDMVA->Initialize("BDTG method",
|
1040 |
|
|
fElectronMVAWeights_Subdet0Pt10To20,
|
1041 |
|
|
fElectronMVAWeights_Subdet1Pt10To20,
|
1042 |
|
|
fElectronMVAWeights_Subdet2Pt10To20,
|
1043 |
|
|
fElectronMVAWeights_Subdet0Pt20ToInf,
|
1044 |
|
|
fElectronMVAWeights_Subdet1Pt20ToInf,
|
1045 |
|
|
fElectronMVAWeights_Subdet2Pt20ToInf,
|
1046 |
mingyang |
1.131 |
ElectronIDMVA::kIDEGamma2012NonTrigV1,
|
1047 |
mingyang |
1.129 |
fTheRhoType);
|
1048 |
|
|
}
|
1049 |
|
|
|
1050 |
loizides |
1.30 |
}
|
1051 |
ceballos |
1.77 |
|
1052 |
|
|
//--------------------------------------------------------------------------------------------------
|
1053 |
|
|
void ElectronIDMod::Terminate()
|
1054 |
|
|
{
|
1055 |
|
|
// Run finishing code on the computer (slave) that did the analysis
|
1056 |
sixie |
1.110 |
delete fElectronIDMVA;
|
1057 |
ceballos |
1.77 |
}
|