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.1 by sixie, Sat Apr 10 18:06:51 2010 UTC vs.
Revision 1.10 by ceballos, Fri Jun 4 20:07:29 2010 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.05,  0.05,  0.05,  0.05,  0.04,   0.04,   0.04,   0.04  }, //hovere
39 >    {0.5,   0.5,   0.5,   0.5,   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.006, 0.006, 0.006, 0.006, 0.008,  0.008,  0.008,  0.008 }, //deltaetain
42 >    {0.007, 0.007, 0.007, 0.007, 0.010,  0.010,  0.010,  0.010 }, //deltaetain
43      {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0   }, //eoverp
44      {0.0,   0.0,   0,     0,     0,      0,      0,      0     }  //extra cuts fbrem and E_Over_P
45    };            
46  
47
47    Double_t VBTFWorkingPoint90[6][8] = {
48 <    {0.05,  0.05,  0.05,  0.05,  0.025,  0.025,  0.025,  0.025 }, //hovere
48 >    {0.12,  0.12,  0.12,  0.12,  0.05,   0.05,   0.05,   0.05  }, //hovere
49 >    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03  }, //sigmaetaeta
50 >    {0.8,   0.8,   0.8,   0.8,   0.7,    0.7,    0.7,    0.7   }, //deltaphiin
51 >    {0.007, 0.007, 0.007, 0.007, 0.009,  0.009,  0.009,  0.009 }, //deltaetain
52 >    {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0   }, //eoverp
53 >    {0.0,   0.0,   0,     0,     0,      0,      0,      0     }  //extra cuts fbrem and E_Over_P
54 >  };            
55 >
56 >  Double_t VBTFWorkingPoint85[6][8] = {
57 >    {0.04,  0.04,  0.04,  0.04,  0.025,  0.025,  0.025,  0.025 }, //hovere
58      {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03  }, //sigmaetaeta
59 <    {0.04,  0.04,  0.04,  0.04,  0.025,  0.025,  0.025,  0.025 }, //deltaphiin
60 <    {0.006, 0.006, 0.006, 0.006, 0.008,  0.008,  0.008,  0.008 }, //deltaetain
59 >    {0.06,  0.06,  0.06,  0.06,  0.04,   0.04,   0.04,   0.04  }, //deltaphiin
60 >    {0.006, 0.006, 0.006, 0.006, 0.007,  0.007,  0.007,  0.007 }, //deltaetain
61      {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0   }, //eoverp
62      {0.0,   0.0,   0,     0,     0,      0,      0,      0     }  //extra cuts fbrem and E_Over_P
63    };            
64  
65    Double_t VBTFWorkingPoint80[6][8] = {
66 <    {0.05,  0.05,  0.05,  0.05,  0.025,  0.025,  0.025,  0.025}, //hovere
66 >    {0.04,  0.04,  0.04,  0.04,  0.025,  0.025,  0.025,  0.025}, //hovere
67      {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
68 <    {0.02,  0.02,  0.02,  0.02,  0.02,   0.02,   0.02,   0.02 }, //deltaphiin
69 <    {0.006, 0.006, 0.006, 0.006, 0.006,  0.006,  0.006,  0.006}, //deltaetain
68 >    {0.06,  0.06,  0.06,  0.06,  0.03,   0.03,   0.03,   0.03 }, //deltaphiin
69 >    {0.004, 0.004, 0.004, 0.004, 0.007,  0.007,  0.007,  0.007}, //deltaetain
70      {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0  }, //eoverp
71      {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
72    };            
73  
74    Double_t VBTFWorkingPoint70[6][8] = {
75 <    {0.02,  0.02,  0.02,  0.02,  0.025,  0.025,  0.025,  0.025}, //hovere
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.02,  0.02,  0.02,  0.02,  0.02,   0.02,   0.02,   0.02 }, //deltaphiin
78 <    {0.006, 0.006, 0.006, 0.006, 0.003,  0.003,  0.003,  0.003}, //deltaetain
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
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 85 | Line 93 | Bool_t ElectronTools::PassCustomID(const
93      case kVBTFWorkingPoint90Id:
94        memcpy(fCuts,VBTFWorkingPoint90,sizeof(fCuts));
95        break;
96 +    case kVBTFWorkingPoint85Id:
97 +      memcpy(fCuts,VBTFWorkingPoint85,sizeof(fCuts));
98 +      break;
99      case kVBTFWorkingPoint80Id:
100        memcpy(fCuts,VBTFWorkingPoint80,sizeof(fCuts));
101        break;
# Line 142 | Line 153 | Bool_t ElectronTools::PassCustomID(const
153   }
154  
155   //--------------------------------------------------------------------------------------------------
156 < Bool_t ElectronTools::PassCustomIso(const Electron *ele, EElIsoType isoType)
156 > Bool_t ElectronTools::PassCustomIso(const Electron *ele, EElIsoType isoType,
157 >                                    Bool_t useCombineIso)
158   {
159    Bool_t pass = kTRUE;
160    Double_t fIsoCuts[4][2];          //!custom isolation cuts
149
161    Double_t VBTFWorkingPoint95[4][2] = {
162 <    {7.0 ,  8.0   },   //TrkIso
163 <    {5.0 ,  3.0   },   //ECALIso
164 <    {5.0 ,  2.0   },   //HCALIso
165 <    {9999,  9999  }   //Combined    
162 >    {0.15 , 0.08   },   //TrkIso
163 >    {2.00 , 0.06   },   //ECALIso
164 >    {0.12 , 0.05   },   //HCALIso
165 >    {0.15,  0.10   }   //Combined    
166    };            
167  
168    Double_t VBTFWorkingPoint90[4][2] = {
169 <    {6.0 ,  6.0   },   //TrkIso
170 <    {5.0 ,  2.5   },   //ECALIso
171 <    {5.0 ,  1.5   },   //HCALIso
172 <    {9999,  9999  }   //Combined    
169 >    {0.12 , 0.05   },   //TrkIso
170 >    {0.09 , 0.06   },   //ECALIso
171 >    {0.10 , 0.03   },   //HCALIso
172 >    {0.10,  0.07   }   //Combined    
173 >  };            
174 >
175 >  Double_t VBTFWorkingPoint85[4][2] = {
176 >    {0.09 , 0.05   },   //TrkIso
177 >    {0.08 , 0.05   },   //ECALIso
178 >    {0.10 , 0.025  },   //HCALIso
179 >    {0.09,  0.06   }   //Combined    
180    };            
181  
182    Double_t VBTFWorkingPoint80[4][2] = {
183 <    {3.0 ,  1.5   },   //TrkIso
184 <    {4.0 ,  2.5   },   //ECALIso
185 <    {5.0 ,  0.7   },   //HCALIso
186 <    {9999,  9999  }   //Combined    
183 >    {0.09 , 0.04   },   //TrkIso
184 >    {0.07 , 0.05   },   //ECALIso
185 >    {0.10 , 0.025  },   //HCALIso
186 >    {0.07,  0.06   }   //Combined    
187    };            
188  
189    Double_t VBTFWorkingPoint70[4][2] = {
190 <    {2.5 ,  0.8   },   //TrkIso
191 <    {3.0 ,  2.5   },   //ECALIso
192 <    {5.0 ,  0.25  },   //HCALIso
193 <    {9999,  9999  }   //Combined    
190 >    {0.06 , 0.03   },   //TrkIso
191 >    {0.06 , 0.03   },   //ECALIso
192 >    {0.05 , 0.015  },   //HCALIso
193 >    {0.05,  0.04   }   //Combined    
194    };            
195  
196    switch (isoType) {
# Line 182 | Line 200 | Bool_t ElectronTools::PassCustomIso(cons
200      case kVBTFWorkingPoint90Iso:
201        memcpy(fIsoCuts,VBTFWorkingPoint90,sizeof(fIsoCuts));
202        break;
203 +    case kVBTFWorkingPoint85Iso:
204 +      memcpy(fIsoCuts,VBTFWorkingPoint85,sizeof(fIsoCuts));
205 +      break;
206      case kVBTFWorkingPoint80Iso:
207        memcpy(fIsoCuts,VBTFWorkingPoint80,sizeof(fIsoCuts));
208        break;
# Line 193 | Line 214 | Bool_t ElectronTools::PassCustomIso(cons
214        break;
215    }
216  
217 <  Double_t trkIso  = ele->TrackIsolationDr03();
218 <  Double_t ecalIso = ele->EcalRecHitIsoDr04();
219 <  Double_t hcalIso = ele->HcalIsolation();
220 <  Double_t combinedIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr04() - 1.5;
217 >  Double_t trkIso  = ele->TrackIsolationDr03() / ele->Pt();
218 >  Double_t ecalIso = ele->EcalRecHitIsoDr03() / ele->Pt();
219 >  Double_t hcalIso = ele->HcalTowerSumEtDr03() / ele->Pt();
220 >  Double_t combinedIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03();
221 >  if(ele->IsEB()) combinedIso = ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) + ele->HcalTowerSumEtDr03();
222  
223    Int_t eb = 1;
224    if (ele->IsEB())
225      eb = 0;
226  
227 <  if (trkIso>fIsoCuts[0][eb])
228 <    pass = kFALSE;
229 <  if (ecalIso>fIsoCuts[1][eb])
230 <    pass = kFALSE;
231 <  if (hcalIso>fIsoCuts[2][eb])
232 <    pass = kFALSE;
233 <  if (combinedIso>fIsoCuts[3][eb])
234 <    pass = kFALSE;
235 <
227 >  if(useCombineIso == kFALSE){
228 >    if (trkIso>fIsoCuts[0][eb])
229 >      pass = kFALSE;
230 >    if (ecalIso>fIsoCuts[1][eb])
231 >      pass = kFALSE;
232 >    if (hcalIso>fIsoCuts[2][eb])
233 >      pass = kFALSE;
234 >  }
235 >  else {
236 >    if (combinedIso>fIsoCuts[3][eb])
237 >      pass = kFALSE;
238 >  }
239  
240    return pass;
241   }
# Line 238 | Line 263 | Bool_t ElectronTools::PassConversionFilt
263      if (ConversionMatchFound == kTRUE){
264        isGoodConversion =  (conversions->At(ifc)->Prob() > 1e-6) &&
265          (conversions->At(ifc)->Lxy() > 0) &&
266 +        (conversions->At(ifc)->Lz() > 0) &&
267          (conversions->At(ifc)->Position().Rho() > 2.0);
268  
269        if (isGoodConversion == kTRUE) {
# Line 288 | Line 314 | Bool_t ElectronTools::PassD0Cut(const El
314   }
315  
316   //--------------------------------------------------------------------------------------------------
317 + Bool_t ElectronTools::PassD0Cut(const Electron *ele, const BeamSpotCol *beamspots, Double_t fD0Cut,
318 +                                Bool_t fReverseD0Cut)
319 + {
320 +  Bool_t d0cut = kFALSE;
321 +  // d0 cut
322 +  Double_t d0_real = 99999;
323 +  for(UInt_t i0 = 0; i0 < beamspots->GetEntries(); i0++) {
324 +    Double_t pD0 = ele->GsfTrk()->D0Corrected(*beamspots->At(i0));
325 +    if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
326 +  }
327 +  if(d0_real < fD0Cut) d0cut = kTRUE;
328 +  
329 +  if     (fReverseD0Cut == kTRUE &&
330 +          d0cut == kFALSE && d0_real < 0.05)
331 +    d0cut = kTRUE;
332 +  else if(fReverseD0Cut == kTRUE)
333 +    d0cut = kFALSE;
334 +  
335 +  return d0cut;
336 + }
337 +
338 + //--------------------------------------------------------------------------------------------------
339   Bool_t ElectronTools::PassChargeFilter(const Electron *ele)
340   {
341    Bool_t passChargeFilter = kTRUE;
# Line 316 | Line 364 | Bool_t ElectronTools::PassSpikeRemovalFi
364      
365    return passSpikeRemovalFilter;
366   }
367 +
368 + Bool_t ElectronTools::PassTriggerMatching(const Electron *ele, const TriggerObjectCol *trigobjs)
369 + {
370 +  
371 +  for (UInt_t i=0; i<trigobjs->GetEntries(); ++i) {
372 +    const TriggerObject *trigobj = trigobjs->At(i);
373 +    if (trigobj->TriggerType()==TriggerObject::TriggerCluster || trigobj->TriggerType()==TriggerObject::TriggerElectron) {
374 +      if (MathUtils::DeltaR(ele,trigobj)<0.3) {
375 +        return kTRUE;
376 +      }
377 +    }
378 +  }
379 +  
380 +  return kFALSE;
381 +  
382 +  
383 + }
384 +
385 + //--------------------------------------------------------------------------------------------------
386 + Int_t ElectronTools::Classify(const Electron *ele) {
387 +  
388 +  double eta    = ele->AbsEta();
389 +  double eOverP = ele->ESuperClusterOverP();
390 +  double fBrem  = ele->FBrem();
391 +
392 +  int cat = -1;
393 +  if (ele->IsEB()) {
394 +    if ((fBrem >= 0.12) and (eOverP > 0.9) and (eOverP < 1.2))
395 +      cat = 0;
396 +    else if (((eta >  .445   and eta <  .45  ) or
397 +              (eta >  .79    and eta <  .81  ) or
398 +              (eta > 1.137   and eta < 1.157 ) or
399 +              (eta > 1.47285 and eta < 1.4744)))
400 +      cat = 6;
401 +    else if (ele->IsTrackerDriven() and !ele->IsEcalDriven())
402 +      cat = 8;
403 +    else if (fBrem < 0.12)
404 +      cat = 1;
405 +    else
406 +      cat = 2;
407 +  } else {
408 +    if ((fBrem >= 0.2) and (eOverP > 0.82) and (eOverP < 1.22))
409 +      cat = 3;
410 +    else if (eta > 1.5 and eta <  1.58)
411 +      cat = 7;
412 +    else if (ele->IsTrackerDriven() and !ele->IsEcalDriven())
413 +      cat = 8;
414 +    else if (fBrem < 0.2)
415 +      cat = 4;
416 +    else
417 +      cat = 5;
418 +  }
419 +
420 +  return cat;
421 + }
422 +
423 + //--------------------------------------------------------------------------------------------------
424 + Int_t ElectronTools::PassTightId(const Electron *ele, const VertexCol *vertices,
425 +                                 const DecayParticleCol *conversions, const Int_t typeCuts){
426 +
427 +  Double_t scEt   = ele->SCluster()->Et();
428 +  Double_t eOverP = ele->ESuperClusterOverP();
429 +
430 +  Double_t fBrem = ele->FBrem();
431 +  Double_t hOverE = ele->HadronicOverEm();
432 +  Double_t sigmaee = ele->CoviEtaiEta();
433 +  Double_t deltaPhiIn = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
434 +  Double_t deltaEtaIn = TMath::Abs(ele->DeltaEtaSuperClusterTrackAtVtx());
435 +  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
436 +
437 +  Int_t mishits = ele->BestTrk()->NExpectedHitsInner();
438 +  Double_t tkIso   = ele->TrackIsolationDr03();
439 +  Double_t ecalIso = ele->EcalRecHitIsoDr04();
440 +  Double_t ecalIsoPed = (ele->IsEB())?std::max(0.,ecalIso-1.):ecalIso;
441 +  Double_t hcalIso  = ele->HcalTowerSumEtDr04();
442 +  Double_t hcalIso1 = ele->HcalDepth1TowerSumEtDr04();
443 +  Double_t hcalIso2 = ele->HcalDepth2TowerSumEtDr04();
444 +  Double_t e25Max = ele->E25Max();
445 +  Double_t e15 = ele->E15();
446 +  Double_t e55 = ele->E55();
447 +  Double_t e25Maxoe55 = e25Max/e55;
448 +  Double_t e15oe55 = e15/e55;
449 +
450 +  int cat = Classify(ele);
451 +  int eb;
452 +
453 +  if (ele->IsEB())
454 +    eb = 0;
455 +  else
456 +    eb = 1;
457 +
458 +  Int_t result = 0.;
459 +  
460 +  Int_t bin = 0;
461 +  
462 +  Double_t WantBin = kFALSE;
463 +  if(WantBin) {
464 +    if (scEt < 20.)
465 +      bin = 2;
466 +    else if (scEt > 30.)
467 +      bin = 0;
468 +    else
469 +      bin = 1;
470 +  }
471 +
472 +  if (fBrem > 0)
473 +    eSeedOverPin = eSeedOverPin + fBrem;
474 +
475 +  if(typeCuts == 3 || typeCuts == 4){
476 +  // Loose robust cuts
477 +    Double_t robustlooseEleIDCuts[52] = {
478 +       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,
479 +       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
480 +    };
481 +  // Tight robust cuts
482 +    Double_t robusttightEleIDCuts[52] = {
483 +        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,
484 +        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
485 +    };                            
486 +    Double_t cut[52];
487 +    if     (typeCuts == 3) {
488 +      memcpy(cut  ,robustlooseEleIDCuts  ,sizeof(cut));
489 +    }
490 +    else {
491 +      memcpy(cut  ,robusttightEleIDCuts  ,sizeof(cut));
492 +    }
493 +
494 +    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]) ||
495 +        (tkIso/ele->Pt() > cut[26*eb+11]) || (ecalIso/ele->Pt() > cut[26*eb+12]) || (hcalIso/ele->Pt() > cut[26*eb+13]) ||
496 +        ((tkIso+ecalIso+hcalIso)>cut[26*eb+14]) || (((tkIso+ecalIso+hcalIso)/ ele->Pt()) > cut[26*eb+15]) ||
497 +        ((tkIso+ecalIsoPed+hcalIso)>cut[26*eb+16]) || (((tkIso+ecalIsoPed+hcalIso)/ ele->Pt()) > cut[26*eb+17])  )
498 +      result = 0.;
499 +    else
500 +      result = 2.;
501 +
502 +    if (hOverE > cut[26*eb+0])
503 +      return result;    
504 +
505 +    if (sigmaee > cut[26*eb+1])
506 +      return result;    
507 +
508 +    if (fabs(deltaPhiIn) > cut[26*eb+2])
509 +      return result;    
510 +
511 +    if (fabs(deltaEtaIn) > cut[26*eb+3])
512 +      return result;    
513 +    
514 +    if (e25Maxoe55 < cut[26*eb+4] && e15oe55 < cut[26*eb+5])
515 +      return result;
516 +    // some extra electron id cuts
517 +    if (sigmaee < cut[26*eb+18]) // inverted sigmaee cut - spike removal related
518 +      return result;
519 +
520 +    if (  eOverP < cut[26*eb+19] ||  eOverP > cut[26*eb+20]) // lower and upper cut in E/P
521 +      return result;
522 +    
523 +    result = result + 1;
524 +
525 +    Double_t d0_real = 99999;
526 +    for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
527 +      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
528 +      if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
529 +    }
530 +    if (d0_real > cut[26*eb+21])
531 +      return result;
532 +
533 +    if (mishits > cut[26*eb+22]) // expected missing hits
534 +      return result;
535 +
536 +    Bool_t passConvVeto = PassConversionFilter(ele, conversions, kTRUE);
537 +    if (passConvVeto == kFALSE)
538 +      return result;
539 +      
540 +    result += 4;
541 +  }
542 +  else if(typeCuts == 0 || typeCuts == 1 || typeCuts == 2){
543 +    // Loose cuts
544 +  Double_t cutdcotdistLoose[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
545 +  };
546 +  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
547 +  };
548 +  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
549 +  };
550 +  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
551 +  };
552 +  Double_t cutetLoose[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.
553 +  };
554 +  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
555 +  };
556 +  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
557 +  };
558 +  Double_t cutip_gsfLoose[9] = {0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02
559 +  };
560 +  Double_t cutiso_sumLoose[9] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1
561 +  };
562 +  Double_t cutiso_sumoetLoose[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
563 +  };
564 +  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
565 +  };
566 +
567 +    // Medium cuts
568 +  Double_t cutdcotdistMedium[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
569 +  };
570 +  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
571 +  };
572 +  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
573 +  };
574 +  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
575 +  };
576 +  Double_t cutetMedium[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.
577 +  };
578 +  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
579 +  };
580 +  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
581 +  };
582 +  Double_t cutip_gsfMedium[9] = {0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02
583 +  };
584 +  Double_t cutiso_sumMedium[9] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1
585 +  };
586 +  Double_t cutiso_sumoetMedium[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
587 +  };
588 +  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
589 +  };
590 +
591 +    // Tight cuts
592 +  Double_t cutdcotdistTight[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
593 +  };
594 +  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
595 +  };
596 +  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
597 +  };
598 +  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
599 +  };
600 +  Double_t cutetTight[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.
601 +  };
602 +  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
603 +  };
604 +  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
605 +  };
606 +  Double_t cutip_gsfTight[9] = {0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02
607 +  };
608 +  Double_t cutiso_sumTight[9] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1
609 +  };
610 +  Double_t cutiso_sumoetTight[9] = {9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.
611 +  };
612 +  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
613 +  };
614 +
615 +    Double_t cutdcotdist[9];
616 +    Double_t cutdetain[9];
617 +    Double_t cutdphiin[9];
618 +    Double_t cuteseedopcor[9];
619 +    Double_t cutet[9];
620 +    Double_t cutfmishits[9];
621 +    Double_t cuthoe[9];
622 +    Double_t cutip_gsf[9];
623 +    Double_t cutiso_sum[9];
624 +    Double_t cutiso_sumoet[9];
625 +    Double_t cutsee[9];
626 +    if     (typeCuts == 0) {
627 +      memcpy(cutdcotdist  ,cutdcotdistLoose  ,sizeof(cutdcotdistLoose));
628 +      memcpy(cutdetain    ,cutdetainLoose       ,sizeof(cutdetainLoose));
629 +      memcpy(cutdphiin    ,cutdphiinLoose       ,sizeof(cutdphiinLoose));
630 +      memcpy(cuteseedopcor,cuteseedopcorLoose,sizeof(cuteseedopcorLoose));
631 +      memcpy(cutet        ,cutetLoose   ,sizeof(cutetLoose));
632 +      memcpy(cutfmishits  ,cutfmishitsLoose  ,sizeof(cutfmishitsLoose));
633 +      memcpy(cuthoe       ,cuthoeLoose  ,sizeof(cuthoeLoose));
634 +      memcpy(cutip_gsf    ,cutip_gsfLoose       ,sizeof(cutip_gsfLoose));
635 +      memcpy(cutiso_sum   ,cutiso_sumLoose      ,sizeof(cutiso_sumLoose));
636 +      memcpy(cutiso_sumoet,cutiso_sumoetLoose,sizeof(cutiso_sumoetLoose));
637 +      memcpy(cutsee       ,cutseeLoose  ,sizeof(cutseeLoose));
638 +    }
639 +    else if(typeCuts == 1) {
640 +      memcpy(cutdcotdist  ,cutdcotdistMedium  ,sizeof(cutdcotdistMedium));
641 +      memcpy(cutdetain    ,cutdetainMedium      ,sizeof(cutdetainMedium));
642 +      memcpy(cutdphiin    ,cutdphiinMedium      ,sizeof(cutdphiinMedium));
643 +      memcpy(cuteseedopcor,cuteseedopcorMedium,sizeof(cuteseedopcorMedium));
644 +      memcpy(cutet        ,cutetMedium  ,sizeof(cutetMedium));
645 +      memcpy(cutfmishits  ,cutfmishitsMedium  ,sizeof(cutfmishitsMedium));
646 +      memcpy(cuthoe       ,cuthoeMedium ,sizeof(cuthoeMedium));
647 +      memcpy(cutip_gsf    ,cutip_gsfMedium      ,sizeof(cutip_gsfMedium));
648 +      memcpy(cutiso_sum   ,cutiso_sumMedium     ,sizeof(cutiso_sumMedium));
649 +      memcpy(cutiso_sumoet,cutiso_sumoetMedium,sizeof(cutiso_sumoetMedium));
650 +      memcpy(cutsee       ,cutseeMedium ,sizeof(cutseeMedium));
651 +    }
652 +    else {
653 +      memcpy(cutdcotdist  ,cutdcotdistTight  ,sizeof(cutdcotdistTight));
654 +      memcpy(cutdetain    ,cutdetainTight       ,sizeof(cutdetainTight));
655 +      memcpy(cutdphiin    ,cutdphiinTight       ,sizeof(cutdphiinTight));
656 +      memcpy(cuteseedopcor,cuteseedopcorTight,sizeof(cuteseedopcorTight));
657 +      memcpy(cutet        ,cutetTight   ,sizeof(cutetTight));
658 +      memcpy(cutfmishits  ,cutfmishitsTight  ,sizeof(cutfmishitsTight));
659 +      memcpy(cuthoe       ,cuthoeTight  ,sizeof(cuthoeTight));
660 +      memcpy(cutip_gsf    ,cutip_gsfTight       ,sizeof(cutip_gsfTight));
661 +      memcpy(cutiso_sum   ,cutiso_sumTight      ,sizeof(cutiso_sumTight));
662 +      memcpy(cutiso_sumoet,cutiso_sumoetTight,sizeof(cutiso_sumoetTight));
663 +      memcpy(cutsee       ,cutseeTight  ,sizeof(cutseeTight));
664 +    }
665 +
666 +    // CAREFUL, I HAVE COMMENTED OUT WHAT SANI IS DOING
667 +    //Double_t iso_sum = tkIso + ecalIso + hcalIso;
668 +    Double_t iso_sum = (ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) +
669 +                        ele->HcalTowerSumEtDr03()) / ele->Pt();
670 +    Double_t iso_sum_corrected = iso_sum*pow(40./scEt, 2);
671 +    if ((iso_sum < cutiso_sum[cat+bin*9]) &&
672 +        (iso_sum_corrected < cutiso_sumoet[cat+bin*9]))
673 +      result += 2;
674 +
675 +    if (fBrem > -2) {
676 +      if ((hOverE < cuthoe[cat+bin*9]) and
677 +          (sigmaee < cutsee[cat+bin*9]) and
678 +          (fabs(deltaPhiIn) < cutdphiin[cat+bin*9]) and
679 +          (fabs(deltaEtaIn) < cutdetain[cat+bin*9]) and
680 +          (eSeedOverPin > cuteseedopcor[cat+bin*9]) and
681 +          (scEt > cutet[cat+bin*9]))
682 +        result += 1.;
683 +    }
684 +
685 +    Double_t d0_real = 99999;
686 +    for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
687 +      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
688 +      if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
689 +    }
690 +    if (d0_real < cutip_gsf[cat+bin*9])
691 +      result += 4;
692 +
693 +    Bool_t passConvVeto = PassConversionFilter(ele, conversions, kTRUE);
694 +    if (mishits < cutfmishits[cat+bin*9] &&
695 +        passConvVeto)
696 +      result += 8;
697 +  } // classbased
698 +
699 +  return result;
700 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines