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.29 by ceballos, Fri Jun 10 10:42:44 2011 UTC

# Line 35 | Line 35 | Bool_t ElectronTools::PassCustomID(const
35      {0.3, 0.92, 0.211, 0.0, 0.42, 0.88, 0.68, 0.0},             //eoverp
36      {0.8,0.2,0,0,0,0,0,0}};                                     //extra cuts fbrem and E_Over_P
37  
38 +  Double_t VBTFWorkingPointFakeable[6][8] = {
39 +    {0.12,  0.12,  0.12,  0.12,  0.10,   0.10,   0.10,   0.10  }, //hovere
40 +    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03  }, //sigmaetaeta
41 +    {0.15,  0.15,  0.15,  0.15,  0.10,   0.10,   0.10,   0.10  }, //deltaphiin
42 +    {0.007, 0.007, 0.007, 0.007, 0.009,  0.009,  0.009,  0.009 }, //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    Double_t VBTFWorkingPoint95[6][8] = {
48 <    {0.05,  0.05,  0.05,  0.05,  0.04,   0.04,   0.04,   0.04  }, //hovere
48 >    {0.15,  0.15,  0.15,  0.15,  0.07,   0.07,   0.07,   0.07  }, //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.006, 0.006, 0.006, 0.006, 0.008,  0.008,  0.008,  0.008 }, //deltaetain
51 >    {0.007, 0.007, 0.007, 0.007, 0.010,  0.010,  0.010,  0.010 }, //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  
47
56    Double_t VBTFWorkingPoint90[6][8] = {
57 <    {0.05,  0.05,  0.05,  0.05,  0.025,  0.025,  0.025,  0.025 }, //hovere
57 >    {0.12,  0.12,  0.12,  0.12,  0.05,   0.05,   0.05,   0.05  }, //hovere
58 >    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03  }, //sigmaetaeta
59 >    {0.8,   0.8,   0.8,   0.8,   0.7,    0.7,    0.7,    0.7   }, //deltaphiin
60 >    {0.007, 0.007, 0.007, 0.007, 0.009,  0.009,  0.009,  0.009 }, //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 VBTFWorkingPoint85[6][8] = {
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.04,  0.04,  0.04,  0.04,  0.025,  0.025,  0.025,  0.025 }, //deltaphiin
69 <    {0.006, 0.006, 0.006, 0.006, 0.008,  0.008,  0.008,  0.008 }, //deltaetain
68 >    {0.06,  0.06,  0.06,  0.06,  0.04,   0.04,   0.04,   0.04  }, //deltaphiin
69 >    {0.006, 0.006, 0.006, 0.006, 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 VBTFWorkingPoint80[6][8] = {
75 <    {0.05,  0.05,  0.05,  0.05,  0.025,  0.025,  0.025,  0.025}, //hovere
75 >    {0.04,  0.04,  0.04,  0.04,  0.025,  0.025,  0.025,  0.025}, //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.006,  0.006,  0.006,  0.006}, //deltaetain
77 >    {0.06,  0.06,  0.06,  0.06,  0.03,   0.03,   0.03,   0.03 }, //deltaphiin
78 >    {0.004, 0.004, 0.004, 0.004, 0.007,  0.007,  0.007,  0.007}, //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    };            
82  
83    Double_t VBTFWorkingPoint70[6][8] = {
84 <    {0.02,  0.02,  0.02,  0.02,  0.025,  0.025,  0.025,  0.025}, //hovere
84 >    {0.025, 0.025, 0.025, 0.025, 0.012,  0.012,  0.012,  0.012}, //hovere
85      {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
86 <    {0.02,  0.02,  0.02,  0.02,  0.02,   0.02,   0.02,   0.02 }, //deltaphiin
87 <    {0.006, 0.006, 0.006, 0.006, 0.003,  0.003,  0.003,  0.003}, //deltaetain
86 >    {0.03,  0.03,  0.03,  0.03,  0.02,   0.02,   0.02,   0.02 }, //deltaphiin
87 >    {0.004, 0.004, 0.004, 0.004, 0.005,  0.005,  0.005,  0.005}, //deltaetain
88 >    {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0  }, //eoverp
89 >    {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
90 >  };            
91 >
92 >  Double_t VBTFWorkingPoint80NoHOverEE[6][8] = {
93 >    {0.04,  0.04,  0.04,  0.04,  0.10,   0.10,   0.10,   0.10 }, //hovere
94 >    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
95 >    {0.06,  0.06,  0.06,  0.06,  0.03,   0.03,   0.03,   0.03 }, //deltaphiin
96 >    {0.004, 0.004, 0.004, 0.004, 0.007,  0.007,  0.007,  0.007}, //deltaetain
97 >    {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0  }, //eoverp
98 >    {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
99 >  };            
100 >
101 >  Double_t VBTFWorkingPoint70NoHOverEE[6][8] = {
102 >    {0.025, 0.025, 0.025, 0.025, 0.10,   0.10,   0.10,   0.10 }, //hovere
103 >    {0.01,  0.01,  0.01,  0.01,  0.03,   0.03,   0.03,   0.03 }, //sigmaetaeta
104 >    {0.03,  0.03,  0.03,  0.03,  0.02,   0.02,   0.02,   0.02 }, //deltaphiin
105 >    {0.004, 0.004, 0.004, 0.004, 0.005,  0.005,  0.005,  0.005}, //deltaetain
106      {0.0,   0.0,   0.0,   0.0,   0.0,    0.0,    0.0,    0.0  }, //eoverp
107      {0.0,   0.0,   0,     0,     0,      0,      0,      0    }  //extra cuts fbrem and E_Over_P
108    };            
# Line 79 | Line 114 | Bool_t ElectronTools::PassCustomID(const
114      case kCustomIdLoose:
115        memcpy(fCuts,loosecuts,sizeof(fCuts));
116        break;
117 +    case kVBTFWorkingPointFakeableId:
118 +      memcpy(fCuts,VBTFWorkingPointFakeable,sizeof(fCuts));
119 +      break;
120      case kVBTFWorkingPoint95Id:
121        memcpy(fCuts,VBTFWorkingPoint95,sizeof(fCuts));
122        break;
123      case kVBTFWorkingPoint90Id:
124        memcpy(fCuts,VBTFWorkingPoint90,sizeof(fCuts));
125        break;
126 +    case kVBTFWorkingPoint85Id:
127 +      memcpy(fCuts,VBTFWorkingPoint85,sizeof(fCuts));
128 +      break;
129      case kVBTFWorkingPoint80Id:
130        memcpy(fCuts,VBTFWorkingPoint80,sizeof(fCuts));
131        break;
132 +    case kVBTFWorkingPointLowPtId:
133 +      if(ele->Pt() < 20)
134 +        memcpy(fCuts,VBTFWorkingPoint70NoHOverEE,sizeof(fCuts));
135 +      else
136 +        memcpy(fCuts,VBTFWorkingPoint80NoHOverEE,sizeof(fCuts));
137 +      break;
138      case kVBTFWorkingPoint70Id:
139        memcpy(fCuts,VBTFWorkingPoint70,sizeof(fCuts));
140        break;
# Line 96 | Line 143 | Bool_t ElectronTools::PassCustomID(const
143        break;
144    }
145  
99
146    // Based on RecoEgamma/ElectronIdentification/src/CutBasedElectronID.cc.
147    Double_t eOverP = ele->ESuperClusterOverP();
148    Double_t fBrem  = ele->FBrem();
149  
150 <  if ((eOverP < fCuts[5][0]) && (fBrem < fCuts[5][1]))
150 >  if ( (fCuts[5][0]>0.0) && (eOverP < fCuts[5][0]) && (fCuts[5][1]>0.0) && (fBrem < fCuts[5][1]))
151      return kFALSE;
152  
153 <  if (eOverP < fCuts[5][2]*(1-fBrem))
153 >  if ( (fCuts[5][2]>0.0) && (eOverP < fCuts[5][2]*(1-fBrem)))
154      return kFALSE;
155  
156    Int_t cat = 2;
# Line 112 | Line 158 | Bool_t ElectronTools::PassCustomID(const
158      cat=1;
159    else if (eOverP < 1.2 && eOverP > 0.8)
160      cat=0;
161 <
162 <  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
161 >  
162 >  if(ele->SCluster() == 0)
163 >    return kFALSE;
164 >  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
165    Double_t hOverE       = ele->HadronicOverEm();
166    Double_t sigmaee      = ele->CoviEtaiEta();
167    Double_t deltaPhiIn   = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
# Line 122 | Line 170 | Bool_t ElectronTools::PassCustomID(const
170    Int_t eb = 1;
171    if (ele->IsEB())
172      eb = 0;
173 <
173 >
174    if (hOverE>fCuts[0][cat+4*eb])
175      return kFALSE;
176  
# Line 138 | Line 186 | Bool_t ElectronTools::PassCustomID(const
186    if(eSeedOverPin<fCuts[4][cat+4*eb])
187      return kFALSE;
188  
189 +  // Cuts only for pt<20 region and kVBTFWorkingPointLowPtId
190 +  if(ele->Pt() < 20 && idType == kVBTFWorkingPointLowPtId) {
191 +    Bool_t isGoodLowPtEl = fBrem > 0.15 ||
192 +                          (ele->SCluster()->AbsEta() < 1.0 && eOverP > 0.95);
193 +    if(!isGoodLowPtEl) return kFALSE;
194 +  }
195 +  
196    return kTRUE;
197   }
198  
199   //--------------------------------------------------------------------------------------------------
200 < Bool_t ElectronTools::PassCustomIso(const Electron *ele, EElIsoType isoType)
200 > Bool_t ElectronTools::PassCustomIso(const Electron *ele, EElIsoType isoType,
201 >                                    Bool_t useCombineIso)
202   {
203    Bool_t pass = kTRUE;
204    Double_t fIsoCuts[4][2];          //!custom isolation cuts
149
205    Double_t VBTFWorkingPoint95[4][2] = {
206 <    {7.0 ,  8.0   },   //TrkIso
207 <    {5.0 ,  3.0   },   //ECALIso
208 <    {5.0 ,  2.0   },   //HCALIso
209 <    {9999,  9999  }   //Combined    
206 >    {0.15 , 0.08   },   //TrkIso
207 >    {2.00 , 0.06   },   //ECALIso
208 >    {0.12 , 0.05   },   //HCALIso
209 >    {0.15,  0.10   }   //Combined    
210    };            
211  
212    Double_t VBTFWorkingPoint90[4][2] = {
213 <    {6.0 ,  6.0   },   //TrkIso
214 <    {5.0 ,  2.5   },   //ECALIso
215 <    {5.0 ,  1.5   },   //HCALIso
216 <    {9999,  9999  }   //Combined    
213 >    {0.12 , 0.05   },   //TrkIso
214 >    {0.09 , 0.06   },   //ECALIso
215 >    {0.10 , 0.03   },   //HCALIso
216 >    {0.10,  0.07   }   //Combined    
217 >  };            
218 >
219 >  Double_t VBTFWorkingPoint85[4][2] = {
220 >    {0.09 , 0.05   },   //TrkIso
221 >    {0.08 , 0.05   },   //ECALIso
222 >    {0.10 , 0.025  },   //HCALIso
223 >    {0.09,  0.06   }   //Combined    
224    };            
225  
226    Double_t VBTFWorkingPoint80[4][2] = {
227 <    {3.0 ,  1.5   },   //TrkIso
228 <    {4.0 ,  2.5   },   //ECALIso
229 <    {5.0 ,  0.7   },   //HCALIso
230 <    {9999,  9999  }   //Combined    
227 >    {0.09 , 0.04   },   //TrkIso
228 >    {0.07 , 0.05   },   //ECALIso
229 >    {0.10 , 0.025  },   //HCALIso
230 >    {0.07,  0.06   }   //Combined    
231    };            
232  
233    Double_t VBTFWorkingPoint70[4][2] = {
234 <    {2.5 ,  0.8   },   //TrkIso
235 <    {3.0 ,  2.5   },   //ECALIso
236 <    {5.0 ,  0.25  },   //HCALIso
237 <    {9999,  9999  }   //Combined    
234 >    {0.05 , 0.025  },   //TrkIso
235 >    {0.06 , 0.025  },   //ECALIso
236 >    {0.03 , 0.020  },   //HCALIso
237 >    {0.04,  0.030  }   //Combined
238    };            
239  
240    switch (isoType) {
# Line 182 | Line 244 | Bool_t ElectronTools::PassCustomIso(cons
244      case kVBTFWorkingPoint90Iso:
245        memcpy(fIsoCuts,VBTFWorkingPoint90,sizeof(fIsoCuts));
246        break;
247 +    case kVBTFWorkingPoint85Iso:
248 +      memcpy(fIsoCuts,VBTFWorkingPoint85,sizeof(fIsoCuts));
249 +      break;
250      case kVBTFWorkingPoint80Iso:
251        memcpy(fIsoCuts,VBTFWorkingPoint80,sizeof(fIsoCuts));
252        break;
# Line 193 | Line 258 | Bool_t ElectronTools::PassCustomIso(cons
258        break;
259    }
260  
261 <  Double_t trkIso  = ele->TrackIsolationDr03();
262 <  Double_t ecalIso = ele->EcalRecHitIsoDr04();
263 <  Double_t hcalIso = ele->HcalIsolation();
264 <  Double_t combinedIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr04() - 1.5;
261 >  Double_t trkIso  = ele->TrackIsolationDr03() / ele->Pt();
262 >  Double_t ecalIso = ele->EcalRecHitIsoDr03() / ele->Pt();
263 >  Double_t hcalIso = ele->HcalTowerSumEtDr03() / ele->Pt();
264 >  Double_t combinedIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03();
265 >  if(ele->IsEB()) combinedIso = ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) + ele->HcalTowerSumEtDr03();
266 >  combinedIso = combinedIso / ele->Pt();
267  
268    Int_t eb = 1;
269    if (ele->IsEB())
270      eb = 0;
271  
272 <  if (trkIso>fIsoCuts[0][eb])
273 <    pass = kFALSE;
274 <  if (ecalIso>fIsoCuts[1][eb])
275 <    pass = kFALSE;
276 <  if (hcalIso>fIsoCuts[2][eb])
277 <    pass = kFALSE;
278 <  if (combinedIso>fIsoCuts[3][eb])
279 <    pass = kFALSE;
280 <
272 >  if(useCombineIso == kFALSE){
273 >    if (trkIso>fIsoCuts[0][eb])
274 >      pass = kFALSE;
275 >    if (ecalIso>fIsoCuts[1][eb])
276 >      pass = kFALSE;
277 >    if (hcalIso>fIsoCuts[2][eb])
278 >      pass = kFALSE;
279 >  }
280 >  else {
281 >    if (combinedIso>fIsoCuts[3][eb])
282 >      pass = kFALSE;
283 >  }
284  
285    return pass;
286   }
# Line 218 | Line 288 | Bool_t ElectronTools::PassCustomIso(cons
288  
289   //--------------------------------------------------------------------------------------------------
290   Bool_t ElectronTools::PassConversionFilter(const Electron *ele,
291 <                                           const DecayParticleCol *conversions,
292 <                                           Bool_t WrongHitsRequirement)
291 >                                           const DecayParticleCol *conversions,
292 >                                           const BaseVertex *vtx,
293 >                                           UInt_t nWrongHitsMax,
294 >                                           Double_t probMin,
295 >                                           Double_t lxyMin,
296 >                                           Bool_t matchCkf,
297 >                                           Bool_t requireArbitratedMerged,
298 >                                           Double_t trkptMin)
299   {
300    Bool_t isGoodConversion = kFALSE;
301  
# Line 228 | Line 304 | Bool_t ElectronTools::PassConversionFilt
304      for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
305        const Track *trk = dynamic_cast<const ChargedParticle*>
306          (conversions->At(ifc)->Daughter(d))->Trk();
307 <      if (ele->GsfTrk() == trk) {
307 >      if (ele->GsfTrk() == trk || (matchCkf && ele->TrackerTrk()==trk) ) {
308          ConversionMatchFound = kTRUE;
309          break;
310        }
# Line 236 | Line 312 | Bool_t ElectronTools::PassConversionFilt
312  
313      // if match between the e-track and one of the conversion legs
314      if (ConversionMatchFound == kTRUE){
315 <      isGoodConversion =  (conversions->At(ifc)->Prob() > 1e-6) &&
316 <        (conversions->At(ifc)->Lxy() > 0) &&
317 <        (conversions->At(ifc)->Position().Rho() > 2.0);
315 >      isGoodConversion =  (conversions->At(ifc)->Prob() > probMin) &&
316 >        (!requireArbitratedMerged || conversions->At(ifc)->Quality().Quality(ConversionQuality::arbitratedMerged)) &&
317 >        (conversions->At(ifc)->LxyCorrected(vtx) > lxyMin);
318  
319        if (isGoodConversion == kTRUE) {
320          for (UInt_t d=0; d<conversions->At(ifc)->NDaughters(); d++) {
321            const Track *trk = dynamic_cast<const ChargedParticle*>
322              (conversions->At(ifc)->Daughter(d))->Trk();
323            if (trk) {
324 <            // These requirements are not used for the GSF track
249 <            if (!(trk->NHits() >= 3 && trk->Prob() > 1e-6) && trk!=ele->GsfTrk())
250 <              isGoodConversion = kFALSE;
324 >            if (trk->Pt()<trkptMin) isGoodConversion = kFALSE;
325              const StableData *sd = dynamic_cast<const StableData*>
326                (conversions->At(ifc)->DaughterDat(d));
327 <            if (WrongHitsRequirement && sd->NWrongHits() != 0)
327 >            if (sd->NWrongHits() > nWrongHitsMax)
328                isGoodConversion = kFALSE;
329            } else {
330              isGoodConversion = kFALSE;
# Line 258 | Line 332 | Bool_t ElectronTools::PassConversionFilt
332          }
333        }
334      }
335 +
336      if (isGoodConversion == kTRUE) break;
337      
338    } // loop over all conversions
# Line 266 | Line 341 | Bool_t ElectronTools::PassConversionFilt
341   }
342  
343   //--------------------------------------------------------------------------------------------------
344 < Bool_t ElectronTools::PassD0Cut(const Electron *ele, const VertexCol *vertices, Double_t fD0Cut,
345 <                                Bool_t fReverseD0Cut)
344 > Bool_t ElectronTools::PassD0Cut(const Electron *ele, const VertexCol *vertices, Double_t fD0Cut, Int_t nVertex)
345 > {
346 >  Bool_t d0cut = kFALSE;
347 >
348 >  Double_t d0_real = 1e30;
349 >  if(nVertex >= 0) d0_real = TMath::Abs(ele->GsfTrk()->D0Corrected(*vertices->At(nVertex)));
350 >  else            {
351 >    Double_t distVtx = 999.0;
352 >    Int_t closestVtx = 0;
353 >    for(UInt_t nv=0; nv<vertices->GetEntries(); nv++){
354 >      double dz = TMath::Abs(ele->GsfTrk()->DzCorrected(*vertices->At(nv)));
355 >      if(dz < distVtx) {
356 >        distVtx    = dz;
357 >        closestVtx = nv;
358 >      }
359 >    }
360 >    d0_real = TMath::Abs(ele->GsfTrk()->D0Corrected(*vertices->At(closestVtx)));
361 >  }
362 >  if(d0_real < fD0Cut) d0cut = kTRUE;
363 >  
364 >  return d0cut;
365 > }
366 >
367 > //--------------------------------------------------------------------------------------------------
368 > Bool_t ElectronTools::PassD0Cut(const Electron *ele, const BeamSpotCol *beamspots, Double_t fD0Cut)
369   {
370    Bool_t d0cut = kFALSE;
371    // d0 cut
372    Double_t d0_real = 99999;
373 <  for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
374 <    Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
373 >  for(UInt_t i0 = 0; i0 < beamspots->GetEntries(); i0++) {
374 >    Double_t pD0 = ele->GsfTrk()->D0Corrected(*beamspots->At(i0));
375      if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
376    }
377    if(d0_real < fD0Cut) d0cut = kTRUE;
378    
281  if     (fReverseD0Cut == kTRUE &&
282          d0cut == kFALSE && d0_real < 0.05)
283    d0cut = kTRUE;
284  else if(fReverseD0Cut == kTRUE)
285    d0cut = kFALSE;
286  
379    return d0cut;
380   }
381  
382   //--------------------------------------------------------------------------------------------------
383 + Bool_t ElectronTools::PassDZCut(const Electron *ele, const VertexCol *vertices, Double_t fDZCut, Int_t nVertex)
384 + {
385 +  Bool_t dzcut = kFALSE;
386 +
387 +  Double_t distVtx = 999.0;
388 +  if(nVertex >= 0) distVtx = TMath::Abs(ele->GsfTrk()->DzCorrected(*vertices->At(nVertex)));
389 +  else {
390 +    for(UInt_t nv=0; nv<vertices->GetEntries(); nv++){
391 +      double dz = TMath::Abs(ele->GsfTrk()->DzCorrected(*vertices->At(nv)));
392 +      if(dz < distVtx) {
393 +        distVtx  = dz;
394 +      }
395 +    }
396 +  }
397 +
398 +  if(distVtx < fDZCut) dzcut = kTRUE;
399 +  
400 +  return dzcut;
401 + }
402 +
403 + //--------------------------------------------------------------------------------------------------
404   Bool_t ElectronTools::PassChargeFilter(const Electron *ele)
405   {
406    Bool_t passChargeFilter = kTRUE;
# Line 301 | Line 414 | Bool_t ElectronTools::PassChargeFilter(c
414   Bool_t ElectronTools::PassSpikeRemovalFilter(const Electron *ele)
415   {
416    Bool_t passSpikeRemovalFilter = kTRUE;
417 <  if(ele->SCluster()->Seed()->Energy() > 5.0 &&
417 >  if(ele->SCluster() &&
418 >     ele->SCluster()->Seed()->Energy() > 5.0 &&
419       ele->SCluster()->Seed()->EMax() / ele->SCluster()->Seed()->E3x3() > 0.95
420      ) {
421      passSpikeRemovalFilter = kFALSE;
# Line 316 | Line 430 | Bool_t ElectronTools::PassSpikeRemovalFi
430      
431    return passSpikeRemovalFilter;
432   }
433 +
434 + Bool_t ElectronTools::PassTriggerMatching(const Electron *ele, const TriggerObjectCol *trigobjs)
435 + {
436 +  
437 +  for (UInt_t i=0; i<trigobjs->GetEntries(); ++i) {
438 +    const TriggerObject *trigobj = trigobjs->At(i);
439 +    if (trigobj->TriggerType()==TriggerObject::TriggerCluster || trigobj->TriggerType()==TriggerObject::TriggerElectron || trigobj->TriggerType()==TriggerObject::TriggerPhoton) {
440 +      if (MathUtils::DeltaR(ele->SCluster(),trigobj)<0.3) {
441 +        return kTRUE;
442 +      }
443 +    }
444 +  }
445 +  
446 +  return kFALSE;
447 +  
448 +  
449 + }
450 +
451 + //--------------------------------------------------------------------------------------------------
452 + Int_t ElectronTools::Classify(const Electron *ele) {
453 +  
454 +  double eta    = ele->AbsEta();
455 +  double eOverP = ele->ESuperClusterOverP();
456 +  double fBrem  = ele->FBrem();
457 +
458 +  int cat = -1;
459 +  if (ele->IsEB()) {
460 +    if ((fBrem >= 0.12) and (eOverP > 0.9) and (eOverP < 1.2))
461 +      cat = 0;
462 +    else if (((eta >  .445   and eta <  .45  ) or
463 +              (eta >  .79    and eta <  .81  ) or
464 +              (eta > 1.137   and eta < 1.157 ) or
465 +              (eta > 1.47285 and eta < 1.4744)))
466 +      cat = 6;
467 +    else if (ele->IsTrackerDriven() and !ele->IsEcalDriven())
468 +      cat = 8;
469 +    else if (fBrem < 0.12)
470 +      cat = 1;
471 +    else
472 +      cat = 2;
473 +  } else {
474 +    if ((fBrem >= 0.2) and (eOverP > 0.82) and (eOverP < 1.22))
475 +      cat = 3;
476 +    else if (eta > 1.5 and eta <  1.58)
477 +      cat = 7;
478 +    else if (ele->IsTrackerDriven() and !ele->IsEcalDriven())
479 +      cat = 8;
480 +    else if (fBrem < 0.2)
481 +      cat = 4;
482 +    else
483 +      cat = 5;
484 +  }
485 +
486 +  return cat;
487 + }
488 +
489 + //--------------------------------------------------------------------------------------------------
490 + Int_t ElectronTools::PassTightId(const Electron *ele, const VertexCol *vertices,
491 +                                 const DecayParticleCol *conversions, const Int_t typeCuts,
492 +                                 Double_t beta){
493 +
494 + // original code on
495 + // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/RecoEgamma/ElectronIdentification/src/CutBasedElectronID.cc
496 + // beta must be computed with a DR cone of 0.4
497 +
498 +  Double_t scEt   = ele->SCluster()->Et();
499 +  Double_t scEta  = ele->SCluster()->Eta();
500 +
501 +  Double_t fBrem = ele->FBrem();
502 +  Double_t hOverE = ele->HadronicOverEm();
503 +  Double_t sigmaee = ele->CoviEtaiEta();
504 +  Double_t deltaPhiIn = TMath::Abs(ele->DeltaPhiSuperClusterTrackAtVtx());
505 +  Double_t deltaEtaIn = TMath::Abs(ele->DeltaEtaSuperClusterTrackAtVtx());
506 +  Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
507 +
508 +  Int_t mishits = ele->BestTrk()->NExpectedHitsInner();
509 +  Double_t tkIso   = ele->TrackIsolationDr03();
510 +  Double_t ecalIso = ele->EcalRecHitIsoDr04()*beta;
511 +  Double_t hcalIso  = ele->HcalTowerSumEtDr04()*beta;
512 +
513 +  int cat = Classify(ele);
514 +  int eb;
515 +
516 +  if (ele->IsEB())
517 +    eb = 0;
518 +  else
519 +    eb = 1;
520 +
521 +  // Medium cuts
522 +  Double_t cutdcotdistMedium[9] = {
523 +  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};
524 +  Double_t cutdetainMedium[9] = {
525 +  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};
526 +  Double_t cutdetainlMedium[9] = {
527 +  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};
528 +  Double_t cutdphiinMedium[9] = {
529 +  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};
530 +  Double_t cutdphiinlMedium[9] = {
531 +  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};
532 +  Double_t cuteseedopcorMedium[9] = {
533 +  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};
534 +  Double_t cutfmishitsMedium[9] = {
535 +  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};
536 +  Double_t cuthoeMedium[9] = {
537 +  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};
538 +  Double_t cuthoelMedium[9] = {
539 +  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};
540 +  Double_t cutip_gsfMedium[9] = {
541 +  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};
542 +  Double_t cutip_gsflMedium[9] = {
543 +  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};
544 +  Double_t cutiso_sumMedium[9] = {
545 +  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};
546 +  Double_t cutiso_sumoetMedium[9] = {
547 +  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};
548 +  Double_t cutiso_sumoetlMedium[9] = {
549 +  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};
550 +  Double_t cutseeMedium[9] = {
551 +  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};
552 +  Double_t cutseelMedium[9] = {
553 +  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};
554 +
555 +  // Tight cuts
556 +  Double_t cutdcotdistTight[9] = {
557 +  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};
558 +  Double_t cutdetainTight[9] = {
559 +  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};
560 +  Double_t cutdetainlTight[9] = {
561 +  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};
562 +  Double_t cutdphiinTight[9] = {
563 +  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};
564 +  Double_t cutdphiinlTight[9] = {
565 +  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};
566 +  Double_t cuteseedopcorTight[9] = {
567 +  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};
568 +  Double_t cutfmishitsTight[9] = {
569 +  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};
570 +  Double_t cuthoeTight[9] = {
571 +  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};
572 +  Double_t cuthoelTight[9] = {
573 +  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};
574 +  Double_t cutip_gsfTight[9] = {
575 +  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};
576 +  Double_t cutip_gsflTight[9] = {
577 +  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};
578 +  Double_t cutiso_sumTight[9] = {
579 +  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};
580 +  Double_t cutiso_sumoetTight[9] = {
581 +  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};
582 +  Double_t cutiso_sumoetlTight[9] = {
583 +  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};
584 +  Double_t cutseeTight[9] = {
585 +  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};
586 +  Double_t cutseelTight[9] = {
587 +  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};
588 +  
589 +  // SuperTight cuts
590 +  Double_t cutdcotdistSuperTight[9] = {
591 +  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};
592 +  Double_t cutdetainSuperTight[9] = {
593 +  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};
594 +  Double_t cutdetainlSuperTight[9] = {
595 +  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};
596 +  Double_t cutdphiinSuperTight[9] = {
597 +  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};
598 +  Double_t cutdphiinlSuperTight[9] = {
599 +  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};
600 +  Double_t cuteseedopcorSuperTight[9] = {
601 +  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};
602 +  Double_t cutfmishitsSuperTight[9] = {
603 +  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};
604 +  Double_t cuthoeSuperTight[9] = {
605 +  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};
606 +  Double_t cuthoelSuperTight[9] = {
607 +  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};
608 +  Double_t cutip_gsfSuperTight[9] = {
609 +  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};
610 +  Double_t cutip_gsflSuperTight[9] = {
611 +  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};
612 +  Double_t cutiso_sumSuperTight[9] = {
613 +  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};
614 +  Double_t cutiso_sumoetSuperTight[9] = {
615 +  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};
616 +  Double_t cutiso_sumoetlSuperTight[9] = {
617 +  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};
618 +  Double_t cutseeSuperTight[9] = {
619 +  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};
620 +  Double_t cutseelSuperTight[9] = {
621 +  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};
622 +
623 +  // HyperTight1 cuts
624 +  Double_t cutdcotdistHyperTight1[9] = {
625 +  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};
626 +  Double_t cutdetainHyperTight1[9] = {
627 +  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};
628 +  Double_t cutdetainlHyperTight1[9] = {
629 +  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};
630 +  Double_t cutdphiinHyperTight1[9] = {
631 +  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};
632 +  Double_t cutdphiinlHyperTight1[9] = {
633 +  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};
634 +  Double_t cuteseedopcorHyperTight1[9] = {
635 +  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};
636 +  Double_t cutfmishitsHyperTight1[9] = {
637 +  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};
638 +  Double_t cuthoeHyperTight1[9] = {
639 +  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};
640 +  Double_t cuthoelHyperTight1[9] = {
641 +  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};
642 +  Double_t cutip_gsfHyperTight1[9] = {
643 +  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};
644 +  Double_t cutip_gsflHyperTight1[9] = {
645 +  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};
646 +  Double_t cutiso_sumHyperTight1[9] = {
647 +  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};
648 +  Double_t cutiso_sumoetHyperTight1[9] = {
649 +  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};
650 +  Double_t cutiso_sumoetlHyperTight1[9] = {
651 +  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};
652 +  Double_t cutseeHyperTight1[9] = {
653 +  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};
654 +  Double_t cutseelHyperTight1[9] = {
655 +  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};
656 +
657 +  // HyperTight2 cuts
658 +  Double_t cutdcotdistHyperTight2[9] = {
659 +  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};
660 +  Double_t cutdetainHyperTight2[9] = {
661 +  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};
662 +  Double_t cutdetainlHyperTight2[9] = {
663 +  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};
664 +  Double_t cutdphiinHyperTight2[9] = {
665 +  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};
666 +  Double_t cutdphiinlHyperTight2[9] = {
667 +  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};
668 +  Double_t cuteseedopcorHyperTight2[9] = {
669 +  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};
670 +  Double_t cutfmishitsHyperTight2[9] = {
671 +  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};
672 +  Double_t cuthoeHyperTight2[9] = {
673 +  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};
674 +  Double_t cuthoelHyperTight2[9] = {
675 +  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};
676 +  Double_t cutip_gsfHyperTight2[9] = {
677 +  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};
678 +  Double_t cutip_gsflHyperTight2[9] = {
679 +  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};
680 +  Double_t cutiso_sumHyperTight2[9] = {
681 +  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};
682 +  Double_t cutiso_sumoetHyperTight2[9] = {
683 +  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};
684 +  Double_t cutiso_sumoetlHyperTight2[9] = {
685 +  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};
686 +  Double_t cutseeHyperTight2[9] = {
687 +  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};
688 +  Double_t cutseelHyperTight2[9] = {
689 +  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};
690 +
691 +  // HyperTight3 cuts
692 +  Double_t cutdcotdistHyperTight3[9] = {
693 +  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};
694 +  Double_t cutdetainHyperTight3[9] = {
695 +  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};
696 +  Double_t cutdetainlHyperTight3[9] = {
697 +  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};
698 +  Double_t cutdphiinHyperTight3[9] = {
699 +  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};
700 +  Double_t cutdphiinlHyperTight3[9] = {
701 +  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};
702 +  Double_t cuteseedopcorHyperTight3[9] = {
703 +  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};
704 +  Double_t cutfmishitsHyperTight3[9] = {
705 +  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};
706 +  Double_t cuthoeHyperTight3[9] = {
707 +  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};
708 +  Double_t cuthoelHyperTight3[9] = {
709 +  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};
710 +  Double_t cutip_gsfHyperTight3[9] = {
711 +  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};
712 +  Double_t cutip_gsflHyperTight3[9] = {
713 +  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};
714 +  Double_t cutiso_sumHyperTight3[9] = {
715 +  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};
716 +  Double_t cutiso_sumoetHyperTight3[9] = {
717 +  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};
718 +  Double_t cutiso_sumoetlHyperTight3[9] = {
719 +  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};
720 +  Double_t cutseeHyperTight3[9] = {
721 +  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};
722 +  Double_t cutseelHyperTight3[9] = {
723 +  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};
724 +
725 +  // HyperTight4 cuts
726 +  Double_t cutdcotdistHyperTight4[9] = {
727 +  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};
728 +  Double_t cutdetainHyperTight4[9] = {
729 +  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};
730 +  Double_t cutdetainlHyperTight4[9] = {
731 +  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};
732 +  Double_t cutdphiinHyperTight4[9] = {
733 +  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};
734 +  Double_t cutdphiinlHyperTight4[9] = {
735 +  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};
736 +  Double_t cuteseedopcorHyperTight4[9] = {
737 +  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};
738 +  Double_t cutfmishitsHyperTight4[9] = {
739 +  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};
740 +  Double_t cuthoeHyperTight4[9] = {
741 +  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};
742 +  Double_t cuthoelHyperTight4[9] = {
743 +  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};
744 +  Double_t cutip_gsfHyperTight4[9] = {
745 +  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};
746 +  Double_t cutip_gsflHyperTight4[9] = {
747 +  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};
748 +  Double_t cutiso_sumHyperTight4[9] = {
749 +  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};
750 +  Double_t cutiso_sumoetHyperTight4[9] = {
751 +  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};
752 +  Double_t cutiso_sumoetlHyperTight4[9] = {
753 +  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};
754 +  Double_t cutseeHyperTight4[9] = {
755 +  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};
756 +  Double_t cutseelHyperTight4[9] = {
757 +  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};
758 +
759 +  Double_t cutdcotdist[9];
760 +  Double_t cutdetain[9];
761 +  Double_t cutdetainl[9];
762 +  Double_t cutdphiin[9];
763 +  Double_t cutdphiinl[9];
764 +  Double_t cuteseedopcor[9];
765 +  Double_t cutfmishits[9];
766 +  Double_t cuthoe[9];
767 +  Double_t cuthoel[9];
768 +  Double_t cutip_gsf[9];
769 +  Double_t cutip_gsfl[9];
770 +  Double_t cutiso_sum[9];
771 +  Double_t cutiso_sumoet[9];
772 +  Double_t cutiso_sumoetl[9];
773 +  Double_t cutsee[9];
774 +  Double_t cutseel[9];
775 +  if     (typeCuts == 0) {
776 +    memcpy(cutdcotdist   ,cutdcotdistMedium   ,sizeof(cutdcotdistMedium));
777 +    memcpy(cutdetain     ,cutdetainMedium     ,sizeof(cutdetainMedium));
778 +    memcpy(cutdetainl    ,cutdetainlMedium    ,sizeof(cutdetainlMedium));
779 +    memcpy(cutdphiin     ,cutdphiinMedium     ,sizeof(cutdphiinMedium));
780 +    memcpy(cutdphiinl    ,cutdphiinlMedium    ,sizeof(cutdphiinlMedium));
781 +    memcpy(cuteseedopcor ,cuteseedopcorMedium ,sizeof(cuteseedopcorMedium));
782 +    memcpy(cutfmishits   ,cutfmishitsMedium   ,sizeof(cutfmishitsMedium));
783 +    memcpy(cuthoe        ,cuthoeMedium        ,sizeof(cuthoeMedium));
784 +    memcpy(cuthoel       ,cuthoelMedium       ,sizeof(cuthoelMedium));
785 +    memcpy(cutip_gsf     ,cutip_gsfMedium     ,sizeof(cutip_gsfMedium));
786 +    memcpy(cutip_gsfl    ,cutip_gsflMedium    ,sizeof(cutip_gsflMedium));
787 +    memcpy(cutiso_sum    ,cutiso_sumMedium    ,sizeof(cutiso_sumMedium));
788 +    memcpy(cutiso_sumoet ,cutiso_sumoetMedium ,sizeof(cutiso_sumoetMedium));
789 +    memcpy(cutiso_sumoetl,cutiso_sumoetlMedium,sizeof(cutiso_sumoetlMedium));
790 +    memcpy(cutsee        ,cutseeMedium        ,sizeof(cutseeMedium));
791 +    memcpy(cutseel       ,cutseelMedium       ,sizeof(cutseelMedium));
792 +  }
793 +  else if(typeCuts == 1) {
794 +    memcpy(cutdcotdist   ,cutdcotdistTight   ,sizeof(cutdcotdistTight));
795 +    memcpy(cutdetain     ,cutdetainTight     ,sizeof(cutdetainTight));
796 +    memcpy(cutdetainl    ,cutdetainlTight    ,sizeof(cutdetainlTight));
797 +    memcpy(cutdphiin     ,cutdphiinTight     ,sizeof(cutdphiinTight));
798 +    memcpy(cutdphiinl    ,cutdphiinlTight    ,sizeof(cutdphiinlTight));
799 +    memcpy(cuteseedopcor ,cuteseedopcorTight ,sizeof(cuteseedopcorTight));
800 +    memcpy(cutfmishits   ,cutfmishitsTight   ,sizeof(cutfmishitsTight));
801 +    memcpy(cuthoe        ,cuthoeTight        ,sizeof(cuthoeTight));
802 +    memcpy(cuthoel       ,cuthoelTight       ,sizeof(cuthoelTight));
803 +    memcpy(cutip_gsf     ,cutip_gsfTight     ,sizeof(cutip_gsfTight));
804 +    memcpy(cutip_gsfl    ,cutip_gsflTight    ,sizeof(cutip_gsflTight));
805 +    memcpy(cutiso_sum    ,cutiso_sumTight    ,sizeof(cutiso_sumTight));
806 +    memcpy(cutiso_sumoet ,cutiso_sumoetTight ,sizeof(cutiso_sumoetTight));
807 +    memcpy(cutiso_sumoetl,cutiso_sumoetlTight,sizeof(cutiso_sumoetlTight));
808 +    memcpy(cutsee        ,cutseeTight        ,sizeof(cutseeTight));
809 +    memcpy(cutseel       ,cutseelTight       ,sizeof(cutseelTight));
810 +  }
811 +  else if(typeCuts == 2) {
812 +    memcpy(cutdcotdist   ,cutdcotdistSuperTight   ,sizeof(cutdcotdistSuperTight));
813 +    memcpy(cutdetain     ,cutdetainSuperTight     ,sizeof(cutdetainSuperTight));
814 +    memcpy(cutdetainl    ,cutdetainlSuperTight    ,sizeof(cutdetainlSuperTight));
815 +    memcpy(cutdphiin     ,cutdphiinSuperTight     ,sizeof(cutdphiinSuperTight));
816 +    memcpy(cutdphiinl    ,cutdphiinlSuperTight    ,sizeof(cutdphiinlSuperTight));
817 +    memcpy(cuteseedopcor ,cuteseedopcorSuperTight ,sizeof(cuteseedopcorSuperTight));
818 +    memcpy(cutfmishits   ,cutfmishitsSuperTight   ,sizeof(cutfmishitsSuperTight));
819 +    memcpy(cuthoe        ,cuthoeSuperTight        ,sizeof(cuthoeSuperTight));
820 +    memcpy(cuthoel       ,cuthoelSuperTight       ,sizeof(cuthoelSuperTight));
821 +    memcpy(cutip_gsf     ,cutip_gsfSuperTight     ,sizeof(cutip_gsfSuperTight));
822 +    memcpy(cutip_gsfl    ,cutip_gsflSuperTight    ,sizeof(cutip_gsflSuperTight));
823 +    memcpy(cutiso_sum    ,cutiso_sumSuperTight    ,sizeof(cutiso_sumSuperTight));
824 +    memcpy(cutiso_sumoet ,cutiso_sumoetSuperTight ,sizeof(cutiso_sumoetSuperTight));
825 +    memcpy(cutiso_sumoetl,cutiso_sumoetlSuperTight,sizeof(cutiso_sumoetlSuperTight));
826 +    memcpy(cutsee        ,cutseeSuperTight        ,sizeof(cutseeSuperTight));
827 +    memcpy(cutseel       ,cutseelSuperTight       ,sizeof(cutseelSuperTight));
828 +  }
829 +  else if(typeCuts == 3) {
830 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight1   ,sizeof(cutdcotdistHyperTight1));
831 +    memcpy(cutdetain     ,cutdetainHyperTight1     ,sizeof(cutdetainHyperTight1));
832 +    memcpy(cutdetainl    ,cutdetainlHyperTight1    ,sizeof(cutdetainlHyperTight1));
833 +    memcpy(cutdphiin     ,cutdphiinHyperTight1     ,sizeof(cutdphiinHyperTight1));
834 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight1    ,sizeof(cutdphiinlHyperTight1));
835 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight1 ,sizeof(cuteseedopcorHyperTight1));
836 +    memcpy(cutfmishits   ,cutfmishitsHyperTight1   ,sizeof(cutfmishitsHyperTight1));
837 +    memcpy(cuthoe        ,cuthoeHyperTight1       ,sizeof(cuthoeHyperTight1));
838 +    memcpy(cuthoel       ,cuthoelHyperTight1      ,sizeof(cuthoelHyperTight1));
839 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight1     ,sizeof(cutip_gsfHyperTight1));
840 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight1    ,sizeof(cutip_gsflHyperTight1));
841 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight1    ,sizeof(cutiso_sumHyperTight1));
842 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight1 ,sizeof(cutiso_sumoetHyperTight1));
843 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight1,sizeof(cutiso_sumoetlHyperTight1));
844 +    memcpy(cutsee        ,cutseeHyperTight1       ,sizeof(cutseeHyperTight1));
845 +    memcpy(cutseel       ,cutseelHyperTight1      ,sizeof(cutseelHyperTight1));
846 +  }
847 +  else if(typeCuts == 4) {
848 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight2   ,sizeof(cutdcotdistHyperTight2));
849 +    memcpy(cutdetain     ,cutdetainHyperTight2     ,sizeof(cutdetainHyperTight2));
850 +    memcpy(cutdetainl    ,cutdetainlHyperTight2    ,sizeof(cutdetainlHyperTight2));
851 +    memcpy(cutdphiin     ,cutdphiinHyperTight2     ,sizeof(cutdphiinHyperTight2));
852 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight2    ,sizeof(cutdphiinlHyperTight2));
853 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight2 ,sizeof(cuteseedopcorHyperTight2));
854 +    memcpy(cutfmishits   ,cutfmishitsHyperTight2   ,sizeof(cutfmishitsHyperTight2));
855 +    memcpy(cuthoe        ,cuthoeHyperTight2       ,sizeof(cuthoeHyperTight2));
856 +    memcpy(cuthoel       ,cuthoelHyperTight2      ,sizeof(cuthoelHyperTight2));
857 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight2     ,sizeof(cutip_gsfHyperTight2));
858 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight2    ,sizeof(cutip_gsflHyperTight2));
859 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight2    ,sizeof(cutiso_sumHyperTight2));
860 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight2 ,sizeof(cutiso_sumoetHyperTight2));
861 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight2,sizeof(cutiso_sumoetlHyperTight2));
862 +    memcpy(cutsee        ,cutseeHyperTight2       ,sizeof(cutseeHyperTight2));
863 +    memcpy(cutseel       ,cutseelHyperTight2      ,sizeof(cutseelHyperTight2));
864 +  }
865 +  else if(typeCuts == 5) {
866 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight3   ,sizeof(cutdcotdistHyperTight3));
867 +    memcpy(cutdetain     ,cutdetainHyperTight3     ,sizeof(cutdetainHyperTight3));
868 +    memcpy(cutdetainl    ,cutdetainlHyperTight3    ,sizeof(cutdetainlHyperTight3));
869 +    memcpy(cutdphiin     ,cutdphiinHyperTight3     ,sizeof(cutdphiinHyperTight3));
870 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight3    ,sizeof(cutdphiinlHyperTight3));
871 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight3 ,sizeof(cuteseedopcorHyperTight3));
872 +    memcpy(cutfmishits   ,cutfmishitsHyperTight3   ,sizeof(cutfmishitsHyperTight3));
873 +    memcpy(cuthoe        ,cuthoeHyperTight3       ,sizeof(cuthoeHyperTight3));
874 +    memcpy(cuthoel       ,cuthoelHyperTight3      ,sizeof(cuthoelHyperTight3));
875 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight3     ,sizeof(cutip_gsfHyperTight3));
876 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight3    ,sizeof(cutip_gsflHyperTight3));
877 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight3    ,sizeof(cutiso_sumHyperTight3));
878 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight3 ,sizeof(cutiso_sumoetHyperTight3));
879 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight3,sizeof(cutiso_sumoetlHyperTight3));
880 +    memcpy(cutsee        ,cutseeHyperTight3       ,sizeof(cutseeHyperTight3));
881 +    memcpy(cutseel       ,cutseelHyperTight3      ,sizeof(cutseelHyperTight3));
882 +  }
883 +  else if(typeCuts == 6) {
884 +    memcpy(cutdcotdist   ,cutdcotdistHyperTight4   ,sizeof(cutdcotdistHyperTight4));
885 +    memcpy(cutdetain     ,cutdetainHyperTight4     ,sizeof(cutdetainHyperTight4));
886 +    memcpy(cutdetainl    ,cutdetainlHyperTight4    ,sizeof(cutdetainlHyperTight4));
887 +    memcpy(cutdphiin     ,cutdphiinHyperTight4     ,sizeof(cutdphiinHyperTight4));
888 +    memcpy(cutdphiinl    ,cutdphiinlHyperTight4    ,sizeof(cutdphiinlHyperTight4));
889 +    memcpy(cuteseedopcor ,cuteseedopcorHyperTight4 ,sizeof(cuteseedopcorHyperTight4));
890 +    memcpy(cutfmishits   ,cutfmishitsHyperTight4   ,sizeof(cutfmishitsHyperTight4));
891 +    memcpy(cuthoe        ,cuthoeHyperTight4       ,sizeof(cuthoeHyperTight4));
892 +    memcpy(cuthoel       ,cuthoelHyperTight4      ,sizeof(cuthoelHyperTight4));
893 +    memcpy(cutip_gsf     ,cutip_gsfHyperTight4     ,sizeof(cutip_gsfHyperTight4));
894 +    memcpy(cutip_gsfl    ,cutip_gsflHyperTight4    ,sizeof(cutip_gsflHyperTight4));
895 +    memcpy(cutiso_sum    ,cutiso_sumHyperTight4    ,sizeof(cutiso_sumHyperTight4));
896 +    memcpy(cutiso_sumoet ,cutiso_sumoetHyperTight4 ,sizeof(cutiso_sumoetHyperTight4));
897 +    memcpy(cutiso_sumoetl,cutiso_sumoetlHyperTight4,sizeof(cutiso_sumoetlHyperTight4));
898 +    memcpy(cutsee        ,cutseeHyperTight4       ,sizeof(cutseeHyperTight4));
899 +    memcpy(cutseel       ,cutseelHyperTight4      ,sizeof(cutseelHyperTight4));
900 +  }
901 +  else {
902 +    return 0;
903 +  }
904 +  int result = 0;
905 +  
906 +  const int ncuts = 10;
907 +  std::vector<bool> cut_results(ncuts, false);
908 +  
909 +  float iso_sum = tkIso + ecalIso + hcalIso;
910 +  if(fabs(scEta)>1.5)
911 +    iso_sum += (fabs(scEta)-1.5)*1.09;
912 +  
913 +  float iso_sumoet = iso_sum*(40./scEt);
914 +  
915 +  float eseedopincor = eSeedOverPin + fBrem;
916 +  if(fBrem < 0)
917 +    eseedopincor = eSeedOverPin;
918 +
919 +  float dist = (TMath::Abs(ele->ConvPartnerDist())      == -9999.? 9999:TMath::Abs(ele->ConvPartnerDist()));
920 +  float dcot = (TMath::Abs(ele->ConvPartnerDCotTheta()) == -9999.? 9999:TMath::Abs(ele->ConvPartnerDCotTheta()));
921 +
922 +  float dcotdistcomb = ((0.04 - std::max(dist, dcot)) > 0?(0.04 - std::max(dist, dcot)):0);
923 +
924 +  Double_t ip = 99999;
925 +  for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
926 +    if(vertices->At(i0)->NTracks() > 0){
927 +      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
928 +      ip = TMath::Abs(pD0);
929 +      break;
930 +    }
931 +  }
932 +
933 +  for (int cut=0; cut<ncuts; cut++) {
934 +    switch (cut) {
935 +    case 0:
936 +      cut_results[cut] = compute_cut(fabs(deltaEtaIn), scEt, cutdetainl[cat], cutdetain[cat]);
937 +      break;
938 +    case 1:
939 +      cut_results[cut] = compute_cut(fabs(deltaPhiIn), scEt, cutdphiinl[cat], cutdphiin[cat]);
940 +      break;
941 +    case 2:
942 +      cut_results[cut] = (eseedopincor > cuteseedopcor[cat]);
943 +      break;
944 +    case 3:
945 +      cut_results[cut] = compute_cut(hOverE, scEt, cuthoel[cat], cuthoe[cat]);
946 +      break;
947 +    case 4:
948 +      cut_results[cut] = compute_cut(sigmaee, scEt, cutseel[cat], cutsee[cat]);
949 +      break;
950 +    case 5:
951 +      cut_results[cut] = compute_cut(iso_sumoet, scEt, cutiso_sumoetl[cat], cutiso_sumoet[cat]);
952 +      break;
953 +    case 6:
954 +      cut_results[cut] = (iso_sum < cutiso_sum[cat]);
955 +      break;
956 +    case 7:
957 +      cut_results[cut] = compute_cut(fabs(ip), scEt, cutip_gsfl[cat], cutip_gsf[cat]);
958 +      break;
959 +    case 8:
960 +      cut_results[cut] = (mishits < cutfmishits[cat]);
961 +      break;
962 +    case 9:
963 +      cut_results[cut] = (dcotdistcomb < cutdcotdist[cat]);
964 +      break;
965 +    }
966 +  }
967 +  
968 +  // ID part
969 +  if (cut_results[0] & cut_results[1] & cut_results[2] & cut_results[3] & cut_results[4])
970 +    result = result + 1;
971 +  
972 +  // ISO part
973 +  if (cut_results[5] & cut_results[6])
974 +    result = result + 2;
975 +  
976 +  // IP part
977 +  if (cut_results[7])
978 +    result = result + 8;
979 +  
980 +  // Conversion part
981 +  if (cut_results[8] and cut_results[9])
982 +    result = result + 4;
983 +  
984 +  return result;
985 + }
986 +
987 + //--------------------------------------------------------------------------------------------------
988 + bool ElectronTools::compute_cut(double x, double et, double cut_min, double cut_max, bool gtn) {
989 +
990 +  float et_min = 10;
991 +  float et_max = 40;
992 +
993 +  bool accept = false;
994 +  float cut = cut_max; //  the cut at et=40 GeV
995 +
996 +  if(et < et_max) {
997 +    cut = cut_min + (1/et_min - 1/et)*(cut_max - cut_min)/(1/et_min - 1/et_max);
998 +  }
999 +  
1000 +  if(et < et_min) {
1001 +    cut = cut_min;
1002 +  }
1003 +
1004 +  if(gtn) {   // useful for e/p cut which is gt
1005 +    accept = (x >= cut);
1006 +  }
1007 +  else {
1008 +    accept = (x <= cut);
1009 +  }
1010 +
1011 +  return accept;
1012 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines