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

Comparing UserCode/MitPhysics/Utils/src/MetLeptonTools.cc (file contents):
Revision 1.1 by pharris, Thu Aug 9 13:15:43 2012 UTC vs.
Revision 1.4 by pharris, Sat Jan 12 11:49:50 2013 UTC

# Line 1 | Line 1
1   #include "MitPhysics/Utils/interface/MetLeptonTools.h"
2   #include <algorithm>
3   #include <vector>
4 + #include "TString.h"
5  
6   using namespace mithep;
7  
8   ClassImp(mithep::MetLeptonTools)
9  
10 < bool MetLeptonTools::looseTauId(const PFTau *iTau) {
11 <  if(iTau->Pt() < 19)                                  return false;
12 <  if(fabs(iTau->Eta()) > fabs(2.3) )                   return false;
13 <  if(!iTau->DiscriminationByDecayModeFinding())        return false;
14 <  if(!iTau->DiscriminationByLooseElectronRejection())  return false;
15 <  if(!iTau->DiscriminationByLooseMuonRejection())      return false;
16 <  if(!iTau->DiscriminationByVLooseIsolation()   )      return false;
10 > MetLeptonTools::MetLeptonTools() {
11 >  fTauIsoMVA = new TauIsoMVA();
12 >  fTauIsoMVA->Initialize(TString(getenv("CMSSW_BASE")+std::string("/src/MitPhysics/data/SXIsoMVA_BDTG.weights.xml")));
13 > }
14 >
15 > bool MetLeptonTools::looseTauId(const PFTau *iTau,const PileupEnergyDensityCol* iPUEnergyDensity) {
16 >  if(iTau->Pt() < 19)                                                 return false;
17 >  if(fabs(iTau->Eta()) > fabs(2.3) )                                  return false;
18 >  if(!iTau->DiscriminationByDecayModeFinding())                       return false;
19 >  if(!iTau->DiscriminationByLooseElectronRejection())                 return false;
20 >  if(!iTau->DiscriminationByLooseMuonRejection())                     return false;
21 >  //if(!iTau->DiscriminationByVLooseIsolation()   )                   return false;
22 >  if(fTauIsoMVA->MVAValue(iTau,iPUEnergyDensity->At(0)->Rho()) < 0.7) return false;
23    return true;
24   }
25   bool MetLeptonTools::looseEleId(const Electron *iElectron,const PileupEnergyDensityCol* iPUEnergyDensity,
26                                  const PFCandidateCol *iCands,const Vertex *iPV,const VertexCol *iVertices) {
27 +  if(iElectron->SCluster()  == 0)    return false;  
28    if(iElectron->Pt()         < 9.5)  return false;
29    if(fabs(iElectron->Eta())  > 2.5)  return false;
30    if(fabs(iElectron->Eta()) > 1.4442 && fabs(iElectron->Eta()) < 1.566) return false;
31    //if(!fEleTools->PassSpikeRemovalFilter(iElectron)) return false;
32 <  //if(isConversion(iElectron))       return false;                                                                                                                                        
33 <  //if(iElectron->BestTrk()->D0Corrected(*iPV)     > 0.04 )    return false;                                                                                                              
34 <  //if(iElectron->BestTrk()->DzCorrected(*iPV)     > 0.2  )    return false;                                                                                                                
35 <  //if(!passEleMVA(iElectron ,iPUEnergyDensity,iCands,iPV)                             )    return false;                                                                                    
36 <  //if(isoDeltaBeta(iElectron,                 iCands,iPV,iVertices) > 0.30)    return false;                                                                                                
32 >  //if(isConversion(iElectron))       return false;                                                                                                                        
33 >  //if(iElectron->BestTrk()->D0Corrected(*iPV)     > 0.04 )    return false;                                                                                                
34 >  //if(iElectron->BestTrk()->DzCorrected(*iPV)     > 0.2  )    return false;                                                                                              
35 >  //if(!passEleMVA(iElectron ,iPUEnergyDensity,iCands,iPV)                             )    return false;                                                                  
36 >  //if(isoDeltaBeta(iElectron,                 iCands,iPV,iVertices) > 0.30)    return false;                                                                          
37    //return true;                                                                                                                                                                                    
38    
39    if(iElectron->GsfTrk() == 0) return false;
# Line 72 | Line 80 | bool MetLeptonTools::looseMuId(const Muo
80    if(iMu->IsoR03SumPt()/iMu->Pt()                > 0.2)         return false;
81    return true;
82   }
83 + bool MetLeptonTools::loosePhotonId(const Photon *iPhoton) {
84 +  if(iPhoton->Pt()        <   20)                                   return false;
85 +  if(fabs(iPhoton->Eta()) > 1.45)                                   return false;
86 +  if(iPhoton->HadOverEm() > 0.05)                                   return false;
87 +  if(iPhoton->CoviEtaiEta() > 0.01)                                 return false;
88 +  if(iPhoton->HollowConeTrkIsoDr04()    > (2.+0.002*iPhoton->Pt())) return false;
89 +  return true;
90 + }
91   double MetLeptonTools::vis(const PFTau *iTau) {
92    double lPtTot        = 0.;
93    double lChargedPtTot = 0.;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines