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 28 of file L1MuRegionalCand.h.

Member Enumeration Documentation

anonymous enum
Enumerator
PHI_START 

Definition at line 187 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
PHI_LENGTH 

Definition at line 187 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
PT_START 

Definition at line 188 of file L1MuRegionalCand.h.

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

Definition at line 188 of file L1MuRegionalCand.h.

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

Definition at line 189 of file L1MuRegionalCand.h.

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

Definition at line 189 of file L1MuRegionalCand.h.

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

Definition at line 190 of file L1MuRegionalCand.h.

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

Definition at line 190 of file L1MuRegionalCand.h.

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

Definition at line 191 of file L1MuRegionalCand.h.

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

Definition at line 191 of file L1MuRegionalCand.h.

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

Definition at line 192 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
CHARGE_LENGTH 

Definition at line 192 of file L1MuRegionalCand.h.

anonymous enum
Enumerator
CHVALID_START 

Definition at line 193 of file L1MuRegionalCand.h.

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

Definition at line 193 of file L1MuRegionalCand.h.

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

Definition at line 196 of file L1MuRegionalCand.h.

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

Definition at line 196 of file L1MuRegionalCand.h.

196 { 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 44 of file L1MuRegionalCand.cc.

References m_etaValue, m_invalidValue, m_phiValue, and m_ptValue.

44  : m_bx(bx), m_dataWord(dataword) {
48 }
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 51 of file L1MuRegionalCand.cc.

References m_etaValue, m_invalidValue, m_phiValue, m_ptValue, setChargePacked(), setChargeValidPacked(), setEtaPacked(), setFineHaloPacked(), setPhiPacked(), setPtPacked(), setQualityPacked(), and setType().

53  :
54  m_bx(bx), m_dataWord(0) {
58  setPtPacked(pt);
60  setChargeValidPacked(ch_valid);
61  setFineHaloPacked(finehalo);
66 }
T eta() const
void setChargeValidPacked(unsigned valid)
Set Charge Valid.
double charge(const std::vector< uint8_t > &Ampls)
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
Definition: DDAxes.h:10
virtual L1MuRegionalCand::~L1MuRegionalCand ( )
inlinevirtual

destructor

Definition at line 40 of file L1MuRegionalCand.h.

40 {}

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 102 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 64 of file L1MuRegionalCand.h.

References charge_valid_packed().

Referenced by print().

64 { 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 61 of file L1MuRegionalCand.h.

References CHARGE_LENGTH, CHARGE_START, and readDataField().

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

61 { 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 86 of file L1MuRegionalCand.cc.

References m_etaValue, and m_invalidValue.

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

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

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

Definition at line 96 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 67 of file L1MuRegionalCand.h.

References finehalo_packed().

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

67 { 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 78 of file L1MuRegionalCand.cc.

References m_invalidValue, and m_phiValue.

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

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

print candidate

Reimplemented in L1MuDTTrack.

Definition at line 102 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().

102  {
103  if ( !empty() ) {
104  if(m_phiValue == m_invalidValue ||
107  edm::LogVerbatim("GMT_Input_info")
108  << setiosflags(ios::showpoint | ios::fixed | ios::right | ios::adjustfield)
109  << "pt(index) = " << setw(2) << setprecision(1) << pt_packed() << " "
110  << "charge = " << setw(2) << chargeValue() << " "
111  << "eta(index) = " << setw(2) << eta_packed() << " "
112  << "phi(index) = " << setw(3) << phi_packed() << " "
113  << "quality = " << setw(1) << quality() << " "
114  << "charge_valid = " << setw(1) << chargeValid() << " "
115  << "fine_halo = " << setw(1) << isFineHalo() << " "
116  << "bx = " << setw(3) << bx() << " "
117  << "type_idx = " << setw(1) << type_idx();
118  } else {
119  edm::LogVerbatim("GMT_Input_info")
120  << setiosflags(ios::showpoint | ios::fixed | ios::right | ios::adjustfield)
121  << "pt = " << setw(5) << setprecision(1) << ptValue() << " GeV "
122  << "charge = " << setw(2) << chargeValue() << " "
123  << "eta = " << setw(6) << setprecision(3) << etaValue() << " "
124  << "phi = " << setw(5) << setprecision(3) << phiValue() << " rad "
125  << "quality = " << setw(1) << quality() << " "
126  << "charge_valid = " << setw(1) << chargeValid() << " "
127  << "fine_halo = " << setw(1) << isFineHalo() << " "
128  << "bx = " << setw(3) << bx() << " "
129  << "type_idx = " << setw(1) << type_idx();
130  }
131  }
132 }
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 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") <<
97  "L1MuRegionalCand::ptValue requested physical value is invalid";
98  }
99  return m_ptValue;
100 }
static const float m_invalidValue
unsigned int L1MuRegionalCand::quality ( ) const
inline

return quality

Definition at line 70 of file L1MuRegionalCand.h.

References quality_packed().

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

70 { 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 135 of file L1MuRegionalCand.cc.

References prof2calltree::count, and m_dataWord.

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

135  {
136  unsigned mask = ( (1 << count) - 1 ) << start;
137  return (m_dataWord & mask) >> start;
138 }
void L1MuRegionalCand::reset ( void  )
virtual

reset

Reimplemented in L1MuDTTrack.

Definition at line 68 of file L1MuRegionalCand.cc.

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

Referenced by L1MuDTTrack::reset().

68  {
69 
70  m_bx = 0;
71  m_dataWord = 0;
75 
76 }
static const float m_invalidValue
void L1MuRegionalCand::setBx ( int  bx)
inline
void L1MuRegionalCand::setChargePacked ( unsigned  ch)
inline
void L1MuRegionalCand::setChargeValid ( bool  valid)
inline
void L1MuRegionalCand::setChargeValidPacked ( unsigned  valid)
inline
void L1MuRegionalCand::setChargeValue ( int  charge)
inline

Set Charge Value: -1, 1.

Definition at line 153 of file L1MuRegionalCand.h.

References CHARGE_LENGTH, CHARGE_START, and writeDataField().

Referenced by L1MuDTTrack::setCharge().

153 { writeDataField (CHARGE_START, CHARGE_LENGTH, charge == 1 ? 0 : 1); }
void writeDataField(unsigned start, unsigned count, unsigned value)
double charge(const std::vector< uint8_t > &Ampls)
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;}
void L1MuRegionalCand::setEtaPacked ( unsigned  eta)
inline
void L1MuRegionalCand::setEtaValue ( float  etaVal)
inline

Set Eta Value (need to set type, first)

Definition at line 150 of file L1MuRegionalCand.h.

References m_etaValue.

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

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

Set Fine / Halo.

Definition at line 159 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 144 of file L1MuRegionalCand.h.

References m_phiValue.

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

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

Set Pt Value.

Definition at line 147 of file L1MuRegionalCand.h.

References m_ptValue.

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

147 {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 140 of file L1MuRegionalCand.cc.

References prof2calltree::count, and m_dataWord.

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

140  {
141  if ( value >= ( 1U << count ) ) edm::LogWarning("ValueOutOfRange") // value >= 0, since value is unsigned
142  << "L1MuRegionalCand::writeDataField(): value " << value
143  << " out of range for data field with bit width " << count;
144 
145  unsigned mask = ( (1 << count) - 1 ) << start;
146  m_dataWord &= ~mask; // clear
147  m_dataWord |= (value << start) & mask ;
148 }

Member Data Documentation

int L1MuRegionalCand::m_bx
private

Definition at line 176 of file L1MuRegionalCand.h.

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

unsigned L1MuRegionalCand::m_dataWord
private

Definition at line 177 of file L1MuRegionalCand.h.

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

float L1MuRegionalCand::m_etaValue
private

Definition at line 180 of file L1MuRegionalCand.h.

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

const float L1MuRegionalCand::m_invalidValue = -10.
staticprivate

Definition at line 182 of file L1MuRegionalCand.h.

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

float L1MuRegionalCand::m_phiValue
private

Definition at line 179 of file L1MuRegionalCand.h.

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

float L1MuRegionalCand::m_ptValue
private

Definition at line 181 of file L1MuRegionalCand.h.

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