CMS 3D CMS Logo

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

wrapper for a 32b data word identifying a readout channel in the raw data The format is the following: Reserved: b'[29,31] z side: b'[28] Local FED ID: b'[18,27] Capture Block ID: b'[14,17] ECON-D idx: b'[10,13] ECON-D eRx: b'[6,9] 1/2 ROC channel number: b'[0-5] More...

#include <HGCalElectronicsId.h>

Public Types

enum  HGCalElectronicsIdMask {
  kZsideMask = 0x1, kLocalFEDIDMask = 0x3ff, kCaptureBlockMask = 0xf, kECONDIdxMask = 0xf,
  kECONDeRxMask = 0xf, kHalfROCChannelMask = 0x3f
}
 
enum  HGCalElectronicsIdShift {
  kZsideShift = 28, kLocalFEDIDShift = 18, kCaptureBlockShift = 14, kECONDIdxShift = 10,
  kECONDeRxShift = 6, kHalfROCChannelShift = 0
}
 

Public Member Functions

uint8_t captureBlock () const
 
uint8_t cmWord () const
 
uint8_t econdeRx () const
 
uint8_t econdIdx () const
 
uint8_t halfrocChannel () const
 
 HGCalElectronicsId ()
 CTOR. More...
 
 HGCalElectronicsId (bool zside, uint16_t localfedid, uint8_t captureblock, uint8_t econdidx, uint8_t econderx, uint8_t halfrocch)
 
 HGCalElectronicsId (uint32_t value)
 
bool isCM () const
 
uint16_t localFEDId () const
 
uint32_t operator() () const
 getters More...
 
bool operator< (const HGCalElectronicsId &oth) const
 
bool operator== (const HGCalElectronicsId &oth) const
 
void print (std::ostream &out=std::cout) const
 
uint32_t raw () const
 
uint8_t rocChannel () const
 
bool zSide () const
 

Private Attributes

uint32_t value_
 

Detailed Description

wrapper for a 32b data word identifying a readout channel in the raw data The format is the following: Reserved: b'[29,31] z side: b'[28] Local FED ID: b'[18,27] Capture Block ID: b'[14,17] ECON-D idx: b'[10,13] ECON-D eRx: b'[6,9] 1/2 ROC channel number: b'[0-5]

Definition at line 21 of file HGCalElectronicsId.h.

Member Enumeration Documentation

◆ HGCalElectronicsIdMask

Enumerator
kZsideMask 
kLocalFEDIDMask 
kCaptureBlockMask 
kECONDIdxMask 
kECONDeRxMask 
kHalfROCChannelMask 

Definition at line 23 of file HGCalElectronicsId.h.

◆ HGCalElectronicsIdShift

Enumerator
kZsideShift 
kLocalFEDIDShift 
kCaptureBlockShift 
kECONDIdxShift 
kECONDeRxShift 
kHalfROCChannelShift 

Definition at line 31 of file HGCalElectronicsId.h.

Constructor & Destructor Documentation

◆ HGCalElectronicsId() [1/3]

HGCalElectronicsId::HGCalElectronicsId ( )
inline

CTOR.

Definition at line 43 of file HGCalElectronicsId.h.

43 : value_(0) {}

◆ HGCalElectronicsId() [2/3]

HGCalElectronicsId::HGCalElectronicsId ( bool  zside,
uint16_t  localfedid,
uint8_t  captureblock,
uint8_t  econdidx,
uint8_t  econderx,
uint8_t  halfrocch 
)
explicit

Definition at line 4 of file HGCalElectronicsId.cc.

References PixelSLinkDataInputSource_cfi::fedid, kCaptureBlockMask, kCaptureBlockShift, kECONDeRxMask, kECONDeRxShift, kECONDIdxMask, kECONDIdxShift, kHalfROCChannelMask, kHalfROCChannelShift, kLocalFEDIDMask, kLocalFEDIDShift, kZsideMask, kZsideShift, value_, and ecaldqm::zside().

