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.8 by ceballos, Fri May 28 16:31:43 2010 UTC vs.
Revision 1.22 by ceballos, Tue Mar 15 08:33:42 2011 UTC

# Line 36 | Line 36 | Bool_t ElectronTools::PassCustomID(const
36      {0.8,0.2,0,0,0,0,0,0}};                                     //extra cuts fbrem and E_Over_P
37  
38    Double_t VBTFWorkingPoint95[6][8] = {
39 <    {0.5,   0.5,   0.5,   0.5,   0.07,   0.07,   0.07,   0.07  }, //hovere
39 >    {0.15,  0.15,  0.15,  0.15,  0.07,   0.07,   0.07,   0.07  }, //hovere
40      {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03  }, //sigmaetaeta
41      {0.8,   0.8,   0.8,   0.8,   0.7,    0.7,    0.7,    0.7   }, //deltaphiin
42      {0.007, 0.007, 0.007, 0.007, 0.010,  0.010,  0.010,  0.010 }, //deltaetain
# Line 75 | Line 75 | Bool_t ElectronTools::PassCustomID(const
75      {0.025, 0.025, 0.025, 0.025, 0.012,  0.012,  0.012,  0.012}, //hovere
76      {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
77      {0.03,  0.03,  0.03,  0.03,  0.02,   0.02,   0.02,   0.02 }, //deltaphiin
78 <    {0.003, 0.003, 0.003, 0.003, 0.005,  0.005,  0.005,  0.005}, //deltaetain
78 >    {0.004, 0.004, 0.004, 0.004, 0.005,  0.005,  0.005,  0.005}, //deltaetain
79      {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0  }, //eoverp
80      {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
81    };            
# Line 99 | Line 99 | Bool_t ElectronTools::PassCustomID(const
99      case kVBTFWorkingPoint80Id:
100        memcpy(fCuts,VBTFWorkingPoint80,sizeof(fCuts));
101        break;
102 +    case kVBTFWorkingPoint80LowPtId:
103 +      memcpy(fCuts,VBTFWorkingPoint80,sizeof(fCuts));
104 +      break;
105      case kVBTFWorkingPoint70Id:
106        memcpy(fCuts,VBTFWorkingPoint70,sizeof(fCuts));
107        break;
# Line 112 | Line 115 | Bool_t ElectronTools::PassCustomID(const
115    Double_t eOverP = ele->ESuperClusterOverP();
116    Double_t fBrem  = ele->FBrem();
117  
118 <  if ((eOverP < fCuts[5][0]) && (fBrem < fCuts[5][1]))
118 >  if ( (fCuts[5][0]>0.0) && (eOverP < fCuts[5][0]) && (fCuts[5][1]>0.0) && (fBrem < fCuts[5][1]))
119      return kFALSE;
120  
121 <  if (eOverP < fCuts[5][2]*(1-fBrem))
121 >  if ( (fCuts[5][2]>0.0) && (eOverP < fCuts[5][2]*(1-fBrem)))
122      return kFALSE;
123  
124    Int_t cat = 2;
# Line 123 | Line 126 | Bool_t ElectronTools::PassCustomID(const
126      cat=1;
127    else if (eOverP < 1.2 && eOverP > 0.8)
128      cat=0;
129 <
130 <  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
129 >  
130 >  if(ele->SCluster() == 0)
131 >    return kFALSE;
132 >  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
133    Double_t hOverE       = ele->HadronicOverEm();
134    Double_t sigmaee      = ele->CoviEtaiEta();
135    Double_t deltaPhiIn   = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
# Line 149 | Line 154 | Bool_t ElectronTools::PassCustomID(const
154    if(eSeedOverPin<fCuts[4][cat+4*eb])
155      return kFALSE;
156  
157 +  // Cuts only for pt<20 region and kVBTFWorkingPoint80LowPtId
158 +  if(ele->Pt() < 20 && idType == kVBTFWorkingPoint80LowPtId) {
159 +    Bool_t isGoodLowPtEl = fBrem > 0.15 ||
160 +                          (ele->AbsEta() < 1.0 && eOverP > 0.95 &&
161 +                           TMath::Abs(ele->Charge()*ele->DeltaPhiSuperClusterTrackAtVtx()) < 0.006);
162 +    if(!isGoodLowPtEl) return kFALSE;
163 +  }
164 +  
165    return kTRUE;
166   }
167  
# Line 187 | Line 200 | Bool_t ElectronTools::PassCustomIso(cons
200    };            
201  
202    Double_t VBTFWorkingPoint70[4][2] = {
203 <    {0.06 , 0.03   },   //TrkIso
204 <    {0.06 , 0.03   },   //ECALIso
205 <    {0.05 , 0.015  },   //HCALIso
206 <    {0.05,  0.04   }   //Combined    
203 >    {0.05 , 0.025  },   //TrkIso
204 >    {0.06 , 0.025  },   //ECALIso
205 >    {0.03 , 0.020  },   //HCALIso
206 >    {0.04,  0.030  }   //Combined
207    };            
208  
209    switch (isoType) {
# Line 214 | Line 227 | Bool_t ElectronTools::PassCustomIso(cons
227        break;
228    }
229  
230 <  Double_t trkIso  = ele->TrackIsolationDr03();
231 <  Double_t ecalIso = ele->EcalRecHitIsoDr03();
232 <  Double_t hcalIso = ele->HcalTowerSumEtDr03();
233 <  Double_t combinedIso = trkIso + ecalIso + hcalIso;
234 <  if(ele->IsEB()) combinedIso = trkIso + TMath::Max(ecalIso - 1.0, 0.0) + hcalIso;
230 >  Double_t trkIso  = ele->TrackIsolationDr03() / ele->Pt();
231 >  Double_t ecalIso = ele->EcalRecHitIsoDr03() / ele->Pt();
232 >  Double_t hcalIso = ele->HcalTowerSumEtDr03() / ele->Pt();
233 >  Double_t combinedIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03();
234 >  if(ele->IsEB()) combinedIso = ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) + ele->HcalTowerSumEtDr03();
235    combinedIso = combinedIso / ele->Pt();
236  
237    Int_t eb = 1;
# Line 244 | Line 257 | Bool_t ElectronTools::PassCustomIso(cons
257  
258   //--------------------------------------------------------------------------------------------------
259   Bool_t ElectronTools::PassConversionFilter(const Electron *ele,
260 <                                           const DecayParticleCol *conversions,
261 <                                           Bool_t WrongHitsRequirement)
260 >                                           const DecayParticleCol *conversions,
261 >                                           const BaseVertex *vtx,
262 >                                           UInt_t nWrongHitsMax,
263 >                                           Double_t probMin,
264 >                                           Double_t lxyMin,
265 >                                           Bool_t matchCkf,
266 >                                           Bool_t requireArbitratedMerged)
267   {
268    Bool_t isGoodConversion = kFALSE;
269  
# Line 254 | Line 272 | Bool_t ElectronTools::PassConversionFilt
272      for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
273        const Track *trk = dynamic_cast<const ChargedParticle*>
274          (conversions->At(ifc)->Daughter(d))->Trk();
275 <      if (ele->GsfTrk() == trk) {
275 >      if (ele->GsfTrk() == trk || (matchCkf && ele->TrackerTrk()==trk) ) {
276          ConversionMatchFound = kTRUE;
277          break;
278        }
# Line 262 | Line 280 | Bool_t ElectronTools::PassConversionFilt
280  
281      // if match between the e-track and one of the conversion legs
282      if (ConversionMatchFound == kTRUE){
283 <      isGoodConversion =  (conversions->At(ifc)->Prob() > 1e-6) &&
284 <        (conversions->At(ifc)->Lxy() > 0) &&
285 <        (conversions->At(ifc)->Lz() > 0) &&
268 <        (conversions->At(ifc)->Position().Rho() > 2.0);
283 >      isGoodConversion =  (conversions->At(ifc)->Prob() > probMin) &&
284 >        (!requireArbitratedMerged || conversions->At(ifc)->Quality().Quality(ConversionQuality::arbitratedMerged)) &&
285 >        (conversions->At(ifc)->LxyCorrected(vtx) > lxyMin);
286  
287        if (isGoodConversion == kTRUE) {
288          for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
289            const Track *trk = dynamic_cast<const ChargedParticle*>
290              (conversions->At(ifc)->Daughter(d))->Trk();
291            if (trk) {
275            // These requirements are not used for the GSF track
276            if (!(trk->NHits() >= 3 && trk->Prob() > 1e-6) && trk!=ele->GsfTrk())
277              isGoodConversion = kFALSE;
292              const StableData *sd = dynamic_cast<const StableData*>
293                (conversions->At(ifc)->DaughterDat(d));
294 <            if (WrongHitsRequirement && sd->NWrongHits() != 0)
294 >            if (sd->NWrongHits() > nWrongHitsMax)
295                isGoodConversion = kFALSE;
296            } else {
297              isGoodConversion = kFALSE;
# Line 285 | Line 299 | Bool_t ElectronTools::PassConversionFilt
299          }
300        }
301      }
302 +
303      if (isGoodConversion == kTRUE) break;
304      
305    } // loop over all conversions
# Line 293 | Line 308 | Bool_t ElectronTools::PassConversionFilt
308   }
309  
310   //--------------------------------------------------------------------------------------------------
311 < Bool_t ElectronTools::PassD0Cut(const Electron *ele, const VertexCol *vertices, Double_t fD0Cut,
297 <                                Bool_t fReverseD0Cut)
311 > Bool_t ElectronTools::PassD0Cut(const Electron *ele, const VertexCol *vertices, Double_t fD0Cut)
312   {
313    Bool_t d0cut = kFALSE;
314    // d0 cut
315    Double_t d0_real = 99999;
316    for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
317 <    Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
318 <    if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
317 >    if(vertices->At(i0)->NTracks() > 0){
318 >      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
319 >      d0_real = TMath::Abs(pD0);
320 >      break;
321 >    }
322    }
323    if(d0_real < fD0Cut) d0cut = kTRUE;
324    
308  if     (fReverseD0Cut == kTRUE &&
309          d0cut == kFALSE && d0_real < 0.05)
310    d0cut = kTRUE;
311  else if(fReverseD0Cut == kTRUE)
312    d0cut = kFALSE;
313  
325    return d0cut;
326   }
327  
328   //--------------------------------------------------------------------------------------------------
329 < Bool_t ElectronTools::PassD0Cut(const Electron *ele, const BeamSpotCol *beamspots, Double_t fD0Cut,
319 <                                Bool_t fReverseD0Cut)
329 > Bool_t ElectronTools::PassD0Cut(const Electron *ele, const BeamSpotCol *beamspots, Double_t fD0Cut)
330   {
331    Bool_t d0cut = kFALSE;
332    // d0 cut
# Line 327 | Line 337 | Bool_t ElectronTools::PassD0Cut(const El
337    }
338    if(d0_real < fD0Cut) d0cut = kTRUE;
339    
330  if     (fReverseD0Cut == kTRUE &&
331          d0cut == kFALSE && d0_real < 0.05)
332    d0cut = kTRUE;
333  else if(fReverseD0Cut == kTRUE)
334    d0cut = kFALSE;
335  
340    return d0cut;
341   }
342  
# Line 350 | Line 354 | Bool_t ElectronTools::PassChargeFilter(c
354   Bool_t ElectronTools::PassSpikeRemovalFilter(const Electron *ele)
355   {
356    Bool_t passSpikeRemovalFilter = kTRUE;
357 <  if(ele->SCluster()->Seed()->Energy() > 5.0 &&
357 >  if(ele->SCluster() &&
358 >     ele->SCluster()->Seed()->Energy() > 5.0 &&
359       ele->SCluster()->Seed()->EMax() / ele->SCluster()->Seed()->E3x3() > 0.95
360      ) {
361      passSpikeRemovalFilter = kFALSE;
# Line 366 | Line 371 | Bool_t ElectronTools::PassSpikeRemovalFi
371    return passSpikeRemovalFilter;
372   }
373  
374 + Bool_t ElectronTools::PassTriggerMatching(const Electron *ele, const TriggerObjectCol *trigobjs)
375 + {
376 +  
377 +  for (UInt_t i=0; i<trigobjs->GetEntries(); ++i) {
378 +    const TriggerObject *trigobj = trigobjs->At(i);
379 +    if (trigobj->TriggerType()==TriggerObject::TriggerCluster || trigobj->TriggerType()==TriggerObject::TriggerElectron || trigobj->TriggerType()==TriggerObject::TriggerPhoton) {
380 +      if (MathUtils::DeltaR(ele->SCluster(),trigobj)<0.3) {
381 +        return kTRUE;
382 +      }
383 +    }
384 +  }
385 +  
386 +  return kFALSE;
387 +  
388 +  
389 + }
390 +
391   //--------------------------------------------------------------------------------------------------
392   Int_t ElectronTools::Classify(const Electron *ele) {
393    
# Line 406 | Line 428 | Int_t ElectronTools::Classify(const Elec
428  
429   //--------------------------------------------------------------------------------------------------
430   Int_t ElectronTools::PassTightId(const Electron *ele, const VertexCol *vertices,
431 <                                 const DecayParticleCol *conversions, const Int_t typeCuts){
431 >                                 const DecayParticleCol *conversions, const Int_t typeCuts,
432 >                                 Double_t beta){
433  
434 <  Double_t scEt   = ele->SCluster()->Et();
435 <  Double_t eOverP = ele->ESuperClusterOverP();
434 > // original code on
435 > // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/RecoEgamma/ElectronIdentification/src/CutBasedElectronID.cc
436 > // beta must be computed with a DR cone of 0.4
437 >
438 >  Double_t scEt   = ele->SCluster()->Et();
439 >  Double_t scEta  = ele->SCluster()->Eta();
440  
441    Double_t fBrem = ele->FBrem();
442    Double_t hOverE = ele->HadronicOverEm();
# Line 420 | Line 447 | Int_t ElectronTools::PassTightId(const E
447  
448    Int_t mishits = ele->BestTrk()->NExpectedHitsInner();
449    Double_t tkIso   = ele->TrackIsolationDr03();
450 <  Double_t ecalIso = ele->EcalRecHitIsoDr04();
451 <  Double_t ecalIsoPed = (ele->IsEB())?std::max(0.,ecalIso-1.):ecalIso;
425 <  Double_t hcalIso  = ele->HcalTowerSumEtDr04();
426 <  Double_t hcalIso1 = ele->HcalDepth1TowerSumEtDr04();
427 <  Double_t hcalIso2 = ele->HcalDepth2TowerSumEtDr04();
428 <  Double_t e25Max = ele->E25Max();
429 <  Double_t e15 = ele->E15();
430 <  Double_t e55 = ele->E55();
431 <  Double_t e25Maxoe55 = e25Max/e55;
432 <  Double_t e15oe55 = e15/e55;
450 >  Double_t ecalIso = ele->EcalRecHitIsoDr04()*beta;
451 >  Double_t hcalIso  = ele->HcalTowerSumEtDr04()*beta;
452  
453    int cat = Classify(ele);
454    int eb;
# Line 439 | Line 458 | Int_t ElectronTools::PassTightId(const E
458    else
459      eb = 1;
460  
461 <  Int_t result = 0.;
461 >  // Medium cuts
462 >  Double_t cutdcotdistMedium[9] = {
463 >  3.32e-02, 2.92e-02, 2.49e-02, 3.92e-02, 3.41e-02, 3.96e-02, 2.91e-02, 3.95e-02, 7.71e-03};
464 >  Double_t cutdetainMedium[9] = {
465 >  1.33e-02, 4.48e-03, 9.22e-03, 1.54e-02, 7.26e-03, 1.24e-02, 1.29e-02, 3.84e-02, 1.88e-02};
466 >  Double_t cutdetainlMedium[9] = {
467 >  1.21e-02, 4.22e-03, 9.18e-03, 1.61e-02, 6.45e-03, 1.16e-02, 1.23e-02, 6.20e-02, 2.43e-02};
468 >  Double_t cutdphiinMedium[9] = {
469 >  7.09e-02, 2.43e-01, 2.96e-01, 7.98e-02, 2.35e-01, 2.76e-01, 3.42e-01, 4.04e-01, 2.99e-01};
470 >  Double_t cutdphiinlMedium[9] = {
471 >  7.42e-02, 2.43e-01, 2.97e-01, 9.12e-02, 2.26e-01, 2.76e-01, 3.34e-01, 5.58e-01, 2.91e-01};
472 >  Double_t cuteseedopcorMedium[9] = {
473 >  6.42e-01, 9.44e-01, 4.53e-01, 7.62e-01, 3.67e-01, 5.57e-01, 1.98e-01, 9.15e-01, 6.28e-02};
474 >  Double_t cutfmishitsMedium[9] = {
475 >  4.50e+00, 1.50e+00, 1.50e+00, 1.50e+00, 1.50e+00, 5.00e-01, 1.50e+00, 5.00e-01, 5.00e-01};
476 >  Double_t cuthoeMedium[9] = {
477 >  1.96e-01, 6.30e-02, 1.48e-01, 3.66e-01, 5.66e-02, 1.45e-01, 4.29e-01, 4.28e-01, 3.99e-01};
478 >  Double_t cuthoelMedium[9] = {
479 >  2.19e-01, 6.19e-02, 1.47e-01, 3.58e-01, 4.61e-02, 1.46e-01, 3.26e-01, 3.81e-01, 3.89e-01};
480 >  Double_t cutip_gsfMedium[9] = {
481 >  2.45e-02, 9.74e-02, 1.48e-01, 5.49e-02, 5.65e-01, 3.33e-01, 2.04e-01, 5.41e-01, 1.21e-01};
482 >  Double_t cutip_gsflMedium[9] = {
483 >  1.92e-02, 9.81e-02, 1.33e-01, 4.34e-02, 5.65e-01, 3.24e-01, 2.33e-01, 4.30e-01, 6.44e-02};
484 >  Double_t cutiso_sumMedium[9] = {
485 >  1.44e+01, 1.12e+01, 1.09e+01, 1.08e+01, 6.35e+00, 9.78e+00, 1.30e+01, 1.62e+01, 1.96e+00};
486 >  Double_t cutiso_sumoetMedium[9] = {
487 >  1.01e+01, 6.41e+00, 6.00e+00, 8.14e+00, 3.90e+00, 4.76e+00, 6.86e+00, 6.48e+00, 1.74e+01};
488 >  Double_t cutiso_sumoetlMedium[9] = {
489 >  9.44e+00, 7.67e+00, 7.15e+00, 7.34e+00, 3.35e+00, 4.70e+00, 8.32e+00, 7.55e+00, 6.25e+00};
490 >  Double_t cutseeMedium[9] = {
491 >  1.30e-02, 1.09e-02, 1.18e-02, 3.94e-02, 3.04e-02, 3.28e-02, 1.00e-02, 3.73e-02, 6.69e-02};
492 >  Double_t cutseelMedium[9] = {
493 >  1.42e-02, 1.11e-02, 1.29e-02, 4.32e-02, 2.96e-02, 3.82e-02, 1.01e-02, 4.45e-02, 1.19e-01};
494 >
495 >  // Tight cuts
496 >  Double_t cutdcotdistTight[9] = {
497 >  2.68e-02, 2.36e-02, 2.21e-02, 3.72e-02, 3.17e-02, 3.61e-02, 2.55e-02, 3.75e-02, 2.16e-04};
498 >  Double_t cutdetainTight[9] = {
499 >  8.92e-03, 3.96e-03, 8.50e-03, 1.34e-02, 6.27e-03, 1.05e-02, 1.12e-02, 3.09e-02, 1.88e-02};
500 >  Double_t cutdetainlTight[9] = {
501 >  9.23e-03, 3.77e-03, 8.70e-03, 1.39e-02, 5.60e-03, 9.40e-03, 1.07e-02, 6.20e-02, 4.10e-03};
502 >  Double_t cutdphiinTight[9] = {
503 >  6.37e-02, 1.53e-01, 2.90e-01, 7.69e-02, 1.81e-01, 2.34e-01, 3.42e-01, 3.93e-01, 2.84e-01};
504 >  Double_t cutdphiinlTight[9] = {
505 >  6.92e-02, 2.33e-01, 2.96e-01, 8.65e-02, 1.85e-01, 2.76e-01, 3.34e-01, 3.53e-01, 2.90e-01};
506 >  Double_t cuteseedopcorTight[9] = {
507 >  6.52e-01, 9.69e-01, 9.12e-01, 7.79e-01, 3.67e-01, 6.99e-01, 3.28e-01, 9.67e-01, 5.89e-01};
508 >  Double_t cutfmishitsTight[9] = {
509 >  4.50e+00, 1.50e+00, 5.00e-01, 1.50e+00, 1.50e+00, 5.00e-01, 5.00e-01, 5.00e-01, 5.00e-01};
510 >  Double_t cuthoeTight[9] = {
511 >  1.74e-01, 4.88e-02, 1.46e-01, 3.64e-01, 4.93e-02, 1.45e-01, 4.29e-01, 4.20e-01, 3.99e-01};
512 >  Double_t cuthoelTight[9] = {
513 >  2.19e-01, 5.25e-02, 1.47e-01, 3.57e-01, 4.25e-02, 1.45e-01, 3.26e-01, 3.80e-01, 1.32e-01};
514 >  Double_t cutip_gsfTight[9] = {
515 >  1.58e-02, 8.25e-02, 1.15e-01, 4.05e-02, 5.40e-01, 1.51e-01, 7.74e-02, 4.17e-01, 7.80e-02};
516 >  Double_t cutip_gsflTight[9] = {
517 >  1.27e-02, 6.26e-02, 9.68e-02, 3.02e-02, 5.65e-01, 1.46e-01, 7.90e-02, 4.10e-01, 4.79e-02};
518 >  Double_t cutiso_sumTight[9] = {
519 >  1.23e+01, 9.77e+00, 1.01e+01, 9.77e+00, 6.13e+00, 7.55e+00, 1.30e+01, 1.62e+01, 1.78e+00};
520 >  Double_t cutiso_sumoetTight[9] = {
521 >  7.75e+00, 5.45e+00, 5.67e+00, 5.97e+00, 3.17e+00, 3.86e+00, 6.06e+00, 5.31e+00, 1.05e+01};
522 >  Double_t cutiso_sumoetlTight[9] = {
523 >  7.56e+00, 5.08e+00, 5.77e+00, 5.74e+00, 2.37e+00, 3.32e+00, 4.97e+00, 5.46e+00, 3.82e+00};
524 >  Double_t cutseeTight[9] = {
525 >  1.16e-02, 1.07e-02, 1.08e-02, 3.49e-02, 2.89e-02, 3.08e-02, 9.87e-03, 3.37e-02, 4.40e-02};
526 >  Double_t cutseelTight[9] = {
527 >  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};
528    
529 <  Int_t bin = 0;
530 <  
531 <  Double_t WantBin = kFALSE;
532 <  if(WantBin) {
533 <    if (scEt < 20.)
534 <      bin = 2;
535 <    else if (scEt > 30.)
536 <      bin = 0;
537 <    else
538 <      bin = 1;
529 >  // SuperTight cuts
530 >  Double_t cutdcotdistSuperTight[9] = {
531 >  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};
532 >  Double_t cutdetainSuperTight[9] = {
533 >  7.84e-03, 3.67e-03, 7.00e-03, 1.28e-02, 5.65e-03, 9.53e-03, 1.08e-02, 2.97e-02, 7.24e-03};
534 >  Double_t cutdetainlSuperTight[9] = {
535 >  7.61e-03, 3.28e-03, 6.57e-03, 1.03e-02, 5.05e-03, 8.55e-03, 1.07e-02, 2.94e-02, 4.10e-03};
536 >  Double_t cutdphiinSuperTight[9] = {
537 >  4.83e-02, 7.39e-02, 2.38e-01, 5.74e-02, 1.29e-01, 2.13e-01, 3.31e-01, 3.93e-01, 2.84e-01};
538 >  Double_t cutdphiinlSuperTight[9] = {
539 >  5.79e-02, 7.21e-02, 2.18e-01, 7.70e-02, 1.41e-01, 2.11e-01, 2.43e-01, 3.53e-01, 2.89e-01};
540 >  Double_t cuteseedopcorSuperTight[9] = {
541 >  7.32e-01, 9.77e-01, 9.83e-01, 8.55e-01, 4.31e-01, 7.35e-01, 4.18e-01, 9.99e-01, 5.89e-01};
542 >  Double_t cutfmishitsSuperTight[9] = {
543 >  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};
544 >  Double_t cuthoeSuperTight[9] = {
545 >  9.19e-02, 4.11e-02, 1.42e-01, 3.35e-01, 3.82e-02, 1.41e-01, 4.29e-01, 4.01e-01, 3.99e-01};
546 >  Double_t cuthoelSuperTight[9] = {
547 >  7.51e-02, 3.81e-02, 1.41e-01, 3.32e-01, 3.10e-02, 1.43e-01, 2.35e-01, 3.80e-01, 1.32e-01};
548 >  Double_t cutip_gsfSuperTight[9] = {
549 >  1.42e-02, 2.66e-02, 1.06e-01, 3.38e-02, 3.23e-01, 1.07e-01, 7.74e-02, 2.32e-01, 7.80e-02};
550 >  Double_t cutip_gsflSuperTight[9] = {
551 >  1.15e-02, 2.72e-02, 8.41e-02, 2.49e-02, 4.17e-01, 1.02e-01, 7.90e-02, 1.69e-01, 4.79e-02};
552 >  Double_t cutiso_sumSuperTight[9] = {
553 >  8.95e+00, 8.18e+00, 8.75e+00, 7.47e+00, 5.43e+00, 5.87e+00, 8.16e+00, 1.02e+01, 1.78e+00};
554 >  Double_t cutiso_sumoetSuperTight[9] = {
555 >  6.45e+00, 5.14e+00, 4.99e+00, 5.21e+00, 2.65e+00, 3.12e+00, 4.52e+00, 4.72e+00, 3.68e+00};
556 >  Double_t cutiso_sumoetlSuperTight[9] = {
557 >  6.02e+00, 3.96e+00, 4.23e+00, 4.73e+00, 1.99e+00, 2.64e+00, 3.72e+00, 3.81e+00, 1.44e+00};
558 >  Double_t cutseeSuperTight[9] = {
559 >  1.09e-02, 1.05e-02, 1.05e-02, 3.24e-02, 2.81e-02, 2.95e-02, 9.77e-03, 2.75e-02, 2.95e-02};
560 >  Double_t cutseelSuperTight[9] = {
561 >  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};
562 >
563 >  // HyperTight1 cuts
564 >  Double_t cutdcotdistHyperTight1[9] = {
565 >  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};
566 >  Double_t cutdetainHyperTight1[9] = {
567 >  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};
568 >  Double_t cutdetainlHyperTight1[9] = {
569 >  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};
570 >  Double_t cutdphiinHyperTight1[9] = {
571 >  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};
572 >  Double_t cutdphiinlHyperTight1[9] = {
573 >  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};
574 >  Double_t cuteseedopcorHyperTight1[9] = {
575 >  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};
576 >  Double_t cutfmishitsHyperTight1[9] = {
577 >  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};
578 >  Double_t cuthoeHyperTight1[9] = {
579 >  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};
580 >  Double_t cuthoelHyperTight1[9] = {
581 >  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};
582 >  Double_t cutip_gsfHyperTight1[9] = {
583 >  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};
584 >  Double_t cutip_gsflHyperTight1[9] = {
585 >  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};
586 >  Double_t cutiso_sumHyperTight1[9] = {
587 >  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};
588 >  Double_t cutiso_sumoetHyperTight1[9] = {
589 >  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};
590 >  Double_t cutiso_sumoetlHyperTight1[9] = {
591 >  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};
592 >  Double_t cutseeHyperTight1[9] = {
593 >  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};
594 >  Double_t cutseelHyperTight1[9] = {
595 >  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};
596 >
597 >  // HyperTight2 cuts
598 >  Double_t cutdcotdistHyperTight2[9] = {
599 >  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};
600 >  Double_t cutdetainHyperTight2[9] = {
601 >  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};
602 >  Double_t cutdetainlHyperTight2[9] = {
603 >  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};
604 >  Double_t cutdphiinHyperTight2[9] = {
605 >  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};
606 >  Double_t cutdphiinlHyperTight2[9] = {
607 >  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};
608 >  Double_t cuteseedopcorHyperTight2[9] = {
609 >  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};
610 >  Double_t cutfmishitsHyperTight2[9] = {
611 >  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};
612 >  Double_t cuthoeHyperTight2[9] = {
613 >  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};
614 >  Double_t cuthoelHyperTight2[9] = {
615 >  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};
616 >  Double_t cutip_gsfHyperTight2[9] = {
617 >  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};
618 >  Double_t cutip_gsflHyperTight2[9] = {
619 >  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};
620 >  Double_t cutiso_sumHyperTight2[9] = {
621 >  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};
622 >  Double_t cutiso_sumoetHyperTight2[9] = {
623 >  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};
624 >  Double_t cutiso_sumoetlHyperTight2[9] = {
625 >  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};
626 >  Double_t cutseeHyperTight2[9] = {
627 >  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};
628 >  Double_t cutseelHyperTight2[9] = {
629 >  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};
630 >
631 >  // HyperTight3 cuts
632 >  Double_t cutdcotdistHyperTight3[9] = {
633 >  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};
634 >  Double_t cutdetainHyperTight3[9] = {
635 >  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};
636 >  Double_t cutdetainlHyperTight3[9] = {
637 >  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};
638 >  Double_t cutdphiinHyperTight3[9] = {
639 >  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};
640 >  Double_t cutdphiinlHyperTight3[9] = {
641 >  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};
642 >  Double_t cuteseedopcorHyperTight3[9] = {
643 >  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};
644 >  Double_t cutfmishitsHyperTight3[9] = {
645 >  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};
646 >  Double_t cuthoeHyperTight3[9] = {
647 >  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};
648 >  Double_t cuthoelHyperTight3[9] = {
649 >  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};
650 >  Double_t cutip_gsfHyperTight3[9] = {
651 >  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};
652 >  Double_t cutip_gsflHyperTight3[9] = {
653 >  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};
654 >  Double_t cutiso_sumHyperTight3[9] = {
655 >  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};
656 >  Double_t cutiso_sumoetHyperTight3[9] = {
657 >  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};
658 >  Double_t cutiso_sumoetlHyperTight3[9] = {
659 >  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};
660 >  Double_t cutseeHyperTight3[9] = {
661 >  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};
662 >  Double_t cutseelHyperTight3[9] = {
663 >  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};
664 >
665 >  // HyperTight4 cuts
666 >  Double_t cutdcotdistHyperTight4[9] = {
667 >  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};
668 >  Double_t cutdetainHyperTight4[9] = {
669 >  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};
670 >  Double_t cutdetainlHyperTight4[9] = {
671 >  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};
672 >  Double_t cutdphiinHyperTight4[9] = {
673 >  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};
674 >  Double_t cutdphiinlHyperTight4[9] = {
675 >  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};
676 >  Double_t cuteseedopcorHyperTight4[9] = {
677 >  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};
678 >  Double_t cutfmishitsHyperTight4[9] = {
679 >  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};
680 >  Double_t cuthoeHyperTight4[9] = {
681 >  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};
682 >  Double_t cuthoelHyperTight4[9] = {
683 >  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};
684 >  Double_t cutip_gsfHyperTight4[9] = {
685 >  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};
686 >  Double_t cutip_gsflHyperTight4[9] = {
687 >  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};
688 >  Double_t cutiso_sumHyperTight4[9] = {
689 >  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};
690 >  Double_t cutiso_sumoetHyperTight4[9] = {
691 >  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};
692 >  Double_t cutiso_sumoetlHyperTight4[9] = {
693 >  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};
694 >  Double_t cutseeHyperTight4[9] = {
695 >  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};
696 >  Double_t cutseelHyperTight4[9] = {
697 >  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};
698 >
699 >  Double_t cutdcotdist[9];
700 >  Double_t cutdetain[9];
701 >  Double_t cutdetainl[9];
702 >  Double_t cutdphiin[9];
703 >  Double_t cutdphiinl[9];
704 >  Double_t cuteseedopcor[9];
705 >  Double_t cutfmishits[9];
706 >  Double_t cuthoe[9];
707 >  Double_t cuthoel[9];
708 >  Double_t cutip_gsf[9];
709 >  Double_t cutip_gsfl[9];
710 >  Double_t cutiso_sum[9];
711 >  Double_t cutiso_sumoet[9];
712 >  Double_t cutiso_sumoetl[9];
713 >  Double_t cutsee[9];
714 >  Double_t cutseel[9];
715 >  if     (typeCuts == 0) {
716 >    memcpy(cutdcotdist   ,cutdcotdistMedium   ,sizeof(cutdcotdistMedium));
717 >    memcpy(cutdetain     ,cutdetainMedium     ,sizeof(cutdetainMedium));
718 >    memcpy(cutdetainl    ,cutdetainlMedium    ,sizeof(cutdetainlMedium));
719 >    memcpy(cutdphiin     ,cutdphiinMedium     ,sizeof(cutdphiinMedium));
720 >    memcpy(cutdphiinl    ,cutdphiinlMedium    ,sizeof(cutdphiinlMedium));
721 >    memcpy(cuteseedopcor ,cuteseedopcorMedium ,sizeof(cuteseedopcorMedium));
722 >    memcpy(cutfmishits   ,cutfmishitsMedium   ,sizeof(cutfmishitsMedium));
723 >    memcpy(cuthoe        ,cuthoeMedium        ,sizeof(cuthoeMedium));
724 >    memcpy(cuthoel       ,cuthoelMedium       ,sizeof(cuthoelMedium));
725 >    memcpy(cutip_gsf     ,cutip_gsfMedium     ,sizeof(cutip_gsfMedium));
726 >    memcpy(cutip_gsfl    ,cutip_gsflMedium    ,sizeof(cutip_gsflMedium));
727 >    memcpy(cutiso_sum    ,cutiso_sumMedium    ,sizeof(cutiso_sumMedium));
728 >    memcpy(cutiso_sumoet ,cutiso_sumoetMedium ,sizeof(cutiso_sumoetMedium));
729 >    memcpy(cutiso_sumoetl,cutiso_sumoetlMedium,sizeof(cutiso_sumoetlMedium));
730 >    memcpy(cutsee        ,cutseeMedium        ,sizeof(cutseeMedium));
731 >    memcpy(cutseel       ,cutseelMedium       ,sizeof(cutseelMedium));
732    }
733 +  else if(typeCuts == 1) {
734 +    memcpy(cutdcotdist   ,cutdcotdistTight   ,sizeof(cutdcotdistTight));
735 +    memcpy(cutdetain     ,cutdetainTight     ,sizeof(cutdetainTight));
736 +    memcpy(cutdetainl    ,cutdetainlTight    ,sizeof(cutdetainlTight));
737 +    memcpy(cutdphiin     ,cutdphiinTight     ,sizeof(cutdphiinTight));
738 +    memcpy(cutdphiinl    ,cutdphiinlTight    ,sizeof(cutdphiinlTight));
739 +    memcpy(cuteseedopcor ,cuteseedopcorTight ,sizeof(cuteseedopcorTight));
740 +    memcpy(cutfmishits   ,cutfmishitsTight   ,sizeof(cutfmishitsTight));
741 +    memcpy(cuthoe        ,cuthoeTight        ,sizeof(cuthoeTight));
742 +    memcpy(cuthoel       ,cuthoelTight       ,sizeof(cuthoelTight));
743 +    memcpy(cutip_gsf     ,cutip_gsfTight     ,sizeof(cutip_gsfTight));
744 +    memcpy(cutip_gsfl    ,cutip_gsflTight    ,sizeof(cutip_gsflTight));
745 +    memcpy(cutiso_sum    ,cutiso_sumTight    ,sizeof(cutiso_sumTight));
746 +    memcpy(cutiso_sumoet ,cutiso_sumoetTight ,sizeof(cutiso_sumoetTight));
747 +    memcpy(cutiso_sumoetl,cutiso_sumoetlTight,sizeof(cutiso_sumoetlTight));
748 +    memcpy(cutsee        ,cutseeTight        ,sizeof(cutseeTight));
749 +    memcpy(cutseel       ,cutseelTight       ,sizeof(cutseelTight));
750 +  }
751 +  else if(typeCuts == 2) {
752 +    memcpy(cutdcotdist   ,cutdcotdistSuperTight   ,sizeof(cutdcotdistSuperTight));
753 +    memcpy(cutdetain     ,cutdetainSuperTight     ,sizeof(cutdetainSuperTight));
754 +    memcpy(cutdetainl    ,cutdetainlSuperTight    ,sizeof(cutdetainlSuperTight));
755 +    memcpy(cutdphiin     ,cutdphiinSuperTight     ,sizeof(cutdphiinSuperTight));
756 +    memcpy(cutdphiinl    ,cutdphiinlSuperTight    ,sizeof(cutdphiinlSuperTight));
757 +    memcpy(cuteseedopcor ,cuteseedopcorSuperTight ,sizeof(cuteseedopcorSuperTight));
758 +    memcpy(cutfmishits   ,cutfmishitsSuperTight   ,sizeof(cutfmishitsSuperTight));
759 +    memcpy(cuthoe        ,cuthoeSuperTight        ,sizeof(cuthoeSuperTight));
760 +    memcpy(cuthoel       ,cuthoelSuperTight       ,sizeof(cuthoelSuperTight));
761 +    memcpy(cutip_gsf     ,cutip_gsfSuperTight     ,sizeof(cutip_gsfSuperTight));
762 +    memcpy(cutip_gsfl    ,cutip_gsflSuperTight    ,sizeof(cutip_gsflSuperTight));
763 +    memcpy(cutiso_sum    ,cutiso_sumSuperTight    ,sizeof(cutiso_sumSuperTight));
764 +    memcpy(cutiso_sumoet ,cutiso_sumoetSuperTight ,sizeof(cutiso_sumoetSuperTight));
765 +    memcpy(cutiso_sumoetl,cutiso_sumoetlSuperTight,sizeof(cutiso_sumoetlSuperTight));
766 +    memcpy(cutsee        ,cutseeSuperTight        ,sizeof(cutseeSuperTight));
767 +    memcpy(cutseel       ,cutseelSuperTight       ,sizeof(cutseelSuperTight));
768 +  }
769 +  else if(typeCuts == 3) {
770 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight1   ,sizeof(cutdcotdistHyperTight1));
771 +    memcpy(cutdetain     ,cutdetainHyperTight1     ,sizeof(cutdetainHyperTight1));
772 +    memcpy(cutdetainl    ,cutdetainlHyperTight1    ,sizeof(cutdetainlHyperTight1));
773 +    memcpy(cutdphiin     ,cutdphiinHyperTight1     ,sizeof(cutdphiinHyperTight1));
774 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight1    ,sizeof(cutdphiinlHyperTight1));
775 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight1 ,sizeof(cuteseedopcorHyperTight1));
776 +    memcpy(cutfmishits   ,cutfmishitsHyperTight1   ,sizeof(cutfmishitsHyperTight1));
777 +    memcpy(cuthoe        ,cuthoeHyperTight1       ,sizeof(cuthoeHyperTight1));
778 +    memcpy(cuthoel       ,cuthoelHyperTight1      ,sizeof(cuthoelHyperTight1));
779 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight1     ,sizeof(cutip_gsfHyperTight1));
780 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight1    ,sizeof(cutip_gsflHyperTight1));
781 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight1    ,sizeof(cutiso_sumHyperTight1));
782 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight1 ,sizeof(cutiso_sumoetHyperTight1));
783 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight1,sizeof(cutiso_sumoetlHyperTight1));
784 +    memcpy(cutsee        ,cutseeHyperTight1       ,sizeof(cutseeHyperTight1));
785 +    memcpy(cutseel       ,cutseelHyperTight1      ,sizeof(cutseelHyperTight1));
786 +  }
787 +  else if(typeCuts == 4) {
788 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight2   ,sizeof(cutdcotdistHyperTight2));
789 +    memcpy(cutdetain     ,cutdetainHyperTight2     ,sizeof(cutdetainHyperTight2));
790 +    memcpy(cutdetainl    ,cutdetainlHyperTight2    ,sizeof(cutdetainlHyperTight2));
791 +    memcpy(cutdphiin     ,cutdphiinHyperTight2     ,sizeof(cutdphiinHyperTight2));
792 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight2    ,sizeof(cutdphiinlHyperTight2));
793 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight2 ,sizeof(cuteseedopcorHyperTight2));
794 +    memcpy(cutfmishits   ,cutfmishitsHyperTight2   ,sizeof(cutfmishitsHyperTight2));
795 +    memcpy(cuthoe        ,cuthoeHyperTight2       ,sizeof(cuthoeHyperTight2));
796 +    memcpy(cuthoel       ,cuthoelHyperTight2      ,sizeof(cuthoelHyperTight2));
797 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight2     ,sizeof(cutip_gsfHyperTight2));
798 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight2    ,sizeof(cutip_gsflHyperTight2));
799 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight2    ,sizeof(cutiso_sumHyperTight2));
800 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight2 ,sizeof(cutiso_sumoetHyperTight2));
801 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight2,sizeof(cutiso_sumoetlHyperTight2));
802 +    memcpy(cutsee        ,cutseeHyperTight2       ,sizeof(cutseeHyperTight2));
803 +    memcpy(cutseel       ,cutseelHyperTight2      ,sizeof(cutseelHyperTight2));
804 +  }
805 +  else if(typeCuts == 5) {
806 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight3   ,sizeof(cutdcotdistHyperTight3));
807 +    memcpy(cutdetain     ,cutdetainHyperTight3     ,sizeof(cutdetainHyperTight3));
808 +    memcpy(cutdetainl    ,cutdetainlHyperTight3    ,sizeof(cutdetainlHyperTight3));
809 +    memcpy(cutdphiin     ,cutdphiinHyperTight3     ,sizeof(cutdphiinHyperTight3));
810 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight3    ,sizeof(cutdphiinlHyperTight3));
811 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight3 ,sizeof(cuteseedopcorHyperTight3));
812 +    memcpy(cutfmishits   ,cutfmishitsHyperTight3   ,sizeof(cutfmishitsHyperTight3));
813 +    memcpy(cuthoe        ,cuthoeHyperTight3       ,sizeof(cuthoeHyperTight3));
814 +    memcpy(cuthoel       ,cuthoelHyperTight3      ,sizeof(cuthoelHyperTight3));
815 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight3     ,sizeof(cutip_gsfHyperTight3));
816 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight3    ,sizeof(cutip_gsflHyperTight3));
817 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight3    ,sizeof(cutiso_sumHyperTight3));
818 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight3 ,sizeof(cutiso_sumoetHyperTight3));
819 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight3,sizeof(cutiso_sumoetlHyperTight3));
820 +    memcpy(cutsee        ,cutseeHyperTight3       ,sizeof(cutseeHyperTight3));
821 +    memcpy(cutseel       ,cutseelHyperTight3      ,sizeof(cutseelHyperTight3));
822 +  }
823 +  else if(typeCuts == 6) {
824 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight4   ,sizeof(cutdcotdistHyperTight4));
825 +    memcpy(cutdetain     ,cutdetainHyperTight4     ,sizeof(cutdetainHyperTight4));
826 +    memcpy(cutdetainl    ,cutdetainlHyperTight4    ,sizeof(cutdetainlHyperTight4));
827 +    memcpy(cutdphiin     ,cutdphiinHyperTight4     ,sizeof(cutdphiinHyperTight4));
828 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight4    ,sizeof(cutdphiinlHyperTight4));
829 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight4 ,sizeof(cuteseedopcorHyperTight4));
830 +    memcpy(cutfmishits   ,cutfmishitsHyperTight4   ,sizeof(cutfmishitsHyperTight4));
831 +    memcpy(cuthoe        ,cuthoeHyperTight4       ,sizeof(cuthoeHyperTight4));
832 +    memcpy(cuthoel       ,cuthoelHyperTight4      ,sizeof(cuthoelHyperTight4));
833 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight4     ,sizeof(cutip_gsfHyperTight4));
834 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight4    ,sizeof(cutip_gsflHyperTight4));
835 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight4    ,sizeof(cutiso_sumHyperTight4));
836 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight4 ,sizeof(cutiso_sumoetHyperTight4));
837 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight4,sizeof(cutiso_sumoetlHyperTight4));
838 +    memcpy(cutsee        ,cutseeHyperTight4       ,sizeof(cutseeHyperTight4));
839 +    memcpy(cutseel       ,cutseelHyperTight4      ,sizeof(cutseelHyperTight4));
840 +  }
841 +  else {
842 +    return 0;
843 +  }
844 +  int result = 0;
845 +  
846 +  const int ncuts = 10;
847 +  std::vector<bool> cut_results(ncuts, false);
848 +  
849 +  float iso_sum = tkIso + ecalIso + hcalIso;
850 +  if(fabs(scEta)>1.5)
851 +    iso_sum += (fabs(scEta)-1.5)*1.09;
852 +  
853 +  float iso_sumoet = iso_sum*(40./scEt);
854 +  
855 +  float eseedopincor = eSeedOverPin + fBrem;
856 +  if(fBrem < 0)
857 +    eseedopincor = eSeedOverPin;
858  
859 <  if (fBrem > 0)
860 <    eSeedOverPin = eSeedOverPin + fBrem;
458 <
459 <  if(typeCuts == 3 || typeCuts == 4){
460 <  // Loose robust cuts
461 <    Double_t robustlooseEleIDCuts[52] = {
462 <       0.05,  0.0103,  0.8, 0.00688, -1, -1, 7.33, 4.68, 9999., 9999., 9999.,9999., 9999.,9999., 9999., 9999.,9999., 9999., 0.000, -9999., 9999., 9999., 9999, -1, 0, 0,
463 <       0.0389, 0.0307, 0.7, 0.00944, -1, -1, 7.76, 3.09,  2.23, 9999., 9999.,9999., 9999.,9999., 9999., 9999.,9999., 9999., 0.000, -9999., 9999., 9999., 9999, -1, 0, 0
464 <    };
465 <  // Tight robust cuts
466 <    Double_t robusttightEleIDCuts[52] = {
467 <        0.0201, 0.0102, 0.0211, 0.00606, -1, -1, 2.34, 3.24, 4.51, 9999., 9999.,9999., 9999.,9999., 9999., 9999.,9999., 9999., 0.000, -9999., 9999., 9999., 9999, -1, 0, 0,
468 <        0.00253, 0.0291, 0.022, 0.0032, -1, -1, 0.826, 2.7, 0.255, 9999., 9999.,9999., 9999.,9999., 9999., 9999.,9999., 9999., 0.000, -9999., 9999., 9999., 9999, -1, 0, 0
469 <    };                            
470 <    Double_t cut[52];
471 <    if     (typeCuts == 3) {
472 <      memcpy(cut  ,robustlooseEleIDCuts  ,sizeof(cut));
473 <    }
474 <    else {
475 <      memcpy(cut  ,robusttightEleIDCuts  ,sizeof(cut));
476 <    }
477 <
478 <    if ((tkIso > cut[26*eb+6]) || (ecalIso > cut[26*eb+7]) || (hcalIso > cut[26*eb+8]) || (hcalIso1 > cut[26*eb+9]) || (hcalIso2 > cut[26*eb+10]) ||
479 <        (tkIso/ele->Pt() > cut[26*eb+11]) || (ecalIso/ele->Pt() > cut[26*eb+12]) || (hcalIso/ele->Pt() > cut[26*eb+13]) ||
480 <        ((tkIso+ecalIso+hcalIso)>cut[26*eb+14]) || (((tkIso+ecalIso+hcalIso)/ ele->Pt()) > cut[26*eb+15]) ||
481 <        ((tkIso+ecalIsoPed+hcalIso)>cut[26*eb+16]) || (((tkIso+ecalIsoPed+hcalIso)/ ele->Pt()) > cut[26*eb+17])  )
482 <      result = 0.;
483 <    else
484 <      result = 2.;
485 <
486 <    if (hOverE > cut[26*eb+0])
487 <      return result;    
488 <
489 <    if (sigmaee > cut[26*eb+1])
490 <      return result;    
491 <
492 <    if (fabs(deltaPhiIn) > cut[26*eb+2])
493 <      return result;    
494 <
495 <    if (fabs(deltaEtaIn) > cut[26*eb+3])
496 <      return result;    
497 <    
498 <    if (e25Maxoe55 < cut[26*eb+4] && e15oe55 < cut[26*eb+5])
499 <      return result;
500 <    // some extra electron id cuts
501 <    if (sigmaee < cut[26*eb+18]) // inverted sigmaee cut - spike removal related
502 <      return result;
859 >  float dist = (TMath::Abs(ele->ConvPartnerDist())      == -9999.? 9999:TMath::Abs(ele->ConvPartnerDist()));
860 >  float dcot = (TMath::Abs(ele->ConvPartnerDCotTheta()) == -9999.? 9999:TMath::Abs(ele->ConvPartnerDCotTheta()));
861  
862 <    if (  eOverP < cut[26*eb+19] ||  eOverP > cut[26*eb+20]) // lower and upper cut in E/P
505 <      return result;
506 <    
507 <    result = result + 1;
862 >  float dcotdistcomb = ((0.04 - std::max(dist, dcot)) > 0?(0.04 - std::max(dist, dcot)):0);
863  
864 <    Double_t d0_real = 99999;
865 <    for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
864 >  Double_t ip = 99999;
865 >  for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
866 >    if(vertices->At(i0)->NTracks() > 0){
867        Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
868 <      if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
868 >      ip = TMath::Abs(pD0);
869 >      break;
870      }
871 <    if (d0_real > cut[26*eb+21])
515 <      return result;
516 <
517 <    if (mishits > cut[26*eb+22]) // expected missing hits
518 <      return result;
871 >  }
872  
873 <    Bool_t passConvVeto = PassConversionFilter(ele, conversions, kTRUE);
874 <    if (passConvVeto == kFALSE)
875 <      return result;
876 <      
877 <    result += 4;
878 <  }
879 <  else if(typeCuts == 0 || typeCuts == 1 || typeCuts == 2){
880 <    // Loose cuts
881 <  Double_t cutdcotdistLoose[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
882 <  };
883 <  Double_t cutdetainLoose[9] = {1.30e-02, 5.95e-03, 3.10e-02, 1.68e-02, 8.44e-03, 1.70e-02, 1.55e-02, 5.13e-02, 1.61e-02
884 <  };
885 <  Double_t cutdphiinLoose[9] = {7.51e-02, 3.30e-01, 4.20e-01, 9.86e-02, 2.84e-01, 3.28e-01, 3.77e-01, 4.32e-01, 3.74e-01
886 <  };
887 <  Double_t cuteseedopcorLoose[9] = {6.31e-01, 3.02e-01, 3.04e-01, 8.10e-01, 2.23e-01, 5.03e-01, 2.78e-01, 3.10e-01, 4.69e-01
888 <  };
889 <  Double_t cutetLoose[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.
890 <  };
891 <  Double_t cutfmishitsLoose[9] = {4.50e+00, 1.50e+00, 1.50e+00, 2.50e+00, 2.50e+00, 1.50e+00, 2.50e+00, 4.50e+00, 5.00e-01
892 <  };
893 <  Double_t cuthoeLoose[9] = {2.47e-01, 7.78e-02, 1.49e-01, 3.82e-01, 4.70e-02, 1.12e-01, 1.16e+00, 5.04e+00, 1.35e+00
894 <  };
895 <  Double_t cutip_gsfLoose[9] = {0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02
896 <  };
897 <  Double_t cutiso_sumLoose[9] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1
898 <  };
899 <  Double_t cutiso_sumoetLoose[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
900 <  };
901 <  Double_t cutseeLoose[9] = {1.92e-02, 1.31e-02, 2.53e-02, 5.27e-02, 3.29e-02, 4.19e-02, 2.65e-02, 6.58e-02, 1.38e-01
902 <  };
903 <
904 <    // Medium cuts
552 <  Double_t cutdcotdistMedium[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
553 <  };
554 <  Double_t cutdetainMedium[9] = {1.19e-02, 4.20e-03, 1.07e-02, 1.49e-02, 6.56e-03, 1.19e-02, 1.16e-02, 5.13e-02, 6.37e-03
555 <  };
556 <  Double_t cutdphiinMedium[9] = {7.51e-02, 2.93e-01, 3.58e-01, 9.53e-02, 1.62e-01, 2.99e-01, 2.76e-01, 4.32e-01, 2.57e-01
557 <  };
558 <  Double_t cuteseedopcorMedium[9] = {6.31e-01, 8.14e-01, 7.60e-01, 8.18e-01, 7.56e-01, 5.35e-01, 6.20e-01, 7.88e-01, 8.85e-01
559 <  };
560 <  Double_t cutetMedium[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.
561 <  };
562 <  Double_t cutfmishitsMedium[9] = {1.50e+00, 1.50e+00, 1.50e+00, 1.50e+00, 1.50e+00, 1.50e+00, 2.50e+00, 1.50e+00, 5.00e-01
563 <  };
564 <  Double_t cuthoeMedium[9] = {2.46e-01, 6.80e-02, 1.35e-01, 3.73e-01, 2.33e-02, 5.58e-02, 8.80e-01, 5.04e+00, 3.78e-02
565 <  };
566 <  Double_t cutip_gsfMedium[9] = {0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02
567 <  };
568 <  Double_t cutiso_sumMedium[9] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1
569 <  };
570 <  Double_t cutiso_sumoetMedium[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
571 <  };
572 <  Double_t cutseeMedium[9] = {1.92e-02, 1.13e-02, 1.47e-02, 3.84e-02, 3.05e-02, 3.36e-02, 1.35e-02, 5.05e-02, 2.79e-02
573 <  };
574 <
575 <    // Tight cuts
576 <  Double_t cutdcotdistTight[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
577 <  };
578 <  Double_t cutdetainTight[9] = {9.28e-03, 3.56e-03, 7.16e-03, 1.31e-02, 5.81e-03, 9.79e-03, 1.15e-02, 1.66e-02, 3.19e-03
579 <  };
580 <  Double_t cutdphiinTight[9] = {4.66e-02, 7.80e-02, 2.64e-01, 4.42e-02, 3.20e-02, 2.37e-01, 8.25e-02, 2.07e-01, 5.39e-02
581 <  };
582 <  Double_t cuteseedopcorTight[9] = {6.48e-01, 8.97e-01, 8.91e-01, 8.39e-01, 8.35e-01, 6.49e-01, 6.76e-01, 8.70e-01, 9.91e-01
583 <  };
584 <  Double_t cutetTight[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.
585 <  };
586 <  Double_t cutfmishitsTight[9] = {1.50e+00, 1.50e+00, 1.50e+00, 1.50e+00, 1.50e+00, 5.00e-01, 2.50e+00, 5.00e-01, 5.00e-01
587 <  };
588 <  Double_t cuthoeTight[9] = {9.94e-02, 5.61e-02, 1.05e-01, 9.73e-02, 1.81e-02, 3.06e-02, 5.57e-01, 5.04e+00, 1.06e-03
589 <  };
590 <  Double_t cutip_gsfTight[9] = {0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02
591 <  };
592 <  Double_t cutiso_sumTight[9] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1
593 <  };
594 <  Double_t cutiso_sumoetTight[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
595 <  };
596 <  Double_t cutseeTight[9] = {1.56e-02, 1.07e-02, 1.23e-02, 3.35e-02, 2.98e-02, 3.06e-02, 1.07e-02, 3.79e-02, 1.01e-02
597 <  };
598 <
599 <    Double_t cutdcotdist[9];
600 <    Double_t cutdetain[9];
601 <    Double_t cutdphiin[9];
602 <    Double_t cuteseedopcor[9];
603 <    Double_t cutet[9];
604 <    Double_t cutfmishits[9];
605 <    Double_t cuthoe[9];
606 <    Double_t cutip_gsf[9];
607 <    Double_t cutiso_sum[9];
608 <    Double_t cutiso_sumoet[9];
609 <    Double_t cutsee[9];
610 <    if     (typeCuts == 0) {
611 <      memcpy(cutdcotdist  ,cutdcotdistLoose  ,sizeof(cutdcotdistLoose));
612 <      memcpy(cutdetain    ,cutdetainLoose       ,sizeof(cutdetainLoose));
613 <      memcpy(cutdphiin    ,cutdphiinLoose       ,sizeof(cutdphiinLoose));
614 <      memcpy(cuteseedopcor,cuteseedopcorLoose,sizeof(cuteseedopcorLoose));
615 <      memcpy(cutet        ,cutetLoose   ,sizeof(cutetLoose));
616 <      memcpy(cutfmishits  ,cutfmishitsLoose  ,sizeof(cutfmishitsLoose));
617 <      memcpy(cuthoe       ,cuthoeLoose  ,sizeof(cuthoeLoose));
618 <      memcpy(cutip_gsf    ,cutip_gsfLoose       ,sizeof(cutip_gsfLoose));
619 <      memcpy(cutiso_sum   ,cutiso_sumLoose      ,sizeof(cutiso_sumLoose));
620 <      memcpy(cutiso_sumoet,cutiso_sumoetLoose,sizeof(cutiso_sumoetLoose));
621 <      memcpy(cutsee       ,cutseeLoose  ,sizeof(cutseeLoose));
622 <    }
623 <    else if(typeCuts == 1) {
624 <      memcpy(cutdcotdist  ,cutdcotdistMedium  ,sizeof(cutdcotdistMedium));
625 <      memcpy(cutdetain    ,cutdetainMedium      ,sizeof(cutdetainMedium));
626 <      memcpy(cutdphiin    ,cutdphiinMedium      ,sizeof(cutdphiinMedium));
627 <      memcpy(cuteseedopcor,cuteseedopcorMedium,sizeof(cuteseedopcorMedium));
628 <      memcpy(cutet        ,cutetMedium  ,sizeof(cutetMedium));
629 <      memcpy(cutfmishits  ,cutfmishitsMedium  ,sizeof(cutfmishitsMedium));
630 <      memcpy(cuthoe       ,cuthoeMedium ,sizeof(cuthoeMedium));
631 <      memcpy(cutip_gsf    ,cutip_gsfMedium      ,sizeof(cutip_gsfMedium));
632 <      memcpy(cutiso_sum   ,cutiso_sumMedium     ,sizeof(cutiso_sumMedium));
633 <      memcpy(cutiso_sumoet,cutiso_sumoetMedium,sizeof(cutiso_sumoetMedium));
634 <      memcpy(cutsee       ,cutseeMedium ,sizeof(cutseeMedium));
635 <    }
636 <    else {
637 <      memcpy(cutdcotdist  ,cutdcotdistTight  ,sizeof(cutdcotdistTight));
638 <      memcpy(cutdetain    ,cutdetainTight       ,sizeof(cutdetainTight));
639 <      memcpy(cutdphiin    ,cutdphiinTight       ,sizeof(cutdphiinTight));
640 <      memcpy(cuteseedopcor,cuteseedopcorTight,sizeof(cuteseedopcorTight));
641 <      memcpy(cutet        ,cutetTight   ,sizeof(cutetTight));
642 <      memcpy(cutfmishits  ,cutfmishitsTight  ,sizeof(cutfmishitsTight));
643 <      memcpy(cuthoe       ,cuthoeTight  ,sizeof(cuthoeTight));
644 <      memcpy(cutip_gsf    ,cutip_gsfTight       ,sizeof(cutip_gsfTight));
645 <      memcpy(cutiso_sum   ,cutiso_sumTight      ,sizeof(cutiso_sumTight));
646 <      memcpy(cutiso_sumoet,cutiso_sumoetTight,sizeof(cutiso_sumoetTight));
647 <      memcpy(cutsee       ,cutseeTight  ,sizeof(cutseeTight));
873 >  for (int cut=0; cut<ncuts; cut++) {
874 >    switch (cut) {
875 >    case 0:
876 >      cut_results[cut] = compute_cut(fabs(deltaEtaIn), scEt, cutdetainl[cat], cutdetain[cat]);
877 >      break;
878 >    case 1:
879 >      cut_results[cut] = compute_cut(fabs(deltaPhiIn), scEt, cutdphiinl[cat], cutdphiin[cat]);
880 >      break;
881 >    case 2:
882 >      cut_results[cut] = (eseedopincor > cuteseedopcor[cat]);
883 >      break;
884 >    case 3:
885 >      cut_results[cut] = compute_cut(hOverE, scEt, cuthoel[cat], cuthoe[cat]);
886 >      break;
887 >    case 4:
888 >      cut_results[cut] = compute_cut(sigmaee, scEt, cutseel[cat], cutsee[cat]);
889 >      break;
890 >    case 5:
891 >      cut_results[cut] = compute_cut(iso_sumoet, scEt, cutiso_sumoetl[cat], cutiso_sumoet[cat]);
892 >      break;
893 >    case 6:
894 >      cut_results[cut] = (iso_sum < cutiso_sum[cat]);
895 >      break;
896 >    case 7:
897 >      cut_results[cut] = compute_cut(fabs(ip), scEt, cutip_gsfl[cat], cutip_gsf[cat]);
898 >      break;
899 >    case 8:
900 >      cut_results[cut] = (mishits < cutfmishits[cat]);
901 >      break;
902 >    case 9:
903 >      cut_results[cut] = (dcotdistcomb < cutdcotdist[cat]);
904 >      break;
905      }
906 +  }
907 +  
908 +  // ID part
909 +  if (cut_results[0] & cut_results[1] & cut_results[2] & cut_results[3] & cut_results[4])
910 +    result = result + 1;
911 +  
912 +  // ISO part
913 +  if (cut_results[5] & cut_results[6])
914 +    result = result + 2;
915 +  
916 +  // IP part
917 +  if (cut_results[7])
918 +    result = result + 8;
919 +  
920 +  // Conversion part
921 +  if (cut_results[8] and cut_results[9])
922 +    result = result + 4;
923 +  
924 +  return result;
925 + }
926  
927 <    // CAREFUL, I HAVE COMMENTED OUT WHAT SANI IS DOING
928 <    //Double_t iso_sum = tkIso + ecalIso + hcalIso;
652 <    Double_t iso_sum = (ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) +
653 <                        ele->HcalTowerSumEtDr03()) / ele->Pt();
654 <    Double_t iso_sum_corrected = iso_sum*pow(40./scEt, 2);
655 <    if ((iso_sum < cutiso_sum[cat+bin*9]) &&
656 <        (iso_sum_corrected < cutiso_sumoet[cat+bin*9]))
657 <      result += 2;
658 <
659 <    if (fBrem > -2) {
660 <      if ((hOverE < cuthoe[cat+bin*9]) and
661 <          (sigmaee < cutsee[cat+bin*9]) and
662 <          (fabs(deltaPhiIn) < cutdphiin[cat+bin*9]) and
663 <          (fabs(deltaEtaIn) < cutdetain[cat+bin*9]) and
664 <          (eSeedOverPin > cuteseedopcor[cat+bin*9]) and
665 <          (scEt > cutet[cat+bin*9]))
666 <        result += 1.;
667 <    }
927 > //--------------------------------------------------------------------------------------------------
928 > bool ElectronTools::compute_cut(double x, double et, double cut_min, double cut_max, bool gtn) {
929  
930 <    Double_t d0_real = 99999;
931 <    for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
671 <      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
672 <      if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
673 <    }
674 <    if (d0_real < cutip_gsf[cat+bin*9])
675 <      result += 4;
930 >  float et_min = 10;
931 >  float et_max = 40;
932  
933 <    Bool_t passConvVeto = PassConversionFilter(ele, conversions, kTRUE);
934 <    if (mishits < cutfmishits[cat+bin*9] &&
679 <        passConvVeto)
680 <      result += 8;
681 <  } // classbased
933 >  bool accept = false;
934 >  float cut = cut_max; //  the cut at et=40 GeV
935  
936 <  return result;
936 >  if(et < et_max) {
937 >    cut = cut_min + (1/et_min - 1/et)*(cut_max - cut_min)/(1/et_min - 1/et_max);
938 >  }
939 >  
940 >  if(et < et_min) {
941 >    cut = cut_min;
942 >  }
943 >
944 >  if(gtn) {   // useful for e/p cut which is gt
945 >    accept = (x >= cut);
946 >  }
947 >  else {
948 >    accept = (x <= cut);
949 >  }
950 >
951 >  return accept;
952   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines