CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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
 
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 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 ()
 

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

Additional Inherited Members

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

Detailed Description

Definition at line 440 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

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

Definition at line 1050 of file SiStripFEDBufferComponents.h.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

1051  {
1052  memcpy(header_,headerBuffer,FULL_DEBUG_HEADER_SIZE_IN_BYTES);
1053  }
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 1066 of file SiStripFEDBufferComponents.cc.

1067  {
1068  }
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 1149 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().

1152  {
1157  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1158  setFEUnitLength(iFE,feUnitLengths[iFE]);
1159  setFEUnitMajorityAddress(iFE,feMajorityAddresses[iFE]);
1160  }
1161  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1162  setChannelStatus(iCh,channelStatus[iCh]);
1163  }
1164  }
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 1117 of file SiStripFEDBufferComponents.h.

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

Referenced by apvAddressError(), and checkStatusBits().

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

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

1125  {
1126  return apvAddressError(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum);
1127  }
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 1155 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by apvAddressError().

1156  {
1157  return !getBit(internalFEDChannelNum,1+2*apvNum);
1158  }
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 1105 of file SiStripFEDBufferComponents.h.

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

Referenced by apvError(), and checkStatusBits().

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

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

1113  {
1114  return apvError(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum);
1115  }
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 1144 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by apvError().

1145  {
1146  //Discovered March 2012: two bits inverted in firmware. Decided
1147  //to update documentation but keep firmware identical for
1148  //backward compatibility. So status bit order is actually:
1149  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1150  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1151 
1152  return !getBit(internalFEDChannelNum,0+2*(1-apvNum));
1153  }
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 1060 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

1061  {
1062  return FEDBackendStatusRegister(get32BitWordFrom(feWord(0)+10));
1063  }
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 1093 of file SiStripFEDBufferComponents.cc.

References sistrip::CHANNEL_STATUS_NO_PROBLEMS, and getChannelStatus().

1094  {
1095  //return ( !unlockedFromBit(internalFEDChannelNum) &&
1096  // !outOfSyncFromBit(internalFEDChannelNum) &&
1097  // !apvErrorFromBit(internalFEDChannelNum,0) &&
1098  // !apvAddressErrorFromBit(internalFEDChannelNum,0) &&
1099  // !apvErrorFromBit(internalFEDChannelNum,1) &&
1100  // !apvAddressErrorFromBit(internalFEDChannelNum,1) );
1102  }
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 1085 of file SiStripFEDBufferComponents.cc.

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

1086  {
1089  !apvError(internalFEDChannelNum,apvNum) &&
1091  }
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 1080 of file SiStripFEDBufferComponents.cc.

References FEDFullDebugHeader().

1081  {
1082  return new FEDFullDebugHeader(*this);
1083  }
FEDFullDebugHeader(const uint8_t *headerBuffer)
uint32_t sistrip::FEDFullDebugHeader::daqRegister ( ) const
inline

Definition at line 1065 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

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

1066  {
1067  return get32BitWordFrom(feWord(7)+10);
1068  }
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 1070 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

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

1071  {
1072  return get32BitWordFrom(feWord(6)+10);
1073  }
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 1144 of file SiStripFEDBufferComponents.cc.

References header_.

Referenced by cuy.FindIssue::__init__().

1145  {
1146  return header_;
1147  }
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
bool sistrip::FEDFullDebugHeader::fePresent ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1080 of file SiStripFEDBufferComponents.h.

References feUnitLength().

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

1081  {
1082  return (feUnitLength(internalFEUnitNum) != 0);
1083  }
uint16_t feUnitLength(const uint8_t internalFEUnitNum) const
uint16_t sistrip::FEDFullDebugHeader::feUnitLength ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1075 of file SiStripFEDBufferComponents.h.

References feWord().

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

1076  {
1077  return ( (feWord(internalFEUnitNum)[15]<<8) | (feWord(internalFEUnitNum)[14]) );
1078  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
uint8_t sistrip::FEDFullDebugHeader::feUnitMajorityAddress ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1055 of file SiStripFEDBufferComponents.h.

References feWord().

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

1056  {
1057  return feWord(internalFEUnitNum)[9];
1058  }
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
const uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum) const
inlineprivate
uint8_t * sistrip::FEDFullDebugHeader::feWord ( const uint8_t  internalFEUnitNum)
inlineprivate

Definition at line 1183 of file SiStripFEDBufferComponents.h.

References feWord().

1184  {
1185  return const_cast<uint8_t*>(static_cast<const FEDFullDebugHeader*>(this)->feWord(internalFEUnitNum));
1186  }
FEDFullDebugHeader(const uint8_t *headerBuffer)
const uint8_t * feWord(const uint8_t internalFEUnitNum) const
uint32_t sistrip::FEDFullDebugHeader::get32BitWordFrom ( const uint8_t *  startOfWord)
inlinestaticprivate

Definition at line 1167 of file SiStripFEDBufferComponents.h.

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

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

Definition at line 1160 of file SiStripFEDBufferComponents.h.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

