CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
L1MuRegionalCand Class Reference

#include <L1MuRegionalCand.h>

Inheritance diagram for L1MuRegionalCand:
csc::L1Track L1MuDTTrack L1MuDTTrackCand

Public Types

enum  { PHI_START = 0 }
 
enum  { PHI_LENGTH = 8 }
 
enum  { PT_START = 8 }
 
enum  { PT_LENGTH = 5 }
 
enum  { QUAL_START = 13 }
 
enum  { QUAL_LENGTH = 3 }
 
enum  { ETA_START = 16 }
 
enum  { ETA_LENGTH = 6 }
 
enum  { FINEHALO_START = 22 }
 
enum  { FINEHALO_LENGTH = 1 }
 
enum  { CHARGE_START = 23 }
 
enum  { CHARGE_LENGTH = 1 }
 
enum  { CHVALID_START = 24 }
 
enum  { CHVALID_LENGTH = 1 }
 
enum  { TYPE_START = 30 }
 
enum  { TYPE_LENGTH = 2 }
 

Public Member Functions

int bx () const
 return bunch crossing identifier More...
 
unsigned charge_packed () const
 return charge packed as in hardware (0=pos, 1=neg) More...
 
unsigned charge_valid_packed () const
 return charge valid packed as in hardware (1=valid, 0=not valid) More...
 
bool chargeValid () const
 is the charge valid ? More...
 
int chargeValue () const
 get charge More...
 
virtual bool empty () const
 return empty flag More...
 
unsigned eta_packed () const
 return eta packed as in hardware More...
 
float etaValue () const
 get eta-value of muon candidate More...
 
unsigned finehalo_packed () const
 return eta-fine (for DT) / halo (for CSC) bit More...
 
unsigned getDataWord () const
 return data word More...
 
bool isFineHalo () const
 is it fine (DT) / halo (CSC) ? More...
 
 L1MuRegionalCand (unsigned dataword=0, int bx=0)
 constructor from data word More...
 
 L1MuRegionalCand (unsigned type_idx, unsigned phi, unsigned eta, unsigned pt, unsigned charge, unsigned ch_valid, unsigned finehalo, unsigned quality, int bx)
 constructor from packed members More...
 
unsigned phi_packed () const
 return phi packed as in hardware More...
 
float phiValue () const
 get phi-value of muon candidate in radians (low edge of bin) More...
 
virtual void print () const
 print candidate More...
 
unsigned pt_packed () const
 return pt packed as in hardware More...
 
float ptValue () const
 get pt-value of muon candidate in GeV More...
 
unsigned int quality () const
 return quality More...
 
unsigned int quality_packed () const
 return quality packed as in hardware More...
 
virtual void reset ()
 reset More...
 
void setBx (int bx)
 Set Bunch Crossing. More...
 
void setChargePacked (unsigned ch)
 Set Charge (0=pos, 1=neg) More...
 
void setChargeValid (bool valid)
 Set Charge Valid. More...
 
void setChargeValidPacked (unsigned valid)
 Set Charge Valid. More...
 
void setChargeValue (int charge)
 Set Charge Value: -1, 1. More...
 
void setDataWord (unsigned dataword)
 Set data word. More...
 
void setEtaPacked (unsigned eta)
 Set Eta: 6-bit code. More...
 
void setEtaValue (float etaVal)
 Set Eta Value (need to set type, first) More...
 
void setFineHalo (bool fh)
 Set Fine / Halo. More...
 
void setFineHaloPacked (unsigned fh)
 Set Fine / Halo. More...
 
void setPhiPacked (unsigned phi)
 Set Phi: 0..143. More...
 
void setPhiValue (float phiVal)
 Set Phi Value. More...
 
void setPtPacked (unsigned pt)
 Set Pt: 0..31. More...
 
void setPtValue (float ptVal)
 Set Pt Value. More...
 
void setQualityPacked (unsigned qual)
 Set Quality: 0..7. More...
 
void setType (unsigned type)
 Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC. More...
 
unsigned type_idx () const
 return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC More...
 
virtual ~L1MuRegionalCand ()
 destructor More...
 

Private Member Functions

unsigned readDataField (unsigned start, unsigned count) const
 
void writeDataField (unsigned start, unsigned count, unsigned value)
 

Private Attributes

int m_bx
 
unsigned m_dataWord
 
float m_etaValue
 
float m_phiValue
 
float m_ptValue
 

Static Private Attributes

static const float m_invalidValue = -10.
 

Detailed Description

A regional muon trigger candidate as received by the GMT

Definition at line 26 of file L1MuRegionalCand.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PHI_START 

Definition at line 186 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
PHI_LENGTH 

Definition at line 187 of file L1MuRegionalCand.h.

187 { PHI_LENGTH = 8 }; // Bits 0:7 phi (8 bits)

◆ anonymous enum

anonymous enum
Enumerator
PT_START 

Definition at line 188 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
PT_LENGTH 

Definition at line 189 of file L1MuRegionalCand.h.

189 { PT_LENGTH = 5 }; // Bits 8:12 pt (5 bits)

◆ anonymous enum

anonymous enum
Enumerator
QUAL_START 

Definition at line 190 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
QUAL_LENGTH 

Definition at line 191 of file L1MuRegionalCand.h.

191 { QUAL_LENGTH = 3 }; // Bits 13:15 quality (3 bits)

◆ anonymous enum

anonymous enum
Enumerator
ETA_START 

Definition at line 192 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
ETA_LENGTH 

Definition at line 193 of file L1MuRegionalCand.h.

193 { ETA_LENGTH = 6 }; // Bits 16:21 eta (6 bits)

◆ anonymous enum

anonymous enum
Enumerator
FINEHALO_START 

Definition at line 194 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
FINEHALO_LENGTH 

Definition at line 195 of file L1MuRegionalCand.h.

195 { FINEHALO_LENGTH = 1 }; // Bit 22 Eta is fine (DT) / Halo (CSC)

◆ anonymous enum

anonymous enum
Enumerator
CHARGE_START 

Definition at line 196 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
CHARGE_LENGTH 

Definition at line 197 of file L1MuRegionalCand.h.

197 { CHARGE_LENGTH = 1 }; // Bit 23 Charge: 0 = positive

◆ anonymous enum

anonymous enum
Enumerator
CHVALID_START 

Definition at line 198 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
CHVALID_LENGTH 

Definition at line 199 of file L1MuRegionalCand.h.

199  {
200  CHVALID_LENGTH = 1
201  }; // Bit 24 Charge is vaild (1=valid)

◆ anonymous enum

anonymous enum
Enumerator
TYPE_START 

Definition at line 204 of file L1MuRegionalCand.h.

◆ anonymous enum

anonymous enum
Enumerator
TYPE_LENGTH 

Definition at line 205 of file L1MuRegionalCand.h.

205  {
206  TYPE_LENGTH = 2
207  }; // Bit 30/31 type DT, bRPC, CSC, fRPC

Constructor & Destructor Documentation

◆ L1MuRegionalCand() [1/2]

L1MuRegionalCand::L1MuRegionalCand ( unsigned  dataword = 0,
int  bx = 0 
)

constructor from data word

Definition at line 42 of file L1MuRegionalCand.cc.

References m_etaValue, m_invalidValue, m_phiValue, and m_ptValue.

42  : m_bx(bx), m_dataWord(dataword) {
46 }
static const float m_invalidValue
int bx() const
return bunch crossing identifier

◆ L1MuRegionalCand() [2/2]

L1MuRegionalCand::L1MuRegionalCand ( unsigned  type_idx,
unsigned  phi,
unsigned  eta,
unsigned  pt,
unsigned  charge,
unsigned  ch_valid,
unsigned  finehalo,
unsigned  quality,
int  bx 
)

