18 bool subtractMuon =
true) {
22 float dot = muP4.Vect().Dot(jp4.Vect());
23 float ptrel = muP4.P2() -
dot *
dot / jp4.P2();
24 ptrel = ptrel > 0 ?
sqrt(ptrel) : 0.0;
35 double jecL1L2L3Res = 1.;
39 const float chIso =
muon.pfIsolationR04().sumChargedHadronPt;
40 const float nIso =
muon.pfIsolationR04().sumNeutralHadronEt;
41 const float phoIso =
muon.pfIsolationR04().sumPhotonEt;
42 const float puIso =
muon.pfIsolationR04().sumPUPt;
43 const float dbCorrectedIsolation = chIso +
std::max(nIso + phoIso - .5
f * puIso, 0.
f);
44 const float dbCorrectedRelIso = dbCorrectedIsolation /
muon.pt();
46 float JetPtRatio = 1. / (1 + dbCorrectedRelIso);
50 for (
const auto& tagI :
bTags) {
59 if (correctorL1 && correctorL1L2L3Res) {
60 jecL1L2L3Res = correctorL1L2L3Res->
correction(*(tagI.first));
61 jecL1 = correctorL1->
correction(*(tagI.first));
65 if ((jetP4 - muP4).Rho() < 0.0001) {
69 jetP4 -= muP4 / jecL1;
70 jetP4 *= jecL1L2L3Res;
73 JetPtRatio = muP4.pt() / jetP4.pt();
74 JetPtRel =
ptRel(muP4, jetP4);
82 std::array<float, 2>
outputs = {{JetPtRatio, JetPtRel}};
CalculatePtRatioRel(float dR2max)
double correction(const LorentzVector &fJet) const
get correction using Jet information only
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::array< float, 2 > computePtRatioRel(const pat::Muon &imuon, const reco::JetTagCollection &bTags, const reco::JetCorrector *correctorL1=nullptr, const reco::JetCorrector *correctorL1L2L3Res=nullptr) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.