CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
sistrip::FEDAPVErrorHeader Class Referencefinal

#include <SiStripFEDBufferComponents.h>

Inheritance diagram for sistrip::FEDAPVErrorHeader:
sistrip::FEDFEHeader

Public Member Functions

virtual bool checkChannelStatusBits (const uint8_t internalFEDChannelNum) const
 
virtual bool checkStatusBits (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
 
virtual FEDAPVErrorHeaderclone () const
 
virtual const uint8_t * data () const
 
 FEDAPVErrorHeader (const uint8_t *headerBuffer)
 
 FEDAPVErrorHeader (const std::vector< bool > &apvsGood=std::vector< bool >(APVS_PER_FED, true))
 
virtual size_t lengthInBytes () const
 
virtual void print (std::ostream &os) const
 
virtual void set32BitReservedRegister (const uint8_t internalFEUnitNum, const uint32_t reservedRegister)
 
FEDAPVErrorHeadersetAPVStatusBit (const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
 
FEDAPVErrorHeadersetAPVStatusBit (const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const uint8_t apvNum, const bool apvGood)
 
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)
 
virtual ~FEDAPVErrorHeader ()
 
- 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 Attributes

uint8_t header_ [APV_ERROR_HEADER_SIZE_IN_BYTES]
 

Static Private Attributes

static const size_t APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3
 
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES = APV_ERROR_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::FEDAPVErrorHeader::FEDAPVErrorHeader ( const uint8_t *  headerBuffer)
inlineexplicit

Definition at line 1065 of file SiStripFEDBufferComponents.h.

1066  {
1067  memcpy(header_,headerBuffer,APV_ERROR_HEADER_SIZE_IN_BYTES);
1068  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
sistrip::FEDAPVErrorHeader::~FEDAPVErrorHeader ( )
virtual

Definition at line 1011 of file SiStripFEDBufferComponents.cc.

1012  {
1013  }
sistrip::FEDAPVErrorHeader::FEDAPVErrorHeader ( const std::vector< bool > &  apvsGood = std::vector<bool>(APVS_PER_FED,true))

Definition at line 1048 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FED.

1049  {
1051  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1052  setAPVStatusBit(iCh,0,apvsGood[iCh*2]);
1053  setAPVStatusBit(iCh,1,apvsGood[iCh*2+1]);
1054  }
1055  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
static const uint16_t FEDCH_PER_FED
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]

Member Function Documentation

bool sistrip::FEDAPVErrorHeader::checkChannelStatusBits ( const uint8_t  internalFEDChannelNum) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1038 of file SiStripFEDBufferComponents.cc.

1039  {
1041  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
virtual bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
bool sistrip::FEDAPVErrorHeader::checkStatusBits ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum 
) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1030 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT.

1031  {
1032  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1033  const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FEUNIT)*24 + (FEDCH_PER_FEUNIT-1-(internalFEDChannelNum%FEDCH_PER_FEUNIT))*2 + apvNum;
1034  //bit high means no error
1035  return (header_[bitNumber/8] & (0x01<<(bitNumber%8)) );
1036  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint16_t FEDCH_PER_FEUNIT
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
FEDAPVErrorHeader * sistrip::FEDAPVErrorHeader::clone ( void  ) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1025 of file SiStripFEDBufferComponents.cc.

1026  {
1027  return new FEDAPVErrorHeader(*this);
1028  }
FEDAPVErrorHeader(const uint8_t *headerBuffer)
const uint8_t * sistrip::FEDAPVErrorHeader::data ( ) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1043 of file SiStripFEDBufferComponents.cc.

1044  {
1045  return header_;
1046  }
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
size_t sistrip::FEDAPVErrorHeader::lengthInBytes ( ) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1015 of file SiStripFEDBufferComponents.cc.

1016  {
1018  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
void sistrip::FEDAPVErrorHeader::print ( std::ostream &  os) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1020 of file SiStripFEDBufferComponents.cc.

References sistrip::printHex().

1021  {
1023  }
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
void printHex(const void *pointer, const size_t length, std::ostream &os)
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
void sistrip::FEDAPVErrorHeader::set32BitReservedRegister ( const uint8_t  internalFEUnitNum,
const uint32_t  reservedRegister 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1107 of file SiStripFEDBufferComponents.cc.

1108  {
1109  return;
1110  }
FEDAPVErrorHeader & sistrip::FEDAPVErrorHeader::setAPVStatusBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  apvGood 
)

Definition at line 1057 of file SiStripFEDBufferComponents.cc.

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

1058  {
1059  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1060  const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FED)*24 + (FEDCH_PER_FED-1-(internalFEDChannelNum%FEDCH_PER_FED))*2+apvNum;
1061  const uint8_t byteNumber = bitNumber/8;
1062  const uint8_t bitInByte = bitNumber%8;
1063  const uint8_t mask = (0x01 << bitInByte);
1064  header_[byteNumber] = ( (header_[byteNumber] & (~mask)) | (apvGood?mask:0x00) );
1065  return *this;
1066  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint16_t FEDCH_PER_FED
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
FEDAPVErrorHeader & sistrip::FEDAPVErrorHeader::setAPVStatusBit ( const uint8_t  internalFEUnitNum,
const uint8_t  internalFEUnitChannelNum,
const uint8_t  apvNum,
const bool  apvGood 
)
inline

Definition at line 1070 of file SiStripFEDBufferComponents.h.

References sistrip::internalFEDChannelNum().

1072  {
1073  return setAPVStatusBit(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum,apvGood);
1074  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
void sistrip::FEDAPVErrorHeader::setBEStatusRegister ( const FEDBackendStatusRegister  beStatusRegister)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1095 of file SiStripFEDBufferComponents.cc.

1096  {
1097  return;
1098  }
void sistrip::FEDAPVErrorHeader::setChannelStatus ( const uint8_t  internalFEDChannelNum,
const FEDChannelStatus  status 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1068 of file SiStripFEDBufferComponents.cc.

References sistrip::CHANNEL_STATUS_APV0_ADDRESS_GOOD, sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT, sistrip::CHANNEL_STATUS_APV1_ADDRESS_GOOD, sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT, sistrip::CHANNEL_STATUS_IN_SYNC, and sistrip::CHANNEL_STATUS_LOCKED.

1069  {
1070  //if channel is unlocked then set both APV bits bad
1071  if ( (!(status & CHANNEL_STATUS_LOCKED)) || (!(status & CHANNEL_STATUS_IN_SYNC)) ) {
1074  return;
1075  } else {
1078  } else {
1080  }
1083  } else {
1085  }
1086  }
1087  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
void sistrip::FEDAPVErrorHeader::setDAQRegister ( const uint32_t  daqRegister)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1099 of file SiStripFEDBufferComponents.cc.

1100  {
1101  return;
1102  }
void sistrip::FEDAPVErrorHeader::setDAQRegister2 ( const uint32_t  daqRegister2)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1103 of file SiStripFEDBufferComponents.cc.

1104  {
1105  return;
1106  }
void sistrip::FEDAPVErrorHeader::setFEUnitLength ( const uint8_t  internalFEUnitNum,
const uint16_t  length 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1111 of file SiStripFEDBufferComponents.cc.

1112  {
1113  return;
1114  }
void sistrip::FEDAPVErrorHeader::setFEUnitMajorityAddress ( const uint8_t  internalFEUnitNum,
const uint8_t  address 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1091 of file SiStripFEDBufferComponents.cc.

1092  {
1093  return;
1094  }

Member Data Documentation

const size_t sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3
staticprivate

Definition at line 464 of file SiStripFEDBufferComponents.h.

const size_t sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_BYTES = APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS*8
staticprivate

Definition at line 465 of file SiStripFEDBufferComponents.h.

uint8_t sistrip::FEDAPVErrorHeader::header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
private

Definition at line 466 of file SiStripFEDBufferComponents.h.