22 float kt_scale,
float ptthresh,
float deadcone_ch,
23 float deadcone_pu,
float deadcone_ph,
float deadcone_nh,
27 float chiso=0, nhiso=0, phiso=0, puiso=0;
28 float drcut =
miniIsoDr(p4,mindr,maxdr,kt_scale);
29 for(
auto const & pc : *pfcands){
33 float pt = pc.p4().pt();
36 bool fromPV = (pc.fromPV()>1 || fabs(pc.dz()) < dZ_cut);
37 if(fromPV && dr > deadcone_ch){
40 }
else if(!fromPV && pt > ptthresh && dr > deadcone_pu){
46 if(
std::abs(
id)==130 && pt>ptthresh && dr>deadcone_nh)
49 if(
std::abs(
id)==22 && pt>ptthresh && dr>deadcone_ph)
63 double absEta = fabs(p4.eta());
66 if (absEta<0.800) ea = 0.0735;
67 else if (absEta<1.300) ea = 0.0619;
68 else if (absEta<2.000) ea = 0.0465;
69 else if (absEta<2.200) ea = 0.0433;
70 else if (absEta<2.500) ea = 0.0577;
71 double correction = rho * ea * (dr/0.3) * (dr/0.3);
73 return correctedIso/p4.pt();
float muonRelMiniIsoPUCorrected(const PFIsolation &iso, const math::XYZTLorentzVector &p4, float dr, float rho)
std::vector< pat::PackedCandidate > PackedCandidateCollection
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Abs< T >::type abs(const T &t)
double deltaR(double eta1, double eta2, double phi1, double phi2)
PFIsolation getMiniPFIsolation(const pat::PackedCandidateCollection *pfcands, const math::XYZTLorentzVector &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 miniIsoDr(const math::XYZTLorentzVector &p4, float mindr, float maxdr, float kt_scale)
float chargedHadronIso() const
float neutralHadronIso() const