constructor from packed members

Definition at line 49 of file L1MuRegionalCand.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, PVValHelper::eta, m_etaValue, m_invalidValue, m_phiValue, m_ptValue, phi, DiDispStaMuonMonitor_cfi::pt, quality(), setChargePacked(), setChargeValidPacked(), setEtaPacked(), setFineHaloPacked(), setPhiPacked(), setPtPacked(), setQualityPacked(), setType(), and type_idx().

58  : m_bx(bx), m_dataWord(0) {
62  setPtPacked(pt);
64  setChargeValidPacked(ch_valid);
65  setFineHaloPacked(finehalo);
70 }
unsigned int quality() const
return quality
void setChargeValidPacked(unsigned valid)
Set Charge Valid.
static const float m_invalidValue
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
void setChargePacked(unsigned ch)
Set Charge (0=pos, 1=neg)
void setPtPacked(unsigned pt)
Set Pt: 0..31.
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
void setEtaPacked(unsigned eta)
Set Eta: 6-bit code.
void setFineHaloPacked(unsigned fh)
Set Fine / Halo.
int bx() const
return bunch crossing identifier
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC

◆ ~L1MuRegionalCand()

virtual L1MuRegionalCand::~L1MuRegionalCand ( )
inlinevirtual

destructor

Definition at line 43 of file L1MuRegionalCand.h.

43 {}

Member Function Documentation

◆ bx()

int L1MuRegionalCand::bx ( ) const
inline

◆ charge_packed()

unsigned L1MuRegionalCand::charge_packed ( ) const
inline

◆ charge_valid_packed()

unsigned L1MuRegionalCand::charge_valid_packed ( ) const
inline

return charge valid packed as in hardware (1=valid, 0=not valid)

Definition at line 104 of file L1MuRegionalCand.h.

References CHVALID_LENGTH, CHVALID_START, and readDataField().

Referenced by chargeValid(), csc::L1Track::L1Track(), and csc::L1Track::operator=().

◆ chargeValid()

bool L1MuRegionalCand::chargeValid ( ) const
inline

is the charge valid ?

Definition at line 67 of file L1MuRegionalCand.h.

References charge_valid_packed().

Referenced by print().

67 { return charge_valid_packed() == 1; }
unsigned charge_valid_packed() const
return charge valid packed as in hardware (1=valid, 0=not valid)

◆ chargeValue()

int L1MuRegionalCand::chargeValue ( ) const
inline

get charge

Definition at line 64 of file L1MuRegionalCand.h.

References CHARGE_LENGTH, CHARGE_START, and readDataField().

Referenced by L1MuDTTrack::charge(), and print().

64 { return readDataField(CHARGE_START, CHARGE_LENGTH) == 0 ? 1 : -1; }
unsigned readDataField(unsigned start, unsigned count) const

◆ empty()

virtual bool L1MuRegionalCand::empty ( ) const
inlinevirtual

◆ eta_packed()

unsigned L1MuRegionalCand::eta_packed ( ) const
inline

◆ etaValue()

float L1MuRegionalCand::etaValue ( ) const

get eta-value of muon candidate

Definition at line 87 of file L1MuRegionalCand.cc.

References m_etaValue, and m_invalidValue.

Referenced by HLTDTActivityFilter::matchChamber(), print(), and L1DummyProducer::SimpleDigi().

87  {
88  if (m_etaValue == m_invalidValue) {
89  edm::LogWarning("ValueInvalid") << "L1MuRegionalCand::etaValue requested physical value is invalid";
90  }
91  return m_etaValue;
92 }
static const float m_invalidValue
Log< level::Warning, false > LogWarning

◆ finehalo_packed()

unsigned L1MuRegionalCand::finehalo_packed ( ) const
inline

return eta-fine (for DT) / halo (for CSC) bit

Definition at line 98 of file L1MuRegionalCand.h.

