CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonGmtPair Class Reference

#include <L1TMuonDQMOffline.h>

Public Member Functions

int charge () const
 
double dR ()
 
double eta () const
 
L1TMuonDQMOffline::EtaRegion etaRegion () const
 
double getDeltaVar (const L1TMuonDQMOffline::ResType) const
 
double getVar (const L1TMuonDQMOffline::EffType) const
 
int gmtCharge () const
 
double gmtEta () const
 
double gmtPhi () const
 
double gmtPt () const
 
int gmtQual () const
 
 MuonGmtPair (const reco::Muon *muon, const l1t::Muon *regMu, const PropagateToMuon &propagator, bool useAtVtxCoord)
 
 MuonGmtPair (const MuonGmtPair &muonGmtPair)
 
double phi () const
 
double pt () const
 
 ~MuonGmtPair ()
 

Private Attributes

double m_eta
 
double m_gmtEta
 
double m_gmtPhi
 
const reco::Muonm_muon
 
double m_phi
 
const l1t::Muonm_regMu
 

Detailed Description

Definition at line 172 of file L1TMuonDQMOffline.h.

Constructor & Destructor Documentation

MuonGmtPair::MuonGmtPair ( const reco::Muon muon,
const l1t::Muon regMu,
const PropagateToMuon propagator,
bool  useAtVtxCoord 
)

Definition at line 23 of file L1TMuonDQMOffline.cc.

References PV3DBase< T, PVType, FrameType >::eta(), reco::LeafCandidate::eta(), l1t::Muon::etaAtVtx(), PropagateToMuon::extrapolate(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), m_eta, m_gmtEta, m_gmtPhi, m_muon, m_phi, m_regMu, PV3DBase< T, PVType, FrameType >::phi(), reco::LeafCandidate::phi(), and l1t::Muon::phiAtVtx().

23  :
24  m_muon(muon), m_regMu(regMu)
25 {
26  if (m_regMu) {
27  if (useAtVtxCoord) {
30  } else {
31  m_gmtEta = m_regMu->eta();
32  m_gmtPhi = m_regMu->phi();
33  }
34  } else {
35  m_gmtEta = -5.;
36  m_gmtPhi = -5.;
37  }
38  if (m_muon) {
39  TrajectoryStateOnSurface trajectory = propagator.extrapolate(*m_muon);
40  if (trajectory.isValid()) {
41  m_eta = trajectory.globalPosition().eta();
42  m_phi = trajectory.globalPosition().phi();
43  } else {
44  m_eta = 999.;
45  m_phi = 999.;
46  }
47  } else {
48  m_eta = 999.;
49  m_phi = 999.;
50  }
51 };
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails.
double eta() const final
momentum pseudorapidity
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint globalPosition() const
const l1t::Muon * m_regMu
const reco::Muon * m_muon
double etaAtVtx() const
Definition: Muon.h:94
T eta() const
Definition: PV3DBase.h:76
double phiAtVtx() const
Definition: Muon.h:95
double phi() const final
momentum azimuthal angle
MuonGmtPair::MuonGmtPair ( const MuonGmtPair muonGmtPair)

Definition at line 53 of file L1TMuonDQMOffline.cc.

References m_eta, m_gmtEta, m_gmtPhi, m_muon, m_phi, and m_regMu.

53  {
54  m_muon = muonGmtPair.m_muon;
55  m_regMu = muonGmtPair.m_regMu;
56 
57  m_gmtEta = muonGmtPair.m_gmtEta;
58  m_gmtPhi = muonGmtPair.m_gmtPhi;
59 
60  m_eta = muonGmtPair.m_eta;
61  m_phi = muonGmtPair.m_phi;
62 }
const l1t::Muon * m_regMu
const reco::Muon * m_muon
MuonGmtPair::~MuonGmtPair ( )
inline

Definition at line 176 of file L1TMuonDQMOffline.h.

References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR.

176 { };

Member Function Documentation

int MuonGmtPair::charge ( ) const
inline

Definition at line 182 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

182 { return m_muon->charge(); };
int charge() const final
electric charge
Definition: LeafCandidate.h:91
const reco::Muon * m_muon
double MuonGmtPair::dR ( )

Definition at line 64 of file L1TMuonDQMOffline.cc.

References reco::deltaPhi(), particleFlow_cfi::dEta, particleFlow_cfi::dPhi, m_eta, m_gmtEta, m_gmtPhi, m_phi, m_regMu, and mathSSE::sqrt().

Referenced by L1TMuonDQMOffline::getMuonGmtPairs().