1161  {
1162  const uint8_t* pFEWord = feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT);
1163  const uint8_t bitInFeWord = ((FEDCH_PER_FEUNIT-1) - (internalFEDChannelNum%FEDCH_PER_FEUNIT)) * 6 + bit;
1164  return ( pFEWord[bitInFeWord/8] & (0x1 << (bitInFeWord%8)) );
1165  }
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 1104 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

1105  {
1106  const uint8_t* pFEWord = feWord(internalFEDChannelNum/FEDCH_PER_FEUNIT);
1107  const uint8_t feUnitChanNum = internalFEDChannelNum % FEDCH_PER_FEUNIT;
1108  const uint8_t startByteInFEWord = (FEDCH_PER_FEUNIT-1 - feUnitChanNum) * 6 / 8;
1109  switch ( (FEDCH_PER_FEUNIT-1-feUnitChanNum) % 4 ) {
1110  case 0:
1111  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1112  case 1:
1113  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1114  case 2:
1115  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1116  case 3:
1117  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1118  //stop compiler warning
1119  default:
1120  return FEDChannelStatus(0);
1121  }
1122  /*const uint8_t feUnitChanNum = internalFEDChannelNum / FEDCH_PER_FEUNIT;
1123  const uint8_t* pFEWord = feWord(feUnitChanNum);
1124  const uint8_t startByteInFEWord = feUnitChanNum * 3 / 4;
1125  //const uint8_t shift = ( 6 - ((feUnitChanNum-1)%4) );
1126  //const uint16_t mask = ( 0x003F << shift );
1127  //uint8_t result = ( (pFEWord[startByteInFEWord] & (mask&0x00FF)) >> shift );
1128  //result |= ( (pFEWord[startByteInFEWord+1] & (mask>>8)) << (8-shift) );
1129  switch (feUnitChanNum % 4) {
1130  case 0:
1131  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1132  case 1:
1133  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1134  case 2:
1135  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1136  case 3:
1137  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1138  //stop compiler warning
1139  default:
1140  return FEDChannelStatus(0);
1141  }*/
1142  }
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 1129 of file SiStripFEDBufferComponents.h.

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

1130  {
1131  return getChannelStatus(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum));
1132  }
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 1070 of file SiStripFEDBufferComponents.cc.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES.

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

Definition at line 1095 of file SiStripFEDBufferComponents.h.

References outOfSyncFromBit(), and unlocked().

Referenced by outOfSync().

1096  {
1098  }
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 1100 of file SiStripFEDBufferComponents.h.

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

1101  {
1102  return outOfSync(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum));
1103  }
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 1139 of file SiStripFEDBufferComponents.h.

References getBit().

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

1140  {
1141  return !getBit(internalFEDChannelNum,4);
1142  }
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 1075 of file SiStripFEDBufferComponents.cc.

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

1076  {
1078  }
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::set32BitWordAt ( uint8_t *  startOfWord,
const uint32_t  value 
)
inlinestaticprivate

Definition at line 1172 of file SiStripFEDBufferComponents.h.

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

1173  {
1174  memcpy(startOfWord,&value,4);
1175  }
void sistrip::FEDFullDebugHeader::setAPVAddressError ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  value 
)
inlineprivate

Definition at line 1198 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

1199  {
1200  setBit(internalFEDChannelNum,1+2*apvNum,!value);
1201  }
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 1203 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

1204  {
1205  //Discovered March 2012: two bits inverted in firmware. Decided
1206  //to update documentation but keep firmware identical for
1207  //backward compatibility. So status bit order is actually:
1208  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1209  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1210 
1211  setBit(internalFEDChannelNum,0+2*(1-apvNum),!value);
1212  }
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 1181 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1182  {
1184  }
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 1202 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

1203  {
1204  const uint8_t bitInFeWord = (FEDCH_PER_FEUNIT-1 - (internalFEDChannelNum%FEDCH_PER_FEUNIT)) * 6 + bit;
1205  uint8_t& byte = *(feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT)+(bitInFeWord/8));
1206  const uint8_t mask = (0x1 << bitInFeWord%8);
1207  byte = ( (byte & (~mask)) | (value?mask:0x0) );
1208  }
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 1166 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().

1167  {
1174  }
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

Definition at line 1186 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1187  {
1189  }
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

Definition at line 1191 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1192  {
1194  }
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 1196 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

1197  {
1198  feWord(internalFEUnitNum)[15] = ( (length & 0xFF00) >> 8);
1199  feWord(internalFEUnitNum)[14] = (length & 0x00FF);
1200  }
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 1176 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

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

Definition at line 1193 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

1194  {
1196  }
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 1188 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

1189  {
1191  }
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 1085 of file SiStripFEDBufferComponents.h.

References unlockedFromBit().

Referenced by outOfSync(), and unlocked().

1086  {
1088  }
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 1090 of file SiStripFEDBufferComponents.h.

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

1091  {
1092  return unlocked(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum));
1093  }
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 1134 of file SiStripFEDBufferComponents.h.

References getBit().

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

1135  {
1136  return !getBit(internalFEDChannelNum,5);
1137  }
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 510 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 511 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 512 of file SiStripFEDBufferComponents.h.

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