CMS 3D CMS Logo

Functions
MuonMvaEstimator.cc File Reference
#include "PhysicsTools/PatAlgos/interface/MuonMvaEstimator.h"
#include "DataFormats/MuonReco/interface/MuonSelectors.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/JetReco/interface/PFJet.h"
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "JetMETCorrections/JetCorrector/interface/JetCorrector.h"

Go to the source code of this file.

Functions

float ptRel (const reco::Candidate::LorentzVector &muP4, const reco::Candidate::LorentzVector &jetP4, bool subtractMuon=true)
 

Function Documentation

float ptRel ( const reco::Candidate::LorentzVector muP4,
const reco::Candidate::LorentzVector jetP4,
bool  subtractMuon = true 
)

Definition at line 39 of file MuonMvaEstimator.cc.

References dot(), and mathSSE::sqrt().

Referenced by B2GDQM::analyzeSemiE(), B2GDQM::analyzeSemiMu(), pat::MuonMvaEstimator::computeMva(), and LeptonJetVarProducer< T >::produce().

42 {
44  if (subtractMuon) jp4-=muP4;
45  float dot = muP4.Vect().Dot( jp4.Vect() );
46  float ptrel = muP4.P2() - dot*dot/jp4.P2();
47  ptrel = ptrel>0 ? sqrt(ptrel) : 0.0;
48  return ptrel;
49 }
T sqrt(T t)
Definition: SSEVec.h:18
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.