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 std::vector< bool > &apvsGood=std::vector< bool >(APVS_PER_FED, true))
 
 FEDAPVErrorHeader (const uint8_t *headerBuffer)
 
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)
 
static std::unique_ptr< FEDFEHeadernewFEHeader (const FEDHeaderType headerType, const uint8_t *headerBuffer)
 

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.

1187  {
1188  memcpy(header_, headerBuffer, APV_ERROR_HEADER_SIZE_IN_BYTES);
1189  }

References APV_ERROR_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

◆ ~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.

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  }

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

Member Function Documentation

◆ checkChannelStatusBits()

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

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

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  }

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

Referenced by checkChannelStatusBits().

◆ clone()

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

Implements sistrip::FEDFEHeader.

Definition at line 1053 of file SiStripFEDBufferComponents.cc.

1053 { return new FEDAPVErrorHeader(*this); }

References FEDAPVErrorHeader().

◆ data()

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

Implements sistrip::FEDFEHeader.

Definition at line 1067 of file SiStripFEDBufferComponents.cc.

1067 { return header_; }

References header_.

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

◆ print()

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

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

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  }

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

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

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

1194  {
1195  return setAPVStatusBit(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum, apvGood);
1196  }

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

◆ 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

◆ 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
sistrip::CHANNEL_STATUS_IN_SYNC
Definition: SiStripFEDBufferComponents.h:130
sistrip::CHANNEL_STATUS_APV0_ADDRESS_GOOD
Definition: SiStripFEDBufferComponents.h:133
mps_update.status
status
Definition: mps_update.py:69
sistrip::FEDAPVErrorHeader::checkStatusBits
bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override
Definition: SiStripFEDBufferComponents.cc:1055
sistrip::internalFEDChannelNum
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
Definition: SiStripFEDBufferComponents.h:785
sistrip::FEDAPVErrorHeader::setAPVStatusBit
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
Definition: SiStripFEDBufferComponents.cc:1077
sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT
Definition: SiStripFEDBufferComponents.h:134
sistrip::FEDAPVErrorHeader::FEDAPVErrorHeader
FEDAPVErrorHeader(const uint8_t *headerBuffer)
Definition: SiStripFEDBufferComponents.h:1187
sistrip::printHex
void printHex(const void *pointer, const size_t length, std::ostream &os)
Definition: SiStripFEDBufferComponents.cc:26
sistrip::CHANNEL_STATUS_APV1_ADDRESS_GOOD
Definition: SiStripFEDBufferComponents.h:131
sistrip::FEDCH_PER_FED
static const uint16_t FEDCH_PER_FED
Definition: ConstantsForHardwareSystems.h:30
sistrip::FEDCH_PER_FEUNIT
static const uint16_t FEDCH_PER_FEUNIT
Definition: ConstantsForHardwareSystems.h:28
L1TBPTX_cfi.bitNumber
bitNumber
Definition: L1TBPTX_cfi.py:26
sistrip::CHANNEL_STATUS_LOCKED
Definition: SiStripFEDBufferComponents.h:129
sistrip::FEDAPVErrorHeader::header_
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
Definition: SiStripFEDBufferComponents.h:532
sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT
Definition: SiStripFEDBufferComponents.h:132
sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_BYTES
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
Definition: SiStripFEDBufferComponents.h:531