CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
Enumerator
PHI_START 

Definition at line 185 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
PHI_LENGTH 

Definition at line 185 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
PT_START 

Definition at line 186 of file L1MuRegionalCand.h.

186 { PT_START=8}; enum { PT_LENGTH = 5}; // Bits 8:12 pt (5 bits)
anonymous enum
Enumerator
PT_LENGTH 

Definition at line 186 of file L1MuRegionalCand.h.

186 { PT_START=8}; enum { PT_LENGTH = 5}; // Bits 8:12 pt (5 bits)
anonymous enum
Enumerator
QUAL_START 

Definition at line 187 of file L1MuRegionalCand.h.

187 { QUAL_START=13}; enum { QUAL_LENGTH = 3}; // Bits 13:15 quality (3 bits)
anonymous enum
Enumerator
QUAL_LENGTH 

Definition at line 187 of file L1MuRegionalCand.h.

187 { QUAL_START=13}; enum { QUAL_LENGTH = 3}; // Bits 13:15 quality (3 bits)
anonymous enum
Enumerator
ETA_START 

Definition at line 188 of file L1MuRegionalCand.h.

188 { ETA_START=16}; enum { ETA_LENGTH = 6}; // Bits 16:21 eta (6 bits)
anonymous enum
Enumerator
ETA_LENGTH 

Definition at line 188 of file L1MuRegionalCand.h.

188 { ETA_START=16}; enum { ETA_LENGTH = 6}; // Bits 16:21 eta (6 bits)
anonymous enum
Enumerator
FINEHALO_START 

Definition at line 189 of file L1MuRegionalCand.h.

189 { FINEHALO_START=22}; enum { FINEHALO_LENGTH = 1};// Bit 22 Eta is fine (DT) / Halo (CSC)
anonymous enum
Enumerator
FINEHALO_LENGTH 

Definition at line 189 of file L1MuRegionalCand.h.

189 { FINEHALO_START=22}; enum { FINEHALO_LENGTH = 1};// Bit 22 Eta is fine (DT) / Halo (CSC)
anonymous enum
Enumerator
CHARGE_START 

Definition at line 190 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
CHARGE_LENGTH 

Definition at line 190 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
CHVALID_START 

Definition at line 191 of file L1MuRegionalCand.h.

191 { CHVALID_START=24}; enum { CHVALID_LENGTH = 1}; // Bit 24 Charge is vaild (1=valid)
anonymous enum
Enumerator
CHVALID_LENGTH 

Definition at line 191 of file L1MuRegionalCand.h.

191 { CHVALID_START=24}; enum { CHVALID_LENGTH = 1}; // Bit 24 Charge is vaild (1=valid)
anonymous enum
Enumerator
TYPE_START 

Definition at line 194 of file L1MuRegionalCand.h.

194 { TYPE_START=30}; enum { TYPE_LENGTH = 2}; // Bit 30/31 type DT, bRPC, CSC, fRPC
anonymous enum
Enumerator
TYPE_LENGTH 

Definition at line 194 of file L1MuRegionalCand.h.

194 { TYPE_START=30}; enum { TYPE_LENGTH = 2}; // Bit 30/31 type DT, bRPC, CSC, fRPC

Constructor & Destructor Documentation

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::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 m_etaValue, m_invalidValue, m_phiValue, m_ptValue, setChargePacked(), setChargeValidPacked(), setEtaPacked(), setFineHaloPacked(), setPhiPacked(), setPtPacked(), setQualityPacked(), and setType().

51  :
52  m_bx(bx), m_dataWord(0) {
56  setPtPacked(pt);
57  setChargePacked(charge);
58  setChargeValidPacked(ch_valid);
59  setFineHaloPacked(finehalo);
64 }
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.
unsigned int quality() const
return quality
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
int bx() const
return bunch crossing identifier
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
void setEtaPacked(unsigned eta)
Set Eta: 6-bit code.
void setFineHaloPacked(unsigned fh)
Set Fine / Halo.
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
virtual L1MuRegionalCand::~L1MuRegionalCand ( )
inlinevirtual

destructor

Definition at line 38 of file L1MuRegionalCand.h.

38 {}

Member Function Documentation

int L1MuRegionalCand::bx ( ) const
inline
unsigned L1MuRegionalCand::charge_packed ( ) const
inline
unsigned L1MuRegionalCand::charge_valid_packed ( ) const
inline

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

Definition at line 100 of file L1MuRegionalCand.h.

References CHVALID_LENGTH, CHVALID_START, and readDataField().

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

bool L1MuRegionalCand::chargeValid ( ) const
inline

is the charge valid ?

Definition at line 62 of file L1MuRegionalCand.h.

