38 kSegmentCompatibility,
43 bool subtractMuon=
true)
46 if (subtractMuon) jp4-=muP4;
47 float dot = muP4.Vect().Dot( jp4.Vect() );
48 float ptrel = muP4.P2() - dot*dot/jp4.P2();
49 ptrel = ptrel>0 ?
sqrt(ptrel) : 0.0;
70 var[kMiniRelIsoNeutral] = miniIsoValue -
var[kMiniRelIsoCharged];
76 var[kSip] = edB3D>0?fabs(dB3D/edB3D):0.0;
77 var[kLog_abs_dxyBS] = dB2D>0?
log(dB2D):0;
78 var[kLog_abs_dzPV] = dz>0?
log(dz):0;
82 double jecL1L2L3Res = 1.;
90 double dbCorrectedIsolation = chIso +
std::max( nIso + phoIso - .5*puIso, 0. ) ;
91 double dbCorrectedRelIso = dbCorrectedIsolation/muon.
pt();
93 var[kJetPtRatio] = 1./(1+dbCorrectedRelIso);
95 var[kJetBTagCSV] = -999;
96 var[kJetNDauCharged] = -1;
99 for (
const auto& tagI: bTags){
101 double dr =
deltaR(*(tagI.first), muon);
102 if(dr > minDr)
continue;
108 if (correctorL1 && correctorL1L2L3Res){
109 jecL1L2L3Res = correctorL1L2L3Res->
correction(*(tagI.first));
110 jecL1 = correctorL1->
correction(*(tagI.first));
114 var[kJetBTagCSV] = tagI.second;
115 var[kJetNDauCharged] = 0;
116 for (
auto jet: tagI.first->getJetConstituentsQuick()){
118 if (pfcand==
nullptr)
throw cms::Exception(
"ConfigurationError") <<
"Cannot get jet constituents";
119 if (pfcand->
charge()==0)
continue;
121 if (!bestTrackPtr)
continue;
123 if (bestTrackPtr->pt()<1.)
continue;
124 if (bestTrackPtr->hitPattern().numberOfValidHits()<8)
continue;
125 if (bestTrackPtr->hitPattern().numberOfValidPixelHits()<2)
continue;
126 if (bestTrackPtr->normalizedChi2()>=5)
continue;
128 if (std::fabs(bestTrackPtr->dxy(vertex.
position())) > 0.2)
continue;
129 if (std::fabs(bestTrackPtr->dz(vertex.
position())) > 17)
continue;
130 var[kJetNDauCharged]++;
134 if ((jetP4-muP4).Rho()<0.0001){
136 var[kJetPtRatio] = 1;
139 jetP4 *= jecL1L2L3Res;
142 var[kJetPtRatio] = muP4.
pt()/jetP4.pt();
143 var[kJetPtRel] =
ptRel(muP4,jetP4);
148 if (var[kJetPtRatio] > 1.5) var[kJetPtRatio] = 1.5;
149 if (var[kJetBTagCSV] < 0) var[kJetBTagCSV] = 0;
150 jetPtRatio = var[kJetPtRatio];
151 jetPtRel = var[kJetPtRel];
double eta() const final
momentum pseudorapidity
example_track example_track const char *const kPt
float computeMva(const pat::Muon &imuon, const reco::Vertex &vertex, const reco::JetTagCollection &bTags, float &jetPtRatio, float &jetPtRel, float &miniIsoValue, const reco::JetCorrector *correctorL1=0, const reco::JetCorrector *correctorL1L2L3Res=0) const
double dB(IPTYPE type) const
double pt() const final
transverse momentum
int charge() const final
electric charge
double correction(const LorentzVector &fJet) const
get correction using Jet information only
MuonMvaEstimator(const edm::FileInPath &weightsfile, float dRmax)
float sumPhotonEt
sum pt of PF photons
const Point & position() const
position
float sumNeutralHadronEt
sum pt of neutral hadrons
const PFIsolation & miniPFIsolation() const
double segmentCompatibility(reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration) const
Returns the segment compatibility, using muon::segmentCompatibility (DataFormats/MuonReco/interface/M...
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
double pt() const
track transverse momentum
const LorentzVector & p4() const final
four-momentum Lorentz vector
double edB(IPTYPE type) const
const MuonPFIsolation & pfIsolationR04() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::unique_ptr< const GBRForest > gbrForest_
reco::TrackRef muonBestTrack() const override
Track selected to be the best measurement of the muon parameters (including PFlow global information)...
float chargedHadronIso() const
Analysis-level muon class.
const reco::Track * bestTrack() const override
float sumChargedHadronPt
sum-pt of charged Hadron