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;
74 var[kSip] = edB3D>0?fabs(dB3D/edB3D):0.0;
75 var[kLog_abs_dxyBS] = dB2D>0?
log(dB2D):0;
76 var[kLog_abs_dzPV] = dz>0?
log(dz):0;
80 double jecL1L2L3Res = 1.;
88 double dbCorrectedIsolation = chIso +
std::max( nIso + phoIso - .5*puIso, 0. ) ;
89 double dbCorrectedRelIso = dbCorrectedIsolation/muon.
pt();
91 var[kJetPtRatio] = 1./(1+dbCorrectedRelIso);
93 var[kJetBTagCSV] = -999;
94 var[kJetNDauCharged] = -1;
97 for (
const auto& tagI: bTags){
99 double dr =
deltaR(*(tagI.first), muon);
100 if(dr > minDr)
continue;
106 if (correctorL1 && correctorL1L2L3Res){
107 jecL1L2L3Res = correctorL1L2L3Res->
correction(*(tagI.first));
108 jecL1 = correctorL1->
correction(*(tagI.first));
112 var[kJetBTagCSV] = tagI.second;
113 var[kJetNDauCharged] = 0;
114 for (
auto jet: tagI.first->getJetConstituentsQuick()){
116 if (pfcand==
nullptr)
throw cms::Exception(
"ConfigurationError") <<
"Cannot get jet constituents";
117 if (pfcand->
charge()==0)
continue;
119 if (!bestTrackPtr)
continue;
121 if (bestTrackPtr->pt()<1.)
continue;
122 if (bestTrackPtr->hitPattern().numberOfValidHits()<8)
continue;
123 if (bestTrackPtr->hitPattern().numberOfValidPixelHits()<2)
continue;
124 if (bestTrackPtr->normalizedChi2()>=5)
continue;
126 if (std::fabs(bestTrackPtr->dxy(vertex.
position())) > 0.2)
continue;
127 if (std::fabs(bestTrackPtr->dz(vertex.
position())) > 17)
continue;
128 var[kJetNDauCharged]++;
132 if ((jetP4-muP4).Rho()<0.0001){
134 var[kJetPtRatio] = 1;
137 jetP4 *= jecL1L2L3Res;
140 var[kJetPtRatio] = muP4.pt()/jetP4.pt();
146 if (
var[kJetPtRatio] > 1.5)
var[kJetPtRatio] = 1.5;
147 if (
var[kJetBTagCSV] < 0)
var[kJetBTagCSV] = 0;
148 jetPtRatio =
var[kJetPtRatio];
149 jetPtRel =
var[kJetPtRel];
double eta() const final
momentum pseudorapidity
example_track example_track const char *const kPt
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)
const LorentzVector & p4() const final
four-momentum Lorentz vector
double edB(IPTYPE type) const
float computeMva(const pat::Muon &imuon, const reco::Vertex &vertex, const reco::JetTagCollection &bTags, float &jetPtRatio, float &jetPtRel, const reco::JetCorrector *correctorL1=0, const reco::JetCorrector *correctorL1L2L3Res=0) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
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 neutralHadronIso() const
float sumChargedHadronPt
sum-pt of charged Hadron