CMS 3D CMS Logo

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

#include <SiStripFEDBufferComponents.h>

Inheritance diagram for sistrip::FEDFullDebugHeader:
sistrip::FEDFEHeader

Public Member Functions

bool apvAddressError (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
 
bool apvAddressError (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const uint8_t apvNum) const
 
bool apvError (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
 
bool apvError (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const uint8_t apvNum) const
 
FEDBackendStatusRegister beStatusRegister () const
 
bool checkChannelStatusBits (const uint8_t internalFEDChannelNum) const override
 
bool checkStatusBits (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override
 
FEDFullDebugHeaderclone () const override
 
uint32_t daqRegister () const
 
uint32_t daqRegister2 () const
 
const uint8_t * data () const override
 
 FEDFullDebugHeader (const uint8_t *headerBuffer)
 
 FEDFullDebugHeader (const std::vector< uint16_t > &feUnitLengths=std::vector< uint16_t >(FEUNITS_PER_FED, 0), const std::vector< uint8_t > &feMajorityAddresses=std::vector< uint8_t >(FEUNITS_PER_FED, 0), const std::vector< FEDChannelStatus > &channelStatus=std::vector< FEDChannelStatus >(FEDCH_PER_FED, CHANNEL_STATUS_NO_PROBLEMS), const FEDBackendStatusRegister beStatusRegister=FEDBackendStatusRegister(), const uint32_t daqRegister=0, const uint32_t daqRegister2=0)
 
bool fePresent (const uint8_t internalFEUnitNum) const
 
uint16_t feUnitLength (const uint8_t internalFEUnitNum) const
 
uint8_t feUnitMajorityAddress (const uint8_t internalFEUnitNum) const
 
uint8_t * feWord (const uint8_t internalFEUnitNum)
 
const uint8_t * feWord (const uint8_t internalFEUnitNum) const
 
FEDChannelStatus getChannelStatus (const uint8_t internalFEDChannelNum) const
 
FEDChannelStatus getChannelStatus (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const
 
size_t lengthInBytes () const override
 
bool outOfSync (const uint8_t internalFEDChannelNum) const
 
bool outOfSync (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const
 
void print (std::ostream &os) const override
 
void set32BitReservedRegister (const uint8_t internalFEUnitNum, const uint32_t reservedRegister) override
 
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
 
bool unlocked (const uint8_t internalFEDChannelNum) const
 
bool unlocked (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const
 
 ~FEDFullDebugHeader () 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 ()
 

Static Public Member Functions

static uint32_t get32BitWordFrom (const uint8_t *startOfWord)
 
- 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)
 

Private Member Functions

bool apvAddressErrorFromBit (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
 
bool apvErrorFromBit (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
 
bool getBit (const uint8_t internalFEDChannelNum, const uint8_t bit) const
 
bool outOfSyncFromBit (const uint8_t internalFEDChannelNum) const
 
void setAPVAddressError (const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value)
 
void setAPVError (const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value)
 
void setBit (const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)
 
void setOutOfSync (const uint8_t internalFEDChannelNum, const bool value)
 
void setUnlocked (const uint8_t internalFEDChannelNum, const bool value)
 
bool unlockedFromBit (const uint8_t internalFEDChannelNum) const
 

Static Private Member Functions

static void set32BitWordAt (uint8_t *startOfWord, const uint32_t value)
 

Private Attributes

uint8_t header_ [FULL_DEBUG_HEADER_SIZE_IN_BYTES]
 

Static Private Attributes

static const size_t FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS = FEUNITS_PER_FED * 2
 
static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES = FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS * 8
 

Detailed Description

Definition at line 535 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

◆ FEDFullDebugHeader() [1/2]

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

Definition at line 1198 of file SiStripFEDBufferComponents.h.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

1198  {
1199  memcpy(header_, headerBuffer, FULL_DEBUG_HEADER_SIZE_IN_BYTES);
1200  }
static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]

◆ ~FEDFullDebugHeader()

sistrip::FEDFullDebugHeader::~FEDFullDebugHeader ( )
override

Definition at line 1121 of file SiStripFEDBufferComponents.cc.

1121 {}

◆ FEDFullDebugHeader() [2/2]

sistrip::FEDFullDebugHeader::FEDFullDebugHeader ( const std::vector< uint16_t > &  feUnitLengths = std::vector<uint16_t>(FEUNITS_PER_FED, 0),
const std::vector< uint8_t > &  feMajorityAddresses = std::vector<uint8_t>(FEUNITS_PER_FED, 0),
const std::vector< FEDChannelStatus > &  channelStatus = std::vector<FEDChannelStatus>(FEDCH_PER_FEDCHANNEL_STATUS_NO_PROBLEMS),
const FEDBackendStatusRegister  beStatusRegister = FEDBackendStatusRegister(),
const uint32_t  daqRegister = 0,
const uint32_t  daqRegister2 = 0 
)

Definition at line 1187 of file SiStripFEDBufferComponents.cc.

References beStatusRegister(), daqRegister(), daqRegister2(), sistrip::FEDCH_PER_FED, sistrip::FEUNITS_PER_FED, FULL_DEBUG_HEADER_SIZE_IN_BYTES, header_, setBEStatusRegister(), setChannelStatus(), setDAQRegister(), setDAQRegister2(), setFEUnitLength(), and setFEUnitMajorityAddress().

1192  {
1197  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1198  setFEUnitLength(iFE, feUnitLengths[iFE]);
1199  setFEUnitMajorityAddress(iFE, feMajorityAddresses[iFE]);
1200  }
1201  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1202  setChannelStatus(iCh, channelStatus[iCh]);
1203  }
1204  }
void setDAQRegister2(const uint32_t daqRegister2) override
void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address) override
FEDBackendStatusRegister beStatusRegister() const
void setDAQRegister(const uint32_t daqRegister) override
void setBEStatusRegister(const FEDBackendStatusRegister beStatusRegister) override
static const uint16_t FEUNITS_PER_FED
static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES
void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status) override
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
static const uint16_t FEDCH_PER_FED
void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length) override

Member Function Documentation

◆ apvAddressError() [1/2]

bool sistrip::FEDFullDebugHeader::apvAddressError ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
inline

Definition at line 1251 of file SiStripFEDBufferComponents.h.

References apvAddressErrorFromBit(), sistrip::internalFEDChannelNum(), outOfSyncFromBit(), and unlockedFromBit().

Referenced by apvAddressError(), and checkStatusBits().

1251  {
1254  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool apvAddressErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const

◆ apvAddressError() [2/2]

bool sistrip::FEDFullDebugHeader::apvAddressError ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum,
const uint8_t  apvNum 
) const
inline

Definition at line 1256 of file SiStripFEDBufferComponents.h.

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

1258  {
1259  return apvAddressError(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum);
1260  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool apvAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const

◆ apvAddressErrorFromBit()

bool sistrip::FEDFullDebugHeader::apvAddressErrorFromBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
inlineprivate

Definition at line 1285 of file SiStripFEDBufferComponents.h.

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

Referenced by apvAddressError().

1286  {
1287  return !getBit(internalFEDChannelNum, 1 + 2 * apvNum);
1288  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const

◆ apvError() [1/2]

bool sistrip::FEDFullDebugHeader::apvError ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
inline

Definition at line 1240 of file SiStripFEDBufferComponents.h.

References apvErrorFromBit(), sistrip::internalFEDChannelNum(), outOfSyncFromBit(), and unlockedFromBit().

Referenced by apvError(), and checkStatusBits().

1240  {
1243  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool apvErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const

◆ apvError() [2/2]

bool sistrip::FEDFullDebugHeader::apvError ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum,
const uint8_t  apvNum 
) const
inline

Definition at line 1245 of file SiStripFEDBufferComponents.h.

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

1247  {
1248  return apvError(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum);
1249  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool apvError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const

◆ apvErrorFromBit()

bool sistrip::FEDFullDebugHeader::apvErrorFromBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
inlineprivate

Definition at line 1275 of file SiStripFEDBufferComponents.h.

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

Referenced by apvError().

1275  {
1276  //Discovered March 2012: two bits inverted in firmware. Decided
1277  //to update documentation but keep firmware identical for
1278  //backward compatibility. So status bit order is actually:
1279  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1280  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1281 
1282  return !getBit(internalFEDChannelNum, 0 + 2 * (1 - apvNum));
1283  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const

◆ beStatusRegister()

FEDBackendStatusRegister sistrip::FEDFullDebugHeader::beStatusRegister ( ) const
inline

Definition at line 1206 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

Referenced by FEDFullDebugHeader(), and setBEStatusRegister().

1206  {
1207  return FEDBackendStatusRegister(get32BitWordFrom(feWord(0) + 10));
1208  }
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
uint8_t * feWord(const uint8_t internalFEUnitNum)

◆ checkChannelStatusBits()

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

Implements sistrip::FEDFEHeader.

Definition at line 1134 of file SiStripFEDBufferComponents.cc.

References sistrip::CHANNEL_STATUS_NO_PROBLEMS, getChannelStatus(), and sistrip::internalFEDChannelNum().

1134  {
1135  //return ( !unlockedFromBit(internalFEDChannelNum) &&
1136  // !outOfSyncFromBit(internalFEDChannelNum) &&
1137  // !apvErrorFromBit(internalFEDChannelNum,0) &&
1138  // !apvAddressErrorFromBit(internalFEDChannelNum,0) &&
1139  // !apvErrorFromBit(internalFEDChannelNum,1) &&
1140  // !apvAddressErrorFromBit(internalFEDChannelNum,1) );
1142  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDChannelStatus getChannelStatus(const uint8_t internalFEDChannelNum) const

◆ checkStatusBits()

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

Implements sistrip::FEDFEHeader.

Definition at line 1129 of file SiStripFEDBufferComponents.cc.

References apvAddressError(), apvError(), sistrip::internalFEDChannelNum(), outOfSyncFromBit(), and unlockedFromBit().

1129  {
1132  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool apvError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
bool apvAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const

◆ clone()

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

Implements sistrip::FEDFEHeader.

Definition at line 1127 of file SiStripFEDBufferComponents.cc.

References FEDFullDebugHeader().

1127 { return new FEDFullDebugHeader(*this); }
FEDFullDebugHeader(const uint8_t *headerBuffer)

◆ daqRegister()

uint32_t sistrip::FEDFullDebugHeader::daqRegister ( ) const
inline

Definition at line 1210 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

Referenced by FEDFullDebugHeader(), and setDAQRegister().

1210 { return get32BitWordFrom(feWord(7) + 10); }
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
uint8_t * feWord(const uint8_t internalFEUnitNum)

◆ daqRegister2()

uint32_t sistrip::FEDFullDebugHeader::daqRegister2 ( ) const
inline

Definition at line 1212 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

Referenced by FEDFullDebugHeader(), and setDAQRegister2().

1212 { return get32BitWordFrom(feWord(6) + 10); }
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
uint8_t * feWord(const uint8_t internalFEUnitNum)

◆ data()

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

Implements sistrip::FEDFEHeader.

Definition at line 1185 of file SiStripFEDBufferComponents.cc.

References header_.

1185 { return header_; }
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]

◆ fePresent()

bool sistrip::FEDFullDebugHeader::fePresent ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1218 of file SiStripFEDBufferComponents.h.

References feUnitLength().

Referenced by sistrip::FEDBuffer::FEDBuffer().

1218  {
1219  return (feUnitLength(internalFEUnitNum) != 0);
1220  }
uint16_t feUnitLength(const uint8_t internalFEUnitNum) const

◆ feUnitLength()

uint16_t sistrip::FEDFullDebugHeader::feUnitLength ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1214 of file SiStripFEDBufferComponents.h.

References feWord().

Referenced by sistrip::FEDBuffer::checkFEUnitLengths(), sistrip::FEDBuffer::checkSummary(), and fePresent().

1214  {
1215  return ((feWord(internalFEUnitNum)[15] << 8) | (feWord(internalFEUnitNum)[14]));
1216  }
uint8_t * feWord(const uint8_t internalFEUnitNum)

◆ feUnitMajorityAddress()

uint8_t sistrip::FEDFullDebugHeader::feUnitMajorityAddress ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1202 of file SiStripFEDBufferComponents.h.

References feWord().

Referenced by sistrip::FEDBuffer::checkFEUnitAPVAddresses(), and sistrip::FEDBuffer::checkSummary().

1202  {
1203  return feWord(internalFEUnitNum)[9];
1204  }
uint8_t * feWord(const uint8_t internalFEUnitNum)

◆ feWord() [1/2]

uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum)
inline

◆ feWord() [2/2]

const uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1304 of file SiStripFEDBufferComponents.h.

References header_.

1304  {
1305  return header_ + internalFEUnitNum * 2 * 8;
1306  }
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]

◆ get32BitWordFrom()

uint32_t sistrip::FEDFullDebugHeader::get32BitWordFrom ( const uint8_t *  startOfWord)
inlinestatic

Definition at line 1296 of file SiStripFEDBufferComponents.h.

Referenced by beStatusRegister(), daqRegister(), and daqRegister2().

1296  {
1297  return (startOfWord[0] | (startOfWord[1] << 8) | (startOfWord[2] << 16) | (startOfWord[3] << 24));
1298  }

◆ getBit()

bool sistrip::FEDFullDebugHeader::getBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  bit 
) const
inlineprivate

Definition at line 1290 of file SiStripFEDBufferComponents.h.

References sistrip::FEDCH_PER_FEUNIT, feWord(), sistrip::internalFEDChannelNum(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by apvAddressErrorFromBit(), apvErrorFromBit(), outOfSyncFromBit(), and unlockedFromBit().

1290  {
1291  const uint8_t* pFEWord = feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT);
1292  const uint8_t bitInFeWord = ((FEDCH_PER_FEUNIT - 1) - (internalFEDChannelNum % FEDCH_PER_FEUNIT)) * 6 + bit;
1293  return (pFEWord[bitInFeWord / 8] & (0x1 << (bitInFeWord % 8)));
1294  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
uint8_t * feWord(const uint8_t internalFEUnitNum)
static const uint16_t FEDCH_PER_FEUNIT

◆ getChannelStatus() [1/2]

FEDChannelStatus sistrip::FEDFullDebugHeader::getChannelStatus ( const uint8_t  internalFEDChannelNum) const

Definition at line 1144 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, feWord(), and sistrip::internalFEDChannelNum().

Referenced by checkChannelStatusBits(), sistrip::FEDBuffer::checkSummary(), and getChannelStatus().

1144  {
1145  const uint8_t* pFEWord = feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT);
1146  const uint8_t feUnitChanNum = internalFEDChannelNum % FEDCH_PER_FEUNIT;
1147  const uint8_t startByteInFEWord = (FEDCH_PER_FEUNIT - 1 - feUnitChanNum) * 6 / 8;
1148  switch ((FEDCH_PER_FEUNIT - 1 - feUnitChanNum) % 4) {
1149  case 0:
1150  return FEDChannelStatus(pFEWord[startByteInFEWord] & 0x3F);
1151  case 1:
1152  return FEDChannelStatus(((pFEWord[startByteInFEWord] & 0xC0) >> 6) |
1153  ((pFEWord[startByteInFEWord + 1] & 0x0F) << 2));
1154  case 2:
1155  return FEDChannelStatus(((pFEWord[startByteInFEWord] & 0xF0) >> 4) |
1156  ((pFEWord[startByteInFEWord + 1] & 0x03) << 4));
1157  case 3:
1158  return FEDChannelStatus((pFEWord[startByteInFEWord] & 0xFC) >> 2);
1159  //stop compiler warning
1160  default:
1161  return FEDChannelStatus(0);
1162  }
1163  /*const uint8_t feUnitChanNum = internalFEDChannelNum / FEDCH_PER_FEUNIT;
1164  const uint8_t* pFEWord = feWord(feUnitChanNum);
1165  const uint8_t startByteInFEWord = feUnitChanNum * 3 / 4;
1166  //const uint8_t shift = ( 6 - ((feUnitChanNum-1)%4) );
1167  //const uint16_t mask = ( 0x003F << shift );
1168  //uint8_t result = ( (pFEWord[startByteInFEWord] & (mask&0x00FF)) >> shift );
1169  //result |= ( (pFEWord[startByteInFEWord+1] & (mask>>8)) << (8-shift) );
1170  switch (feUnitChanNum % 4) {
1171  case 0:
1172  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1173  case 1:
1174  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1175  case 2:
1176  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1177  case 3:
1178  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1179  //stop compiler warning
1180  default:
1181  return FEDChannelStatus(0);
1182  }*/
1183  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
uint8_t * feWord(const uint8_t internalFEUnitNum)
static const uint16_t FEDCH_PER_FEUNIT

◆ getChannelStatus() [2/2]

FEDChannelStatus sistrip::FEDFullDebugHeader::getChannelStatus ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum 
) const
inline

Definition at line 1262 of file SiStripFEDBufferComponents.h.

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

1263  {
1264  return getChannelStatus(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum));
1265  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDChannelStatus getChannelStatus(const uint8_t internalFEDChannelNum) const

◆ lengthInBytes()

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

Implements sistrip::FEDFEHeader.

Definition at line 1123 of file SiStripFEDBufferComponents.cc.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES.

static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES

◆ outOfSync() [1/2]

bool sistrip::FEDFullDebugHeader::outOfSync ( const uint8_t  internalFEDChannelNum) const
inline

Definition at line 1231 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum(), outOfSyncFromBit(), and unlocked().

Referenced by outOfSync().

1231  {
1233  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool unlocked(const uint8_t internalFEDChannelNum) const
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const

◆ outOfSync() [2/2]

bool sistrip::FEDFullDebugHeader::outOfSync ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum 
) const
inline

Definition at line 1235 of file SiStripFEDBufferComponents.h.

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

1236  {
1237  return outOfSync(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum));
1238  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool outOfSync(const uint8_t internalFEDChannelNum) const

◆ outOfSyncFromBit()

bool sistrip::FEDFullDebugHeader::outOfSyncFromBit ( const uint8_t  internalFEDChannelNum) const
inlineprivate

Definition at line 1271 of file SiStripFEDBufferComponents.h.

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

Referenced by apvAddressError(), apvError(), checkStatusBits(), and outOfSync().

1271  {
1272  return !getBit(internalFEDChannelNum, 4);
1273  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const

◆ print()

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

Implements sistrip::FEDFEHeader.

Definition at line 1125 of file SiStripFEDBufferComponents.cc.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES, header_, and sistrip::printHex().

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

◆ set32BitReservedRegister()

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

Implements sistrip::FEDFEHeader.

Definition at line 1230 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

1230  {
1231  set32BitWordAt(feWord(internalFEUnitNum) + 10, reservedRegister);
1232  }
uint8_t * feWord(const uint8_t internalFEUnitNum)
static void set32BitWordAt(uint8_t *startOfWord, const uint32_t value)

◆ set32BitWordAt()

void sistrip::FEDFullDebugHeader::set32BitWordAt ( uint8_t *  startOfWord,
const uint32_t  value 
)
inlinestaticprivate

Definition at line 1300 of file SiStripFEDBufferComponents.h.

Referenced by set32BitReservedRegister(), setBEStatusRegister(), setDAQRegister(), and setDAQRegister2().

1300  {
1301  memcpy(startOfWord, &value, 4);
1302  }
Definition: value.py:1

◆ setAPVAddressError()

void sistrip::FEDFullDebugHeader::setAPVAddressError ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  value 
)
inlineprivate

Definition at line 1321 of file SiStripFEDBufferComponents.h.

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

Referenced by setChannelStatus().

1323  {
1324  setBit(internalFEDChannelNum, 1 + 2 * apvNum, !value);
1325  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
Definition: value.py:1
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)

◆ setAPVError()

void sistrip::FEDFullDebugHeader::setAPVError ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  value 
)
inlineprivate

Definition at line 1327 of file SiStripFEDBufferComponents.h.

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

Referenced by setChannelStatus().

1329  {
1330  //Discovered March 2012: two bits inverted in firmware. Decided
1331  //to update documentation but keep firmware identical for
1332  //backward compatibility. So status bit order is actually:
1333  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1334  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1335 
1336  setBit(internalFEDChannelNum, 0 + 2 * (1 - apvNum), !value);
1337  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
Definition: value.py:1
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)

◆ setBEStatusRegister()

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

Implements sistrip::FEDFEHeader.

Definition at line 1219 of file SiStripFEDBufferComponents.cc.

References beStatusRegister(), feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1219  {
1221  }
FEDBackendStatusRegister beStatusRegister() const
uint8_t * feWord(const uint8_t internalFEUnitNum)
static void set32BitWordAt(uint8_t *startOfWord, const uint32_t value)

◆ setBit()

void sistrip::FEDFullDebugHeader::setBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  bit,
const bool  value 
)
private

Definition at line 1239 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, feWord(), sistrip::internalFEDChannelNum(), and gpuClustering::pixelStatus::mask.

Referenced by setAPVAddressError(), setAPVError(), setOutOfSync(), and setUnlocked().

1239  {
1240  const uint8_t bitInFeWord = (FEDCH_PER_FEUNIT - 1 - (internalFEDChannelNum % FEDCH_PER_FEUNIT)) * 6 + bit;
1241  uint8_t& byte = *(feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT) + (bitInFeWord / 8));
1242  const uint8_t mask = (0x1 << bitInFeWord % 8);
1243  byte = ((byte & (~mask)) | (value ? mask : 0x0));
1244  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
constexpr uint32_t mask
Definition: gpuClustering.h:24
Definition: value.py:1
uint8_t * feWord(const uint8_t internalFEUnitNum)
static const uint16_t FEDCH_PER_FEUNIT

◆ setChannelStatus()

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

Implements sistrip::FEDFEHeader.

Definition at line 1206 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(), setAPVAddressError(), setAPVError(), setOutOfSync(), setUnlocked(), and mps_update::status.

Referenced by FEDFullDebugHeader().

1206  {
1213  }
void setOutOfSync(const uint8_t internalFEDChannelNum, const bool value)
void setAPVError(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value)
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
void setUnlocked(const uint8_t internalFEDChannelNum, const bool value)
void setAPVAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value)