References FINEHALO_LENGTH, FINEHALO_START, and readDataField().

Referenced by isFineHalo(), csc::L1Track::L1Track(), csc::L1Track::operator=(), and L1MuDTTrack::print().

◆ getDataWord()

unsigned L1MuRegionalCand::getDataWord ( ) const
inline

◆ isFineHalo()

bool L1MuRegionalCand::isFineHalo ( ) const
inline

is it fine (DT) / halo (CSC) ?

Definition at line 70 of file L1MuRegionalCand.h.

References finehalo_packed().

Referenced by L1MuDTTrack::fineEtaBit(), and print().

70 { return finehalo_packed() == 1; }
unsigned finehalo_packed() const
return eta-fine (for DT) / halo (for CSC) bit

◆ phi_packed()

unsigned L1MuRegionalCand::phi_packed ( ) const
inline

◆ phiValue()

float L1MuRegionalCand::phiValue ( ) const

get phi-value of muon candidate in radians (low edge of bin)

Definition at line 80 of file L1MuRegionalCand.cc.

References m_invalidValue, and m_phiValue.

Referenced by HLTDTActivityFilter::matchChamber(), print(), and L1DummyProducer::SimpleDigi().

80  {
81  if (m_phiValue == m_invalidValue) {
82  edm::LogWarning("ValueInvalid") << "L1MuRegionalCand::phiValue requested physical value is invalid";
83  }
84  return m_phiValue;
85 }
static const float m_invalidValue
Log< level::Warning, false > LogWarning

◆ print()

void L1MuRegionalCand::print ( void  ) const
virtual

print candidate

Reimplemented in L1MuDTTrack.

Definition at line 101 of file L1MuRegionalCand.cc.

References bx(), chargeValid(), chargeValue(), empty(), eta_packed(), etaValue(), alignBH_cfg::fixed, isFineHalo(), m_etaValue, m_invalidValue, m_phiValue, m_ptValue, phi_packed(), phiValue(), pt_packed(), ptValue(), quality(), and type_idx().

101  {
102  if (!empty()) {
104  edm::LogVerbatim("GMT_Input_info") << setiosflags(ios::showpoint | ios::fixed | ios::right | ios::adjustfield)
105  << "pt(index) = " << setw(2) << setprecision(1) << pt_packed() << " "
106  << "charge = " << setw(2) << chargeValue() << " "
107  << "eta(index) = " << setw(2) << eta_packed() << " "
108  << "phi(index) = " << setw(3) << phi_packed() << " "
109  << "quality = " << setw(1) << quality() << " "
110  << "charge_valid = " << setw(1) << chargeValid() << " "
111  << "fine_halo = " << setw(1) << isFineHalo() << " "
112  << "bx = " << setw(3) << bx() << " "
113  << "type_idx = " << setw(1) << type_idx();
114  } else {
115  edm::LogVerbatim("GMT_Input_info") << setiosflags(ios::showpoint | ios::fixed | ios::right | ios::adjustfield)
116  << "pt = " << setw(5) << setprecision(1) << ptValue() << " GeV "
117  << "charge = " << setw(2) << chargeValue() << " "
118  << "eta = " << setw(6) << setprecision(3) << etaValue() << " "
119  << "phi = " << setw(5) << setprecision(3) << phiValue() << " rad "
120  << "quality = " << setw(1) << quality() << " "
121  << "charge_valid = " << setw(1) << chargeValid() << " "
122  << "fine_halo = " << setw(1) << isFineHalo() << " "
123  << "bx = " << setw(3) << bx() << " "
124  << "type_idx = " << setw(1) << type_idx();
125  }
126  }
127 }
Log< level::Info, true > LogVerbatim
unsigned pt_packed() const
return pt packed as in hardware
unsigned int quality() const
return quality
unsigned phi_packed() const
return phi packed as in hardware
float phiValue() const
get phi-value of muon candidate in radians (low edge of bin)
static const float m_invalidValue
unsigned eta_packed() const
return eta packed as in hardware
virtual bool empty() const
return empty flag
int chargeValue() const
get charge
bool isFineHalo() const
is it fine (DT) / halo (CSC) ?
bool chargeValid() const
is the charge valid ?
float ptValue() const
get pt-value of muon candidate in GeV
float etaValue() const
get eta-value of muon candidate
int bx() const
return bunch crossing identifier
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC

◆ pt_packed()

unsigned L1MuRegionalCand::pt_packed ( ) const
inline

◆ ptValue()

float L1MuRegionalCand::ptValue ( ) const

get pt-value of muon candidate in GeV

Definition at line 94 of file L1MuRegionalCand.cc.

References m_invalidValue, and m_ptValue.

Referenced by print(), and L1DummyProducer::SimpleDigi().

94  {
95  if (m_ptValue == m_invalidValue) {
96  edm::LogWarning("ValueInvalid") << "L1MuRegionalCand::ptValue requested physical value is invalid";
97  }
98  return m_ptValue;
99 }
static const float m_invalidValue
Log< level::Warning, false > LogWarning

◆ quality()

unsigned int L1MuRegionalCand::quality ( ) const
inline

◆ quality_packed()

unsigned int L1MuRegionalCand::quality_packed ( ) const
inline

◆ readDataField()

unsigned L1MuRegionalCand::readDataField ( unsigned  start,
unsigned  count 
) const
private

◆ reset()

void L1MuRegionalCand::reset ( void  )
virtual

reset

Reimplemented in L1MuDTTrack.

Definition at line 72 of file L1MuRegionalCand.cc.

References m_bx, m_dataWord, m_etaValue, m_invalidValue, m_phiValue, and m_ptValue.

Referenced by L1MuDTTrack::reset().

◆ setBx()

void L1MuRegionalCand::setBx ( int  bx)
inline

Set Bunch Crossing.

Definition at line 117 of file L1MuRegionalCand.h.

References bx(), and m_bx.

Referenced by csc::L1Track::L1Track(), csc::L1Track::operator=(), L1MuDTTrack::operator=(), L1MuDTAssignmentUnit::run(), CSCTFSPCoreLogic::run(), and L1DummyProducer::SimpleDigi().

117 { m_bx = bx; }
int bx() const
return bunch crossing identifier

◆ setChargePacked()

void L1MuRegionalCand::setChargePacked ( unsigned  ch)
inline

◆ setChargeValid()

void L1MuRegionalCand::setChargeValid ( bool  valid)
inline

◆ setChargeValidPacked()

void L1MuRegionalCand::setChargeValidPacked ( unsigned  valid)
inline

◆ setChargeValue()

void L1MuRegionalCand::setChargeValue ( int  charge)
inline

◆ setDataWord()

void L1MuRegionalCand::setDataWord ( unsigned  dataword)
inline

Set data word.

Definition at line 166 of file L1MuRegionalCand.h.

References m_dataWord.

Referenced by csc::L1Track::L1Track(), csc::L1Track::operator=(), L1MuDTTrack::operator=(), and L1DummyProducer::SimpleDigi().

166 { m_dataWord = dataword; }

◆ setEtaPacked()

void L1MuRegionalCand::setEtaPacked ( unsigned  eta)
inline

◆ setEtaValue()

void L1MuRegionalCand::setEtaValue ( float  etaVal)
inline

Set Eta Value (need to set type, first)

Definition at line 151 of file L1MuRegionalCand.h.

References m_etaValue.

Referenced by L1DummyProducer::SimpleDigi().

151 { m_etaValue = etaVal; }

◆ setFineHalo()

void L1MuRegionalCand::setFineHalo ( bool  fh)
inline

Set Fine / Halo.

Definition at line 160 of file L1MuRegionalCand.h.

References FINEHALO_LENGTH, FINEHALO_START, and writeDataField().