64  {
65  float dEta = m_regMu ? (m_gmtEta - m_eta) : 999.;
66  float dPhi = m_regMu ? reco::deltaPhi(m_gmtPhi, m_phi) : 999.;
67  return sqrt(dEta*dEta + dPhi*dPhi);
68 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
const l1t::Muon * m_regMu
T sqrt(T t)
Definition: SSEVec.h:18
double MuonGmtPair::eta ( ) const
inline

Definition at line 180 of file L1TMuonDQMOffline.h.

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

180 { return m_muon->eta(); };
double eta() const final
momentum pseudorapidity
const reco::Muon * m_muon
L1TMuonDQMOffline::EtaRegion MuonGmtPair::etaRegion ( ) const
double MuonGmtPair::getDeltaVar ( const L1TMuonDQMOffline::ResType  type) const

Definition at line 77 of file L1TMuonDQMOffline.cc.

References charge(), reco::deltaPhi(), gmtCharge(), gmtEta(), gmtPhi(), gmtPt(), L1TMuonDQMOffline::kRes1OverPt, L1TMuonDQMOffline::kResCh, L1TMuonDQMOffline::kResEta, L1TMuonDQMOffline::kResPhi, L1TMuonDQMOffline::kResPt, L1TMuonDQMOffline::kResQOverPt, m_eta, m_phi, and pt().

77  {
78  if (type == L1TMuonDQMOffline::kResPt) return (gmtPt() - pt()) / pt();
79  if (type == L1TMuonDQMOffline::kRes1OverPt) return (pt() - gmtPt()) / gmtPt(); // (1/gmtPt - 1/pt) / (1/pt)
80  if (type == L1TMuonDQMOffline::kResQOverPt) return (gmtCharge()*charge()*pt() - gmtPt()) / gmtPt(); // (gmtCharge/gmtPt - charge/pt) / (charge/pt) with gmtCharge/charge = gmtCharge*charge
82  if (type == L1TMuonDQMOffline::kResEta) return gmtEta() - m_eta;
83  if (type == L1TMuonDQMOffline::kResCh) return gmtCharge() - charge();
84  return -999.;
85 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
type
Definition: HCALResponse.h:21
double gmtPt() const
int gmtCharge() const
double gmtPhi() const
int charge() const
double pt() const
double gmtEta() const
double MuonGmtPair::getVar ( const L1TMuonDQMOffline::EffType  type) const
int MuonGmtPair::gmtCharge ( ) const
inline

Definition at line 186 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

186 {return m_regMu ? m_regMu->charge() : -5; };
int charge() const final
electric charge
Definition: LeafCandidate.h:91
const l1t::Muon * m_regMu
double MuonGmtPair::gmtEta ( ) const
inline

Definition at line 184 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

184 { return m_regMu ? m_gmtEta : -5.; };
const l1t::Muon * m_regMu
double MuonGmtPair::gmtPhi ( ) const
inline

Definition at line 185 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

185 { return m_regMu ? m_gmtPhi : -5.; };
const l1t::Muon * m_regMu
double MuonGmtPair::gmtPt ( ) const
inline

Definition at line 183 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

183 { return m_regMu ? m_regMu->pt() : -1.; };
double pt() const final
transverse momentum
const l1t::Muon * m_regMu
int MuonGmtPair::gmtQual ( ) const
inline

Definition at line 187 of file L1TMuonDQMOffline.h.

187 { return m_regMu ? m_regMu->hwQual() : -1; };
const l1t::Muon * m_regMu
int hwQual() const
Definition: L1Candidate.h:51
double MuonGmtPair::phi ( void  ) const
inline

Definition at line 181 of file L1TMuonDQMOffline.h.

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

181 { return m_muon->phi(); };
const reco::Muon * m_muon
double phi() const final
momentum azimuthal angle
double MuonGmtPair::pt ( ) const
inline

Member Data Documentation

double MuonGmtPair::m_eta
private

Definition at line 202 of file L1TMuonDQMOffline.h.

Referenced by dR(), etaRegion(), getDeltaVar(), getVar(), and MuonGmtPair().

double MuonGmtPair::m_gmtEta
private

Definition at line 199 of file L1TMuonDQMOffline.h.

Referenced by dR(), and MuonGmtPair().

double MuonGmtPair::m_gmtPhi
private

Definition at line 200 of file L1TMuonDQMOffline.h.

Referenced by dR(), and MuonGmtPair().

const reco::Muon* MuonGmtPair::m_muon
private

Definition at line 194 of file L1TMuonDQMOffline.h.

Referenced by MuonGmtPair().

double MuonGmtPair::m_phi
private

Definition at line 203 of file L1TMuonDQMOffline.h.

Referenced by dR(), getDeltaVar(), getVar(), and MuonGmtPair().

const l1t::Muon* MuonGmtPair::m_regMu
private

Definition at line 195 of file L1TMuonDQMOffline.h.

Referenced by dR(), and MuonGmtPair().