CMS 3D CMS Logo

List of all members | Public Member Functions | Private 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, bool useAtVtxCoord)
 
 MuonGmtPair (const MuonGmtPair &muonGmtPair)
 
double phi () const
 
void propagate (edm::ESHandle< MagneticField > bField, edm::ESHandle< Propagator > propagatorAlong, edm::ESHandle< Propagator > propagatorOpposite)
 
double pt () const
 
 ~MuonGmtPair ()
 

Private Member Functions

TrajectoryStateOnSurface cylExtrapTrkSam (reco::TrackRef track, double rho)
 
FreeTrajectoryState freeTrajStateMuon (reco::TrackRef track)
 
TrajectoryStateOnSurface surfExtrapTrkSam (reco::TrackRef track, double z)
 

Private Attributes

edm::ESHandle< MagneticFieldm_BField
 
double m_eta
 
double m_gmtEta
 
double m_gmtPhi
 
const reco::Muonm_muon
 
double m_phi_bar
 
double m_phi_end
 
edm::ESHandle< Propagatorm_propagatorAlong
 
edm::ESHandle< Propagatorm_propagatorOpposite
 
const l1t::Muonm_regMu
 

Detailed Description

Definition at line 177 of file L1TMuonDQMOffline.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file L1TMuonDQMOffline.cc.

References reco::LeafCandidate::eta(), l1t::Muon::etaAtVtx(), m_gmtEta, m_gmtPhi, m_regMu, reco::LeafCandidate::phi(), and l1t::Muon::phiAtVtx().

25  :
26  m_muon(muon), m_regMu(regMu), m_eta(999.), m_phi_bar(999.), m_phi_end(999.)
27 {
28  if (m_regMu) {
29  if (useAtVtxCoord) {
32  } else {
33  m_gmtEta = m_regMu->eta();
34  m_gmtPhi = m_regMu->phi();
35  }
36  } else {
37  m_gmtEta = -5.;
38  m_gmtPhi = -5.;
39  }
40 };
double eta() const final
momentum pseudorapidity
const l1t::Muon * m_regMu
const reco::Muon * m_muon
double etaAtVtx() const
Definition: Muon.h:94
double phiAtVtx() const
Definition: Muon.h:95
double phi() const final
momentum azimuthal angle
MuonGmtPair::MuonGmtPair ( const MuonGmtPair muonGmtPair)

Definition at line 42 of file L1TMuonDQMOffline.cc.

References m_eta, m_gmtEta, m_gmtPhi, m_muon, m_phi_bar, m_phi_end, and m_regMu.

42  {
43  m_muon = muonGmtPair.m_muon;
44  m_regMu = muonGmtPair.m_regMu;
45 
46  m_gmtEta = muonGmtPair.m_gmtEta;
47  m_gmtPhi = muonGmtPair.m_gmtPhi;
48 
49  m_eta = muonGmtPair.m_eta;
50  m_phi_bar = muonGmtPair.m_phi_bar;
51  m_phi_end = muonGmtPair.m_phi_end;
52 }
const l1t::Muon * m_regMu
const reco::Muon * m_muon
MuonGmtPair::~MuonGmtPair ( )
inline

Definition at line 181 of file L1TMuonDQMOffline.h.

References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR.

181 { };

Member Function Documentation

int MuonGmtPair::charge ( ) const
inline

Definition at line 187 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

187 { return m_muon->charge(); };
int charge() const final
electric charge
Definition: LeafCandidate.h:91
const reco::Muon * m_muon
TrajectoryStateOnSurface MuonGmtPair::cylExtrapTrkSam ( reco::TrackRef  track,
double  rho 
)
private

Definition at line 109 of file L1TMuonDQMOffline.cc.

References Cylinder::build(), freeTrajStateMuon(), TrajectoryStateOnSurface::isValid(), m_propagatorAlong, m_propagatorOpposite, Propagator::propagate(), and makeMuonMisalignmentScenario::rot.

Referenced by propagate().

110 {
111  Cylinder::PositionType pos(0, 0, 0);
113  Cylinder::CylinderPointer myCylinder = Cylinder::build(pos, rot, rho);
114 
115  FreeTrajectoryState recoStart = freeTrajStateMuon(track);
116  TrajectoryStateOnSurface recoProp;
117  recoProp = m_propagatorAlong->propagate(recoStart, *myCylinder);
118  if (!recoProp.isValid()) {
119  recoProp = m_propagatorOpposite->propagate(recoStart, *myCylinder);
120  }
121  return recoProp;
122 }
edm::ESHandle< Propagator > m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorAlong
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
double MuonGmtPair::dR ( )

