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::auto_ptr< FEDFEHeadernewFEFakeHeader (const FEDHeaderType headerType)
 
static std::auto_ptr< FEDFEHeadernewFEHeader (const FEDHeaderType headerType, const uint8_t *headerBuffer)
 
static std::auto_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 469 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

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

Definition at line 1076 of file SiStripFEDBufferComponents.h.

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

1144  {
1148  }
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 1150 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

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

References sistrip::FEDBackendStatusRegister::getBit().

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

1132  {
1136  }
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 1138 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

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

References sistrip::FEDBackendStatusRegister::getBit().

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

References sistrip::FEDBackendStatusRegister::FEDBackendStatusRegister().

1087  {
1088  return FEDBackendStatusRegister(get32BitWordFrom(feWord(0)+10));
1089  }
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 1091 of file SiStripFEDBufferComponents.h.

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

1092  {
1093  return get32BitWordFrom(feWord(7)+10);
1094  }
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 1096 of file SiStripFEDBufferComponents.h.

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

1097  {
1098  return get32BitWordFrom(feWord(6)+10);
1099  }
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 1106 of file SiStripFEDBufferComponents.h.

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

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

Definition at line 1101 of file SiStripFEDBufferComponents.h.

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

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

Definition at line 1081 of file SiStripFEDBufferComponents.h.

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

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

Definition at line 1203 of file SiStripFEDBufferComponents.h.

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

Definition at line 1209 of file SiStripFEDBufferComponents.h.

1210  {
1211  return const_cast<uint8_t*>(static_cast<const FEDFullDebugHeader*>(this)->feWord(internalFEUnitNum));
1212  }
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 1193 of file SiStripFEDBufferComponents.h.

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

Definition at line 1186 of file SiStripFEDBufferComponents.h.

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

1187  {
1188  const uint8_t* pFEWord = feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT);
1189  const uint8_t bitInFeWord = ((FEDCH_PER_FEUNIT-1) - (internalFEDChannelNum%FEDCH_PER_FEUNIT)) * 6 + bit;
1190  return ( pFEWord[bitInFeWord/8] & (0x1 << (bitInFeWord%8)) );
1191  }
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 1155 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

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

1122  {
1124  }
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 1126 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

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

References sistrip::FEDBackendStatusRegister::getBit().

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

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

Definition at line 1224 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::setBit().

1225  {
1226  setBit(internalFEDChannelNum,1+2*apvNum,!value);
1227  }
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 1229 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::setBit().

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

References sistrip::FEDBackendStatusRegister::setBit().

1220  {
1222  }
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 1214 of file SiStripFEDBufferComponents.h.

References sistrip::FEDBackendStatusRegister::setBit().

1215  {
1217  }
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 1111 of file SiStripFEDBufferComponents.h.

1112  {
1114  }
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 1116 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

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

References sistrip::FEDBackendStatusRegister::getBit().

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

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

Definition at line 542 of file SiStripFEDBufferComponents.h.