References charge_valid_packed().

Referenced by print().

62 { return charge_valid_packed() == 1; }
unsigned charge_valid_packed() const
return charge valid packed as in hardware (1=valid, 0=not valid)
int L1MuRegionalCand::chargeValue ( ) const
inline

get charge

Definition at line 59 of file L1MuRegionalCand.h.

References CHARGE_LENGTH, CHARGE_START, and readDataField().

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

59 { return readDataField( CHARGE_START, CHARGE_LENGTH) == 0 ? 1: -1; }
unsigned readDataField(unsigned start, unsigned count) const
virtual bool L1MuRegionalCand::empty ( ) const
inlinevirtual
unsigned L1MuRegionalCand::eta_packed ( ) const
inline
float L1MuRegionalCand::etaValue ( ) const

get eta-value of muon candidate

Definition at line 84 of file L1MuRegionalCand.cc.

References m_etaValue, and m_invalidValue.

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

84  {
85  if(m_etaValue == m_invalidValue) {
86  edm::LogWarning("ValueInvalid") <<
87  "L1MuRegionalCand::etaValue requested physical value is invalid";
88  }
89  return m_etaValue;
90 }
static const float m_invalidValue
unsigned L1MuRegionalCand::finehalo_packed ( ) const
inline

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

Definition at line 94 of file L1MuRegionalCand.h.

References FINEHALO_LENGTH, FINEHALO_START, and readDataField().

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

unsigned L1MuRegionalCand::getDataWord ( ) const
inline
bool L1MuRegionalCand::isFineHalo ( ) const
inline

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

Definition at line 65 of file L1MuRegionalCand.h.

References finehalo_packed().

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

65 { return finehalo_packed() == 1; }
unsigned finehalo_packed() const
return eta-fine (for DT) / halo (for CSC) bit
unsigned L1MuRegionalCand::phi_packed ( ) const
inline
float L1MuRegionalCand::phiValue ( ) const

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

Definition at line 76 of file L1MuRegionalCand.cc.

References m_invalidValue, and m_phiValue.

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

76  {
77  if(m_phiValue == m_invalidValue) {
78  edm::LogWarning("ValueInvalid") <<
79  "L1MuRegionalCand::phiValue requested physical value is invalid";
80  }
81  return m_phiValue;
82 }
static const float m_invalidValue
void L1MuRegionalCand::print ( void  ) const
virtual

print candidate

Reimplemented in L1MuDTTrack.

Definition at line 100 of file L1MuRegionalCand.cc.

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

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

get pt-value of muon candidate in GeV

Definition at line 92 of file L1MuRegionalCand.cc.

References m_invalidValue, and m_ptValue.

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

92  {
93  if(m_ptValue == m_invalidValue) {
94  edm::LogWarning("ValueInvalid") <<
95  "L1MuRegionalCand::ptValue requested physical value is invalid";
96  }
97  return m_ptValue;
98 }
static const float m_invalidValue
unsigned int L1MuRegionalCand::quality ( ) const
inline

return quality

Definition at line 68 of file L1MuRegionalCand.h.

References quality_packed().

Referenced by L1EmulBias::ModifyCollection(), L1MuDTTrack::operator!=(), L1MuDTTrack::Rank::operator()(), L1MuDTTrack::operator==(), and print().

68 { return quality_packed(); }
unsigned int quality_packed() const
return quality packed as in hardware
unsigned int L1MuRegionalCand::quality_packed ( ) const
inline
unsigned L1MuRegionalCand::readDataField ( unsigned  start,
unsigned  count 
) const
private

Definition at line 133 of file L1MuRegionalCand.cc.

References prof2calltree::count, m_dataWord, and dqm_diff::start.

Referenced by charge_packed(), charge_valid_packed(), chargeValue(), empty(), eta_packed(), finehalo_packed(), phi_packed(), pt_packed(), quality_packed(), and type_idx().

