ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/src/ElectronTools.cc
(Generate patch)

Comparing UserCode/MitPhysics/Utils/src/ElectronTools.cc (file contents):
Revision 1.17 by ceballos, Mon Jan 17 17:32:49 2011 UTC vs.
Revision 1.38 by fabstoec, Tue Apr 24 11:45:53 2012 UTC

# Line 3 | Line 3
3   #include "MitPhysics/Utils/interface/ElectronTools.h"
4   #include "MitAna/DataTree/interface/StableData.h"
5   #include <TFile.h>
6 + #include "MitPhysics/ElectronLikelihood/interface/ElectronLikelihood.h"
7 + #include "MitPhysics/ElectronLikelihood/interface/LikelihoodSwitches.h"
8 + #include "MitPhysics/ElectronLikelihood/interface/LikelihoodMeasurements.h"
9  
10   ClassImp(mithep::ElectronTools)
11  
# Line 35 | Line 38 | Bool_t ElectronTools::PassCustomID(const
38      {0.3, 0.92, 0.211, 0.0, 0.42, 0.88, 0.68, 0.0},             //eoverp
39      {0.8,0.2,0,0,0,0,0,0}};                                     //extra cuts fbrem and E_Over_P
40  
41 +  Double_t VBTFWorkingPointFakeable[6][8] = {
42 +    {0.12,  0.12,  0.12,  0.12,  0.10,   0.10,   0.10,   0.10  }, //hovere
43 +    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03  }, //sigmaetaeta
44 +    {0.15,  0.15,  0.15,  0.15,  0.10,   0.10,   0.10,   0.10  }, //deltaphiin
45 +    {0.007, 0.007, 0.007, 0.007, 0.009,  0.009,  0.009,  0.009 }, //deltaetain
46 +    {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0   }, //eoverp
47 +    {0.0,   0.0,   0,     0,     0,      0,      0,      0     }  //extra cuts fbrem and E_Over_P
48 +  };            
49 +
50    Double_t VBTFWorkingPoint95[6][8] = {
51      {0.15,  0.15,  0.15,  0.15,  0.07,   0.07,   0.07,   0.07  }, //hovere
52      {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03  }, //sigmaetaeta
# Line 63 | Line 75 | Bool_t ElectronTools::PassCustomID(const
75    };            
76  
77    Double_t VBTFWorkingPoint80[6][8] = {
78 <    {0.04,  0.04,  0.04,  0.04,  0.025,  0.025,  0.025,  0.025}, //hovere
78 >    {0.04,  0.04,  0.04,  0.04,  0.10,   0.10,   0.10,   0.10 }, //hovere
79      {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
80      {0.06,  0.06,  0.06,  0.06,  0.03,   0.03,   0.03,   0.03 }, //deltaphiin
81      {0.004, 0.004, 0.004, 0.004, 0.007,  0.007,  0.007,  0.007}, //deltaetain
# Line 80 | Line 92 | Bool_t ElectronTools::PassCustomID(const
92      {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
93    };            
94  
95 +  Double_t VBTFWorkingPoint80NoHOverEE[6][8] = {
96 +    {0.04,  0.04,  0.04,  0.04,  0.10,   0.10,   0.10,   0.10 }, //hovere
97 +    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
98 +    {0.06,  0.06,  0.06,  0.06,  0.03,   0.03,   0.03,   0.03 }, //deltaphiin
99 +    {0.004, 0.004, 0.004, 0.004, 0.007,  0.007,  0.007,  0.007}, //deltaetain
100 +    {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0  }, //eoverp
101 +    {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
102 +  };            
103 +
104 +  Double_t VBTFWorkingPoint70NoHOverEE[6][8] = {
105 +    {0.025, 0.025, 0.025, 0.025, 0.10,   0.10,   0.10,   0.10 }, //hovere
106 +    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
107 +    {0.03,  0.03,  0.03,  0.03,  0.02,   0.02,   0.02,   0.02 }, //deltaphiin
108 +    {0.004, 0.004, 0.004, 0.004, 0.005,  0.005,  0.005,  0.005}, //deltaetain
109 +    {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0  }, //eoverp
110 +    {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
111 +  };            
112 +
113    switch (idType) {
114      case kCustomIdTight:    
115        memcpy(fCuts,tightcuts,sizeof(fCuts));
# Line 87 | Line 117 | Bool_t ElectronTools::PassCustomID(const
117      case kCustomIdLoose:
118        memcpy(fCuts,loosecuts,sizeof(fCuts));
119        break;
120 +    case kVBTFWorkingPointFakeableId:
121 +      memcpy(fCuts,VBTFWorkingPointFakeable,sizeof(fCuts));
122 +      break;
123      case kVBTFWorkingPoint95Id:
124        memcpy(fCuts,VBTFWorkingPoint95,sizeof(fCuts));
125        break;
# Line 99 | Line 132 | Bool_t ElectronTools::PassCustomID(const
132      case kVBTFWorkingPoint80Id:
133        memcpy(fCuts,VBTFWorkingPoint80,sizeof(fCuts));
134        break;
135 +    case kVBTFWorkingPointLowPtId:
136 +      if(ele->Pt() < 20)
137 +        memcpy(fCuts,VBTFWorkingPoint70NoHOverEE,sizeof(fCuts));
138 +      else
139 +        memcpy(fCuts,VBTFWorkingPoint80NoHOverEE,sizeof(fCuts));
140 +      break;
141      case kVBTFWorkingPoint70Id:
142        memcpy(fCuts,VBTFWorkingPoint70,sizeof(fCuts));
143        break;
# Line 107 | Line 146 | Bool_t ElectronTools::PassCustomID(const
146        break;
147    }
148  
110
149    // Based on RecoEgamma/ElectronIdentification/src/CutBasedElectronID.cc.
150    Double_t eOverP = ele->ESuperClusterOverP();
151    Double_t fBrem  = ele->FBrem();
# Line 126 | Line 164 | Bool_t ElectronTools::PassCustomID(const
164    
165    if(ele->SCluster() == 0)
166      return kFALSE;
167 <  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
167 >  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
168    Double_t hOverE       = ele->HadronicOverEm();
169    Double_t sigmaee      = ele->CoviEtaiEta();
170    Double_t deltaPhiIn   = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
# Line 135 | Line 173 | Bool_t ElectronTools::PassCustomID(const
173    Int_t eb = 1;
174    if (ele->IsEB())
175      eb = 0;
176 <
176 >
177    if (hOverE>fCuts[0][cat+4*eb])
178      return kFALSE;
179  
# Line 151 | Line 189 | Bool_t ElectronTools::PassCustomID(const
189    if(eSeedOverPin<fCuts[4][cat+4*eb])
190      return kFALSE;
191  
192 +  Bool_t isoCut = kTRUE;
193 +  if(idType == kVBTFWorkingPointFakeableId){
194 +    double isoEcal = ele->EcalRecHitIsoDr03();
195 +    if(ele->IsEB()) isoEcal = isoEcal - 1.0;
196 +    isoCut = (ele->TrackIsolationDr03() < ele->Pt()*0.2) &&
197 +             (isoEcal                   < ele->Pt()*0.2) &&
198 +             (ele->HcalTowerSumEtDr03() < ele->Pt()*0.2);
199 +  }
200 +  if(isoCut == kFALSE) return kFALSE;
201 +
202 +  // Cuts only for pt<20 region and kVBTFWorkingPointLowPtId
203 +  if(ele->Pt() < 20 && idType == kVBTFWorkingPointLowPtId) {
204 +    Bool_t isGoodLowPtEl = fBrem > 0.15 ||
205 +                          (ele->SCluster()->AbsEta() < 1.0 && eOverP > 0.95);
206 +    if(!isGoodLowPtEl) return kFALSE;
207 +  }
208 +  
209    return kTRUE;
210   }
211  
# Line 246 | Line 301 | Bool_t ElectronTools::PassCustomIso(cons
301  
302   //--------------------------------------------------------------------------------------------------
303   Bool_t ElectronTools::PassConversionFilter(const Electron *ele,
304 <                                           const DecayParticleCol *conversions,
305 <                                           Bool_t WrongHitsRequirement)
304 >                                           const DecayParticleCol *conversions,
305 >                                           const BaseVertex *vtx,
306 >                                           UInt_t nWrongHitsMax,
307 >                                           Double_t probMin,
308 >                                           Double_t lxyMin,
309 >                                           Bool_t matchCkf,
310 >                                           Bool_t requireArbitratedMerged,
311 >                                           Double_t trkptMin)
312   {
313    Bool_t isGoodConversion = kFALSE;
314  
# Line 256 | Line 317 | Bool_t ElectronTools::PassConversionFilt
317      for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
318        const Track *trk = dynamic_cast<const ChargedParticle*>
319          (conversions->At(ifc)->Daughter(d))->Trk();
320 <      if (ele->GsfTrk() == trk) {
320 >      if (ele->GsfTrk() == trk || (matchCkf && ele->TrackerTrk()==trk) ) {
321          ConversionMatchFound = kTRUE;
322          break;
323        }
# Line 264 | Line 325 | Bool_t ElectronTools::PassConversionFilt
325  
326      // if match between the e-track and one of the conversion legs
327      if (ConversionMatchFound == kTRUE){
328 <      isGoodConversion =  (conversions->At(ifc)->Prob() > 1e-6) &&
329 <        (conversions->At(ifc)->Lxy() > 0) &&
330 <        (conversions->At(ifc)->Lz() > 0) &&
270 <        (conversions->At(ifc)->Position().Rho() > 2.0);
328 >      isGoodConversion =  (conversions->At(ifc)->Prob() > probMin) &&
329 >        (!requireArbitratedMerged || conversions->At(ifc)->Quality().Quality(ConversionQuality::arbitratedMerged)) &&
330 >        (conversions->At(ifc)->LxyCorrected(vtx) > lxyMin);
331  
332        if (isGoodConversion == kTRUE) {
333          for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
334            const Track *trk = dynamic_cast<const ChargedParticle*>
335              (conversions->At(ifc)->Daughter(d))->Trk();
336            if (trk) {
337 <            // These requirements are not used for the GSF track
278 <            if (!(trk->NHits() >= 3 && trk->Prob() > 1e-6) && trk!=ele->GsfTrk())
279 <              isGoodConversion = kFALSE;
337 >            if (trk->Pt()<trkptMin) isGoodConversion = kFALSE;
338              const StableData *sd = dynamic_cast<const StableData*>
339                (conversions->At(ifc)->DaughterDat(d));
340 <            if (WrongHitsRequirement && sd->NWrongHits() != 0)
340 >            if (sd->NWrongHits() > nWrongHitsMax)
341                isGoodConversion = kFALSE;
342            } else {
343              isGoodConversion = kFALSE;
# Line 296 | Line 354 | Bool_t ElectronTools::PassConversionFilt
354   }
355  
356   //--------------------------------------------------------------------------------------------------
357 < Bool_t ElectronTools::PassD0Cut(const Electron *ele, const VertexCol *vertices, Double_t fD0Cut,
300 <                                Bool_t fReverseD0Cut)
357 > Bool_t ElectronTools::PassD0Cut(const Electron *ele, const VertexCol *vertices, Double_t fD0Cut, Int_t nVertex)
358   {
359    Bool_t d0cut = kFALSE;
360 <  // d0 cut
361 <  Double_t d0_real = 99999;
362 <  for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
363 <    if(vertices->At(i0)->NTracks() > 0){
364 <      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
365 <      d0_real = TMath::Abs(pD0);
366 <      break;
360 >
361 >  Double_t d0_real = 1e30;
362 >
363 >  if( nVertex >= (int) vertices->GetEntries() )
364 >    nVertex = vertices->GetEntries() - 1;
365 >  
366 >  if(nVertex >= 0) d0_real = TMath::Abs(ele->GsfTrk()->D0Corrected(*vertices->At(nVertex)));
367 >  else            {
368 >    Double_t distVtx = 999.0;
369 >    Int_t closestVtx = 0;
370 >    for(UInt_t nv=0; nv<vertices->GetEntries(); nv++){
371 >      double dz = TMath::Abs(ele->GsfTrk()->DzCorrected(*vertices->At(nv)));
372 >      if(dz < distVtx) {
373 >        distVtx    = dz;
374 >        closestVtx = nv;
375 >      }
376      }
377 +    d0_real = TMath::Abs(ele->GsfTrk()->D0Corrected(*vertices->At(closestVtx)));
378    }
379    if(d0_real < fD0Cut) d0cut = kTRUE;
380    
314  if     (fReverseD0Cut == kTRUE &&
315          d0cut == kFALSE && d0_real < 0.05)
316    d0cut = kTRUE;
317  else if(fReverseD0Cut == kTRUE)
318    d0cut = kFALSE;
319  
381    return d0cut;
382   }
383  
384   //--------------------------------------------------------------------------------------------------
385 < Bool_t ElectronTools::PassD0Cut(const Electron *ele, const BeamSpotCol *beamspots, Double_t fD0Cut,
325 <                                Bool_t fReverseD0Cut)
385 > Bool_t ElectronTools::PassD0Cut(const Electron *ele, const BeamSpotCol *beamspots, Double_t fD0Cut)
386   {
387    Bool_t d0cut = kFALSE;
388    // d0 cut
# Line 333 | Line 393 | Bool_t ElectronTools::PassD0Cut(const El
393    }
394    if(d0_real < fD0Cut) d0cut = kTRUE;
395    
336  if     (fReverseD0Cut == kTRUE &&
337          d0cut == kFALSE && d0_real < 0.05)
338    d0cut = kTRUE;
339  else if(fReverseD0Cut == kTRUE)
340    d0cut = kFALSE;
341  
396    return d0cut;
397   }
398  
399   //--------------------------------------------------------------------------------------------------
400 + Bool_t ElectronTools::PassDZCut(const Electron *ele, const VertexCol *vertices, Double_t fDZCut, Int_t nVertex)
401 + {
402 +  Bool_t dzcut = kFALSE;
403 +
404 +  Double_t distVtx = 999.0;
405 +
406 +  if( nVertex >= (int) vertices->GetEntries() )
407 +    nVertex = vertices->GetEntries()-1;
408 +  
409 +  if(nVertex >= 0) distVtx = TMath::Abs(ele->GsfTrk()->DzCorrected(*vertices->At(nVertex)));
410 +  else {
411 +    for(UInt_t nv=0; nv<vertices->GetEntries(); nv++){
412 +      double dz = TMath::Abs(ele->GsfTrk()->DzCorrected(*vertices->At(nv)));
413 +      if(dz < distVtx) {
414 +        distVtx  = dz;
415 +      }
416 +    }
417 +  }
418 +  
419 +  if(distVtx < fDZCut) dzcut = kTRUE;
420 +  
421 +  return dzcut;
422 + }
423 +
424 + //--------------------------------------------------------------------------------------------------
425   Bool_t ElectronTools::PassChargeFilter(const Electron *ele)
426   {
427    Bool_t passChargeFilter = kTRUE;
# Line 430 | Line 509 | Int_t ElectronTools::Classify(const Elec
509  
510   //--------------------------------------------------------------------------------------------------
511   Int_t ElectronTools::PassTightId(const Electron *ele, const VertexCol *vertices,
512 <                                 const DecayParticleCol *conversions, const Int_t typeCuts){
512 >                                 const DecayParticleCol *conversions, const Int_t typeCuts,
513 >                                 Double_t beta){
514  
515   // original code on
516   // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/RecoEgamma/ElectronIdentification/src/CutBasedElectronID.cc
517 + // beta must be computed with a DR cone of 0.4
518  
519    Double_t scEt   = ele->SCluster()->Et();
520    Double_t scEta  = ele->SCluster()->Eta();
# Line 447 | Line 528 | Int_t ElectronTools::PassTightId(const E
528  
529    Int_t mishits = ele->BestTrk()->NExpectedHitsInner();
530    Double_t tkIso   = ele->TrackIsolationDr03();
531 <  Double_t ecalIso = ele->EcalRecHitIsoDr04();
532 <  Double_t hcalIso  = ele->HcalTowerSumEtDr04();
531 >  Double_t ecalIso = ele->EcalRecHitIsoDr04()*beta;
532 >  Double_t hcalIso  = ele->HcalTowerSumEtDr04()*beta;
533  
534    int cat = Classify(ele);
535    int eb;
# Line 526 | Line 607 | Int_t ElectronTools::PassTightId(const E
607    Double_t cutseelTight[9] = {
608    1.27e-02, 1.08e-02, 1.13e-02, 4.19e-02, 2.81e-02, 3.02e-02, 9.76e-03, 4.28e-02, 2.98e-02};
609    
610 +  // SuperTight cuts
611    Double_t cutdcotdistSuperTight[9] = {
612    2.11e-02, 1.86e-02, 1.55e-02, 3.40e-02, 2.85e-02, 3.32e-02, 1.64e-02, 3.75e-02, 1.30e-04};
613    Double_t cutdetainSuperTight[9] = {
# Line 559 | Line 641 | Int_t ElectronTools::PassTightId(const E
641    Double_t cutseelSuperTight[9] = {
642    1.12e-02, 1.05e-02, 1.07e-02, 3.51e-02, 2.75e-02, 2.87e-02, 9.59e-03, 2.67e-02, 2.98e-02};
643  
644 +  // HyperTight1 cuts
645 +  Double_t cutdcotdistHyperTight1[9] = {
646 +  1.48e-02, 1.50e-02, 8.25e-03, 3.16e-02, 2.85e-02, 3.15e-02, 6.62e-03, 3.48e-02, 3.63e-06};
647 +  Double_t cutdetainHyperTight1[9] = {
648 +  6.51e-03, 3.51e-03, 5.53e-03, 9.16e-03, 5.30e-03, 8.28e-03, 1.08e-02, 2.97e-02, 7.24e-03};
649 +  Double_t cutdetainlHyperTight1[9] = {
650 +  6.05e-03, 3.23e-03, 4.93e-03, 8.01e-03, 4.93e-03, 7.91e-03, 1.03e-02, 2.94e-02, 4.10e-03};
651 +  Double_t cutdphiinHyperTight1[9] = {
652 +  4.83e-02, 4.91e-02, 2.30e-01, 3.48e-02, 7.44e-02, 2.04e-01, 9.95e-02, 3.93e-01, 2.84e-01};
653 +  Double_t cutdphiinlHyperTight1[9] = {
654 +  4.74e-02, 4.51e-02, 2.18e-01, 2.99e-02, 7.37e-02, 2.11e-01, 9.99e-02, 3.53e-01, 2.89e-01};
655 +  Double_t cuteseedopcorHyperTight1[9] = {
656 +  7.72e-01, 9.90e-01, 1.01e+00, 8.55e-01, 9.11e-01, 7.72e-01, 9.17e-01, 1.06e+00, 7.63e-01};
657 +  Double_t cutfmishitsHyperTight1[9] = {
658 +  3.50e+00, 1.50e+00, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01};
659 +  Double_t cuthoeHyperTight1[9] = {
660 +  6.17e-02, 3.70e-02, 1.41e-01, 2.91e-01, 3.82e-02, 1.34e-01, 4.19e-01, 3.87e-01, 3.93e-01};
661 +  Double_t cuthoelHyperTight1[9] = {
662 +  4.43e-02, 3.57e-02, 1.41e-01, 2.81e-01, 3.07e-02, 1.28e-01, 2.27e-01, 3.80e-01, 1.32e-01};
663 +  Double_t cutip_gsfHyperTight1[9] = {
664 +  1.21e-02, 1.76e-02, 6.01e-02, 2.96e-02, 1.74e-01, 9.70e-02, 7.74e-02, 1.33e-01, 7.80e-02};
665 +  Double_t cutip_gsflHyperTight1[9] = {
666 +  1.01e-02, 1.56e-02, 6.87e-02, 2.13e-02, 1.25e-01, 8.16e-02, 7.90e-02, 1.30e-01, 4.79e-02};
667 +  Double_t cutiso_sumHyperTight1[9] = {
668 +  7.92e+00, 6.85e+00, 7.87e+00, 6.77e+00, 4.47e+00, 5.28e+00, 6.57e+00, 1.02e+01, 1.78e+00};
669 +  Double_t cutiso_sumoetHyperTight1[9] = {
670 +  5.20e+00, 3.93e+00, 3.88e+00, 4.10e+00, 2.40e+00, 2.43e+00, 3.49e+00, 3.94e+00, 3.01e+00};
671 +  Double_t cutiso_sumoetlHyperTight1[9] = {
672 +  4.18e+00, 3.12e+00, 3.44e+00, 3.25e+00, 1.77e+00, 2.06e+00, 2.83e+00, 3.12e+00, 1.43e+00};
673 +  Double_t cutseeHyperTight1[9] = {
674 +  1.05e-02, 1.04e-02, 1.01e-02, 3.24e-02, 2.80e-02, 2.85e-02, 9.67e-03, 2.61e-02, 2.95e-02};
675 +  Double_t cutseelHyperTight1[9] = {
676 +  1.04e-02, 1.03e-02, 1.01e-02, 3.04e-02, 2.74e-02, 2.78e-02, 9.58e-03, 2.54e-02, 2.83e-02};
677 +
678 +  // HyperTight2 cuts
679 +  Double_t cutdcotdistHyperTight2[9] = {
680 +  1.15e-02, 1.07e-02, 4.01e-03, 2.97e-02, 2.85e-02, 3.10e-02, 9.34e-04, 3.40e-02, 2.82e-07};
681 +  Double_t cutdetainHyperTight2[9] = {
682 +  5.29e-03, 2.56e-03, 4.89e-03, 7.89e-03, 5.30e-03, 7.37e-03, 8.91e-03, 9.36e-03, 5.94e-03};
683 +  Double_t cutdetainlHyperTight2[9] = {
684 +  4.48e-03, 2.59e-03, 4.42e-03, 6.54e-03, 4.93e-03, 6.98e-03, 8.49e-03, 9.06e-03, -4.81e-03};
685 +  Double_t cutdphiinHyperTight2[9] = {
686 +  2.41e-02, 3.83e-02, 1.48e-01, 2.91e-02, 3.15e-02, 1.57e-01, 8.90e-02, 1.02e-01, 2.81e-01};
687 +  Double_t cutdphiinlHyperTight2[9] = {
688 +  2.13e-02, 3.79e-02, 1.25e-01, 2.24e-02, 3.69e-02, 1.64e-01, 9.99e-02, 9.23e-02, 2.37e-01};
689 +  Double_t cuteseedopcorHyperTight2[9] = {
690 +  1.03e+00, 9.95e-01, 1.03e+00, 1.01e+00, 9.46e-01, 9.03e-01, 9.97e-01, 1.14e+00, 8.00e-01};
691 +  Double_t cutfmishitsHyperTight2[9] = {
692 +  1.50e+00, 1.50e+00, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, -5.00e-01};
693 +  Double_t cuthoeHyperTight2[9] = {
694 +  4.94e-02, 3.45e-02, 1.40e-01, 2.02e-01, 3.82e-02, 1.19e-01, 1.23e-01, 3.82e-01, 2.50e-01};
695 +  Double_t cuthoelHyperTight2[9] = {
696 +  4.04e-02, 3.42e-02, 1.31e-01, 1.85e-01, 3.01e-02, 1.27e-01, 2.27e-01, 3.80e-01, 1.32e-01};
697 +  Double_t cutip_gsfHyperTight2[9] = {
698 +  1.14e-02, 1.38e-02, 5.29e-02, 1.87e-02, 1.31e-01, 8.63e-02, 7.74e-02, 1.04e-01, 2.42e-02};
699 +  Double_t cutip_gsflHyperTight2[9] = {
700 +  9.83e-03, 1.35e-02, 4.27e-02, 1.72e-02, 1.25e-01, 7.92e-02, 7.90e-02, 1.30e-01, 3.40e-02};
701 +  Double_t cutiso_sumHyperTight2[9] = {
702 +  6.40e+00, 5.77e+00, 6.54e+00, 5.22e+00, 3.86e+00, 4.63e+00, 6.31e+00, 1.02e+01, 1.78e+00};
703 +  Double_t cutiso_sumoetHyperTight2[9] = {
704 +  4.03e+00, 3.03e+00, 3.24e+00, 3.13e+00, 2.05e+00, 2.01e+00, 2.99e+00, 3.44e+00, 2.76e+00};
705 +  Double_t cutiso_sumoetlHyperTight2[9] = {
706 +  3.08e+00, 2.31e+00, 2.84e+00, 2.53e+00, 1.65e+00, 1.72e+00, 2.34e+00, 3.11e+00, 1.35e+00};
707 +  Double_t cutseeHyperTight2[9] = {
708 +  1.03e-02, 1.03e-02, 9.88e-03, 3.03e-02, 2.79e-02, 2.79e-02, 9.67e-03, 2.52e-02, 2.58e-02};
709 +  Double_t cutseelHyperTight2[9] = {
710 +  1.02e-02, 1.02e-02, 9.80e-03, 2.90e-02, 2.74e-02, 2.75e-02, 9.58e-03, 2.49e-02, 2.50e-02};
711 +
712 +  // HyperTight3 cuts
713 +  Double_t cutdcotdistHyperTight3[9] = {
714 +  9.63e-03, 5.11e-03, 1.95e-04, 2.97e-02, 2.85e-02, 2.18e-02, 2.61e-05, 2.57e-02, 2.82e-07};
715 +  Double_t cutdetainHyperTight3[9] = {
716 +  4.86e-03, 2.29e-03, 4.40e-03, 7.79e-03, 4.07e-03, 6.33e-03, 7.70e-03, 7.93e-03, 5.94e-03};
717 +  Double_t cutdetainlHyperTight3[9] = {
718 +  4.48e-03, 2.30e-03, 4.14e-03, 6.04e-03, 3.87e-03, 6.09e-03, 7.97e-03, 8.04e-03, -4.81e-03};
719 +  Double_t cutdphiinHyperTight3[9] = {
720 +  2.41e-02, 2.88e-02, 7.39e-02, 2.91e-02, 1.91e-02, 1.14e-01, 3.61e-02, 8.92e-02, 2.81e-01};
721 +  Double_t cutdphiinlHyperTight3[9] = {
722 +  1.95e-02, 3.42e-02, 8.06e-02, 2.22e-02, 2.26e-02, 9.73e-02, 4.51e-02, 9.23e-02, 2.37e-01};
723 +  Double_t cuteseedopcorHyperTight3[9] = {
724 +  1.07e+00, 1.01e+00, 1.08e+00, 1.01e+00, 9.69e-01, 9.10e-01, 1.04e+00, 1.20e+00, 8.00e-01};
725 +  Double_t cutfmishitsHyperTight3[9] = {
726 +  5.00e-01, 1.50e+00, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, -5.00e-01};
727 +  Double_t cuthoeHyperTight3[9] = {
728 +  3.52e-02, 3.45e-02, 1.33e-01, 1.88e-01, 2.72e-02, 1.19e-01, 9.28e-02, 2.46e-01, 2.50e-01};
729 +  Double_t cuthoelHyperTight3[9] = {
730 +  4.04e-02, 3.40e-02, 1.31e-01, 1.84e-01, 2.64e-02, 1.18e-01, 9.76e-02, 2.53e-01, 1.32e-01};
731 +  Double_t cutip_gsfHyperTight3[9] = {
732 +  1.14e-02, 1.26e-02, 3.79e-02, 1.68e-02, 1.21e-01, 5.29e-02, 7.74e-02, 3.35e-02, 2.42e-02};
733 +  Double_t cutip_gsflHyperTight3[9] = {
734 +  9.83e-03, 1.18e-02, 3.59e-02, 1.56e-02, 1.20e-01, 5.36e-02, 7.90e-02, 2.88e-02, 3.40e-02};
735 +  Double_t cutiso_sumHyperTight3[9] = {
736 +  5.40e+00, 5.41e+00, 5.88e+00, 4.32e+00, 3.86e+00, 4.33e+00, 5.87e+00, 9.05e+00, 1.78e+00};
737 +  Double_t cutiso_sumoetHyperTight3[9] = {
738 +  3.03e+00, 2.50e+00, 2.58e+00, 2.44e+00, 1.91e+00, 1.76e+00, 2.92e+00, 3.13e+00, 2.76e+00};
739 +  Double_t cutiso_sumoetlHyperTight3[9] = {
740 +  2.36e+00, 2.02e+00, 2.29e+00, 1.89e+00, 1.65e+00, 1.69e+00, 2.03e+00, 2.79e+00, 1.35e+00};
741 +  Double_t cutseeHyperTight3[9] = {
742 +  1.03e-02, 1.01e-02, 9.84e-03, 2.89e-02, 2.74e-02, 2.73e-02, 9.47e-03, 2.44e-02, 2.58e-02};
743 +  Double_t cutseelHyperTight3[9] = {
744 +  1.02e-02, 1.00e-02, 9.73e-03, 2.79e-02, 2.73e-02, 2.69e-02, 9.40e-03, 2.46e-02, 2.50e-02};
745 +
746 +  // HyperTight4 cuts
747 +  Double_t cutdcotdistHyperTight4[9] = {
748 +  2.70e-04, 1.43e-04, 1.95e-04, 2.64e-03, 2.82e-02, 1.64e-02, 2.61e-05, 2.57e-02, 2.82e-07};
749 +  Double_t cutdetainHyperTight4[9] = {
750 +  2.44e-03, 1.67e-03, 2.26e-03, 3.43e-03, 3.51e-03, 3.52e-03, 2.98e-03, 4.79e-03, 5.94e-03};
751 +  Double_t cutdetainlHyperTight4[9] = {
752 +  2.34e-03, 1.29e-03, 2.30e-03, 3.30e-03, 3.61e-03, 3.84e-03, 2.53e-03, 3.66e-03, -4.81e-03};
753 +  Double_t cutdphiinHyperTight4[9] = {
754 +  8.44e-03, 5.21e-03, 2.18e-02, 1.39e-02, 7.82e-03, 1.52e-02, 2.59e-02, 3.87e-02, 2.81e-01};
755 +  Double_t cutdphiinlHyperTight4[9] = {
756 +  5.77e-03, 3.20e-03, 2.85e-02, 2.22e-02, 7.00e-03, 1.84e-02, 2.91e-02, 4.40e-02, 2.37e-01};
757 +  Double_t cuteseedopcorHyperTight4[9] = {
758 +  1.15e+00, 1.01e+00, 1.21e+00, 1.07e+00, 9.69e-01, 9.10e-01, 1.08e+00, 1.36e+00, 8.00e-01};
759 +  Double_t cutfmishitsHyperTight4[9] = {
760 +  5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01, -5.00e-01};
761 +  Double_t cuthoeHyperTight4[9] = {
762 +  2.39e-02, 2.68e-02, 2.12e-02, 1.03e-01, 9.92e-03, 7.07e-02, 7.12e-02, 1.48e-01, 2.50e-01};
763 +  Double_t cuthoelHyperTight4[9] = {
764 +  2.87e-02, 1.94e-02, 2.16e-02, 5.68e-02, 1.35e-02, 4.04e-02, 7.98e-02, 1.50e-01, 1.32e-01};
765 +  Double_t cutip_gsfHyperTight4[9] = {
766 +  7.61e-03, 5.22e-03, 3.79e-02, 1.02e-02, 4.62e-02, 1.82e-02, 7.74e-02, 3.35e-02, 2.42e-02};
767 +  Double_t cutip_gsflHyperTight4[9] = {
768 +  7.81e-03, 4.25e-03, 3.08e-02, 1.04e-02, 2.35e-02, 2.45e-02, 7.90e-02, 2.88e-02, 3.40e-02};
769 +  Double_t cutiso_sumHyperTight4[9] = {
770 +  5.40e+00, 5.41e+00, 5.88e+00, 4.32e+00, 3.86e+00, 4.33e+00, 5.86e+00, 9.05e+00, 1.78e+00};
771 +  Double_t cutiso_sumoetHyperTight4[9] = {
772 +  2.53e+00, 2.10e+00, 1.87e+00, 1.84e+00, 1.79e+00, 1.61e+00, 2.53e+00, 1.98e+00, 2.76e+00};
773 +  Double_t cutiso_sumoetlHyperTight4[9] = {
774 +  2.28e+00, 2.02e+00, 2.04e+00, 1.69e+00, 1.65e+00, 1.61e+00, 2.03e+00, 1.82e+00, 1.35e+00};
775 +  Double_t cutseeHyperTight4[9] = {
776 +  9.99e-03, 9.61e-03, 9.65e-03, 2.75e-02, 2.61e-02, 2.64e-02, 9.18e-03, 2.44e-02, 2.58e-02};
777 +  Double_t cutseelHyperTight4[9] = {
778 +  9.66e-03, 9.69e-03, 9.58e-03, 2.73e-02, 2.66e-02, 2.66e-02, 8.64e-03, 2.46e-02, 2.50e-02};
779 +
780    Double_t cutdcotdist[9];
781    Double_t cutdetain[9];
782    Double_t cutdetainl[9];
# Line 611 | Line 829 | Int_t ElectronTools::PassTightId(const E
829      memcpy(cutsee        ,cutseeTight        ,sizeof(cutseeTight));
830      memcpy(cutseel       ,cutseelTight       ,sizeof(cutseelTight));
831    }
832 <  else {
832 >  else if(typeCuts == 2) {
833      memcpy(cutdcotdist   ,cutdcotdistSuperTight   ,sizeof(cutdcotdistSuperTight));
834      memcpy(cutdetain     ,cutdetainSuperTight     ,sizeof(cutdetainSuperTight));
835      memcpy(cutdetainl    ,cutdetainlSuperTight    ,sizeof(cutdetainlSuperTight));
# Line 629 | Line 847 | Int_t ElectronTools::PassTightId(const E
847      memcpy(cutsee        ,cutseeSuperTight        ,sizeof(cutseeSuperTight));
848      memcpy(cutseel       ,cutseelSuperTight       ,sizeof(cutseelSuperTight));
849    }
850 <
850 >  else if(typeCuts == 3) {
851 >    memcpy(cutdcotdist   ,cutdcotdistHyperTight1   ,sizeof(cutdcotdistHyperTight1));
852 >    memcpy(cutdetain     ,cutdetainHyperTight1     ,sizeof(cutdetainHyperTight1));
853 >    memcpy(cutdetainl    ,cutdetainlHyperTight1    ,sizeof(cutdetainlHyperTight1));
854 >    memcpy(cutdphiin     ,cutdphiinHyperTight1     ,sizeof(cutdphiinHyperTight1));
855 >    memcpy(cutdphiinl    ,cutdphiinlHyperTight1    ,sizeof(cutdphiinlHyperTight1));
856 >    memcpy(cuteseedopcor ,cuteseedopcorHyperTight1 ,sizeof(cuteseedopcorHyperTight1));
857 >    memcpy(cutfmishits   ,cutfmishitsHyperTight1   ,sizeof(cutfmishitsHyperTight1));
858 >    memcpy(cuthoe        ,cuthoeHyperTight1       ,sizeof(cuthoeHyperTight1));
859 >    memcpy(cuthoel       ,cuthoelHyperTight1      ,sizeof(cuthoelHyperTight1));
860 >    memcpy(cutip_gsf     ,cutip_gsfHyperTight1     ,sizeof(cutip_gsfHyperTight1));
861 >    memcpy(cutip_gsfl    ,cutip_gsflHyperTight1    ,sizeof(cutip_gsflHyperTight1));
862 >    memcpy(cutiso_sum    ,cutiso_sumHyperTight1    ,sizeof(cutiso_sumHyperTight1));
863 >    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight1 ,sizeof(cutiso_sumoetHyperTight1));
864 >    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight1,sizeof(cutiso_sumoetlHyperTight1));
865 >    memcpy(cutsee        ,cutseeHyperTight1       ,sizeof(cutseeHyperTight1));
866 >    memcpy(cutseel       ,cutseelHyperTight1      ,sizeof(cutseelHyperTight1));
867 >  }
868 >  else if(typeCuts == 4) {
869 >    memcpy(cutdcotdist   ,cutdcotdistHyperTight2   ,sizeof(cutdcotdistHyperTight2));
870 >    memcpy(cutdetain     ,cutdetainHyperTight2     ,sizeof(cutdetainHyperTight2));
871 >    memcpy(cutdetainl    ,cutdetainlHyperTight2    ,sizeof(cutdetainlHyperTight2));
872 >    memcpy(cutdphiin     ,cutdphiinHyperTight2     ,sizeof(cutdphiinHyperTight2));
873 >    memcpy(cutdphiinl    ,cutdphiinlHyperTight2    ,sizeof(cutdphiinlHyperTight2));
874 >    memcpy(cuteseedopcor ,cuteseedopcorHyperTight2 ,sizeof(cuteseedopcorHyperTight2));
875 >    memcpy(cutfmishits   ,cutfmishitsHyperTight2   ,sizeof(cutfmishitsHyperTight2));
876 >    memcpy(cuthoe        ,cuthoeHyperTight2       ,sizeof(cuthoeHyperTight2));
877 >    memcpy(cuthoel       ,cuthoelHyperTight2      ,sizeof(cuthoelHyperTight2));
878 >    memcpy(cutip_gsf     ,cutip_gsfHyperTight2     ,sizeof(cutip_gsfHyperTight2));
879 >    memcpy(cutip_gsfl    ,cutip_gsflHyperTight2    ,sizeof(cutip_gsflHyperTight2));
880 >    memcpy(cutiso_sum    ,cutiso_sumHyperTight2    ,sizeof(cutiso_sumHyperTight2));
881 >    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight2 ,sizeof(cutiso_sumoetHyperTight2));
882 >    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight2,sizeof(cutiso_sumoetlHyperTight2));
883 >    memcpy(cutsee        ,cutseeHyperTight2       ,sizeof(cutseeHyperTight2));
884 >    memcpy(cutseel       ,cutseelHyperTight2      ,sizeof(cutseelHyperTight2));
885 >  }
886 >  else if(typeCuts == 5) {
887 >    memcpy(cutdcotdist   ,cutdcotdistHyperTight3   ,sizeof(cutdcotdistHyperTight3));
888 >    memcpy(cutdetain     ,cutdetainHyperTight3     ,sizeof(cutdetainHyperTight3));
889 >    memcpy(cutdetainl    ,cutdetainlHyperTight3    ,sizeof(cutdetainlHyperTight3));
890 >    memcpy(cutdphiin     ,cutdphiinHyperTight3     ,sizeof(cutdphiinHyperTight3));
891 >    memcpy(cutdphiinl    ,cutdphiinlHyperTight3    ,sizeof(cutdphiinlHyperTight3));
892 >    memcpy(cuteseedopcor ,cuteseedopcorHyperTight3 ,sizeof(cuteseedopcorHyperTight3));
893 >    memcpy(cutfmishits   ,cutfmishitsHyperTight3   ,sizeof(cutfmishitsHyperTight3));
894 >    memcpy(cuthoe        ,cuthoeHyperTight3       ,sizeof(cuthoeHyperTight3));
895 >    memcpy(cuthoel       ,cuthoelHyperTight3      ,sizeof(cuthoelHyperTight3));
896 >    memcpy(cutip_gsf     ,cutip_gsfHyperTight3     ,sizeof(cutip_gsfHyperTight3));
897 >    memcpy(cutip_gsfl    ,cutip_gsflHyperTight3    ,sizeof(cutip_gsflHyperTight3));
898 >    memcpy(cutiso_sum    ,cutiso_sumHyperTight3    ,sizeof(cutiso_sumHyperTight3));
899 >    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight3 ,sizeof(cutiso_sumoetHyperTight3));
900 >    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight3,sizeof(cutiso_sumoetlHyperTight3));
901 >    memcpy(cutsee        ,cutseeHyperTight3       ,sizeof(cutseeHyperTight3));
902 >    memcpy(cutseel       ,cutseelHyperTight3      ,sizeof(cutseelHyperTight3));
903 >  }
904 >  else if(typeCuts == 6) {
905 >    memcpy(cutdcotdist   ,cutdcotdistHyperTight4   ,sizeof(cutdcotdistHyperTight4));
906 >    memcpy(cutdetain     ,cutdetainHyperTight4     ,sizeof(cutdetainHyperTight4));
907 >    memcpy(cutdetainl    ,cutdetainlHyperTight4    ,sizeof(cutdetainlHyperTight4));
908 >    memcpy(cutdphiin     ,cutdphiinHyperTight4     ,sizeof(cutdphiinHyperTight4));
909 >    memcpy(cutdphiinl    ,cutdphiinlHyperTight4    ,sizeof(cutdphiinlHyperTight4));
910 >    memcpy(cuteseedopcor ,cuteseedopcorHyperTight4 ,sizeof(cuteseedopcorHyperTight4));
911 >    memcpy(cutfmishits   ,cutfmishitsHyperTight4   ,sizeof(cutfmishitsHyperTight4));
912 >    memcpy(cuthoe        ,cuthoeHyperTight4       ,sizeof(cuthoeHyperTight4));
913 >    memcpy(cuthoel       ,cuthoelHyperTight4      ,sizeof(cuthoelHyperTight4));
914 >    memcpy(cutip_gsf     ,cutip_gsfHyperTight4     ,sizeof(cutip_gsfHyperTight4));
915 >    memcpy(cutip_gsfl    ,cutip_gsflHyperTight4    ,sizeof(cutip_gsflHyperTight4));
916 >    memcpy(cutiso_sum    ,cutiso_sumHyperTight4    ,sizeof(cutiso_sumHyperTight4));
917 >    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight4 ,sizeof(cutiso_sumoetHyperTight4));
918 >    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight4,sizeof(cutiso_sumoetlHyperTight4));
919 >    memcpy(cutsee        ,cutseeHyperTight4       ,sizeof(cutseeHyperTight4));
920 >    memcpy(cutseel       ,cutseelHyperTight4      ,sizeof(cutseelHyperTight4));
921 >  }
922 >  else {
923 >    return 0;
924 >  }
925    int result = 0;
926    
927    const int ncuts = 10;
# Line 739 | Line 1031 | bool ElectronTools::compute_cut(double x
1031  
1032    return accept;
1033   }
1034 +
1035 + //--------------------------------------------------------------------------------------------------
1036 + Double_t ElectronTools::Likelihood(ElectronLikelihood *LH, const Electron *ele)
1037 + {
1038 +  if (!LH) {
1039 +    std::cout << "Error: Likelihood not properly initialized\n";
1040 +    return -9999;
1041 +  }
1042 +
1043 +  LikelihoodMeasurements measurements;
1044 +  measurements.pt = ele->Pt();
1045 +  if (ele->IsEB() && ele->AbsEta()<1.0) measurements.subdet = 0;
1046 +  else if (ele->IsEB())                 measurements.subdet = 1;
1047 +  else                                  measurements.subdet = 2;
1048 +  measurements.deltaPhi = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
1049 +  measurements.deltaEta = TMath::Abs(ele->DeltaEtaSuperClusterTrackAtVtx());
1050 +  measurements.eSeedClusterOverPout = ele->ESeedClusterOverPout();
1051 +  measurements.eSuperClusterOverP = ele->ESuperClusterOverP();
1052 +  measurements.hadronicOverEm = ele->HadronicOverEm();
1053 +  measurements.sigmaIEtaIEta = ele->CoviEtaiEta();
1054 +  measurements.sigmaIPhiIPhi = TMath::Sqrt(ele->SCluster()->Seed()->CoviPhiiPhi());
1055 +  measurements.fBrem = ele->FBrem();
1056 +  measurements.nBremClusters = ele->NumberOfClusters() - 1;
1057 +  //measurements.OneOverEMinusOneOverP = (1.0 / ele->SCluster()->Energy()) - (1.0 / ele->BestTrk()->P());
1058 +  measurements.OneOverEMinusOneOverP = (1.0 / ele->ESuperClusterOverP() / ele->BestTrk()->P()) - (1.0 / ele->BestTrk()->P());
1059 +  double likelihood = LH->result(measurements);
1060 +
1061 +  double newLik = 0.0;
1062 +  if     (likelihood<=0) newLik = -20.0;
1063 +  else if(likelihood>=1) newLik =  20.0;
1064 +  else                   newLik = log(likelihood/(1.0-likelihood));
1065 +
1066 +  Bool_t isDebug = kFALSE;
1067 +  if(isDebug == kTRUE){
1068 +    printf("LIKELIHOOD: %f %d %f %f %f %f %f %f %f %f %d %f %f %f - %f %f\n",measurements.pt,measurements.subdet,
1069 +    measurements.deltaPhi          ,measurements.deltaEta      ,measurements.eSeedClusterOverPout,
1070 +    measurements.eSuperClusterOverP,measurements.hadronicOverEm,measurements.sigmaIEtaIEta,
1071 +    measurements.sigmaIPhiIPhi     ,measurements.fBrem         ,measurements.nBremClusters,
1072 +    measurements.OneOverEMinusOneOverP,ele->SCluster()->Energy(),ele->BestTrk()->P(),
1073 +    likelihood,newLik);
1074 +  }
1075 +
1076 +  return newLik;
1077 +
1078 + }
1079 +
1080 + Double_t ElectronTools::ElectronEffectiveArea(EElectronEffectiveAreaType type, Double_t SCEta, EElectronEffectiveAreaTarget EffectiveAreaTarget) {
1081 +
1082 +  Double_t EffectiveArea = 0;
1083 +  
1084 +  if (fabs(SCEta) < 1.0) {
1085 +    if (type == ElectronTools::kEleChargedIso03) EffectiveArea = 0.000;
1086 +    if (type == ElectronTools::kEleNeutralHadronIso03) EffectiveArea = 0.017;
1087 +    if (type == ElectronTools::kEleGammaIso03) EffectiveArea = 0.045;
1088 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip03) EffectiveArea = 0.014;
1089 +    if (type == ElectronTools::kEleChargedIso04) EffectiveArea = 0.000;
1090 +    if (type == ElectronTools::kEleNeutralHadronIso04) EffectiveArea = 0.034;
1091 +    if (type == ElectronTools::kEleGammaIso04) EffectiveArea = 0.079;
1092 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip04) EffectiveArea = 0.014;
1093 +    if (type == ElectronTools::kEleNeutralHadronIso007) EffectiveArea = 0.000;
1094 +    if (type == ElectronTools::kEleHoverE) EffectiveArea = 0.00016;
1095 +    if (type == ElectronTools::kEleHcalDepth1OverEcal) EffectiveArea = 0.00016;
1096 +    if (type == ElectronTools::kEleHcalDepth2OverEcal) EffectiveArea = 0.00000;    
1097 +  } else if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) {
1098 +    if (type == ElectronTools::kEleChargedIso03) EffectiveArea = 0.000;
1099 +    if (type == ElectronTools::kEleNeutralHadronIso03) EffectiveArea = 0.025;
1100 +    if (type == ElectronTools::kEleGammaIso03) EffectiveArea = 0.052;
1101 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip03) EffectiveArea = 0.030;
1102 +    if (type == ElectronTools::kEleChargedIso04) EffectiveArea = 0.000;
1103 +    if (type == ElectronTools::kEleNeutralHadronIso04) EffectiveArea = 0.050;
1104 +    if (type == ElectronTools::kEleGammaIso04) EffectiveArea = 0.073;
1105 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip04) EffectiveArea = 0.030;
1106 +    if (type == ElectronTools::kEleNeutralHadronIso007) EffectiveArea = 0.000;
1107 +    if (type == ElectronTools::kEleHoverE) EffectiveArea = 0.00022;
1108 +    if (type == ElectronTools::kEleHcalDepth1OverEcal) EffectiveArea = 0.00022;
1109 +    if (type == ElectronTools::kEleHcalDepth2OverEcal) EffectiveArea = 0.00000;    
1110 +  } else if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) {
1111 +    if (type == ElectronTools::kEleChargedIso03) EffectiveArea = 0.000;
1112 +    if (type == ElectronTools::kEleNeutralHadronIso03) EffectiveArea = 0.030;
1113 +    if (type == ElectronTools::kEleGammaIso03) EffectiveArea = 0.170;
1114 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip03) EffectiveArea = 0.134;
1115 +    if (type == ElectronTools::kEleChargedIso04) EffectiveArea = 0.000;
1116 +    if (type == ElectronTools::kEleNeutralHadronIso04) EffectiveArea = 0.060;
1117 +    if (type == ElectronTools::kEleGammaIso04) EffectiveArea = 0.187;
1118 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip04) EffectiveArea = 0.134;
1119 +    if (type == ElectronTools::kEleNeutralHadronIso007) EffectiveArea = 0.000;
1120 +    if (type == ElectronTools::kEleHoverE) EffectiveArea = 0.00030;
1121 +    if (type == ElectronTools::kEleHcalDepth1OverEcal) EffectiveArea = 0.00026;
1122 +    if (type == ElectronTools::kEleHcalDepth2OverEcal) EffectiveArea = 0.00002;        
1123 +  } else if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.25 ) {
1124 +    if (type == ElectronTools::kEleChargedIso03) EffectiveArea = 0.000;
1125 +    if (type == ElectronTools::kEleNeutralHadronIso03) EffectiveArea = 0.022;
1126 +    if (type == ElectronTools::kEleGammaIso03) EffectiveArea = 0.623;
1127 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip03) EffectiveArea = 0.516;
1128 +    if (type == ElectronTools::kEleChargedIso04) EffectiveArea = 0.000;
1129 +    if (type == ElectronTools::kEleNeutralHadronIso04) EffectiveArea = 0.055;
1130 +    if (type == ElectronTools::kEleGammaIso04) EffectiveArea = 0.659;
1131 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip04) EffectiveArea = 0.517;
1132 +    if (type == ElectronTools::kEleNeutralHadronIso007) EffectiveArea = 0.000;
1133 +    if (type == ElectronTools::kEleHoverE) EffectiveArea = 0.00054;
1134 +    if (type == ElectronTools::kEleHcalDepth1OverEcal) EffectiveArea = 0.00045;
1135 +    if (type == ElectronTools::kEleHcalDepth2OverEcal) EffectiveArea = 0.00003;
1136 +  } else if (fabs(SCEta) >= 2.25 && fabs(SCEta) < 2.5 ) {
1137 +    if (type == ElectronTools::kEleChargedIso03) EffectiveArea = 0.000;
1138 +    if (type == ElectronTools::kEleNeutralHadronIso03) EffectiveArea = 0.018;
1139 +    if (type == ElectronTools::kEleGammaIso03) EffectiveArea = 1.198;
1140 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip03) EffectiveArea = 1.049;
1141 +    if (type == ElectronTools::kEleChargedIso04) EffectiveArea = 0.000;
1142 +    if (type == ElectronTools::kEleNeutralHadronIso04) EffectiveArea = 0.073;
1143 +    if (type == ElectronTools::kEleGammaIso04) EffectiveArea = 1.258;
1144 +    if (type == ElectronTools::kEleGammaIsoVetoEtaStrip04) EffectiveArea = 1.051;
1145 +    if (type == ElectronTools::kEleNeutralHadronIso007) EffectiveArea = 0.000;
1146 +    if (type == ElectronTools::kEleHoverE) EffectiveArea = 0.00082;
1147 +    if (type == ElectronTools::kEleHcalDepth1OverEcal) EffectiveArea = 0.00066;
1148 +    if (type == ElectronTools::kEleHcalDepth2OverEcal) EffectiveArea = 0.00004;
1149 +  }
1150 +    
1151 +  //NoCorrections
1152 +  if (EffectiveAreaTarget == kEleEANoCorr) {
1153 +    return 0.0;
1154 +  }
1155 +  //2011 Data Effective Areas
1156 +  else if (EffectiveAreaTarget == kEleEAData2011) {
1157 +    if (type == kEleGammaIsoDR0p0To0p1) {
1158 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.017;
1159 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.033;
1160 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.005;
1161 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.007;
1162 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.004;
1163 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.000;
1164 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.000;
1165 +    }
1166 +    if (type == kEleGammaIsoDR0p1To0p2) {
1167 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.010;
1168 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.010;
1169 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.019;
1170 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.042;
1171 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.041;
1172 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.035;
1173 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.041;
1174 +    }
1175 +    if (type == kEleGammaIsoDR0p2To0p3) {
1176 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.020;
1177 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.017;
1178 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.014;
1179 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.029;
1180 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.039;
1181 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.042;
1182 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.048;
1183 +    }
1184 +    if (type == kEleGammaIsoDR0p3To0p4) {
1185 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.036;
1186 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.029;
1187 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.020;
1188 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.029;
1189 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.042;
1190 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.047;
1191 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.054;
1192 +    }
1193 +    if (type == kEleGammaIsoDR0p4To0p5) {
1194 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.051;
1195 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.038;
1196 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.028;
1197 +     if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.036;
1198 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.047;
1199 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.057;
1200 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.059;
1201 +    }
1202 +    if (type == kEleNeutralHadronIsoDR0p0To0p1) {
1203 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.001;
1204 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.002;
1205 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.002;
1206 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.000;
1207 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.000;
1208 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.000;
1209 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.000;
1210 +    }
1211 +    if (type == kEleNeutralHadronIsoDR0p1To0p2) {
1212 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.005;
1213 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.008;
1214 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.008;
1215 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.006;
1216 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.003;
1217 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.001;
1218 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.003;
1219 +    }
1220 +    if (type == kEleNeutralHadronIsoDR0p2To0p3) {
1221 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.010;
1222 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.014;
1223 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.017;
1224 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.016;
1225 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.016;
1226 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.016;
1227 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.019;
1228 +    }
1229 +    if (type == kEleNeutralHadronIsoDR0p3To0p4) {
1230 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.015;
1231 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.021;
1232 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.025;
1233 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.030;
1234 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.036;
1235 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.038;
1236 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.084;
1237 +    }
1238 +    if (type == kEleNeutralHadronIsoDR0p4To0p5) {
1239 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.020;
1240 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.027;
1241 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.035;
1242 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.045;
1243 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.051;
1244 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.107;
1245 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.228;
1246 +    }
1247 +  }
1248 +
1249 +  //Summer11 MC Effective Areas
1250 +  else if (EffectiveAreaTarget == kEleEASummer11MC) {
1251 +    if (type == kEleGammaIsoDR0p0To0p1) {
1252 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.015;
1253 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.030;
1254 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.004;
1255 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.010;
1256 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.014;
1257 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.024;
1258 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.023;
1259 +    }
1260 +    if (type == kEleGammaIsoDR0p1To0p2) {
1261 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.012;
1262 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.010;
1263 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.009;
1264 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.037;
1265 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.046;
1266 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.055;
1267 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.046;
1268 +    }
1269 +    if (type == kEleGammaIsoDR0p2To0p3) {
1270 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.021;
1271 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.018;
1272 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.013;
1273 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.026;
1274 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.038;
1275 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.045;
1276 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.059;
1277 +    }
1278 +    if (type == kEleGammaIsoDR0p3To0p4) {
1279 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.036;
1280 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.030;
1281 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.017;
1282 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.036;
1283 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.058;
1284 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.073;
1285 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.083;
1286 +    }
1287 +    if (type == kEleGammaIsoDR0p4To0p5) {
1288 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.053;
1289 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.037;
1290 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.032;
1291 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.048;
1292 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.062;
1293 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.085;
1294 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.118;
1295 +    }
1296 +    if (type == kEleNeutralHadronIsoDR0p0To0p1) {
1297 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.000;
1298 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.000;
1299 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.000;
1300 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.000;
1301 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.000;
1302 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.000;
1303 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.000;
1304 +    }
1305 +    if (type == kEleNeutralHadronIsoDR0p1To0p2) {
1306 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.004;
1307 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.007;
1308 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.009;
1309 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.004;
1310 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.003;
1311 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.000;
1312 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.004;
1313 +    }
1314 +    if (type == kEleNeutralHadronIsoDR0p2To0p3) {
1315 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.008;
1316 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.013;
1317 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.016;
1318 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.013;
1319 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.014;
1320 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.016;
1321 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.021;
1322 +    }
1323 +    if (type == kEleNeutralHadronIsoDR0p3To0p4) {
1324 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.012;
1325 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.017;
1326 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.020;
1327 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.024;
1328 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.040;
1329 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.036;
1330 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.086;
1331 +    }
1332 +    if (type == kEleNeutralHadronIsoDR0p4To0p5) {
1333 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.016;
1334 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.026;
1335 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.030;
1336 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.038;
1337 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.051;
1338 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.105;
1339 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.169;
1340 +    }
1341 +  }
1342 +  
1343 +  //Fall11 MC Effective Areas
1344 +  else if (EffectiveAreaTarget == kEleEAFall11MC) {
1345 +    if (type == kEleGammaIsoDR0p0To0p1) {
1346 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.014;
1347 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.020;
1348 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.004;
1349 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.012;
1350 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.016;
1351 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.021;
1352 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.012;
1353 +    }
1354 +    if (type == kEleGammaIsoDR0p1To0p2) {
1355 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.012;
1356 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.011;
1357 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.015;
1358 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.042;
1359 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.055;
1360 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.068;
1361 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.067;
1362 +    }
1363 +    if (type == kEleGammaIsoDR0p2To0p3) {
1364 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.024;
1365 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.020;
1366 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.017;
1367 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.038;
1368 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.051;
1369 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.066;
1370 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.080;
1371 +    }
1372 +    if (type == kEleGammaIsoDR0p3To0p4) {
1373 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.040;
1374 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.032;
1375 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.021;
1376 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.047;
1377 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.066;
1378 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.083;
1379 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.123;
1380 +    }
1381 +    if (type == kEleGammaIsoDR0p4To0p5) {
1382 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.059;
1383 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.041;
1384 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.037;
1385 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.057;
1386 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.095;
1387 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.123;
1388 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.133;
1389 +    }
1390 +    if (type == kEleNeutralHadronIsoDR0p0To0p1) {
1391 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.002;
1392 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.003;
1393 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.000;
1394 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.000;
1395 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.000;
1396 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.000;
1397 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.000;
1398 +    }
1399 +    if (type == kEleNeutralHadronIsoDR0p1To0p2) {
1400 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.006;
1401 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.008;
1402 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.010;
1403 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.006;
1404 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.005;
1405 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.002;
1406 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.007;
1407 +    }
1408 +    if (type == kEleNeutralHadronIsoDR0p2To0p3) {
1409 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.009;
1410 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.014;
1411 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.018;
1412 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.016;
1413 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.017;
1414 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.020;
1415 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.021;
1416 +    }
1417 +    if (type == kEleNeutralHadronIsoDR0p3To0p4) {
1418 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.013;
1419 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.019;
1420 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.027;
1421 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.035;
1422 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.037;
1423 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.043;
1424 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.110;
1425 +    }
1426 +    if (type == kEleNeutralHadronIsoDR0p4To0p5) {
1427 +      if (fabs(SCEta) >= 0.0 && fabs(SCEta) < 1.0 ) EffectiveArea = 0.017;
1428 +      if (fabs(SCEta) >= 1.0 && fabs(SCEta) < 1.479 ) EffectiveArea = 0.027;
1429 +      if (fabs(SCEta) >= 1.479 && fabs(SCEta) < 2.0 ) EffectiveArea = 0.036;
1430 +      if (fabs(SCEta) >= 2.0 && fabs(SCEta) < 2.2 ) EffectiveArea = 0.045;
1431 +      if (fabs(SCEta) >= 2.2 && fabs(SCEta) < 2.3 ) EffectiveArea = 0.057;
1432 +      if (fabs(SCEta) >= 2.3 && fabs(SCEta) < 2.4 ) EffectiveArea = 0.123;
1433 +      if (fabs(SCEta) >= 2.4) EffectiveArea = 0.220;
1434 +    }
1435 +  }
1436 +
1437 +
1438 +
1439 +  return EffectiveArea;  
1440 + }
1441 +
1442 +
1443 + Bool_t ElectronTools::PassHggLeptonTagID(const Electron* ele) {
1444 +  
1445 +  float dist = ( ele->ConvPartnerDist()      == -9999.? 9999:TMath::Abs(ele->ConvPartnerDist()));
1446 +  float dcot = ( ele->ConvPartnerDCotTheta() == -9999.? 9999:TMath::Abs(ele->ConvPartnerDCotTheta()));  
1447 +  
1448 +  if (dist < 0.02) return false;
1449 +  if (dcot < 0.02) return false;
1450 +
1451 +  int numInnerHits = ele->Trk()->NExpectedHitsInner();
1452 +  if( numInnerHits > 0 ) return false;
1453 +
1454 +  float coviEtaiEta = ele->CoviEtaiEta();
1455 +  if( ele->SCluster()->AbsEta() < 1.5 && coviEtaiEta > 0.01 ) return false;
1456 +  else if( ele->SCluster()->AbsEta() > 1.5 && coviEtaiEta > 0.031 ) return false;
1457 +
1458 +  Double_t deltaPhiIn   = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
1459 +  Double_t deltaEtaIn   = TMath::Abs(ele->DeltaEtaSuperClusterTrackAtVtx());
1460 +
1461 +  if( ele->SCluster()->AbsEta() < 1.5 && ( deltaPhiIn > 0.039 || deltaEtaIn > 0.005 ) ) return false;
1462 +  else if ( ele->SCluster()->AbsEta() > 1.5 && ( deltaPhiIn > 0.028 || deltaEtaIn > 0.007 ) ) return false;
1463 +
1464 +  return true;
1465 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines