CMS 3D CMS Logo

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

#include <L1TPhase2MuonOffline.h>

Public Member Functions

int charge () const
 
float dR2 ()
 
float eta () const
 
L1TPhase2MuonOffline::EtaRegion etaRegion () const
 
 GenMuonGMTPair (const reco::GenParticle *mu, const l1t::L1Candidate *gmtmu)
 
 GenMuonGMTPair (const GenMuonGMTPair &muongmtPair)
 
double getDeltaVar (const L1TPhase2MuonOffline::ResType) const
 
double getVar (const L1TPhase2MuonOffline::EffType) const
 
int gmtCharge () const
 
float gmtEta () const
 
float gmtPhi () const
 
float gmtPt () const
 
int gmtQual () const
 
float phi () const
 
float pt () const
 
 ~GenMuonGMTPair ()
 

Private Attributes

float gmtEta_
 
const l1t::L1Candidategmtmu_
 
float gmtPhi_
 
const reco::GenParticlemu_
 
float muEta_
 
float muPhi_
 

Detailed Description

Definition at line 136 of file L1TPhase2MuonOffline.h.

Constructor & Destructor Documentation

◆ GenMuonGMTPair() [1/2]

GenMuonGMTPair::GenMuonGMTPair ( const reco::GenParticle mu,
const l1t::L1Candidate gmtmu 
)

Definition at line 19 of file L1TPhase2MuonOffline.cc.

References reco::LeafCandidate::eta(), gmtEta_, gmtmu_, gmtPhi_, mu_, muEta_, muPhi_, and reco::LeafCandidate::phi().

20  : mu_(muon), gmtmu_(gmtmu) {
21  if (gmtmu) {
22  gmtEta_ = gmtmu_->eta();
23  gmtPhi_ = gmtmu_->phi();
24  } else {
25  gmtEta_ = -5.;
26  gmtPhi_ = -5.;
27  }
28  if (mu_) {
29  muEta_ = mu_->eta();
30  muPhi_ = mu_->phi();
31  } else {
32  muEta_ = 999.;
33  muPhi_ = 999.;
34  }
35 };
const l1t::L1Candidate * gmtmu_
const reco::GenParticle * mu_
double phi() const final
momentum azimuthal angle
double eta() const final
momentum pseudorapidity

◆ GenMuonGMTPair() [2/2]

GenMuonGMTPair::GenMuonGMTPair ( const GenMuonGMTPair muongmtPair)

Definition at line 37 of file L1TPhase2MuonOffline.cc.

References gmtEta_, gmtmu_, gmtPhi_, mu_, muEta_, and muPhi_.

37  {
38  mu_ = muonGmtPair.mu_;
39  gmtmu_ = muonGmtPair.gmtmu_;
40 
41  gmtEta_ = muonGmtPair.gmtEta_;
42  gmtPhi_ = muonGmtPair.gmtPhi_;
43 
44  muEta_ = muonGmtPair.muEta_;
45  muPhi_ = muonGmtPair.muPhi_;
46 }
const l1t::L1Candidate * gmtmu_
const reco::GenParticle * mu_

◆ ~GenMuonGMTPair()

GenMuonGMTPair::~GenMuonGMTPair ( )
inline

Definition at line 140 of file L1TPhase2MuonOffline.h.

140 {};

Member Function Documentation

◆ charge()

int GenMuonGMTPair::charge ( ) const
inline

Definition at line 146 of file L1TPhase2MuonOffline.h.

References reco::LeafCandidate::charge(), and mu_.

Referenced by getDeltaVar().

146 { return mu_->charge(); };
const reco::GenParticle * mu_
int charge() const final
electric charge

◆ dR2()

float GenMuonGMTPair::dR2 ( )

Definition at line 48 of file L1TPhase2MuonOffline.cc.

References reco::deltaPhi(), HLT_2023v12_cff::dEta, HLT_2023v12_cff::dPhi, gmtEta_, gmtmu_, gmtPhi_, muEta_, and muPhi_.

Referenced by L1TPhase2MuonOffline::matchMuonsToGen().

48  {
49  if (!gmtmu_)
50  return 999.;
51  float dEta = gmtEta_ - muEta_;
53  return dEta * dEta + dPhi * dPhi;
54 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
const l1t::L1Candidate * gmtmu_

◆ eta()

float GenMuonGMTPair::eta ( ) const
inline

Definition at line 144 of file L1TPhase2MuonOffline.h.

References reco::LeafCandidate::eta(), and mu_.

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), Jet.Jet::jetID(), datamodel.Object::p4(), and Jet.Jet::puJetId().

144 { return mu_->eta(); };
const reco::GenParticle * mu_
double eta() const final
momentum pseudorapidity

◆ etaRegion()

L1TPhase2MuonOffline::EtaRegion GenMuonGMTPair::etaRegion ( ) const

◆ getDeltaVar()

double GenMuonGMTPair::getDeltaVar ( const L1TPhase2MuonOffline::ResType  type) const

Definition at line 66 of file L1TPhase2MuonOffline.cc.

