CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
sistrip::FEDAPVErrorHeader Class Referencefinal

#include <SiStripFEDBufferComponents.h>

Inheritance diagram for sistrip::FEDAPVErrorHeader:
sistrip::FEDFEHeader

Public Member Functions

bool checkChannelStatusBits (const uint8_t internalFEDChannelNum) const override
 
bool checkStatusBits (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override
 
FEDAPVErrorHeaderclone () const override
 
const uint8_t * data () const override
 
 FEDAPVErrorHeader (const uint8_t *headerBuffer)
 
 FEDAPVErrorHeader (const std::vector< bool > &apvsGood=std::vector< bool >(APVS_PER_FED, true))
 
size_t lengthInBytes () const override
 
void print (std::ostream &os) const override
 
void set32BitReservedRegister (const uint8_t internalFEUnitNum, const uint32_t reservedRegister) override
 
FEDAPVErrorHeadersetAPVStatusBit (const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
 
FEDAPVErrorHeadersetAPVStatusBit (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const uint8_t apvNum, const bool apvGood)
 
void setBEStatusRegister (const FEDBackendStatusRegister beStatusRegister) override
 
void setChannelStatus (const uint8_t internalFEDChannelNum, const FEDChannelStatus status) override
 
void setDAQRegister (const uint32_t daqRegister) override
 
void setDAQRegister2 (const uint32_t daqRegister2) override
 
void setFEUnitLength (const uint8_t internalFEUnitNum, const uint16_t length) override
 
void setFEUnitMajorityAddress (const uint8_t internalFEUnitNum, const uint8_t address) override
 
 ~FEDAPVErrorHeader () override
 
- Public Member Functions inherited from sistrip::FEDFEHeader
bool checkChannelStatusBits (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const
 
bool checkStatusBits (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const uint8_t apvNum) const
 
void setChannelStatus (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const FEDChannelStatus status)
 
virtual ~FEDFEHeader ()
 

Private Attributes

uint8_t header_ [APV_ERROR_HEADER_SIZE_IN_BYTES]
 

Static Private Attributes

static const size_t APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3
 
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES = APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS * 8
 

Additional Inherited Members

- Static Public Member Functions inherited from sistrip::FEDFEHeader
static std::unique_ptr< FEDFEHeadernewFEFakeHeader (const FEDHeaderType headerType)
 
static std::unique_ptr< FEDFEHeadernewFEHeader (const FEDHeaderType headerType, const uint8_t *headerBuffer)
 
static std::unique_ptr< FEDFEHeadernewFEHeader (const FEDHeaderType headerType)
 

Detailed Description

Definition at line 502 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

◆ FEDAPVErrorHeader() [1/2]

sistrip::FEDAPVErrorHeader::FEDAPVErrorHeader ( const uint8_t *  headerBuffer)
inlineexplicit

Definition at line 1187 of file SiStripFEDBufferComponents.h.

References APV_ERROR_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

1187  {
1188  memcpy(header_, headerBuffer, APV_ERROR_HEADER_SIZE_IN_BYTES);
1189  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]

◆ ~FEDAPVErrorHeader()

sistrip::FEDAPVErrorHeader::~FEDAPVErrorHeader ( )
override

Definition at line 1047 of file SiStripFEDBufferComponents.cc.

1047 {}

◆ FEDAPVErrorHeader() [2/2]

sistrip::FEDAPVErrorHeader::FEDAPVErrorHeader ( const std::vector< bool > &  apvsGood = std::vector<bool>(APVS_PER_FED, true))

Definition at line 1069 of file SiStripFEDBufferComponents.cc.

References APV_ERROR_HEADER_SIZE_IN_BYTES, sistrip::FEDCH_PER_FED, header_, and setAPVStatusBit().

1069  {
1070  memset(header_, 0x00, APV_ERROR_HEADER_SIZE_IN_BYTES);
1071  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1072  setAPVStatusBit(iCh, 0, apvsGood[iCh * 2]);
1073  setAPVStatusBit(iCh, 1, apvsGood[iCh * 2 + 1]);
1074  }
1075  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
static const uint16_t FEDCH_PER_FED
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]

Member Function Documentation

◆ checkChannelStatusBits()

bool sistrip::FEDAPVErrorHeader::checkChannelStatusBits ( const uint8_t  internalFEDChannelNum) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1063 of file SiStripFEDBufferComponents.cc.

References checkStatusBits(), and sistrip::internalFEDChannelNum().

1063  {
1065  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override

◆ checkStatusBits()

bool sistrip::FEDAPVErrorHeader::checkStatusBits ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1055 of file SiStripFEDBufferComponents.cc.

References L1TBPTX_cfi::bitNumber, sistrip::FEDCH_PER_FEUNIT, header_, and sistrip::internalFEDChannelNum().

Referenced by checkChannelStatusBits().

1055  {
1056  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1057  const uint16_t bitNumber = (internalFEDChannelNum / FEDCH_PER_FEUNIT) * 24 +
1058  (FEDCH_PER_FEUNIT - 1 - (internalFEDChannelNum % FEDCH_PER_FEUNIT)) * 2 + apvNum;
1059  //bit high means no error
1060  return (header_[bitNumber / 8] & (0x01 << (bitNumber % 8)));
1061  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint16_t FEDCH_PER_FEUNIT
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]

◆ clone()

FEDAPVErrorHeader * sistrip::FEDAPVErrorHeader::clone ( void  ) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1053 of file SiStripFEDBufferComponents.cc.

References FEDAPVErrorHeader().

1053 { return new FEDAPVErrorHeader(*this); }
FEDAPVErrorHeader(const uint8_t *headerBuffer)

◆ data()

const uint8_t * sistrip::FEDAPVErrorHeader::data ( ) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1067 of file SiStripFEDBufferComponents.cc.

References header_.

1067 { return header_; }
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]

◆ lengthInBytes()

size_t sistrip::FEDAPVErrorHeader::lengthInBytes ( ) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1049 of file SiStripFEDBufferComponents.cc.

References APV_ERROR_HEADER_SIZE_IN_BYTES.

static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES

◆ print()

void sistrip::FEDAPVErrorHeader::print ( std::ostream &  os) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1051 of file SiStripFEDBufferComponents.cc.

References APV_ERROR_HEADER_SIZE_IN_BYTES, header_, l1tGTMenu_BTagSeeds_cff::os, and sistrip::printHex().

static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
void printHex(const void *pointer, const size_t length, std::ostream &os)
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]

◆ set32BitReservedRegister()

void sistrip::FEDAPVErrorHeader::set32BitReservedRegister ( const uint8_t  internalFEUnitNum,
const uint32_t  reservedRegister 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1116 of file SiStripFEDBufferComponents.cc.

1116  {
1117  return;
1118  }

◆ setAPVStatusBit() [1/2]

FEDAPVErrorHeader & sistrip::FEDAPVErrorHeader::setAPVStatusBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  apvGood 
)

Definition at line 1077 of file SiStripFEDBufferComponents.cc.

References L1TBPTX_cfi::bitNumber, sistrip::FEDCH_PER_FED, header_, sistrip::internalFEDChannelNum(), and ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask.

Referenced by FEDAPVErrorHeader(), setAPVStatusBit(), and setChannelStatus().

1079  {
1080  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1081  const uint16_t bitNumber = (internalFEDChannelNum / FEDCH_PER_FED) * 24 +
1082  (FEDCH_PER_FED - 1 - (internalFEDChannelNum % FEDCH_PER_FED)) * 2 + apvNum;
1083  const uint8_t byteNumber = bitNumber / 8;
1084  const uint8_t bitInByte = bitNumber % 8;
1085  const uint8_t mask = (0x01 << bitInByte);
1086  header_[byteNumber] = ((header_[byteNumber] & (~mask)) | (apvGood ? mask : 0x00));
1087  return *this;
1088  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint16_t FEDCH_PER_FED
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]

◆ setAPVStatusBit() [2/2]

FEDAPVErrorHeader & sistrip::FEDAPVErrorHeader::setAPVStatusBit ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum,
const uint8_t  apvNum,
const bool  apvGood 
)
inline

