CMS 3D CMS Logo

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

List of all members.

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

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.

{ PHI_START=0};       enum { PHI_LENGTH = 8};     // Bits 0:7   phi (8 bits)
anonymous enum
Enumerator:
PHI_LENGTH 

Definition at line 187 of file L1MuRegionalCand.h.

{ PHI_START=0};       enum { PHI_LENGTH = 8};     // Bits 0:7   phi (8 bits)
anonymous enum
Enumerator:
PT_START 

Definition at line 188 of file L1MuRegionalCand.h.

{ 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.

{ 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.

{ 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.

{ 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.

{ 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.

{ 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.

{ 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.

{ 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.

{ CHARGE_START=23};   enum { CHARGE_LENGTH = 1};  // Bit  23 Charge: 0 = positive
anonymous enum
Enumerator:
CHARGE_LENGTH 

Definition at line 192 of file L1MuRegionalCand.h.

{ CHARGE_START=23};   enum { CHARGE_LENGTH = 1};  // Bit  23 Charge: 0 = positive
anonymous enum
Enumerator:
CHVALID_START 

Definition at line 193 of file L1MuRegionalCand.h.

{ 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.

{ 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.

{ 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.

{ 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.

L1MuRegionalCand::L1MuRegionalCand ( unsigned  type_idx,
unsigned  phi,
unsigned  eta,
unsigned  pt,
unsigned  charge,
unsigned  ch_valid,
unsigned  finehalo,
unsigned  quality,
int  bx 
)
virtual L1MuRegionalCand::~L1MuRegionalCand ( ) [inline, virtual]

destructor

Definition at line 40 of file L1MuRegionalCand.h.

{}

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().

{ return charge_valid_packed() == 1; }
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().

{ return readDataField( CHARGE_START, CHARGE_LENGTH) == 0 ? 1: -1; }
virtual bool L1MuRegionalCand::empty ( ) const [inline, virtual]
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().

                                       {
  if(m_etaValue == m_invalidValue) {
    edm::LogWarning("ValueInvalid") << 
     "L1MuRegionalCand::etaValue requested physical value is invalid";
  }
  return m_etaValue;
}
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().

{ return finehalo_packed() == 1; }
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().

                                       {
  if(m_phiValue == m_invalidValue) {
    edm::LogWarning("ValueInvalid") << 
     "L1MuRegionalCand::phiValue requested physical value is invalid";
  }
  return m_phiValue;
}
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().

                                   {
  if ( !empty() ) {
    if(m_phiValue == m_invalidValue ||
       m_etaValue == m_invalidValue ||
       m_ptValue == m_invalidValue) {
      edm::LogVerbatim("GMT_Input_info")
           << setiosflags(ios::showpoint | ios::fixed | ios::right | ios::adjustfield)
       << "pt(index) = " << setw(2) << setprecision(1) << pt_packed() << "  "
       << "charge = " << setw(2) << chargeValue() << "  "
       << "eta(index) = " << setw(2) << eta_packed() << "  "
       << "phi(index) = " << setw(3) << phi_packed() << "  "
       << "quality = " << setw(1) << quality() << "  "
       << "charge_valid = " << setw(1) << chargeValid() << "  "
       << "fine_halo = " << setw(1) << isFineHalo() << "  "
       << "bx = " << setw(3) << bx() << "  " 
       << "type_idx = " << setw(1) << type_idx();
    } else {
      edm::LogVerbatim("GMT_Input_info")
           << setiosflags(ios::showpoint | ios::fixed | ios::right | ios::adjustfield)
           << "pt = " << setw(5) << setprecision(1) << ptValue() << " GeV  "
           << "charge = " << setw(2) << chargeValue() << " "
           << "eta = " << setw(6) << setprecision(3) << etaValue() << "  "
           << "phi = " << setw(5) << setprecision(3) << phiValue() << " rad  "
           << "quality = " << setw(1) << quality() << "  "
           << "charge_valid = " << setw(1) << chargeValid() << "  "
           << "fine_halo = " << setw(1) << isFineHalo() << "  "
           << "bx = " << setw(3) << bx() << "  " 
           << "type_idx = " << setw(1) << type_idx();
    }
  }
}
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().

                                      {
  if(m_ptValue == m_invalidValue) {
    edm::LogWarning("ValueInvalid") << 
     "L1MuRegionalCand::ptValue requested physical value is invalid";
  }
  return m_ptValue;
}
unsigned int L1MuRegionalCand::quality ( ) const [inline]
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().

                                                                             {
  unsigned mask = ( (1 << count) - 1 ) << start;
  return (m_dataWord & mask) >> start;
}
void L1MuRegionalCand::reset ( void  ) [virtual]
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().

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().

{ 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 FastL1MuonProducer::loadL1Muons(), L1MuGMTPSB::receiveData(), L1DummyProducer::SimpleDigi(), and L1GlobalTriggerRawToDigi::unpackGMT().

{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 FastL1MuonProducer::loadL1Muons(), L1MuGMTPSB::receiveData(), L1DummyProducer::SimpleDigi(), and L1GlobalTriggerRawToDigi::unpackGMT().

{m_phiValue = phiVal;}
void L1MuRegionalCand::setPtPacked ( unsigned  pt) [inline]
void L1MuRegionalCand::setPtValue ( float  ptVal) [inline]
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().

                                                                                    {
  if ( value >= ( 1U << count ) ) edm::LogWarning("ValueOutOfRange") // value >= 0, since value is unsigned
         << "L1MuRegionalCand::writeDataField(): value " << value  
         << " out of range for data field with bit width "  << count;

  unsigned mask = ( (1 << count) - 1 ) << start;
  m_dataWord &= ~mask; // clear
  m_dataWord |= (value << start) & mask ;
}

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().

Definition at line 180 of file L1MuRegionalCand.h.

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

const float L1MuRegionalCand::m_invalidValue = -10. [static, private]

Definition at line 182 of file L1MuRegionalCand.h.

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

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().