Definition at line 54 of file L1TMuonDQMOffline.cc.

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

Referenced by L1TMuonDQMOffline::getMuonGmtPairs().

54  {
55  float dEta = m_regMu ? (m_gmtEta - eta()) : 999.;
56  float dPhi = m_regMu ? reco::deltaPhi(m_gmtPhi, phi()) : 999.;
57  return sqrt(dEta*dEta + dPhi*dPhi);
58 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
const l1t::Muon * m_regMu
double phi() const
T sqrt(T t)
Definition: SSEVec.h:18
double eta() const
double MuonGmtPair::eta ( ) const
inline

Definition at line 185 of file L1TMuonDQMOffline.h.

Referenced by Particle.Particle::__str__(), dR(), etaRegion(), getDeltaVar(), getVar(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

185 { return m_muon->eta(); };
double eta() const final
momentum pseudorapidity
const reco::Muon * m_muon
L1TMuonDQMOffline::EtaRegion MuonGmtPair::etaRegion ( ) const
FreeTrajectoryState MuonGmtPair::freeTrajStateMuon ( reco::TrackRef  track)
private

Definition at line 139 of file L1TMuonDQMOffline.cc.

References m_BField.

Referenced by cylExtrapTrkSam(), and surfExtrapTrkSam().

140 {
141  GlobalPoint innerPoint(track->innerPosition().x(), track->innerPosition().y(), track->innerPosition().z());
142  GlobalVector innerVec (track->innerMomentum().x(), track->innerMomentum().y(), track->innerMomentum().z());
143  FreeTrajectoryState recoStart(innerPoint, innerVec, track->charge(), &*m_BField);
144  return recoStart;
145 }
edm::ESHandle< MagneticField > m_BField
double MuonGmtPair::getDeltaVar ( const L1TMuonDQMOffline::ResType  type) const

Definition at line 92 of file L1TMuonDQMOffline.cc.

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

92  {
93  if (type == L1TMuonDQMOffline::kResPt) return (gmtPt() - pt()) / pt();
94  if (type == L1TMuonDQMOffline::kRes1OverPt) return (pt() - gmtPt()) / gmtPt(); // (1/gmtPt - 1/pt) / (1/pt)
95  if (type == L1TMuonDQMOffline::kResQOverPt) return (gmtCharge()*charge()*pt() - gmtPt()) / gmtPt(); // (gmtCharge/gmtPt - charge/pt) / (charge/pt) with gmtCharge/charge = gmtCharge*charge
97  if (type == L1TMuonDQMOffline::kResEta) return gmtEta() - eta();
98  if (type == L1TMuonDQMOffline::kResCh) return gmtCharge() - charge();
99  return -999.;
100 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
type
Definition: HCALResponse.h:21
double gmtPt() const
int gmtCharge() const
double phi() const
double gmtPhi() const
int charge() const
double eta() const
double pt() const
double gmtEta() const
double MuonGmtPair::getVar ( const L1TMuonDQMOffline::EffType  type) const
int MuonGmtPair::gmtCharge ( ) const
inline

Definition at line 191 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

191 {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 189 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

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

Definition at line 190 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

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

Definition at line 188 of file L1TMuonDQMOffline.h.

Referenced by getDeltaVar().

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

Definition at line 186 of file L1TMuonDQMOffline.h.

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

186 { return m_muon->phi(); };
const reco::Muon * m_muon
double phi() const final
momentum azimuthal angle
void MuonGmtPair::propagate ( edm::ESHandle< MagneticField bField,
edm::ESHandle< Propagator propagatorAlong,
edm::ESHandle< Propagator propagatorOpposite 
)

Definition at line 60 of file L1TMuonDQMOffline.cc.

References ecalTB2006H4_GenSimDigiReco_cfg::bField, cylExtrapTrkSam(), PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), m_BField, m_eta, m_muon, m_phi_bar, m_phi_end, m_propagatorAlong, m_propagatorOpposite, reco::Muon::outerTrack(), PV3DBase< T, PVType, FrameType >::phi(), gsfElectronCkfTrackCandidateMaker_cff::propagatorAlong, gsfElectronCkfTrackCandidateMaker_cff::propagatorOpposite, and surfExtrapTrkSam().

62  {
63  m_BField = bField;
66  TrackRef standaloneMuon = m_muon->outerTrack();
67  TrajectoryStateOnSurface trajectory;
68  trajectory = cylExtrapTrkSam(standaloneMuon, 500); // track at MB2 radius - extrapolation
69  if (trajectory.isValid()) {
70  m_eta = trajectory.globalPosition().eta();
71  m_phi_bar = trajectory.globalPosition().phi();
72  }
73  trajectory = surfExtrapTrkSam(standaloneMuon, 790); // track at ME2+ plane - extrapolation
74  if (trajectory.isValid()) {
75  m_eta = trajectory.globalPosition().eta();
76  m_phi_end = trajectory.globalPosition().phi();
77  }
78  trajectory = surfExtrapTrkSam(standaloneMuon, -790); // track at ME2- disk - extrapolation
79  if (trajectory.isValid()) {
80  m_eta = trajectory.globalPosition().eta();
81  m_phi_end = trajectory.globalPosition().phi();
82  }
83 }
edm::ESHandle< Propagator > m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorAlong
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint globalPosition() const
edm::ESHandle< MagneticField > m_BField
TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho)
const reco::Muon * m_muon
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:51
TrajectoryStateOnSurface surfExtrapTrkSam(reco::TrackRef track, double z)
T eta() const
Definition: PV3DBase.h:76
double MuonGmtPair::pt ( ) const
inline
TrajectoryStateOnSurface MuonGmtPair::surfExtrapTrkSam ( reco::TrackRef  track,
double  z 
)
private

Definition at line 124 of file L1TMuonDQMOffline.cc.

References Plane::build(), freeTrajStateMuon(), TrajectoryStateOnSurface::isValid(), m_propagatorAlong, m_propagatorOpposite, Propagator::propagate(), and makeMuonMisalignmentScenario::rot.

Referenced by propagate().

125 {
126  Plane::PositionType pos(0, 0, z);
128  Plane::PlanePointer myPlane = Plane::build(pos, rot);
129 
130  FreeTrajectoryState recoStart = freeTrajStateMuon(track);
131  TrajectoryStateOnSurface recoProp;
132  recoProp = m_propagatorAlong->propagate(recoStart, *myPlane);
133  if (!recoProp.isValid()) {
134  recoProp = m_propagatorOpposite->propagate(recoStart, *myPlane);
135  }
136  return recoProp;
137 }
edm::ESHandle< Propagator > m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorAlong
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53

Member Data Documentation

edm::ESHandle<MagneticField> MuonGmtPair::m_BField
private

Definition at line 212 of file L1TMuonDQMOffline.h.

Referenced by freeTrajStateMuon(), and propagate().

double MuonGmtPair::m_eta
private

Definition at line 221 of file L1TMuonDQMOffline.h.

Referenced by MuonGmtPair(), and propagate().

double MuonGmtPair::m_gmtEta
private

Definition at line 218 of file L1TMuonDQMOffline.h.

Referenced by dR(), and MuonGmtPair().

double MuonGmtPair::m_gmtPhi
private

Definition at line 219 of file L1TMuonDQMOffline.h.

Referenced by dR(), and MuonGmtPair().

const reco::Muon* MuonGmtPair::m_muon
private

Definition at line 209 of file L1TMuonDQMOffline.h.

Referenced by MuonGmtPair(), and propagate().

double MuonGmtPair::m_phi_bar
private

Definition at line 222 of file L1TMuonDQMOffline.h.

Referenced by MuonGmtPair(), and propagate().

double MuonGmtPair::m_phi_end
private

Definition at line 223 of file L1TMuonDQMOffline.h.

Referenced by MuonGmtPair(), and propagate().

edm::ESHandle<Propagator> MuonGmtPair::m_propagatorAlong
private

Definition at line 213 of file L1TMuonDQMOffline.h.

Referenced by cylExtrapTrkSam(), propagate(), and surfExtrapTrkSam().

edm::ESHandle<Propagator> MuonGmtPair::m_propagatorOpposite
private

Definition at line 214 of file L1TMuonDQMOffline.h.

Referenced by cylExtrapTrkSam(), propagate(), and surfExtrapTrkSam().

const l1t::Muon* MuonGmtPair::m_regMu
private

Definition at line 210 of file L1TMuonDQMOffline.h.

Referenced by dR(), and MuonGmtPair().