◆ setDAQRegister()

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

Implements sistrip::FEDFEHeader.

Definition at line 1223 of file SiStripFEDBufferComponents.cc.

References daqRegister(), feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1223 { set32BitWordAt(feWord(7) + 10, daqRegister); }
uint8_t * feWord(const uint8_t internalFEUnitNum)
static void set32BitWordAt(uint8_t *startOfWord, const uint32_t value)

◆ setDAQRegister2()

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

Implements sistrip::FEDFEHeader.

Definition at line 1225 of file SiStripFEDBufferComponents.cc.

References daqRegister2(), feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1225  {
1227  }
uint8_t * feWord(const uint8_t internalFEUnitNum)
static void set32BitWordAt(uint8_t *startOfWord, const uint32_t value)

◆ setFEUnitLength()

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

Implements sistrip::FEDFEHeader.

Definition at line 1234 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

1234  {
1235  feWord(internalFEUnitNum)[15] = ((length & 0xFF00) >> 8);
1236  feWord(internalFEUnitNum)[14] = (length & 0x00FF);
1237  }
uint8_t * feWord(const uint8_t internalFEUnitNum)

◆ setFEUnitMajorityAddress()

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

Implements sistrip::FEDFEHeader.

Definition at line 1215 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

1215  {
1216  feWord(internalFEUnitNum)[9] = address;
1217  }
uint8_t * feWord(const uint8_t internalFEUnitNum)