◆ HGCalElectronicsId() [3/3]

HGCalElectronicsId::HGCalElectronicsId ( uint32_t  value)
inlineexplicit

Definition at line 46 of file HGCalElectronicsId.h.

46 : value_(value) {}
Definition: value.py:1

Member Function Documentation

◆ captureBlock()

uint8_t HGCalElectronicsId::captureBlock ( ) const

◆ cmWord()

uint8_t HGCalElectronicsId::cmWord ( ) const

Definition at line 36 of file HGCalElectronicsId.cc.

References halfrocChannel().

Referenced by rocChannel().

36 { return halfrocChannel() - 37; }
uint8_t halfrocChannel() const

◆ econdeRx()

uint8_t HGCalElectronicsId::econdeRx ( ) const

◆ econdIdx()

uint8_t HGCalElectronicsId::econdIdx ( ) const

◆ halfrocChannel()

uint8_t HGCalElectronicsId::halfrocChannel ( ) const

◆ isCM()

bool HGCalElectronicsId::isCM ( ) const

Definition at line 18 of file HGCalElectronicsId.cc.

References halfrocChannel().

Referenced by print(), and rocChannel().

18  {
19  uint8_t halfrocch = halfrocChannel();
20  return (halfrocch == 37) || (halfrocch == 38);
21 }
uint8_t halfrocChannel() const

◆ localFEDId()

uint16_t HGCalElectronicsId::localFEDId ( ) const

◆ operator()()

uint32_t HGCalElectronicsId::operator() ( ) const
inline

getters

Definition at line 52 of file HGCalElectronicsId.h.

References value_.

52 { return value_; }

◆ operator<()

bool HGCalElectronicsId::operator< ( const HGCalElectronicsId oth) const
inline

Definition at line 53 of file HGCalElectronicsId.h.

References value_.

53 { return value_ < oth.value_; }

◆ operator==()

bool HGCalElectronicsId::operator== ( const HGCalElectronicsId oth) const
inline

Definition at line 54 of file HGCalElectronicsId.h.

References value_.

54 { return value_ == oth.value_; }

◆ print()

void HGCalElectronicsId::print ( std::ostream &  out = std::cout) const
inline

Definition at line 65 of file HGCalElectronicsId.h.

References captureBlock(), TauDecayModes::dec, econdeRx(), econdIdx(), halfrocChannel(), isCM(), localFEDId(), MillePedeFileConverter_cfg::out, raw(), and zSide().

65  {
66  out << "Raw=0x" << std::hex << raw() << std::dec << std::endl
67  << "\tLocal FED-ID: " << (uint32_t)localFEDId() << " Capture Block: " << (uint32_t)captureBlock()
68  << " ECON-D idx: " << (uint32_t)econdIdx() << " eRx: " << (uint32_t)econdeRx()
69  << " 1/2 ROC ch.: " << (uint32_t)halfrocChannel() << " isCM=" << isCM() << " zSide=" << zSide() << std::endl;
70  }
uint32_t raw() const
uint8_t halfrocChannel() const
uint8_t econdIdx() const
uint8_t captureBlock() const
uint16_t localFEDId() const
uint8_t econdeRx() const

◆ raw()

uint32_t HGCalElectronicsId::raw ( ) const
inline

◆ rocChannel()

uint8_t HGCalElectronicsId::rocChannel ( ) const

Definition at line 39 of file HGCalElectronicsId.cc.

References cmWord(), econdeRx(), halfrocChannel(), and isCM().

39  {
40  if (isCM())
41  return cmWord() + 2 * (econdeRx() % 2);
42  return halfrocChannel() + 37 * (econdeRx() % 2);
43 }
uint8_t cmWord() const
uint8_t halfrocChannel() const
uint8_t econdeRx() const

◆ zSide()

bool HGCalElectronicsId::zSide ( ) const

Member Data Documentation

◆ value_

uint32_t HGCalElectronicsId::value_
private