133  {
134  unsigned mask = ( (1 << count) - 1 ) << start;
135  return (m_dataWord & mask) >> start;
136 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
void L1MuRegionalCand::reset ( void  )
virtual

reset

Reimplemented in L1MuDTTrack.

Definition at line 66 of file L1MuRegionalCand.cc.

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

Referenced by L1MuDTTrack::reset().

66  {
67 
68  m_bx = 0;
69  m_dataWord = 0;
73 
74 }
static const float m_invalidValue
void L1MuRegionalCand::setBx ( int  bx)
inline
void L1MuRegionalCand::setChargePacked ( unsigned  ch)
inline
void L1MuRegionalCand::setChargeValid ( bool  valid)
inline

Set Charge Valid.

Definition at line 154 of file L1MuRegionalCand.h.

References CHVALID_LENGTH, CHVALID_START, and writeDataField().

Referenced by L1MuDTTrack::L1MuDTTrack(), and L1MuDTTrack::setCharge().

154 { writeDataField( CHVALID_START, CHVALID_LENGTH, valid ? 1 : 0); }
void writeDataField(unsigned start, unsigned count, unsigned value)
void L1MuRegionalCand::setChargeValidPacked ( unsigned  valid)
inline
void L1MuRegionalCand::setChargeValue ( int  charge)
inline

Set Charge Value: -1, 1.

Definition at line 151 of file L1MuRegionalCand.h.

References CHARGE_LENGTH, CHARGE_START, and writeDataField().

Referenced by L1MuDTTrack::setCharge().

151 { writeDataField (CHARGE_START, CHARGE_LENGTH, charge == 1 ? 0 : 1); }
void writeDataField(unsigned start, unsigned count, unsigned value)
void L1MuRegionalCand::setDataWord ( unsigned  dataword)
inline

Set data word.

Definition at line 164 of file L1MuRegionalCand.h.

References m_dataWord.

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

164 { m_dataWord = dataword;}
void L1MuRegionalCand::setEtaPacked ( unsigned  eta)
inline
void L1MuRegionalCand::setEtaValue ( float  etaVal)
inline

Set Eta Value (need to set type, first)

Definition at line 148 of file L1MuRegionalCand.h.

References m_etaValue.

Referenced by L1MuGMTPSB::receiveData(), L1DummyProducer::SimpleDigi(), and L1GlobalTriggerRawToDigi::unpackGMT().

148 {m_etaValue = etaVal;}
void L1MuRegionalCand::setFineHalo ( bool  fh)
inline

Set Fine / Halo.

Definition at line 157 of file L1MuRegionalCand.h.

References FINEHALO_LENGTH, FINEHALO_START, and writeDataField().

Referenced by L1MuDTTrack::setFineEtaBit().

void L1MuRegionalCand::setFineHaloPacked ( unsigned  fh)
inline
void L1MuRegionalCand::setPhiPacked ( unsigned  phi)
inline
void L1MuRegionalCand::setPhiValue ( float  phiVal)
inline

Set Phi Value.

Setters - values

Definition at line 142 of file L1MuRegionalCand.h.

References m_phiValue.

Referenced by L1MuGMTPSB::receiveData(), L1DummyProducer::SimpleDigi(), and L1GlobalTriggerRawToDigi::unpackGMT().

142 {m_phiValue = phiVal;}
void L1MuRegionalCand::setPtPacked ( unsigned  pt)
inline
void L1MuRegionalCand::setPtValue ( float  ptVal)
inline

Set Pt Value.

Definition at line 145 of file L1MuRegionalCand.h.

References m_ptValue.

Referenced by L1MuGMTPSB::receiveData(), L1DummyProducer::SimpleDigi(), and L1GlobalTriggerRawToDigi::unpackGMT().

145 {m_ptValue = ptVal;}
void L1MuRegionalCand::setQualityPacked ( unsigned  qual)
inline
void L1MuRegionalCand::setType ( unsigned  type)
inline
unsigned L1MuRegionalCand::type_idx ( ) const
inline
void L1MuRegionalCand::writeDataField ( unsigned  start,
unsigned  count,
unsigned  value 
)
private

Definition at line 138 of file L1MuRegionalCand.cc.

References prof2calltree::count, m_dataWord, and dqm_diff::start.

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

138  {
139  if ( value >= ( 1U << count ) ) edm::LogWarning("ValueOutOfRange") // value >= 0, since value is unsigned
140  << "L1MuRegionalCand::writeDataField(): value " << value
141  << " out of range for data field with bit width " << count;
142 
143  unsigned mask = ( (1 << count) - 1 ) << start;
144  m_dataWord &= ~mask; // clear
145  m_dataWord |= (value << start) & mask ;
146 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58

Member Data Documentation

int L1MuRegionalCand::m_bx
private

Definition at line 174 of file L1MuRegionalCand.h.

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

unsigned L1MuRegionalCand::m_dataWord
private

Definition at line 175 of file L1MuRegionalCand.h.

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

float L1MuRegionalCand::m_etaValue
private

Definition at line 178 of file L1MuRegionalCand.h.

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

const float L1MuRegionalCand::m_invalidValue = -10.
staticprivate

Definition at line 180 of file L1MuRegionalCand.h.

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

float L1MuRegionalCand::m_phiValue
private

Definition at line 177 of file L1MuRegionalCand.h.

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

float L1MuRegionalCand::m_ptValue
private

Definition at line 179 of file L1MuRegionalCand.h.

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