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.4 by pharris, Sat Jan 12 11:49:50 2013 UTC vs.
Revision 1.5 by pharris, Thu Mar 21 17:50:13 2013 UTC

# Line 8 | Line 8 | using namespace mithep;
8   ClassImp(mithep::MetLeptonTools)
9  
10   MetLeptonTools::MetLeptonTools() {
11 +  //fTauIsoMVA = new TauIsoMVA();
12 +  //fTauIsoMVA->Initialize(TString(getenv("CMSSW_BASE")+std::string("/src/MitPhysics/data/SXIsoMVA_BDTG.weights.xml")));
13    fTauIsoMVA = new TauIsoMVA();
14 <  fTauIsoMVA->Initialize(TString(getenv("CMSSW_BASE")+std::string("/src/MitPhysics/data/SXIsoMVA_BDTG.weights.xml")));
14 >  fTauIsoMVA->InitializeGBR(TString(getenv("CMSSW_BASE")+std::string("/src/MitPhysics/data/gbrfTauIso_v2.root")));
15   }
16  
17   bool MetLeptonTools::looseTauId(const PFTau *iTau,const PileupEnergyDensityCol* iPUEnergyDensity) {
# Line 17 | Line 19 | bool MetLeptonTools::looseTauId(const PF
19    if(fabs(iTau->Eta()) > fabs(2.3) )                                  return false;
20    if(!iTau->DiscriminationByDecayModeFinding())                       return false;
21    if(!iTau->DiscriminationByLooseElectronRejection())                 return false;
22 <  if(!iTau->DiscriminationByLooseMuonRejection())                     return false;
22 >  if(!iTau->LooseMuonRejection2())                                    return false;
23    //if(!iTau->DiscriminationByVLooseIsolation()   )                   return false;
24 <  if(fTauIsoMVA->MVAValue(iTau,iPUEnergyDensity->At(0)->Rho()) < 0.7) return false;
24 >  if(fTauIsoMVA->MVAValue(iTau,iPUEnergyDensity->At(0)->Rho()) < 0.8) return false;
25    return true;
26   }
27   bool MetLeptonTools::looseEleId(const Electron *iElectron,const PileupEnergyDensityCol* iPUEnergyDensity,
# Line 53 | Line 55 | bool MetLeptonTools::looseEleId(const El
55      double lP = iElectron->P();
56      if(fabs(1./lE-1./lP)                                 > 0.05 )    return false;
57    } else {
58 <    if(fabs(iElectron->DeltaEtaSuperClusterTrackAtVtx()) > 0.007)   return false;
59 <    if(fabs(iElectron->DeltaPhiSuperClusterTrackAtVtx()) > 0.03)    return false;
58 >    if(fabs(iElectron->DeltaEtaSuperClusterTrackAtVtx()) > 0.009)   return false;
59 >    if(fabs(iElectron->DeltaPhiSuperClusterTrackAtVtx()) > 0.10)    return false;
60      if(iElectron->CoviEtaiEta()                          > 0.03)    return false;
61      if(iElectron->HadronicOverEm()                       > 0.10)    return false;
62      double lE = iElectron->SCluster()->Energy();
# Line 75 | Line 77 | bool MetLeptonTools::looseMuId(const Muo
77    if(iMu->TrackerTrk()->NHits()                 < 6  )          return false;
78    if(iMu->NValidHits()                          < 1  )          return false;
79    if(iMu->NMatches()                            < 1  )          return false;
80 <  //if(PFIsolation(iMu,iCands)                    > 0.2)          return false;
80 >  if(PFIsolation(iMu,iCands)                    > 0.3)          return false;
81    //if(isoPV(iMu,iCands,iPV,iVertices)/iMu->Pt()   > 0.2)          return false;
82 <  if(iMu->IsoR03SumPt()/iMu->Pt()                > 0.2)         return false;
82 >  //if(iMu->IsoR03SumPt()/iMu->Pt()                > 0.2)         return false;
83    return true;
84   }
85   bool MetLeptonTools::loosePhotonId(const Photon *iPhoton) {
# Line 102 | Line 104 | Float_t MetLeptonTools::PFIsolation(cons
104    Double_t lPtSum = 0.;
105    for(UInt_t i0 = 0; i0 < iCands->GetEntries(); i0++) {
106      const PFCandidate *pCand = iCands->At(i0);
107 <    if(pCand->PFType() != PFCandidate::eHadron) continue;
108 <    Double_t pDR = MathUtils::DeltaR(iLep->Mom(), pCand->Mom());
109 <    if(pCand->Pt() < 0.5) continue;
110 <    if(pDR         < 0.015 && fabs(iLep->Eta()) > 1.56)   continue;
111 <    if(pDR         > 0.3)                                 continue;
107 >     Double_t pDR = MathUtils::DeltaR(iLep->Mom(), pCand->Mom());
108 >     if(pDR < 0.0001) continue;
109 >     if(pDR < 0.01 && (pCand->PFType() != PFCandidate::eNeutralHadron || pCand->PFType() != PFCandidate::eGamma)) continue;
110 >     if(pCand->Pt() < 0.5 && (pCand->PFType() != PFCandidate::eNeutralHadron || pCand->PFType() != PFCandidate::eGamma)) continue;
111 >     if(pCand->PFType() != PFCandidate::eNeutralHadron && pCand->PFType() != PFCandidate::eGamma && pCand->PFType() != PFCandidate::eHadron ) continue;
112 >     //if(pCand->PFType() != PFCandidate::eHadron) continue;
113 >     //if(pCand->Pt() < 0.5) continue;
114 >     //if(pDR         < 0.0001 && fabs(iLep->Eta()) > 1.56)   continue;
115 >     if(pDR         > 0.3)                                 continue;
116      lPtSum += pCand->Pt();
117    }
118 <  return lPtSum;
118 >  return lPtSum/iLep->Pt();
119   }
120   Float_t MetLeptonTools::isoPV(const ChargedParticle *iLep,const PFCandidateCol *iCands,
121                                const Vertex *iPV,const VertexCol *iVertices,bool iEle) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines