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
 
const uint8_t * feWord (const uint8_t internalFEUnitNum) const
 
uint8_t * feWord (const uint8_t internalFEUnitNum)
 
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 470 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

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

Definition at line 1077 of file SiStripFEDBufferComponents.h.

1078  {
1079  memcpy(header_,headerBuffer,FULL_DEBUG_HEADER_SIZE_IN_BYTES);
1080  }
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 1168 of file SiStripFEDBufferComponents.cc.

1169  {
1170  }
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_FED,CHANNEL_STATUS_NO_PROBLEMS),
const FEDBackendStatusRegister  beStatusRegister = FEDBackendStatusRegister(),
const uint32_t  daqRegister = 0,
const uint32_t  daqRegister2 = 0 
)

Definition at line 1251 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FED, and sistrip::FEUNITS_PER_FED.

1254  {
1259  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1260  setFEUnitLength(iFE,feUnitLengths[iFE]);
1261  setFEUnitMajorityAddress(iFE,feMajorityAddresses[iFE]);
1262  }
1263  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1264  setChannelStatus(iCh,channelStatus[iCh]);
1265  }
1266  }
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 1144 of file SiStripFEDBufferComponents.h.

1145  {
1149  }
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 1151 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

1152  {
1153  return apvAddressError(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum);
1154  }
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 1182 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::getBit().

1183  {
1184  return !getBit(internalFEDChannelNum,1+2*apvNum);
1185  }
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 1132 of file SiStripFEDBufferComponents.h.

1133  {
1137  }
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 1139 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

1140  {
1141  return apvError(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum);
1142  }
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 1171 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::getBit().

1172  {
1173  //Discovered March 2012: two bits inverted in firmware. Decided
1174  //to update documentation but keep firmware identical for
1175  //backward compatibility. So status bit order is actually:
1176  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1177  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1178 
1179  return !getBit(internalFEDChannelNum,0+2*(1-apvNum));
1180  }
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 1087 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::FEDBackendStatusRegister().

1088  {
1089  return FEDBackendStatusRegister(get32BitWordFrom(feWord(0)+10));
1090  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
bool sistrip::FEDFullDebugHeader::checkChannelStatusBits ( const uint8_t  internalFEDChannelNum) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1195 of file SiStripFEDBufferComponents.cc.

References sistrip::CHANNEL_STATUS_NO_PROBLEMS.

1196  {
1197  //return ( !unlockedFromBit(internalFEDChannelNum) &&
1198  // !outOfSyncFromBit(internalFEDChannelNum) &&
1199  // !apvErrorFromBit(internalFEDChannelNum,0) &&
1200  // !apvAddressErrorFromBit(internalFEDChannelNum,0) &&
1201  // !apvErrorFromBit(internalFEDChannelNum,1) &&
1202  // !apvAddressErrorFromBit(internalFEDChannelNum,1) );
1204  }
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 1187 of file SiStripFEDBufferComponents.cc.

1188  {
1191  !apvError(internalFEDChannelNum,apvNum) &&
1193  }
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 1182 of file SiStripFEDBufferComponents.cc.

1183  {
1184  return new FEDFullDebugHeader(*this);
1185  }
FEDFullDebugHeader(const uint8_t *headerBuffer)
uint32_t sistrip::FEDFullDebugHeader::daqRegister ( ) const
inline

Definition at line 1092 of file SiStripFEDBufferComponents.h.

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

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

Definition at line 1097 of file SiStripFEDBufferComponents.h.

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

1098  {
1099  return get32BitWordFrom(feWord(6)+10);
1100  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
const uint8_t * sistrip::FEDFullDebugHeader::data ( ) const
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1246 of file SiStripFEDBufferComponents.cc.

1247  {
1248  return header_;
1249  }
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
bool sistrip::FEDFullDebugHeader::fePresent ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1107 of file SiStripFEDBufferComponents.h.

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

1108  {
1109  return (feUnitLength(internalFEUnitNum) != 0);
1110  }
uint16_t feUnitLength(const uint8_t internalFEUnitNum) const
uint16_t sistrip::FEDFullDebugHeader::feUnitLength ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1102 of file SiStripFEDBufferComponents.h.

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

1103  {
1104  return ( (feWord(internalFEUnitNum)[15]<<8) | (feWord(internalFEUnitNum)[14]) );
1105  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
uint8_t sistrip::FEDFullDebugHeader::feUnitMajorityAddress ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1082 of file SiStripFEDBufferComponents.h.

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

1083  {
1084  return feWord(internalFEUnitNum)[9];
1085  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
const uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1204 of file SiStripFEDBufferComponents.h.

1205  {
1206  return header_+internalFEUnitNum*2*8;
1207  }
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum)
inline

Definition at line 1210 of file SiStripFEDBufferComponents.h.

1211  {
1212  return const_cast<uint8_t*>(static_cast<const FEDFullDebugHeader*>(this)->feWord(internalFEUnitNum));
1213  }
FEDFullDebugHeader(const uint8_t *headerBuffer)
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
uint32_t sistrip::FEDFullDebugHeader::get32BitWordFrom ( const uint8_t *  startOfWord)
inlinestatic

Definition at line 1194 of file SiStripFEDBufferComponents.h.

1195  {
1196  return ( startOfWord[0] | (startOfWord[1]<<8) | (startOfWord[2]<<16) | (startOfWord[3]<<24) );
1197  }
bool sistrip::FEDFullDebugHeader::getBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  bit 
) const
inlineprivate

Definition at line 1187 of file SiStripFEDBufferComponents.h.

References sistrip::FEDCH_PER_FEUNIT, and globals_cff::x1.

1188  {
1189  const uint8_t* pFEWord = feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT);
1190  const uint8_t bitInFeWord = ((FEDCH_PER_FEUNIT-1) - (internalFEDChannelNum%FEDCH_PER_FEUNIT)) * 6 + bit;
1191  return ( pFEWord[bitInFeWord/8] & (0x1 << (bitInFeWord%8)) );
1192  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint16_t FEDCH_PER_FEUNIT
FEDChannelStatus sistrip::FEDFullDebugHeader::getChannelStatus ( const uint8_t  internalFEDChannelNum) const

Definition at line 1206 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT.

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

1207  {
1208  const uint8_t* pFEWord = feWord(internalFEDChannelNum/FEDCH_PER_FEUNIT);
1209  const uint8_t feUnitChanNum = internalFEDChannelNum % FEDCH_PER_FEUNIT;
1210  const uint8_t startByteInFEWord = (FEDCH_PER_FEUNIT-1 - feUnitChanNum) * 6 / 8;
1211  switch ( (FEDCH_PER_FEUNIT-1-feUnitChanNum) % 4 ) {
1212  case 0:
1213  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1214  case 1:
1215  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1216  case 2:
1217  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1218  case 3:
1219  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1220  //stop compiler warning
1221  default:
1222  return FEDChannelStatus(0);
1223  }
1224  /*const uint8_t feUnitChanNum = internalFEDChannelNum / FEDCH_PER_FEUNIT;
1225  const uint8_t* pFEWord = feWord(feUnitChanNum);
1226  const uint8_t startByteInFEWord = feUnitChanNum * 3 / 4;
1227  //const uint8_t shift = ( 6 - ((feUnitChanNum-1)%4) );
1228  //const uint16_t mask = ( 0x003F << shift );
1229  //uint8_t result = ( (pFEWord[startByteInFEWord] & (mask&0x00FF)) >> shift );
1230  //result |= ( (pFEWord[startByteInFEWord+1] & (mask>>8)) << (8-shift) );
1231  switch (feUnitChanNum % 4) {
1232  case 0:
1233  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1234  case 1:
1235  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1236  case 2:
1237  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1238  case 3:
1239  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1240  //stop compiler warning
1241  default:
1242  return FEDChannelStatus(0);
1243  }*/
1244  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint16_t FEDCH_PER_FEUNIT
FEDChannelStatus sistrip::FEDFullDebugHeader::getChannelStatus ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum 
) const
inline

Definition at line 1156 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

1157  {
1158  return getChannelStatus(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum));
1159  }
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 1172 of file SiStripFEDBufferComponents.cc.

1173  {
1175  }
static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES
bool sistrip::FEDFullDebugHeader::outOfSync ( const uint8_t  internalFEDChannelNum) const
inline

Definition at line 1122 of file SiStripFEDBufferComponents.h.

1123  {
1125  }
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 1127 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

1128  {
1129  return outOfSync(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum));
1130  }
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 1166 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::getBit().

1167  {
1168  return !getBit(internalFEDChannelNum,4);
1169  }
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 1177 of file SiStripFEDBufferComponents.cc.

References sistrip::printHex().

1178  {
1180  }
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 1299 of file SiStripFEDBufferComponents.cc.

1300  {
1301  set32BitWordAt(feWord(internalFEUnitNum)+10,reservedRegister);
1302  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
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 1199 of file SiStripFEDBufferComponents.h.

1200  {
1201  memcpy(startOfWord,&value,4);
1202  }
Definition: value.py:1
void sistrip::FEDFullDebugHeader::setAPVAddressError ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  value 
)
inlineprivate

Definition at line 1225 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::setBit().

1226  {
1227  setBit(internalFEDChannelNum,1+2*apvNum,!value);
1228  }
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)
void sistrip::FEDFullDebugHeader::setAPVError ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  value 
)
inlineprivate

Definition at line 1230 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::setBit().

1231  {
1232  //Discovered March 2012: two bits inverted in firmware. Decided
1233  //to update documentation but keep firmware identical for
1234  //backward compatibility. So status bit order is actually:
1235  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1236  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1237 
1238  setBit(internalFEDChannelNum,0+2*(1-apvNum),!value);
1239  }
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)
void sistrip::FEDFullDebugHeader::setBEStatusRegister ( const FEDBackendStatusRegister  beStatusRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1283 of file SiStripFEDBufferComponents.cc.

1284  {
1286  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
FEDBackendStatusRegister beStatusRegister() const
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 1310 of file SiStripFEDBufferComponents.cc.

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

1311  {
1312  const uint8_t bitInFeWord = (FEDCH_PER_FEUNIT-1 - (internalFEDChannelNum%FEDCH_PER_FEUNIT)) * 6 + bit;
1313  uint8_t& byte = *(feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT)+(bitInFeWord/8));
1314  const uint8_t mask = (0x1 << bitInFeWord%8);
1315  byte = ( (byte & (~mask)) | (value?mask:0x0) );
1316  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
Definition: value.py:1
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 1268 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.

1269  {
1276  }
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)
void sistrip::FEDFullDebugHeader::setDAQRegister ( const uint32_t  daqRegister)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1288 of file SiStripFEDBufferComponents.cc.

1289  {
1291  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
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 1293 of file SiStripFEDBufferComponents.cc.

1294  {
1296  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
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 1304 of file SiStripFEDBufferComponents.cc.

1305  {
1306  feWord(internalFEUnitNum)[15] = ( (length & 0xFF00) >> 8);
1307  feWord(internalFEUnitNum)[14] = (length & 0x00FF);
1308  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
void sistrip::FEDFullDebugHeader::setFEUnitMajorityAddress ( const uint8_t  internalFEUnitNum,
const uint8_t  address 
)
overridevirtual

Implements sistrip::FEDFEHeader.

Definition at line 1278 of file SiStripFEDBufferComponents.cc.

1279  {
1280  feWord(internalFEUnitNum)[9] = address;
1281  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
void sistrip::FEDFullDebugHeader::setOutOfSync ( const uint8_t  internalFEDChannelNum,
const bool  value 
)
inlineprivate

Definition at line 1220 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::setBit().

1221  {
1223  }
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)
void sistrip::FEDFullDebugHeader::setUnlocked ( const uint8_t  internalFEDChannelNum,
const bool  value 
)
inlineprivate

Definition at line 1215 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::setBit().

1216  {
1218  }
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)
bool sistrip::FEDFullDebugHeader::unlocked ( const uint8_t  internalFEDChannelNum) const
inline

Definition at line 1112 of file SiStripFEDBufferComponents.h.

1113  {
1115  }
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 1117 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

1118  {
1119  return unlocked(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum));
1120  }
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 1161 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::getBit().

1162  {
1163  return !getBit(internalFEDChannelNum,5);
1164  }
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 541 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 542 of file SiStripFEDBufferComponents.h.

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

Definition at line 543 of file SiStripFEDBufferComponents.h.