Referenced by L1MuDTTrack::setFineEtaBit().

◆ setFineHaloPacked()

void L1MuRegionalCand::setFineHaloPacked ( unsigned  fh)
inline

◆ setPhiPacked()

void L1MuRegionalCand::setPhiPacked ( unsigned  phi)
inline

◆ setPhiValue()

void L1MuRegionalCand::setPhiValue ( float  phiVal)
inline

Set Phi Value.

Setters - values

Definition at line 145 of file L1MuRegionalCand.h.

References m_phiValue.

Referenced by L1DummyProducer::SimpleDigi().

145 { m_phiValue = phiVal; }

◆ setPtPacked()

void L1MuRegionalCand::setPtPacked ( unsigned  pt)
inline

◆ setPtValue()

void L1MuRegionalCand::setPtValue ( float  ptVal)
inline

Set Pt Value.

Definition at line 148 of file L1MuRegionalCand.h.

References m_ptValue.

Referenced by L1DummyProducer::SimpleDigi().

148 { m_ptValue = ptVal; }

◆ setQualityPacked()

void L1MuRegionalCand::setQualityPacked ( unsigned  qual)
inline

◆ setType()

void L1MuRegionalCand::setType ( unsigned  type)
inline

◆ type_idx()

unsigned L1MuRegionalCand::type_idx ( ) const
inline

◆ writeDataField()

void L1MuRegionalCand::writeDataField ( unsigned  start,
unsigned  count,
unsigned  value 
)
private

Definition at line 134 of file L1MuRegionalCand.cc.

References submitPVResolutionJobs::count, m_dataWord, gpuClustering::pixelStatus::mask, command_line::start, and mitigatedMETSequence_cff::U.

Referenced by setChargePacked(), setChargeValid(), setChargeValidPacked(), setChargeValue(), setEtaPacked(), setFineHalo(), setFineHaloPacked(), setPhiPacked(), setPtPacked(), setQualityPacked(), and setType().

134  {
135  if (value >= (1U << count))
136  edm::LogWarning("ValueOutOfRange") // value >= 0, since value is unsigned
137  << "L1MuRegionalCand::writeDataField(): value " << value << " out of range for data field with bit width "
138  << count;
139 
140  unsigned mask = ((1 << count) - 1) << start;
141  m_dataWord &= ~mask; // clear
142  m_dataWord |= (value << start) & mask;
143 }
constexpr uint32_t mask
Definition: gpuClustering.h:24
Definition: value.py:1
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ m_bx

int L1MuRegionalCand::m_bx
private

Definition at line 176 of file L1MuRegionalCand.h.

Referenced by bx(), reset(), and setBx().

◆ m_dataWord

unsigned L1MuRegionalCand::m_dataWord
private

Definition at line 177 of file L1MuRegionalCand.h.

Referenced by getDataWord(), readDataField(), reset(), setDataWord(), and writeDataField().

◆ m_etaValue

float L1MuRegionalCand::m_etaValue
private

Definition at line 180 of file L1MuRegionalCand.h.

Referenced by etaValue(), L1MuRegionalCand(), print(), reset(), and setEtaValue().

◆ m_invalidValue

const float L1MuRegionalCand::m_invalidValue = -10.
staticprivate

Definition at line 182 of file L1MuRegionalCand.h.

Referenced by etaValue(), L1MuRegionalCand(), phiValue(), print(), ptValue(), and reset().

◆ m_phiValue

float L1MuRegionalCand::m_phiValue
private

Definition at line 179 of file L1MuRegionalCand.h.

Referenced by L1MuRegionalCand(), phiValue(), print(), reset(), and setPhiValue().

◆ m_ptValue

float L1MuRegionalCand::m_ptValue
private

Definition at line 181 of file L1MuRegionalCand.h.

Referenced by L1MuRegionalCand(), print(), ptValue(), reset(), and setPtValue().