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.6 by ceballos, Thu May 27 09:24:50 2010 UTC vs.
Revision 1.13 by ceballos, Thu Aug 19 14:37:08 2010 UTC

# 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 123 | Line 123 | Bool_t ElectronTools::PassCustomID(const
123      cat=1;
124    else if (eOverP < 1.2 && eOverP > 0.8)
125      cat=0;
126 <
126 >  
127 >  if(ele->SCluster() == 0)
128 >    return kFALSE;
129    Double_t eSeedOverPin = ele->ESeedClusterOverPIn();
130    Double_t hOverE       = ele->HadronicOverEm();
131    Double_t sigmaee      = ele->CoviEtaiEta();
# Line 187 | Line 189 | Bool_t ElectronTools::PassCustomIso(cons
189    };            
190  
191    Double_t VBTFWorkingPoint70[4][2] = {
192 <    {0.06 , 0.03   },   //TrkIso
193 <    {0.06 , 0.03   },   //ECALIso
194 <    {0.05 , 0.015  },   //HCALIso
195 <    {0.05,  0.04   }   //Combined    
192 >    {0.05 , 0.025  },   //TrkIso
193 >    {0.06 , 0.025  },   //ECALIso
194 >    {0.03 , 0.020  },   //HCALIso
195 >    {0.04,  0.030  }   //Combined
196    };            
197  
198    switch (isoType) {
# Line 214 | Line 216 | Bool_t ElectronTools::PassCustomIso(cons
216        break;
217    }
218  
219 <  Double_t trkIso  = ele->TrackIsolationDr03();
220 <  Double_t ecalIso = ele->EcalRecHitIsoDr03();
221 <  Double_t hcalIso = ele->HcalTowerSumEtDr03();
222 <  Double_t combinedIso = trkIso + ecalIso + hcalIso;
223 <  if(ele->IsEB()) combinedIso = combinedIso - 1.0;
219 >  Double_t trkIso  = ele->TrackIsolationDr03() / ele->Pt();
220 >  Double_t ecalIso = ele->EcalRecHitIsoDr03() / ele->Pt();
221 >  Double_t hcalIso = ele->HcalTowerSumEtDr03() / ele->Pt();
222 >  Double_t combinedIso = ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03() + ele->HcalTowerSumEtDr03();
223 >  if(ele->IsEB()) combinedIso = ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) + ele->HcalTowerSumEtDr03();
224    combinedIso = combinedIso / ele->Pt();
225  
226    Int_t eb = 1;
# Line 285 | Line 287 | Bool_t ElectronTools::PassConversionFilt
287          }
288        }
289      }
290 +
291      if (isGoodConversion == kTRUE) break;
292      
293    } // loop over all conversions
# Line 300 | Line 303 | Bool_t ElectronTools::PassD0Cut(const El
303    // d0 cut
304    Double_t d0_real = 99999;
305    for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
306 <    Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
307 <    if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
306 >    if(vertices->At(i0)->NTracks() > 0){
307 >      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
308 >      d0_real = TMath::Abs(pD0);
309 >      break;
310 >    }
311    }
312    if(d0_real < fD0Cut) d0cut = kTRUE;
313    
# Line 350 | Line 356 | Bool_t ElectronTools::PassChargeFilter(c
356   Bool_t ElectronTools::PassSpikeRemovalFilter(const Electron *ele)
357   {
358    Bool_t passSpikeRemovalFilter = kTRUE;
359 <  if(ele->SCluster()->Seed()->Energy() > 5.0 &&
359 >  if(ele->SCluster() &&
360 >     ele->SCluster()->Seed()->Energy() > 5.0 &&
361       ele->SCluster()->Seed()->EMax() / ele->SCluster()->Seed()->E3x3() > 0.95
362      ) {
363      passSpikeRemovalFilter = kFALSE;
# Line 366 | Line 373 | Bool_t ElectronTools::PassSpikeRemovalFi
373    return passSpikeRemovalFilter;
374   }
375  
376 + Bool_t ElectronTools::PassTriggerMatching(const Electron *ele, const TriggerObjectCol *trigobjs)
377 + {
378 +  
379 +  for (UInt_t i=0; i<trigobjs->GetEntries(); ++i) {
380 +    const TriggerObject *trigobj = trigobjs->At(i);
381 +    if (trigobj->TriggerType()==TriggerObject::TriggerCluster || trigobj->TriggerType()==TriggerObject::TriggerElectron) {
382 +      if (MathUtils::DeltaR(ele,trigobj)<0.3) {
383 +        return kTRUE;
384 +      }
385 +    }
386 +  }
387 +  
388 +  return kFALSE;
389 +  
390 +  
391 + }
392 +
393   //--------------------------------------------------------------------------------------------------
394   Int_t ElectronTools::Classify(const Electron *ele) {
395    
# Line 506 | Line 530 | Int_t ElectronTools::PassTightId(const E
530      
531      result = result + 1;
532  
533 <    Double_t d0_real = 99999;
534 <    for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
511 <      Double_t pD0 = ele->GsfTrk()->D0Corrected(*vertices->At(i0));
512 <      if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
513 <    }
514 <    if (d0_real > cut[26*eb+21])
533 >    Bool_t passD0cut = PassD0Cut(ele, vertices, cut[26*eb+21], kFALSE);
534 >    if (!passD0cut)
535        return result;
536  
537      if (mishits > cut[26*eb+22]) // expected missing hits
# Line 649 | Line 669 | Int_t ElectronTools::PassTightId(const E
669  
670      // CAREFUL, I HAVE COMMENTED OUT WHAT SANI IS DOING
671      //Double_t iso_sum = tkIso + ecalIso + hcalIso;
672 <    Double_t iso_sum = (ele->TrackIsolationDr03() + ele->EcalRecHitIsoDr03() +
673 <                        ele->HcalTowerSumEtDr03() - 1.0) / ele->Pt();
672 >    Double_t iso_sum = (ele->TrackIsolationDr03() + TMath::Max(ele->EcalRecHitIsoDr03() - 1.0, 0.0) +
673 >                        ele->HcalTowerSumEtDr03()) / ele->Pt();
674      Double_t iso_sum_corrected = iso_sum*pow(40./scEt, 2);
675      if ((iso_sum < cutiso_sum[cat+bin*9]) &&
676          (iso_sum_corrected < cutiso_sumoet[cat+bin*9]))
# Line 666 | Line 686 | Int_t ElectronTools::PassTightId(const E
686          result += 1.;
687      }
688  
689 <    Double_t d0_real = 99999;
690 <    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])
689 >    Bool_t passD0cut = PassD0Cut(ele, vertices, cutip_gsf[cat+bin*9], kFALSE);
690 >    if (passD0cut)
691        result += 4;
692  
693      Bool_t passConvVeto = PassConversionFilter(ele, conversions, kTRUE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines