CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
 
virtual bool checkChannelStatusBits (const uint8_t internalFEDChannelNum) const
 
virtual bool checkStatusBits (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
 
virtual FEDFullDebugHeaderclone () const
 
uint32_t daqRegister () const
 
uint32_t daqRegister2 () const
 
virtual const uint8_t * data () const
 
 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
 
virtual size_t lengthInBytes () const
 
bool outOfSync (const uint8_t internalFEDChannelNum) const
 
bool outOfSync (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const
 
virtual void print (std::ostream &os) const
 
virtual void set32BitReservedRegister (const uint8_t internalFEUnitNum, const uint32_t reservedRegister)
 
virtual void setBEStatusRegister (const FEDBackendStatusRegister beStatusRegister)
 
virtual void setChannelStatus (const uint8_t internalFEDChannelNum, const FEDChannelStatus status)
 
virtual void setDAQRegister (const uint32_t daqRegister)
 
virtual void setDAQRegister2 (const uint32_t daqRegister2)
 
virtual void setFEUnitLength (const uint8_t internalFEUnitNum, const uint16_t length)
 
virtual void setFEUnitMajorityAddress (const uint8_t internalFEUnitNum, const uint8_t address)
 
bool unlocked (const uint8_t internalFEDChannelNum) const
 
bool unlocked (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const
 
virtual ~FEDFullDebugHeader ()
 
- 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.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

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

Definition at line 1117 of file SiStripFEDBufferComponents.cc.

1118  {
1119  }
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 1200 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().

1203  {
1208  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1209  setFEUnitLength(iFE,feUnitLengths[iFE]);
1210  setFEUnitMajorityAddress(iFE,feMajorityAddresses[iFE]);
1211  }
1212  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1213  setChannelStatus(iCh,channelStatus[iCh]);
1214  }
1215  }
virtual void setDAQRegister(const uint32_t daqRegister)
FEDBackendStatusRegister beStatusRegister() const
virtual void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address)
virtual void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length)
virtual void setBEStatusRegister(const FEDBackendStatusRegister beStatusRegister)
static const uint16_t FEUNITS_PER_FED
virtual void setDAQRegister2(const uint32_t daqRegister2)
static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES
virtual void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status)
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
static const uint16_t FEDCH_PER_FED

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.

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

Referenced by apvAddressError(), and checkStatusBits().

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 apvAddressError(), and 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 getBit().

Referenced by apvAddressError().

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.

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

Referenced by apvError(), and checkStatusBits().

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 apvError(), and 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 getBit().

Referenced by apvError().

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

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
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1144 of file SiStripFEDBufferComponents.cc.

References sistrip::CHANNEL_STATUS_NO_PROBLEMS, and getChannelStatus().

1145  {
1146  //return ( !unlockedFromBit(internalFEDChannelNum) &&
1147  // !outOfSyncFromBit(internalFEDChannelNum) &&
1148  // !apvErrorFromBit(internalFEDChannelNum,0) &&
1149  // !apvAddressErrorFromBit(internalFEDChannelNum,0) &&
1150  // !apvErrorFromBit(internalFEDChannelNum,1) &&
1151  // !apvAddressErrorFromBit(internalFEDChannelNum,1) );
1153  }
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
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1136 of file SiStripFEDBufferComponents.cc.

References apvAddressError(), apvError(), outOfSyncFromBit(), and unlockedFromBit().

1137  {
1140  !apvError(internalFEDChannelNum,apvNum) &&
1142  }
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
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1131 of file SiStripFEDBufferComponents.cc.

References FEDFullDebugHeader().

1132  {
1133  return new FEDFullDebugHeader(*this);
1134  }
FEDFullDebugHeader(const uint8_t *headerBuffer)
uint32_t sistrip::FEDFullDebugHeader::daqRegister ( ) const
inline

Definition at line 1091 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

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.

References feWord(), and get32BitWordFrom().

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
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1195 of file SiStripFEDBufferComponents.cc.

References header_.

Referenced by cuy.FindIssue::__init__().

1196  {
1197  return header_;
1198  }
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.

References feUnitLength().

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.

References feWord().

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

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.

References feWord().

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
uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum)
inline

Definition at line 1209 of file SiStripFEDBufferComponents.h.

References feWord().

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.

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

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

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

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 1155 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

1156  {
1157  const uint8_t* pFEWord = feWord(internalFEDChannelNum/FEDCH_PER_FEUNIT);
1158  const uint8_t feUnitChanNum = internalFEDChannelNum % FEDCH_PER_FEUNIT;
1159  const uint8_t startByteInFEWord = (FEDCH_PER_FEUNIT-1 - feUnitChanNum) * 6 / 8;
1160  switch ( (FEDCH_PER_FEUNIT-1-feUnitChanNum) % 4 ) {
1161  case 0:
1162  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1163  case 1:
1164  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1165  case 2:
1166  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1167  case 3:
1168  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1169  //stop compiler warning
1170  default:
1171  return FEDChannelStatus(0);
1172  }
1173  /*const uint8_t feUnitChanNum = internalFEDChannelNum / FEDCH_PER_FEUNIT;
1174  const uint8_t* pFEWord = feWord(feUnitChanNum);
1175  const uint8_t startByteInFEWord = feUnitChanNum * 3 / 4;
1176  //const uint8_t shift = ( 6 - ((feUnitChanNum-1)%4) );
1177  //const uint16_t mask = ( 0x003F << shift );
1178  //uint8_t result = ( (pFEWord[startByteInFEWord] & (mask&0x00FF)) >> shift );
1179  //result |= ( (pFEWord[startByteInFEWord+1] & (mask>>8)) << (8-shift) );
1180  switch (feUnitChanNum % 4) {
1181  case 0:
1182  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1183  case 1:
1184  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1185  case 2:
1186  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1187  case 3:
1188  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1189  //stop compiler warning
1190  default:
1191  return FEDChannelStatus(0);
1192  }*/
1193  }
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 getChannelStatus(), and 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
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1121 of file SiStripFEDBufferComponents.cc.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES.

1122  {
1124  }
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.

References outOfSyncFromBit(), and unlocked().

Referenced by outOfSync().

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

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

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

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
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1126 of file SiStripFEDBufferComponents.cc.

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

1127  {
1129  }
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 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1248 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

1249  {
1250  set32BitWordAt(feWord(internalFEUnitNum)+10,reservedRegister);
1251  }
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.

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

1199  {
1200  memcpy(startOfWord,&value,4);
1201  }
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 setBit().

Referenced by setChannelStatus().

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

References setBit().

Referenced by setChannelStatus().

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)
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)
void sistrip::FEDFullDebugHeader::setBEStatusRegister ( const FEDBackendStatusRegister  beStatusRegister)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1232 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1233  {
1235  }
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 1259 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

1260  {
1261  const uint8_t bitInFeWord = (FEDCH_PER_FEUNIT-1 - (internalFEDChannelNum%FEDCH_PER_FEUNIT)) * 6 + bit;
1262  uint8_t& byte = *(feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT)+(bitInFeWord/8));
1263  const uint8_t mask = (0x1 << bitInFeWord%8);
1264  byte = ( (byte & (~mask)) | (value?mask:0x0) );
1265  }
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
void sistrip::FEDFullDebugHeader::setChannelStatus ( const uint8_t  internalFEDChannelNum,
const FEDChannelStatus  status 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1217 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().

1218  {
1225  }
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)
tuple status
Definition: ntuplemaker.py:245
void sistrip::FEDFullDebugHeader::setDAQRegister ( const uint32_t  daqRegister)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1237 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1238  {
1240  }
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)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1242 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1243  {
1245  }
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 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1253 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

1254  {
1255  feWord(internalFEUnitNum)[15] = ( (length & 0xFF00) >> 8);
1256  feWord(internalFEUnitNum)[14] = (length & 0x00FF);
1257  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
void sistrip::FEDFullDebugHeader::setFEUnitMajorityAddress ( const uint8_t  internalFEUnitNum,
const uint8_t  address 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1227 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

1228  {
1229  feWord(internalFEUnitNum)[9] = address;
1230  }
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 setBit().

Referenced by setChannelStatus().

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

References setBit().

Referenced by setChannelStatus().

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

References unlockedFromBit().

Referenced by outOfSync(), and unlocked().

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

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

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

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.

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

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

Definition at line 542 of file SiStripFEDBufferComponents.h.

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