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) { |
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, |
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(); |
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) { |
86 |
> |
if(iPhoton->Pt() < 20) return false; |
87 |
> |
if(fabs(iPhoton->Eta()) > 1.45) return false; |
88 |
> |
if(iPhoton->HadOverEm() > 0.05) return false; |
89 |
> |
if(iPhoton->CoviEtaiEta() > 0.01) return false; |
90 |
> |
if(iPhoton->HollowConeTrkIsoDr04() > (2.+0.002*iPhoton->Pt())) return false; |
91 |
|
return true; |
92 |
|
} |
93 |
|
double MetLeptonTools::vis(const PFTau *iTau) { |
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) { |