CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< FEDFEHeader
newFEFakeHeader (const FEDHeaderType headerType)
 
static std::unique_ptr
< FEDFEHeader
newFEHeader (const FEDHeaderType headerType, const uint8_t *headerBuffer)
 
static std::unique_ptr
< FEDFEHeader
newFEHeader (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

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]
sistrip::FEDFullDebugHeader::~FEDFullDebugHeader ( )
override

Definition at line 1121 of file SiStripFEDBufferComponents.cc.

1121 {}
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 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

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

Definition at line 1251 of file SiStripFEDBufferComponents.h.

References apvAddressErrorFromBit(), outOfSyncFromBit(), and unlockedFromBit().

Referenced by apvAddressError(), and checkStatusBits().

1251  {
1254  }
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool apvAddressErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const
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
bool sistrip::FEDFullDebugHeader::apvAddressErrorFromBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
inlineprivate

Definition at line 1285 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by apvAddressError().

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

Definition at line 1240 of file SiStripFEDBufferComponents.h.

References apvErrorFromBit(), outOfSyncFromBit(), and unlockedFromBit().

Referenced by apvError(), and checkStatusBits().

1240  {
1243  }
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool apvErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const
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
bool sistrip::FEDFullDebugHeader::apvErrorFromBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
inlineprivate

Definition at line 1275 of file SiStripFEDBufferComponents.h.

References getBit().

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  }
bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDBackendStatusRegister sistrip::FEDFullDebugHeader::beStatusRegister ( ) const
inline

Definition at line 1206 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

1206  {
1207  return FEDBackendStatusRegister(get32BitWordFrom(feWord(0) + 10));
1208  }
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
uint8_t * feWord(const uint8_t internalFEUnitNum)
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, and getChannelStatus().

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
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(), outOfSyncFromBit(), and unlockedFromBit().

1129  {
1132  }
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
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 outOfSyncFromBit(const uint8_t internalFEDChannelNum) const
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)
uint32_t sistrip::FEDFullDebugHeader::daqRegister ( ) const
inline

Definition at line 1210 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

Referenced by sistrip::RawToDigiUnpacker::updateEventSummary().

1210 { return get32BitWordFrom(feWord(7) + 10); }
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
uint8_t * feWord(const uint8_t internalFEUnitNum)
uint32_t sistrip::FEDFullDebugHeader::daqRegister2 ( ) const
inline

Definition at line 1212 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

Referenced by sistrip::RawToDigiUnpacker::updateEventSummary().

1212 { return get32BitWordFrom(feWord(6) + 10); }
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
uint8_t * feWord(const uint8_t internalFEUnitNum)
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]
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
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)
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(), sistrip::FEDBuffer::checkSummary(), and sistrip::SpyEventMatcherModule::findL1IDandAPVAddress().

1202  {
1203  return feWord(internalFEUnitNum)[9];
1204  }
uint8_t * feWord(const uint8_t internalFEUnitNum)
uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum)
inline
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]
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  }
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, and feWord().

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
FEDChannelStatus sistrip::FEDFullDebugHeader::getChannelStatus ( const uint8_t  internalFEDChannelNum) const

Definition at line 1144 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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
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
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
bool sistrip::FEDFullDebugHeader::outOfSync ( const uint8_t  internalFEDChannelNum) const
inline

Definition at line 1231 of file SiStripFEDBufferComponents.h.

References outOfSyncFromBit(), and unlocked().

Referenced by outOfSync().

1231  {
1233  }
bool unlocked(const uint8_t internalFEDChannelNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const
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
bool sistrip::FEDFullDebugHeader::outOfSyncFromBit ( const uint8_t  internalFEDChannelNum) const
inlineprivate

Definition at line 1271 of file SiStripFEDBufferComponents.h.

References getBit().

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

1271  {
1272  return !getBit(internalFEDChannelNum, 4);
1273  }
bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
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]
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)
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  }
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 setBit().

Referenced by setChannelStatus().

1323  {
1324  setBit(internalFEDChannelNum, 1 + 2 * apvNum, !value);
1325  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)
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 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)
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)
void sistrip::FEDFullDebugHeader::setBEStatusRegister ( const FEDBackendStatusRegister  beStatusRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1219 of file SiStripFEDBufferComponents.cc.

References 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)
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, and feWord().

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)
uint8_t * feWord(const uint8_t internalFEUnitNum)
static const uint16_t FEDCH_PER_FEUNIT
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, setAPVAddressError(), setAPVError(), setOutOfSync(), and setUnlocked().

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)
list status
Definition: mps_update.py:107
void setUnlocked(const uint8_t internalFEDChannelNum, const bool value)
void setAPVAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value)
void sistrip::FEDFullDebugHeader::setDAQRegister ( const uint32_t  daqRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1223 of file SiStripFEDBufferComponents.cc.

References 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)
void sistrip::FEDFullDebugHeader::setDAQRegister2 ( const uint32_t  daqRegister2)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1225 of file SiStripFEDBufferComponents.cc.

References 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)
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)
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)
void sistrip::FEDFullDebugHeader::setOutOfSync ( const uint8_t  internalFEDChannelNum,
const bool  value 
)
inlineprivate

Definition at line 1317 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

1317  {
1319  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)
void sistrip::FEDFullDebugHeader::setUnlocked ( const uint8_t  internalFEDChannelNum,
const bool  value 
)
inlineprivate

Definition at line 1313 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

1313  {
1315  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)
bool sistrip::FEDFullDebugHeader::unlocked ( const uint8_t  internalFEDChannelNum) const
inline

Definition at line 1222 of file SiStripFEDBufferComponents.h.

References unlockedFromBit().

Referenced by outOfSync(), and unlocked().

1222  {
1224  }
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
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  }
bool unlocked(const uint8_t internalFEDChannelNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool sistrip::FEDFullDebugHeader::unlockedFromBit ( const uint8_t  internalFEDChannelNum) const
inlineprivate

Definition at line 1267 of file SiStripFEDBufferComponents.h.

References getBit().

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

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

Member Data Documentation

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.

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().

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().