Definition at line 1191 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum(), and setAPVStatusBit().

1194  {
1195  return setAPVStatusBit(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum, apvGood);
1196  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)

◆ setBEStatusRegister()

void sistrip::FEDAPVErrorHeader::setBEStatusRegister ( const FEDBackendStatusRegister  beStatusRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1113 of file SiStripFEDBufferComponents.cc.

1113 { return; }

◆ setChannelStatus()

void sistrip::FEDAPVErrorHeader::setChannelStatus ( const uint8_t  internalFEDChannelNum,
const FEDChannelStatus  status 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1090 of file SiStripFEDBufferComponents.cc.

References sistrip::CHANNEL_STATUS_APV0_ADDRESS_GOOD, sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT, sistrip::CHANNEL_STATUS_APV1_ADDRESS_GOOD, sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT, sistrip::CHANNEL_STATUS_IN_SYNC, sistrip::CHANNEL_STATUS_LOCKED, sistrip::internalFEDChannelNum(), setAPVStatusBit(), and mps_update::status.

1090  {
1091  //if channel is unlocked then set both APV bits bad
1095  return;
1096  } else {
1099  } else {
1101  }
1104  } else {
1106  }
1107  }
1108  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)

◆ setDAQRegister()

void sistrip::FEDAPVErrorHeader::setDAQRegister ( const uint32_t  daqRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1114 of file SiStripFEDBufferComponents.cc.

1114 { return; }

◆ setDAQRegister2()

void sistrip::FEDAPVErrorHeader::setDAQRegister2 ( const uint32_t  daqRegister2)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1115 of file SiStripFEDBufferComponents.cc.

1115 { return; }

◆ setFEUnitLength()

void sistrip::FEDAPVErrorHeader::setFEUnitLength ( const uint8_t  internalFEUnitNum,
const uint16_t  length 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1119 of file SiStripFEDBufferComponents.cc.

1119 { return; }

◆ setFEUnitMajorityAddress()

void sistrip::FEDAPVErrorHeader::setFEUnitMajorityAddress ( const uint8_t  internalFEUnitNum,
const uint8_t  address 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1112 of file SiStripFEDBufferComponents.cc.

1112 { return; }

Member Data Documentation

◆ APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS

const size_t sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3
staticprivate

Definition at line 530 of file SiStripFEDBufferComponents.h.

◆ APV_ERROR_HEADER_SIZE_IN_BYTES

const size_t sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_BYTES = APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS * 8
staticprivate

Definition at line 531 of file SiStripFEDBufferComponents.h.

Referenced by FEDAPVErrorHeader(), lengthInBytes(), and print().

◆ header_

uint8_t sistrip::FEDAPVErrorHeader::header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
private