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 439 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

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

Definition at line 1049 of file SiStripFEDBufferComponents.h.

References FULL_DEBUG_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

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

1052  {
1053  }
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 1134 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().

1137  {
1142  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1143  setFEUnitLength(iFE,feUnitLengths[iFE]);
1144  setFEUnitMajorityAddress(iFE,feMajorityAddresses[iFE]);
1145  }
1146  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1147  setChannelStatus(iCh,channelStatus[iCh]);
1148  }
1149  }
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 1116 of file SiStripFEDBufferComponents.h.

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

Referenced by apvAddressError(), and checkStatusBits().

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

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

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

References getBit().

Referenced by apvAddressError().

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

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

Referenced by apvError(), and checkStatusBits().

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

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

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

References getBit().

Referenced by apvError().

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

References feWord(), and get32BitWordFrom().

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

References sistrip::CHANNEL_STATUS_NO_PROBLEMS, and getChannelStatus().

1079  {
1080  //return ( !unlockedFromBit(internalFEDChannelNum) &&
1081  // !outOfSyncFromBit(internalFEDChannelNum) &&
1082  // !apvErrorFromBit(internalFEDChannelNum,0) &&
1083  // !apvAddressErrorFromBit(internalFEDChannelNum,0) &&
1084  // !apvErrorFromBit(internalFEDChannelNum,1) &&
1085  // !apvAddressErrorFromBit(internalFEDChannelNum,1) );
1087  }
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 1070 of file SiStripFEDBufferComponents.cc.

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

1071  {
1074  !apvError(internalFEDChannelNum,apvNum) &&
1076  }
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 1065 of file SiStripFEDBufferComponents.cc.

References FEDFullDebugHeader().

1066  {
1067  return new FEDFullDebugHeader(*this);
1068  }
FEDFullDebugHeader(const uint8_t *headerBuffer)
uint32_t sistrip::FEDFullDebugHeader::daqRegister ( ) const
inline

Definition at line 1064 of file SiStripFEDBufferComponents.h.

References feWord(), and get32BitWordFrom().

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

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

References feWord(), and get32BitWordFrom().

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

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

References header_.

Referenced by cuy.FindIssue::__init__().

1130  {
1131  return header_;
1132  }
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
bool sistrip::FEDFullDebugHeader::fePresent ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1079 of file SiStripFEDBufferComponents.h.

References feUnitLength().

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

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

Definition at line 1074 of file SiStripFEDBufferComponents.h.

References feWord().

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

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

Definition at line 1054 of file SiStripFEDBufferComponents.h.

References feWord().

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

1055  {
1056  return feWord(internalFEUnitNum)[9];
1057  }
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 1182 of file SiStripFEDBufferComponents.h.

References feWord().

1183  {
1184  return const_cast<uint8_t*>(static_cast<const FEDFullDebugHeader*>(this)->feWord(internalFEUnitNum));
1185  }
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 1166 of file SiStripFEDBufferComponents.h.

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

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

Definition at line 1159 of file SiStripFEDBufferComponents.h.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

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

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

1090  {
1091  const uint8_t* pFEWord = feWord(internalFEDChannelNum/FEDCH_PER_FEUNIT);
1092  const uint8_t feUnitChanNum = internalFEDChannelNum % FEDCH_PER_FEUNIT;
1093  const uint8_t startByteInFEWord = (FEDCH_PER_FEUNIT-1 - feUnitChanNum) * 6 / 8;
1094  switch ( (FEDCH_PER_FEUNIT-1-feUnitChanNum) % 4 ) {
1095  case 0:
1096  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1097  case 1:
1098  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1099  case 2:
1100  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1101  case 3:
1102  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1103  //stop compiler warning
1104  default:
1105  return FEDChannelStatus(0);
1106  }
1107  /*const uint8_t feUnitChanNum = internalFEDChannelNum / FEDCH_PER_FEUNIT;
1108  const uint8_t* pFEWord = feWord(feUnitChanNum);
1109  const uint8_t startByteInFEWord = feUnitChanNum * 3 / 4;
1110  //const uint8_t shift = ( 6 - ((feUnitChanNum-1)%4) );
1111  //const uint16_t mask = ( 0x003F << shift );
1112  //uint8_t result = ( (pFEWord[startByteInFEWord] & (mask&0x00FF)) >> shift );
1113  //result |= ( (pFEWord[startByteInFEWord+1] & (mask>>8)) << (8-shift) );
1114  switch (feUnitChanNum % 4) {
1115  case 0:
1116  return FEDChannelStatus( pFEWord[startByteInFEWord] & 0x3F );
1117  case 1:
1118  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xC0) >> 6) | ((pFEWord[startByteInFEWord+1] & 0x0F) << 2) );
1119  case 2:
1120  return FEDChannelStatus( ((pFEWord[startByteInFEWord] & 0xF0) >> 4) | ((pFEWord[startByteInFEWord+1] & 0x03) << 4) );
1121  case 3:
1122  return FEDChannelStatus( (pFEWord[startByteInFEWord] & 0xFC) >> 2 );
1123  //stop compiler warning
1124  default:
1125  return FEDChannelStatus(0);
1126  }*/
1127  }
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 1128 of file SiStripFEDBufferComponents.h.

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

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

References FULL_DEBUG_HEADER_SIZE_IN_BYTES.

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

Definition at line 1094 of file SiStripFEDBufferComponents.h.

References outOfSyncFromBit(), and unlocked().

Referenced by outOfSync().

1095  {
1097  }
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 1099 of file SiStripFEDBufferComponents.h.

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

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

References getBit().

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

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

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

1061  {
1063  }
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 1171 of file SiStripFEDBufferComponents.h.

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

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

Definition at line 1197 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

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

References setBit().

Referenced by setChannelStatus().

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

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1167  {
1169  }
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 1187 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and feWord().

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

1188  {
1189  const uint8_t bitInFeWord = (FEDCH_PER_FEUNIT-1 - (internalFEDChannelNum%FEDCH_PER_FEUNIT)) * 6 + bit;
1190  uint8_t& byte = *(feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT)+(bitInFeWord/8));
1191  const uint8_t mask = (0x1 << bitInFeWord%8);
1192  byte = ( (byte & (~mask)) | (value?mask:0x0) );
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
void sistrip::FEDFullDebugHeader::setChannelStatus ( const uint8_t  internalFEDChannelNum,
const FEDChannelStatus  status 
)
virtual

Implements sistrip::FEDFEHeader.

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

1152  {
1159  }
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 1171 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1172  {
1174  }
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 1176 of file SiStripFEDBufferComponents.cc.

References feWord(), and set32BitWordAt().

Referenced by FEDFullDebugHeader().

1177  {
1179  }
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 1181 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

1182  {
1183  feWord(internalFEUnitNum)[15] = ( (length & 0xFF00) >> 8);
1184  feWord(internalFEUnitNum)[14] = (length & 0x00FF);
1185  }
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 1161 of file SiStripFEDBufferComponents.cc.

References feWord().

Referenced by FEDFullDebugHeader().

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

Definition at line 1192 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

1193  {
1195  }
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 1187 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setChannelStatus().

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

References unlockedFromBit().

Referenced by outOfSync(), and unlocked().

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

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

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

References getBit().

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

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

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