ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/ElectronIDMod.cc
Revision: 1.119
Committed: Wed May 2 16:33:46 2012 UTC (13 years ago) by fabstoec
Content type: text/plain
Branch: MAIN
Changes since 1.118: +22 -3 lines
Log Message:
made Rho choice changeable in the macros

File Contents

# User Rev Content
1 fabstoec 1.119 // $Id: ElectronIDMod.cc,v 1.118 2012/04/28 11:34:15 ceballos 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 ceballos 1.31 fElectronIDType("CustomTight"),
33 sixie 1.87 fElectronIsoType("PFIso"),
34 bendavid 1.62 fTrigObjectsName("HLTModTrigObjs"),
35 loizides 1.1 fElectronPtMin(10),
36 bendavid 1.67 fElectronEtMin(0.0),
37 ceballos 1.64 fElectronEtaMax(2.5),
38 ceballos 1.95 fIDLikelihoodCut(-999.0),
39 loizides 1.1 fTrackIsolationCut(5.0),
40     fCaloIsolationCut(5.0),
41 loizides 1.5 fEcalJuraIsoCut(5.0),
42     fHcalIsolationCut(5.0),
43 fabstoec 1.97 fCombIsolationCut(0.1),
44 sixie 1.99 fCombRelativeIsolationCut(0.10),
45 fabstoec 1.115 fCombRelativeIsolationCut_EE(0.10),
46 fabstoec 1.97 fPFIsolationCut(-1.0),
47 ceballos 1.60 fApplyConvFilterType1(kTRUE),
48     fApplyConvFilterType2(kFALSE),
49 bendavid 1.82 fNWrongHitsMax(0),
50 ceballos 1.60 fNExpectedHitsInnerCut(999),
51 ceballos 1.98 fInvertNExpectedHitsInnerCut(kFALSE),
52 ceballos 1.59 fCombinedIdCut(kFALSE),
53 sixie 1.58 fApplySpikeRemoval(kTRUE),
54 ceballos 1.18 fApplyD0Cut(kTRUE),
55 ceballos 1.81 fApplyDZCut(kTRUE),
56 ceballos 1.45 fChargeFilter(kTRUE),
57 ceballos 1.60 fD0Cut(0.020),
58 ceballos 1.89 fDZCut(0.10),
59 ceballos 1.81 fWhichVertex(-1),
60 bendavid 1.62 fApplyTriggerMatching(kFALSE),
61 bendavid 1.67 fApplyEcalSeeded(kFALSE),
62     fApplyCombinedIso(kTRUE),
63     fApplyEcalFiducial(kFALSE),
64 ceballos 1.76 fElectronsFromBranch(kTRUE),
65 sixie 1.56 fElIdType(ElectronTools::kIdUndef),
66     fElIsoType(ElectronTools::kIsoUndef),
67 loizides 1.14 fElectrons(0),
68     fConversions(0),
69 bendavid 1.75 fVertices(0),
70 ceballos 1.76 fBeamSpot(0),
71     fTracks(0),
72     fPFCandidates(0),
73 ceballos 1.118 fPFNoPileUpCands(0),
74 ceballos 1.101 fIntRadius(0.0),
75 ceballos 1.78 fNonIsolatedMuons(0),
76     fNonIsolatedElectrons(0),
77 ceballos 1.80 fLH(0),
78     fPileupEnergyDensityName(Names::gkPileupEnergyDensityBrn),
79 sixie 1.102 fPileupEnergyDensity(0),
80     fElectronIDMVA(0),
81     fElectronMVAWeights_Subdet0Pt10To20(""),
82     fElectronMVAWeights_Subdet1Pt10To20(""),
83     fElectronMVAWeights_Subdet2Pt10To20(""),
84     fElectronMVAWeights_Subdet0Pt20ToInf(""),
85     fElectronMVAWeights_Subdet1Pt20ToInf(""),
86 fabstoec 1.119 fElectronMVAWeights_Subdet2Pt20ToInf(""),
87    
88     fTheRhoType(RhoUtilities::MIT_RHO_VORONOI_HIGH_ETA)
89 sixie 1.102
90 loizides 1.1 {
91     // Constructor.
92     }
93    
94     //--------------------------------------------------------------------------------------------------
95 sixie 1.102 Bool_t ElectronIDMod::PassLikelihoodID(const Electron *ele) const
96 ceballos 1.77 {
97 sixie 1.102
98     Double_t LikelihoodValue = ElectronTools::Likelihood(fLH, ele);
99 ceballos 1.96
100 ceballos 1.95 double likCut = fIDLikelihoodCut;
101     if(likCut > -900){
102     if(ele->Pt() > 20){
103     if(ele->SCluster()->AbsEta() < 1.479){
104 ceballos 1.101 if(ele->NumberOfClusters() - 1 == 0) likCut = 3.5;
105     else likCut = 4.0;
106 ceballos 1.95 }
107     else {
108 ceballos 1.101 if(ele->NumberOfClusters() - 1 == 0) likCut = 4.0;
109     else likCut = 4.0;
110 ceballos 1.95 }
111     }
112     else {
113     if(ele->SCluster()->AbsEta() < 1.479){
114 ceballos 1.101 if(ele->NumberOfClusters() - 1 == 0) likCut = 4.0;
115     else likCut = 4.5;
116 ceballos 1.95 }
117     else {
118 ceballos 1.101 if(ele->NumberOfClusters() - 1 == 0) likCut = 4.0;
119     else likCut = 4.0;
120 ceballos 1.95 }
121     }
122     }
123 sixie 1.102 if (LikelihoodValue > likCut) return kTRUE;
124 ceballos 1.77 return kFALSE;
125     }
126    
127     //--------------------------------------------------------------------------------------------------
128 sixie 1.102 Bool_t ElectronIDMod::PassMVAID(const Electron *el, ElectronTools::EElIdType idType,
129 sixie 1.110 const Vertex *vertex, const PFCandidateCol *PFCands,
130     const PileupEnergyDensityCol *PileupEnergyDensity) const
131 ceballos 1.116 {
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.118 MVAValue = fElectronIDMVA->MVAValue(el, vertex, PFCands, PileupEnergyDensity, ElectronTools::kEleEANoCorr, tempElectrons, tempMuons, kFALSE);
140 ceballos 1.116 delete tempElectrons;
141     delete tempMuons;
142     }
143     else {
144 sixie 1.110 MVAValue = fElectronIDMVA->MVAValue(el, vertex);
145     }
146    
147 ceballos 1.118 Double_t eta = el->SCluster()->AbsEta();
148 sixie 1.102 Int_t MVABin = -1;
149 ceballos 1.118 if(idType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0) {
150     if (el->Pt() < 20 && eta < 0.800 ) MVABin = 0;
151     if (el->Pt() < 20 && eta >= 0.800 && fabs(eta) < 1.479 ) MVABin = 1;
152     if (el->Pt() < 20 && eta >= 1.479 ) MVABin = 2;
153     if (el->Pt() >= 20 && eta < 0.800 ) MVABin = 3;
154     if (el->Pt() >= 20 && eta >= 0.800 && fabs(eta) < 1.479 ) MVABin = 4;
155     if (el->Pt() >= 20 && eta >= 1.479 ) MVABin = 5;
156     } else {
157     if (el->Pt() < 20 && eta < 1.000 ) MVABin = 0;
158     if (el->Pt() < 20 && eta >= 1.000 && fabs(eta) < 1.479 ) MVABin = 1;
159     if (el->Pt() < 20 && eta >= 1.479 ) MVABin = 2;
160     if (el->Pt() >= 20 && eta < 1.000 ) MVABin = 3;
161     if (el->Pt() >= 20 && eta >= 1.000 && fabs(eta) < 1.479 ) MVABin = 4;
162     if (el->Pt() >= 20 && eta >= 1.479 ) MVABin = 5;
163     }
164     if(MVABin == -1) assert(0);
165 sixie 1.102
166     Double_t MVACut = -9999;
167 sixie 1.110 if (idType == ElectronTools::kMVAID_BDTG_NoIPInfo) {
168 ceballos 1.114 if (MVABin == 0) MVACut = 0.133;
169     else if (MVABin == 1) MVACut = 0.465;
170     else if (MVABin == 2) MVACut = 0.518;
171     else if (MVABin == 3) MVACut = 0.942;
172     else if (MVABin == 4) MVACut = 0.947;
173     else if (MVABin == 5) MVACut = 0.878 ;
174 sixie 1.110 } else if (idType == ElectronTools::kMVAID_BDTG_WithIPInfo) {
175 ceballos 1.114 if (MVABin == 0) MVACut = 0.139;
176     else if (MVABin == 1) MVACut = 0.525;
177     else if (MVABin == 2) MVACut = 0.543;
178     else if (MVABin == 3) MVACut = 0.947;
179     else if (MVABin == 4) MVACut = 0.950;
180     else if (MVABin == 5) MVACut = 0.884;
181 sixie 1.110 } else if (idType == ElectronTools::kMVAID_BDTG_IDIsoCombined) {
182 ceballos 1.114 if (MVABin == 0) MVACut = 0.4202;
183     else if (MVABin == 1) MVACut = 0.6206;
184     else if (MVABin == 2) MVACut = 0.6190;
185     else if (MVABin == 3) MVACut = 0.9590;
186     else if (MVABin == 4) MVACut = 0.9586;
187     else if (MVABin == 5) MVACut = 0.9278;
188 ceballos 1.117 } else if (idType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0) {
189 ceballos 1.116 if (MVABin == 0) MVACut = 0.294;
190     else if (MVABin == 1) MVACut = 0.730;
191     else if (MVABin == 2) MVACut = 0.802;
192     else if (MVABin == 3) MVACut = 0.950;
193     else if (MVABin == 4) MVACut = 0.970;
194     else if (MVABin == 5) MVACut = 0.950;
195 sixie 1.107 }
196    
197 sixie 1.102 if (MVAValue > MVACut) return kTRUE;
198     return kFALSE;
199     }
200    
201     //--------------------------------------------------------------------------------------------------
202     Bool_t ElectronIDMod::PassIDCut(const Electron *ele, ElectronTools::EElIdType idType,
203     const Vertex *vertex) const
204 sixie 1.42 {
205    
206     Bool_t idcut = kFALSE;
207     switch (idType) {
208 sixie 1.56 case ElectronTools::kTight:
209 sixie 1.42 idcut = ele->PassTightID();
210     break;
211 sixie 1.56 case ElectronTools::kLoose:
212 sixie 1.42 idcut = ele->PassLooseID();
213     break;
214 sixie 1.56 case ElectronTools::kLikelihood:
215 ceballos 1.101 idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId) &&
216 sixie 1.102 PassLikelihoodID(ele);
217 sixie 1.42 break;
218 sixie 1.56 case ElectronTools::kNoId:
219 sixie 1.42 idcut = kTRUE;
220     break;
221 sixie 1.56 case ElectronTools::kCustomIdLoose:
222     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kCustomIdLoose);
223 sixie 1.42 break;
224 sixie 1.56 case ElectronTools::kCustomIdTight:
225     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kCustomIdTight);
226 sixie 1.42 break;
227 ceballos 1.86 case ElectronTools::kVBTFWorkingPointFakeableId:
228     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
229     break;
230 sixie 1.56 case ElectronTools::kVBTFWorkingPoint95Id:
231     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint95Id);
232 ceballos 1.54 break;
233 sixie 1.56 case ElectronTools::kVBTFWorkingPoint90Id:
234     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint90Id);
235 ceballos 1.54 break;
236 ceballos 1.60 case ElectronTools::kVBTFWorkingPoint85Id:
237     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint85Id);
238     break;
239 sixie 1.56 case ElectronTools::kVBTFWorkingPoint80Id:
240     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint80Id);
241     break;
242 ceballos 1.83 case ElectronTools::kVBTFWorkingPointLowPtId:
243     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointLowPtId);
244 ceballos 1.81 break;
245 sixie 1.56 case ElectronTools::kVBTFWorkingPoint70Id:
246     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPoint70Id);
247 ceballos 1.54 break;
248 fabstoec 1.115 case ElectronTools::kHggLeptonTagId:
249     idcut = ElectronTools::PassHggLeptonTagID(ele);
250     break;
251 sixie 1.110 case ElectronTools::kMVAID_BDTG_NoIPInfo:
252 sixie 1.111 {
253     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
254     if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_NoIPInfo,
255     vertex, fPFCandidates, fPileupEnergyDensity);
256     }
257     break;
258 sixie 1.110 case ElectronTools::kMVAID_BDTG_WithIPInfo:
259 sixie 1.111 {
260     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
261     if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_WithIPInfo,
262     vertex, fPFCandidates, fPileupEnergyDensity);
263     }
264     break;
265 sixie 1.110 case ElectronTools::kMVAID_BDTG_IDIsoCombined:
266 sixie 1.111 {
267     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
268     if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_IDIsoCombined,
269     vertex, fPFCandidates, fPileupEnergyDensity );
270     }
271     break;
272 ceballos 1.117 case ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0:
273 ceballos 1.116 {
274     idcut = ElectronTools::PassCustomID(ele, ElectronTools::kVBTFWorkingPointFakeableId);
275 ceballos 1.117 if (idcut) idcut = PassMVAID(ele, ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0,
276 ceballos 1.116 vertex, fPFCandidates, fPileupEnergyDensity );
277     }
278     break;
279 sixie 1.42 default:
280     break;
281     }
282    
283     return idcut;
284     }
285    
286     //--------------------------------------------------------------------------------------------------
287 ceballos 1.76 Bool_t ElectronIDMod::PassIsolationCut(const Electron *ele, ElectronTools::EElIsoType isoType,
288 ceballos 1.80 const TrackCol *tracks, const Vertex *vertex,
289     const Double_t rho) const
290 sixie 1.42 {
291    
292     Bool_t isocut = kFALSE;
293     switch (isoType) {
294 sixie 1.56 case ElectronTools::kTrackCalo:
295 sixie 1.42 isocut = (ele->TrackIsolationDr03() < fTrackIsolationCut) &&
296     (ele->CaloIsolation() < fCaloIsolationCut);
297     break;
298 sixie 1.56 case ElectronTools::kTrackJura:
299 ceballos 1.85 isocut = (ele->TrackIsolationDr03() < ele->Pt()*fTrackIsolationCut) &&
300     (ele->EcalRecHitIsoDr03() < ele->Pt()*fEcalJuraIsoCut) &&
301     (ele->HcalTowerSumEtDr03() < ele->Pt()*fHcalIsolationCut);
302 sixie 1.42 break;
303 sixie 1.56 case ElectronTools::kTrackJuraCombined:
304 ceballos 1.60 isocut = (ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03()
305 ceballos 1.49 - 1.5 < fCombIsolationCut);
306     break;
307 sixie 1.56 case ElectronTools::kTrackJuraSliding:
308 sixie 1.42 {
309 ceballos 1.80 Double_t totalIso = ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03() - rho * TMath::Pi() * 0.3 * 0.3, 0.0);
310     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);
311 ceballos 1.79 if (totalIso < (ele->Pt()*fCombIsolationCut) )
312     isocut = kTRUE;
313     }
314     break;
315 ceballos 1.80 case ElectronTools::kTrackJuraSlidingNoCorrection:
316 ceballos 1.79 {
317 ceballos 1.80 Double_t totalIso = ele->TrackIsolationDr03() + (ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03());
318     if(ele->SCluster()->AbsEta() < 1.479) totalIso = ele->TrackIsolationDr03() + (TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) + ele->HcalTowerSumEtDr03());
319 ceballos 1.76 if (totalIso < (ele->Pt()*fCombIsolationCut) )
320     isocut = kTRUE;
321     }
322     break;
323 sixie 1.99 case ElectronTools::kCombinedRelativeConeAreaCorrected:
324     {
325     Double_t totalIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03() - rho * TMath::Pi() * 0.3 * 0.3;
326 fabstoec 1.115 if (ele->SCluster()->AbsEta() < 1.5) { // Barrel
327     if (totalIso < (ele->Pt()*fCombRelativeIsolationCut) )
328     isocut = kTRUE;
329     } else {
330     if (totalIso < (ele->Pt()*fCombRelativeIsolationCut_EE) )
331     isocut = kTRUE;
332     }
333 sixie 1.99 }
334     break;
335 ceballos 1.76 case ElectronTools::kPFIso:
336     {
337 sixie 1.87 Double_t pfIsoCutValue = 9999;
338 fabstoec 1.97 if(fPFIsolationCut > 0){
339     pfIsoCutValue = fPFIsolationCut;
340 ceballos 1.88 } else {
341 ceballos 1.91 if (ele->SCluster()->AbsEta() < 1.479) {
342 ceballos 1.88 if (ele->Pt() > 20) {
343 ceballos 1.92 pfIsoCutValue = 0.13;
344 ceballos 1.88 } else {
345 ceballos 1.92 pfIsoCutValue = 0.13;
346 ceballos 1.88 }
347 sixie 1.87 } else {
348 ceballos 1.91 if (ele->Pt() > 20) {
349     pfIsoCutValue = 0.09;
350     } else {
351     pfIsoCutValue = 0.09;
352     }
353     }
354 sixie 1.87 }
355 ceballos 1.101 Double_t totalIso = IsolationTools::PFElectronIsolation(ele, fPFCandidates, vertex, 0.1, 1.0, 0.4, fIntRadius);
356 sixie 1.87 if (totalIso < (ele->Pt()*pfIsoCutValue) )
357 ceballos 1.89 isocut = kTRUE;
358 ceballos 1.76 }
359     break;
360     case ElectronTools::kPFIsoNoL:
361     {
362 ceballos 1.109 Double_t pfIsoCutValue = 9999;
363     if(fPFIsolationCut > 0){
364     pfIsoCutValue = fPFIsolationCut;
365     } else {
366     if (ele->SCluster()->AbsEta() < 1.479) {
367     if (ele->Pt() > 20) {
368     pfIsoCutValue = 0.13;
369     } else {
370     pfIsoCutValue = 0.13;
371     }
372     } else {
373     if (ele->Pt() > 20) {
374     pfIsoCutValue = 0.09;
375     } else {
376     pfIsoCutValue = 0.09;
377     }
378     }
379     }
380     Double_t totalIso = IsolationTools::PFElectronIsolation(ele, fPFCandidates, fNonIsolatedMuons, fNonIsolatedElectrons, vertex, 0.1, 1.0, 0.4, fIntRadius);
381     if (totalIso < (ele->Pt()*pfIsoCutValue) )
382 sixie 1.42 isocut = kTRUE;
383     }
384     break;
385 sixie 1.56 case ElectronTools::kVBTFWorkingPoint95Iso:
386 bendavid 1.67 isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint95Iso, fApplyCombinedIso);
387 sixie 1.56 break;
388     case ElectronTools::kVBTFWorkingPoint90Iso:
389 bendavid 1.67 isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint90Iso, fApplyCombinedIso);
390 sixie 1.51 break;
391 ceballos 1.60 case ElectronTools::kVBTFWorkingPoint85Iso:
392 bendavid 1.67 isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint85Iso, fApplyCombinedIso);
393 ceballos 1.60 break;
394 sixie 1.56 case ElectronTools::kVBTFWorkingPoint80Iso:
395 bendavid 1.67 isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint80Iso, fApplyCombinedIso);
396 sixie 1.51 break;
397 sixie 1.56 case ElectronTools::kVBTFWorkingPoint70Iso:
398 bendavid 1.67 isocut = ElectronTools::PassCustomIso(ele, ElectronTools::kVBTFWorkingPoint70Iso, fApplyCombinedIso);
399 sixie 1.51 break;
400 sixie 1.110 case ElectronTools::kMVAIso_BDTG_IDIsoCombined:
401     isocut = (ele->TrackIsolationDr03() < ele->Pt()*0.2) &&
402     (ele->EcalRecHitIsoDr03() < ele->Pt()*0.2) &&
403     (ele->HcalTowerSumEtDr03() < ele->Pt()*0.2);
404     break;
405 ceballos 1.118 case ElectronTools::kPFIso_HWW2012TrigV0:
406     {
407     ElectronOArr *tempIsoElectrons = new ElectronOArr;
408     MuonOArr *tempIsoMuons = new MuonOArr;
409     Double_t IsoOverPt = IsolationTools::PFElectronIsolation2012(ele, vertex, fPFNoPileUpCands,
410     fPileupEnergyDensity, ElectronTools::kEleEANoCorr, tempIsoElectrons, tempIsoMuons, 0.4);
411     delete tempIsoElectrons;
412     delete tempIsoMuons;
413     Double_t eta = ele->SCluster()->AbsEta();
414     Double_t IsoCut = -1;
415     if (ele->Pt() < 20 && eta < 0.800 ) IsoCut = 0.158;
416     if (ele->Pt() < 20 && eta >= 0.800 && fabs(eta) < 1.479 ) IsoCut = 0.158;
417     if (ele->Pt() < 20 && eta >= 1.479 ) IsoCut = 0.108;
418     if (ele->Pt() >= 20 && eta < 0.800 ) IsoCut = 0.154;
419     if (ele->Pt() >= 20 && eta >= 0.800 && fabs(eta) < 1.479 ) IsoCut = 0.154;
420     if (ele->Pt() >= 20 && eta >= 1.479 ) IsoCut = 0.100;
421     if (IsoOverPt < IsoCut ) isocut = kTRUE;
422     }
423     break;
424 sixie 1.56 case ElectronTools::kNoIso:
425 sixie 1.42 isocut = kTRUE;
426     break;
427 sixie 1.56 case ElectronTools::kCustomIso:
428 ceballos 1.118 break;
429 sixie 1.42 default:
430     break;
431     }
432    
433     return isocut;
434     }
435    
436    
437     //--------------------------------------------------------------------------------------------------
438 loizides 1.1 void ElectronIDMod::Process()
439     {
440     // Process entries of the tree.
441    
442 ceballos 1.76 if(fElIsoType != ElectronTools::kPFIsoNoL) {
443     LoadEventObject(fElectronBranchName, fElectrons);
444     }
445     else {
446     fElectrons = GetObjThisEvt<ElectronOArr>(fElectronBranchName);
447 ceballos 1.78 fNonIsolatedMuons = GetObjThisEvt<MuonCol>(fNonIsolatedMuonsName);
448     fNonIsolatedElectrons = GetObjThisEvt<ElectronCol>(fNonIsolatedElectronsName);
449 ceballos 1.76 }
450 bendavid 1.75 LoadEventObject(fBeamSpotName, fBeamSpot);
451 ceballos 1.76 LoadEventObject(fTrackName, fTracks);
452     LoadEventObject(fPFCandidatesName, fPFCandidates);
453 sixie 1.100 if(fElIsoType == ElectronTools::kTrackJuraSliding ||
454 sixie 1.110 fElIsoType == ElectronTools::kCombinedRelativeConeAreaCorrected ||
455 ceballos 1.116 fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombined ||
456 ceballos 1.118 fElIdType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0 ||
457     fElIsoType == ElectronTools::kPFIso_HWW2012TrigV0
458 sixie 1.110 ) {
459 ceballos 1.80 LoadEventObject(fPileupEnergyDensityName, fPileupEnergyDensity);
460     }
461 ceballos 1.76 fVertices = GetObjThisEvt<VertexOArr>(fVertexName);
462 loizides 1.1
463 ceballos 1.118 if(fElIsoType == ElectronTools::kPFIso_HWW2012TrigV0) {
464     // Name is hardcoded, can be changed if someone feels to do it
465     fPFNoPileUpCands = GetObjThisEvt<PFCandidateCol>("PFNoPileUp");
466     }
467    
468 bendavid 1.62 //get trigger object collection if trigger matching is enabled
469     const TriggerObjectCol *trigObjs = 0;
470     if (fApplyTriggerMatching) {
471     trigObjs = GetHLTObjects(fTrigObjectsName);
472     }
473    
474 loizides 1.6 ElectronOArr *GoodElectrons = new ElectronOArr;
475     GoodElectrons->SetName(fGoodElectronsName);
476 loizides 1.1
477 fabstoec 1.115 for (UInt_t i=0; i<fElectrons->GetEntries() && fVertices->GetEntries() > 0 ; ++i) {
478 loizides 1.5 const Electron *e = fElectrons->At(i);
479 loizides 1.1
480 ceballos 1.66 if (e->SCluster() == 0)
481     continue;
482    
483 ceballos 1.65 if (e->Pt() < fElectronPtMin)
484 loizides 1.5 continue;
485 loizides 1.1
486 dkralph 1.73 if (e->SCluster()->Et() < fElectronEtMin)
487 bendavid 1.67 continue;
488    
489 ceballos 1.65 if (e->AbsEta() > fElectronEtaMax)
490 ceballos 1.64 continue;
491 sixie 1.112
492     //***********************************************************************************************
493     //Debug Info For Lepton MVA
494     //***********************************************************************************************
495     if (fPrintMVADebugInfo &&
496     ( fElIdType == ElectronTools::kMVAID_BDTG_IDIsoCombined ||
497 ceballos 1.116 fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombined ||
498 ceballos 1.117 fElIdType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0 )
499 sixie 1.112 ) {
500     cout << "Event: " << GetEventHeader()->RunNum() << " " << GetEventHeader()->LumiSec() << " "
501     << GetEventHeader()->EvtNum() << " : Rho = " << fPileupEnergyDensity->At(0)->Rho()
502     << " : Electron " << i << " "
503     << endl;
504     fElectronIDMVA->MVAValue(e, fVertices->At(0), fPFCandidates, fPileupEnergyDensity, kTRUE);
505     }
506     //***********************************************************************************************
507    
508 bendavid 1.67 if (fApplyEcalFiducial && ( (e->SCluster()->AbsEta()>1.4442 && e->SCluster()->AbsEta()<1.5666) || e->SCluster()->AbsEta()>2.5 )) {
509     continue;
510     }
511    
512     if (fApplyEcalSeeded && !e->IsEcalDriven()) {
513     continue;
514     }
515    
516 bendavid 1.62 //apply trigger matching
517     Bool_t matchTrigger = fApplyTriggerMatching && ElectronTools::PassTriggerMatching(e,trigObjs);
518     if (fApplyTriggerMatching && !matchTrigger)
519     continue;
520    
521 sixie 1.55 //apply ECAL spike removal
522 sixie 1.56 Bool_t spikecut = ElectronTools::PassSpikeRemovalFilter(e);
523 sixie 1.57 if (fApplySpikeRemoval && !spikecut)
524 sixie 1.55 continue;
525    
526 sixie 1.42 //apply Isolation Cut
527 ceballos 1.80 Double_t Rho = 0.0;
528 sixie 1.100 if( fElIsoType == ElectronTools::kTrackJuraSliding
529 sixie 1.110 || fElIsoType == ElectronTools::kCombinedRelativeConeAreaCorrected
530     || fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombined
531 sixie 1.111 ) {
532 fabstoec 1.119 switch(fTheRhoType) {
533     case RhoUtilities::MIT_RHO_VORONOI_HIGH_ETA:
534     Rho = fPileupEnergyDensity->At(0)->Rho();
535     break;
536     case RhoUtilities::MIT_RHO_VORONOI_LOW_ETA:
537     Rho = fPileupEnergyDensity->At(0)->RhoLowEta();
538     break;
539     case RhoUtilities::MIT_RHO_RANDOM_HIGH_ETA:
540     Rho = fPileupEnergyDensity->At(0)->RhoRandom();
541     break;
542     case RhoUtilities::MIT_RHO_RANDOM_LOW_ETA:
543     Rho = fPileupEnergyDensity->At(0)->RhoRandomLowEta();
544     break;
545     default:
546     // use the old default
547     Rho = fPileupEnergyDensity->At(0)->Rho();
548     break;
549     }
550 ceballos 1.80 }
551     Bool_t isocut = PassIsolationCut(e, fElIsoType, fTracks, fVertices->At(0), Rho);
552 sixie 1.42 if (!isocut)
553 loizides 1.5 continue;
554    
555 ceballos 1.60 // apply conversion filters
556     Bool_t passConvVetoType1 = kFALSE;
557     if (fApplyConvFilterType1) {
558 sixie 1.42 LoadEventObject(fConversionBranchName, fConversions);
559 ceballos 1.60 passConvVetoType1 = ElectronTools::PassConversionFilter(e, fConversions,
560 bendavid 1.82 fBeamSpot->At(0), 0, 1e-6, 2.0, kTRUE, kFALSE);
561 ceballos 1.12 }
562 ceballos 1.60 else {
563     passConvVetoType1 = kTRUE;
564     }
565    
566     if (passConvVetoType1 == kFALSE) continue;
567    
568     Bool_t passConvVetoType2 = kFALSE;
569     if (fApplyConvFilterType2) {
570     passConvVetoType2 = TMath::Abs(e->ConvPartnerDCotTheta()) >= 0.02 ||
571     TMath::Abs(e->ConvPartnerDist()) >= 0.02;
572     }
573     else {
574     passConvVetoType2 = kTRUE;
575     }
576 sixie 1.42
577 ceballos 1.60 if (passConvVetoType2 == kFALSE) continue;
578 ceballos 1.72
579 ceballos 1.60 // apply NExpectedHitsInner Cut
580 ceballos 1.98 if(fInvertNExpectedHitsInnerCut == kFALSE && fNExpectedHitsInnerCut < 999 &&
581 ceballos 1.69 e->CorrectedNExpectedHitsInner() > fNExpectedHitsInnerCut) continue;
582 ceballos 1.60
583 ceballos 1.98 // apply NExpectedHitsInner inverted Cut
584     if(fInvertNExpectedHitsInnerCut == kTRUE && fNExpectedHitsInnerCut < 999 &&
585     e->CorrectedNExpectedHitsInner() <= fNExpectedHitsInnerCut) continue;
586    
587 sixie 1.42 // apply d0 cut
588 ceballos 1.15 if (fApplyD0Cut) {
589 ceballos 1.81 Bool_t passD0cut = kTRUE;
590     if(fWhichVertex >= -1) passD0cut = ElectronTools::PassD0Cut(e, fVertices, fD0Cut, fWhichVertex);
591     else passD0cut = ElectronTools::PassD0Cut(e, fBeamSpot, fD0Cut);
592 sixie 1.42 if (!passD0cut)
593 ceballos 1.24 continue;
594 ceballos 1.12 }
595    
596 ceballos 1.81 // apply dz cut
597     if (fApplyDZCut) {
598 ceballos 1.83 Bool_t passDZcut = ElectronTools::PassDZCut(e, fVertices, fDZCut, fWhichVertex);
599 ceballos 1.81 if (!passDZcut)
600     continue;
601     }
602    
603 sixie 1.102 //apply id cut
604     Bool_t idcut = PassIDCut(e, fElIdType, fVertices->At(0));
605     if (!idcut)
606     continue;
607    
608 ceballos 1.59 // apply charge filter
609 sixie 1.42 if(fChargeFilter == kTRUE) {
610 sixie 1.56 Bool_t passChargeFilter = ElectronTools::PassChargeFilter(e);
611 sixie 1.42 if (!passChargeFilter) continue;
612 ceballos 1.45 }
613    
614 ceballos 1.63 // apply full combined id, using Tight cuts
615 ceballos 1.59 if(fCombinedIdCut == kTRUE) {
616 ceballos 1.68 fVertices = GetObjThisEvt<VertexOArr>(fVertexName);
617 ceballos 1.59 LoadEventObject(fConversionBranchName, fConversions);
618 ceballos 1.63 Int_t result = ElectronTools::PassTightId(e, *&fVertices, fConversions, 2);
619 ceballos 1.59 if(result != 15) continue;
620     }
621    
622 loizides 1.5 // add good electron
623 ceballos 1.12 GoodElectrons->Add(e);
624 loizides 1.5 }
625 loizides 1.1
626 loizides 1.9 // sort according to pt
627     GoodElectrons->Sort();
628    
629 loizides 1.5 // add to event for other modules to use
630 loizides 1.6 AddObjThisEvt(GoodElectrons);
631 loizides 1.1 }
632    
633     //--------------------------------------------------------------------------------------------------
634     void ElectronIDMod::SlaveBegin()
635     {
636     // Run startup code on the computer (slave) doing the actual analysis. Here,
637 loizides 1.5 // we just request the electron collection branch.
638 loizides 1.1
639 ceballos 1.76 // In this case we cannot have a branch
640     if (fElectronIsoType.CompareTo("PFIsoNoL") != 0 ) {
641     ReqEventObject(fElectronBranchName, fElectrons,fElectronsFromBranch);
642     }
643     ReqEventObject(fBeamSpotName, fBeamSpot, kTRUE);
644     ReqEventObject(fTrackName, fTracks, kTRUE);
645     ReqEventObject(fPFCandidatesName, fPFCandidates, kTRUE);
646 sixie 1.100 if (fElectronIsoType.CompareTo("TrackJuraSliding") == 0
647 sixie 1.110 || fElectronIsoType.CompareTo("CombinedRelativeConeAreaCorrected") == 0
648     || fElectronIsoType.CompareTo("MVA_BDTG_IDIsoCombined") == 0
649 ceballos 1.117 || fElectronIDType.CompareTo("MVA_BDTG_IDHWW2012TrigV0") == 0
650 ceballos 1.118 || fElectronIsoType.CompareTo("PFIso_HWW2012TrigV0") == 0
651 sixie 1.110 ) {
652 ceballos 1.80 ReqEventObject(fPileupEnergyDensityName, fPileupEnergyDensity, kTRUE);
653     }
654 loizides 1.17
655 ceballos 1.59 if(fCombinedIdCut == kTRUE) {
656 ceballos 1.60 fElectronIDType = "NoId";
657     fElectronIsoType = "NoIso";
658     fApplyConvFilterType1 = kFALSE;
659     fApplyConvFilterType2 = kFALSE;
660     fApplyD0Cut = kFALSE;
661 ceballos 1.81 fApplyDZCut = kFALSE;
662 ceballos 1.59 }
663    
664 ceballos 1.60 if (fApplyConvFilterType1 || fCombinedIdCut == kTRUE)
665 loizides 1.23 ReqEventObject(fConversionBranchName, fConversions, kTRUE);
666 loizides 1.17
667 sixie 1.42 Setup();
668 sixie 1.102
669 sixie 1.42 }
670    
671     //--------------------------------------------------------------------------------------------------
672     void ElectronIDMod::Setup()
673     {
674     // Set all options properly before execution.
675    
676 loizides 1.5 if (fElectronIDType.CompareTo("Tight") == 0)
677 sixie 1.56 fElIdType = ElectronTools::kTight;
678 loizides 1.5 else if (fElectronIDType.CompareTo("Loose") == 0)
679 sixie 1.56 fElIdType = ElectronTools::kLoose;
680 sixie 1.93 else if (fElectronIDType.CompareTo("Likelihood") == 0) {
681     if (!fLH) { cout << "Error: Likelihood not initialized.\n"; assert(0); }
682 sixie 1.56 fElIdType = ElectronTools::kLikelihood;
683 sixie 1.93 } else if (fElectronIDType.CompareTo("NoId") == 0)
684 sixie 1.56 fElIdType = ElectronTools::kNoId;
685 sixie 1.42 else if (fElectronIDType.CompareTo("ZeeId") == 0)
686 sixie 1.56 fElIdType = ElectronTools::kZeeId;
687 sixie 1.51 else if (fElectronIDType.CompareTo("CustomLoose") == 0)
688 sixie 1.56 fElIdType = ElectronTools::kCustomIdLoose;
689 sixie 1.51 else if (fElectronIDType.CompareTo("CustomTight") == 0)
690 sixie 1.56 fElIdType = ElectronTools::kCustomIdTight;
691 ceballos 1.86 else if (fElectronIDType.CompareTo("VBTFWorkingPointFakeableId") == 0)
692     fElIdType = ElectronTools::kVBTFWorkingPointFakeableId;
693 sixie 1.55 else if (fElectronIDType.CompareTo("VBTFWorkingPoint95Id") == 0)
694 sixie 1.56 fElIdType = ElectronTools::kVBTFWorkingPoint95Id;
695 sixie 1.51 else if (fElectronIDType.CompareTo("VBTFWorkingPoint90Id") == 0)
696 sixie 1.56 fElIdType = ElectronTools::kVBTFWorkingPoint90Id;
697 sixie 1.51 else if (fElectronIDType.CompareTo("VBTFWorkingPoint80Id") == 0)
698 sixie 1.56 fElIdType = ElectronTools::kVBTFWorkingPoint80Id;
699 ceballos 1.83 else if (fElectronIDType.CompareTo("VBTFWorkingPointLowPtId") == 0)
700     fElIdType = ElectronTools::kVBTFWorkingPointLowPtId;
701 ceballos 1.60 else if (fElectronIDType.CompareTo("VBTFWorkingPoint85Id") == 0)
702     fElIdType = ElectronTools::kVBTFWorkingPoint85Id;
703 sixie 1.51 else if (fElectronIDType.CompareTo("VBTFWorkingPoint70Id") == 0)
704 sixie 1.56 fElIdType = ElectronTools::kVBTFWorkingPoint70Id;
705 sixie 1.108 else if (fElectronIDType.CompareTo("MVA_BDTG_NoIPInfo") == 0)
706 sixie 1.110 fElIdType = ElectronTools::kMVAID_BDTG_NoIPInfo;
707 sixie 1.108 else if (fElectronIDType.CompareTo("MVA_BDTG_WithIPInfo") == 0)
708 sixie 1.110 fElIdType = ElectronTools::kMVAID_BDTG_WithIPInfo;
709     else if (fElectronIDType.CompareTo("MVA_BDTG_IDIsoCombined") == 0)
710     fElIdType = ElectronTools::kMVAID_BDTG_IDIsoCombined;
711 ceballos 1.117 else if (fElectronIDType.CompareTo("MVA_BDTG_IDHWW2012TrigV0") == 0)
712     fElIdType = ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0;
713 fabstoec 1.115
714     else if (fElectronIDType.CompareTo("Hgg_LeptonTag_WP85Id") == 0)
715     fElIdType = ElectronTools::kHggLeptonTagId;
716    
717 sixie 1.107 else {
718 loizides 1.5 SendError(kAbortAnalysis, "SlaveBegin",
719     "The specified electron identification %s is not defined.",
720     fElectronIDType.Data());
721     return;
722     }
723 sixie 1.51
724 loizides 1.5 if (fElectronIsoType.CompareTo("TrackCalo") == 0 )
725 sixie 1.56 fElIsoType = ElectronTools::kTrackCalo;
726 loizides 1.5 else if (fElectronIsoType.CompareTo("TrackJura") == 0)
727 sixie 1.56 fElIsoType = ElectronTools::kTrackJura;
728 ceballos 1.49 else if(fElectronIsoType.CompareTo("TrackJuraCombined") == 0)
729 sixie 1.56 fElIsoType = ElectronTools::kTrackJuraCombined;
730 loizides 1.5 else if(fElectronIsoType.CompareTo("TrackJuraSliding") == 0)
731 sixie 1.56 fElIsoType = ElectronTools::kTrackJuraSliding;
732 ceballos 1.80 else if(fElectronIsoType.CompareTo("TrackJuraSlidingNoCorrection") == 0)
733     fElIsoType = ElectronTools::kTrackJuraSlidingNoCorrection;
734 sixie 1.99 else if(fElectronIsoType.CompareTo("CombinedRelativeConeAreaCorrected") == 0)
735     fElIsoType = ElectronTools::kCombinedRelativeConeAreaCorrected;
736 ceballos 1.76 else if (fElectronIsoType.CompareTo("PFIso") == 0 )
737     fElIsoType = ElectronTools::kPFIso;
738     else if (fElectronIsoType.CompareTo("PFIsoNoL") == 0 )
739     fElIsoType = ElectronTools::kPFIsoNoL;
740 loizides 1.5 else if (fElectronIsoType.CompareTo("NoIso") == 0 )
741 sixie 1.56 fElIsoType = ElectronTools::kNoIso;
742 sixie 1.42 else if (fElectronIsoType.CompareTo("ZeeIso") == 0 )
743 sixie 1.56 fElIsoType = ElectronTools::kZeeIso;
744 sixie 1.55 else if (fElectronIsoType.CompareTo("VBTFWorkingPoint95Iso") == 0 )
745 sixie 1.56 fElIsoType = ElectronTools::kVBTFWorkingPoint95Iso;
746 sixie 1.51 else if (fElectronIsoType.CompareTo("VBTFWorkingPoint90Iso") == 0 )
747 sixie 1.56 fElIsoType = ElectronTools::kVBTFWorkingPoint90Iso;
748 ceballos 1.60 else if (fElectronIsoType.CompareTo("VBTFWorkingPoint85Iso") == 0 )
749     fElIsoType = ElectronTools::kVBTFWorkingPoint85Iso;
750 sixie 1.51 else if (fElectronIsoType.CompareTo("VBTFWorkingPoint80Iso") == 0 )
751 sixie 1.56 fElIsoType = ElectronTools::kVBTFWorkingPoint80Iso;
752 sixie 1.51 else if (fElectronIsoType.CompareTo("VBTFWorkingPoint70Iso") == 0 )
753 sixie 1.56 fElIsoType = ElectronTools::kVBTFWorkingPoint70Iso;
754 sixie 1.110 else if (fElectronIsoType.CompareTo("MVA_BDTG_IDIsoCombined") == 0 )
755     fElIsoType = ElectronTools::kMVAIso_BDTG_IDIsoCombined;
756 ceballos 1.118 else if (fElectronIsoType.CompareTo("PFIso_HWW2012TrigV0") == 0)
757     fElIsoType = ElectronTools::kPFIso_HWW2012TrigV0;
758 loizides 1.5 else if (fElectronIsoType.CompareTo("Custom") == 0 ) {
759 sixie 1.56 fElIsoType = ElectronTools::kCustomIso;
760 loizides 1.5 SendError(kWarning, "SlaveBegin",
761     "Custom electron isolation is not yet implemented.");
762     } else {
763     SendError(kAbortAnalysis, "SlaveBegin",
764     "The specified electron isolation %s is not defined.",
765     fElectronIsoType.Data());
766     return;
767     }
768 sixie 1.42
769 loizides 1.30
770 sixie 1.102 //If we use MVA ID, need to load MVA weights
771 sixie 1.110 if (fElIdType == ElectronTools::kMVAID_BDTG_NoIPInfo) {
772 sixie 1.107 fElectronIDMVA = new ElectronIDMVA();
773     fElectronIDMVA->Initialize("BDTG method",
774     fElectronMVAWeights_Subdet0Pt10To20,
775     fElectronMVAWeights_Subdet1Pt10To20,
776     fElectronMVAWeights_Subdet2Pt10To20,
777     fElectronMVAWeights_Subdet0Pt20ToInf,
778     fElectronMVAWeights_Subdet1Pt20ToInf,
779     fElectronMVAWeights_Subdet2Pt20ToInf,
780 sixie 1.108 ElectronIDMVA::kNoIPInfo);
781 sixie 1.107 }
782 sixie 1.110 if (fElIdType == ElectronTools::kMVAID_BDTG_WithIPInfo) {
783 sixie 1.102 fElectronIDMVA = new ElectronIDMVA();
784     fElectronIDMVA->Initialize("BDTG method",
785     fElectronMVAWeights_Subdet0Pt10To20,
786     fElectronMVAWeights_Subdet1Pt10To20,
787     fElectronMVAWeights_Subdet2Pt10To20,
788     fElectronMVAWeights_Subdet0Pt20ToInf,
789     fElectronMVAWeights_Subdet1Pt20ToInf,
790     fElectronMVAWeights_Subdet2Pt20ToInf,
791 sixie 1.108 ElectronIDMVA::kWithIPInfo);
792 sixie 1.102 }
793 sixie 1.110 if (fElIdType == ElectronTools::kMVAID_BDTG_IDIsoCombined || fElIsoType == ElectronTools::kMVAIso_BDTG_IDIsoCombined ) {
794     fElectronIDMVA = new ElectronIDMVA();
795     fElectronIDMVA->Initialize("BDTG method",
796     fElectronMVAWeights_Subdet0Pt10To20,
797     fElectronMVAWeights_Subdet1Pt10To20,
798     fElectronMVAWeights_Subdet2Pt10To20,
799     fElectronMVAWeights_Subdet0Pt20ToInf,
800     fElectronMVAWeights_Subdet1Pt20ToInf,
801     fElectronMVAWeights_Subdet2Pt20ToInf,
802     ElectronIDMVA::kIDIsoCombined);
803     }
804 sixie 1.102
805 ceballos 1.117 if (fElIdType == ElectronTools::kMVAID_BDTG_IDHWW2012TrigV0 ) {
806 ceballos 1.116 fElectronIDMVA = new ElectronIDMVA();
807     fElectronIDMVA->Initialize("BDTG method",
808     fElectronMVAWeights_Subdet0Pt10To20,
809     fElectronMVAWeights_Subdet1Pt10To20,
810     fElectronMVAWeights_Subdet2Pt10To20,
811     fElectronMVAWeights_Subdet0Pt20ToInf,
812     fElectronMVAWeights_Subdet1Pt20ToInf,
813     fElectronMVAWeights_Subdet2Pt20ToInf,
814 ceballos 1.117 ElectronIDMVA::kIDHWW2012TrigV0);
815 ceballos 1.116 }
816    
817 loizides 1.30 }
818 ceballos 1.77
819     //--------------------------------------------------------------------------------------------------
820     void ElectronIDMod::Terminate()
821     {
822     // Run finishing code on the computer (slave) that did the analysis
823 sixie 1.110 delete fElectronIDMVA;
824 ceballos 1.77 }