◆ setOutOfSync()

void sistrip::FEDFullDebugHeader::setOutOfSync ( const uint8_t  internalFEDChannelNum,
const bool  value 
)
inlineprivate

Definition at line 1317 of file SiStripFEDBufferComponents.h.

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

Referenced by setChannelStatus().

1317  {
1319  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
Definition: value.py:1
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)

◆ setUnlocked()

void sistrip::FEDFullDebugHeader::setUnlocked ( const uint8_t  internalFEDChannelNum,
const bool  value 
)
inlineprivate

Definition at line 1313 of file SiStripFEDBufferComponents.h.

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

Referenced by setChannelStatus().

1313  {
1315  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
Definition: value.py:1
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)

◆ unlocked() [1/2]

bool sistrip::FEDFullDebugHeader::unlocked ( const uint8_t  internalFEDChannelNum) const
inline

Definition at line 1222 of file SiStripFEDBufferComponents.h.

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

Referenced by outOfSync(), and unlocked().

1222  {
1224  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const

◆ unlocked() [2/2]

bool sistrip::FEDFullDebugHeader::unlocked ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum 
) const
inline

Definition at line 1226 of file SiStripFEDBufferComponents.h.

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

1227  {
1228  return unlocked(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum));
1229  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool unlocked(const uint8_t internalFEDChannelNum) const

◆ unlockedFromBit()

bool sistrip::FEDFullDebugHeader::unlockedFromBit ( const uint8_t  internalFEDChannelNum) const
inlineprivate

Definition at line 1267 of file SiStripFEDBufferComponents.h.

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

Referenced by apvAddressError(), apvError(), checkStatusBits(), and unlocked().

1267  {
1268  return !getBit(internalFEDChannelNum, 5);
1269  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const

Member Data Documentation

◆ FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS

const size_t sistrip::FEDFullDebugHeader::FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS = FEUNITS_PER_FED * 2
staticprivate

Definition at line 610 of file SiStripFEDBufferComponents.h.

◆ FULL_DEBUG_HEADER_SIZE_IN_BYTES

const size_t sistrip::FEDFullDebugHeader::FULL_DEBUG_HEADER_SIZE_IN_BYTES = FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS * 8
staticprivate

Definition at line 611 of file SiStripFEDBufferComponents.h.

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

◆ header_

uint8_t sistrip::FEDFullDebugHeader::header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
private

Definition at line 612 of file SiStripFEDBufferComponents.h.

Referenced by data(), FEDFullDebugHeader(), feWord(), and print().