30 float chiso = 0, nhiso = 0, phiso = 0, puiso = 0;
31 float drcut =
miniIsoDr(p4, mindr, maxdr, kt_scale);
32 for (
auto const &pc : *pfcands) {
34 if (dr2 > drcut * drcut)
36 float pt = pc.p4().pt();
39 bool fromPV = (pc.fromPV() > 1 || fabs(pc.dz()) < dZ_cut);
40 if (fromPV && dr2 > deadcone_ch * deadcone_ch) {
43 }
else if (!fromPV && pt > ptthresh && dr2 > deadcone_pu * deadcone_pu) {
49 if (
std::abs(
id) == 130 && pt > ptthresh && dr2 > deadcone_nh * deadcone_nh)
52 if (
std::abs(
id) == 22 && pt > ptthresh && dr2 > deadcone_ph * deadcone_ph)
64 const std::vector<double> &
area) {
68 if (absEta<0.800) ea = area.at(0);
69 else if (absEta<1.300) ea = area.at(1);
70 else if (absEta<2.000) ea = area.at(2);
71 else if (absEta<2.200) ea = area.at(3);
72 else if (absEta<2.500) ea = area.at(4);
74 double correction = rho * ea * (dr/0.3) * (dr/0.3);
76 return correctedIso/p4.pt();
std::vector< pat::PackedCandidate > PackedCandidateCollection
double muonRelMiniIsoPUCorrected(const PFIsolation &iso, const reco::Candidate::PolarLorentzVector &p4, double dr, double rho, const std::vector< double > &area)
Abs< T >::type abs(const T &t)
float miniIsoDr(const reco::Candidate::PolarLorentzVector &p4, float mindr, float maxdr, float kt_scale)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
PFIsolation getMiniPFIsolation(const pat::PackedCandidateCollection *pfcands, const reco::Candidate::PolarLorentzVector &p4, float mindr=0.05, float maxdr=0.2, float kt_scale=10.0, float ptthresh=0.5, float deadcone_ch=0.0001, float deadcone_pu=0.01, float deadcone_ph=0.01, float deadcone_nh=0.01, float dZ_cut=0.0)
float chargedHadronIso() const
float neutralHadronIso() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.