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 440 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

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

Definition at line 1066 of file SiStripFEDBufferComponents.h.

1067  {
1068  memcpy(header_,headerBuffer,APV_ERROR_HEADER_SIZE_IN_BYTES);
1069  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
sistrip::FEDAPVErrorHeader::~FEDAPVErrorHeader ( )
override

Definition at line 1062 of file SiStripFEDBufferComponents.cc.

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

Definition at line 1099 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FED.

1100  {
1102  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1103  setAPVStatusBit(iCh,0,apvsGood[iCh*2]);
1104  setAPVStatusBit(iCh,1,apvsGood[iCh*2+1]);
1105  }
1106  }
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

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

Implements sistrip::FEDFEHeader.

Definition at line 1089 of file SiStripFEDBufferComponents.cc.

1090  {
1092  }
bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool sistrip::FEDAPVErrorHeader::checkStatusBits ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1081 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT.

1082  {
1083  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1084  const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FEUNIT)*24 + (FEDCH_PER_FEUNIT-1-(internalFEDChannelNum%FEDCH_PER_FEUNIT))*2 + apvNum;
1085  //bit high means no error
1086  return (header_[bitNumber/8] & (0x01<<(bitNumber%8)) );
1087  }
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]
FEDAPVErrorHeader * sistrip::FEDAPVErrorHeader::clone ( void  ) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1076 of file SiStripFEDBufferComponents.cc.

1077  {
1078  return new FEDAPVErrorHeader(*this);
1079  }
FEDAPVErrorHeader(const uint8_t *headerBuffer)
const uint8_t * sistrip::FEDAPVErrorHeader::data ( ) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1094 of file SiStripFEDBufferComponents.cc.

1095  {
1096  return header_;
1097  }
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
size_t sistrip::FEDAPVErrorHeader::lengthInBytes ( ) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1066 of file SiStripFEDBufferComponents.cc.

1067  {
1069  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
void sistrip::FEDAPVErrorHeader::print ( std::ostream &  os) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1071 of file SiStripFEDBufferComponents.cc.

References sistrip::printHex().

1072  {
1074  }
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]
void sistrip::FEDAPVErrorHeader::set32BitReservedRegister ( const uint8_t  internalFEUnitNum,
const uint32_t  reservedRegister 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1158 of file SiStripFEDBufferComponents.cc.

1159  {
1160  return;
1161  }
FEDAPVErrorHeader & sistrip::FEDAPVErrorHeader::setAPVStatusBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  apvGood 
)

Definition at line 1108 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FED, and RecoTauDiscriminantConfiguration::mask.

1109  {
1110  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1111  const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FED)*24 + (FEDCH_PER_FED-1-(internalFEDChannelNum%FEDCH_PER_FED))*2+apvNum;
1112  const uint8_t byteNumber = bitNumber/8;
1113  const uint8_t bitInByte = bitNumber%8;
1114  const uint8_t mask = (0x01 << bitInByte);
1115  header_[byteNumber] = ( (header_[byteNumber] & (~mask)) | (apvGood?mask:0x00) );
1116  return *this;
1117  }
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]
FEDAPVErrorHeader & sistrip::FEDAPVErrorHeader::setAPVStatusBit ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum,
const uint8_t  apvNum,
const bool  apvGood 
)
inline

Definition at line 1071 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

1073  {
1074  return setAPVStatusBit(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum,apvGood);
1075  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
void sistrip::FEDAPVErrorHeader::setBEStatusRegister ( const FEDBackendStatusRegister  beStatusRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1146 of file SiStripFEDBufferComponents.cc.

1147  {
1148  return;
1149  }
void sistrip::FEDAPVErrorHeader::setChannelStatus ( const uint8_t  internalFEDChannelNum,
const FEDChannelStatus  status 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1119 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, and sistrip::CHANNEL_STATUS_LOCKED.

1120  {
1121  //if channel is unlocked then set both APV bits bad
1122  if ( (!(status & CHANNEL_STATUS_LOCKED)) || (!(status & CHANNEL_STATUS_IN_SYNC)) ) {
1125  return;
1126  } else {
1129  } else {
1131  }
1134  } else {
1136  }
1137  }
1138  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
void sistrip::FEDAPVErrorHeader::setDAQRegister ( const uint32_t  daqRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1150 of file SiStripFEDBufferComponents.cc.

1151  {
1152  return;
1153  }
void sistrip::FEDAPVErrorHeader::setDAQRegister2 ( const uint32_t  daqRegister2)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1154 of file SiStripFEDBufferComponents.cc.

1155  {
1156  return;
1157  }
void sistrip::FEDAPVErrorHeader::setFEUnitLength ( const uint8_t  internalFEUnitNum,
const uint16_t  length 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1162 of file SiStripFEDBufferComponents.cc.

1163  {
1164  return;
1165  }
void sistrip::FEDAPVErrorHeader::setFEUnitMajorityAddress ( const uint8_t  internalFEUnitNum,
const uint8_t  address 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1142 of file SiStripFEDBufferComponents.cc.

1143  {
1144  return;
1145  }

Member Data Documentation

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

Definition at line 465 of file SiStripFEDBufferComponents.h.

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

Definition at line 466 of file SiStripFEDBufferComponents.h.

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

Definition at line 467 of file SiStripFEDBufferComponents.h.