References charge(), reco::deltaPhi(), gmtCharge(), gmtEta(), gmtPhi(), gmtPt(), L1TPhase2MuonOffline::kRes1OverPt, L1TPhase2MuonOffline::kResCh, L1TPhase2MuonOffline::kResEta, L1TPhase2MuonOffline::kResPhi, L1TPhase2MuonOffline::kResPt, L1TPhase2MuonOffline::kResQOverPt, muEta_, muPhi_, and pt().

66  {
68  return (gmtPt() - pt()) / pt();
70  return (pt() - gmtPt()) / gmtPt(); // (1/gmtPt - 1/pt) / (1/pt)
72  return (gmtCharge() * charge() * pt() - gmtPt()) /
73  gmtPt(); // (gmtCharge/gmtPt - charge/pt) / (charge/pt) with gmtCharge/charge = gmtCharge*charge
75  return reco::deltaPhi(gmtPhi(), muPhi_);
77  return gmtEta() - muEta_;
79  return gmtCharge() - charge();
80  return -999.;
81 }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
float gmtEta() const
float gmtPhi() const

◆ getVar()

double GenMuonGMTPair::getVar ( const L1TPhase2MuonOffline::EffType  type) const

◆ gmtCharge()

int GenMuonGMTPair::gmtCharge ( ) const
inline

Definition at line 152 of file L1TPhase2MuonOffline.h.

References reco::LeafCandidate::charge(), and gmtmu_.

Referenced by getDeltaVar().

152 { return gmtmu_ ? gmtmu_->charge() : -5; };
const l1t::L1Candidate * gmtmu_
int charge() const final
electric charge

◆ gmtEta()

float GenMuonGMTPair::gmtEta ( ) const
inline

Definition at line 150 of file L1TPhase2MuonOffline.h.

References gmtEta_, and gmtmu_.

Referenced by getDeltaVar().

150 { return gmtmu_ ? gmtEta_ : -5.; };
const l1t::L1Candidate * gmtmu_

◆ gmtPhi()

float GenMuonGMTPair::gmtPhi ( ) const
inline

Definition at line 151 of file L1TPhase2MuonOffline.h.

References gmtmu_, and gmtPhi_.

Referenced by getDeltaVar().

151 { return gmtmu_ ? gmtPhi_ : -5.; };
const l1t::L1Candidate * gmtmu_

◆ gmtPt()

float GenMuonGMTPair::gmtPt ( ) const
inline

Definition at line 149 of file L1TPhase2MuonOffline.h.

References gmtmu_, and reco::LeafCandidate::pt().

Referenced by getDeltaVar().

149 { return gmtmu_ ? gmtmu_->pt() : -1.; };
double pt() const final
transverse momentum
const l1t::L1Candidate * gmtmu_

◆ gmtQual()

int GenMuonGMTPair::gmtQual ( ) const
inline

Definition at line 153 of file L1TPhase2MuonOffline.h.

References gmtmu_, and l1t::L1Candidate::hwQual().

153 { return gmtmu_ ? gmtmu_->hwQual() : -1; };
const l1t::L1Candidate * gmtmu_
int hwQual() const
Definition: L1Candidate.h:38

◆ phi()

float GenMuonGMTPair::phi ( void  ) const
inline

Definition at line 145 of file L1TPhase2MuonOffline.h.

References mu_, and reco::LeafCandidate::phi().

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), datamodel.Object::p4(), and ntupleDataFormat.Track::phiPull().

145 { return mu_->phi(); };
const reco::GenParticle * mu_
double phi() const final
momentum azimuthal angle

◆ pt()

float GenMuonGMTPair::pt ( ) const
inline

Member Data Documentation

◆ gmtEta_

float GenMuonGMTPair::gmtEta_
private

Definition at line 165 of file L1TPhase2MuonOffline.h.

Referenced by dR2(), GenMuonGMTPair(), and gmtEta().

◆ gmtmu_

const l1t::L1Candidate* GenMuonGMTPair::gmtmu_
private

Definition at line 161 of file L1TPhase2MuonOffline.h.

Referenced by dR2(), GenMuonGMTPair(), gmtCharge(), gmtEta(), gmtPhi(), gmtPt(), and gmtQual().

◆ gmtPhi_

float GenMuonGMTPair::gmtPhi_
private

Definition at line 166 of file L1TPhase2MuonOffline.h.

Referenced by dR2(), GenMuonGMTPair(), and gmtPhi().

◆ mu_

const reco::GenParticle* GenMuonGMTPair::mu_
private

Definition at line 160 of file L1TPhase2MuonOffline.h.

Referenced by charge(), eta(), GenMuonGMTPair(), phi(), and pt().

◆ muEta_

float GenMuonGMTPair::muEta_
private

Definition at line 168 of file L1TPhase2MuonOffline.h.

Referenced by dR2(), etaRegion(), GenMuonGMTPair(), getDeltaVar(), and getVar().

◆ muPhi_

float GenMuonGMTPair::muPhi_
private

Definition at line 169 of file L1TPhase2MuonOffline.h.

Referenced by dR2(), GenMuonGMTPair(), getDeltaVar(), and getVar().