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 Attributes | Static Private Attributes
sistrip::FEDAPVErrorHeader Class Reference

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

Constructor & Destructor Documentation

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

Definition at line 1038 of file SiStripFEDBufferComponents.h.

References APV_ERROR_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

1039  {
1040  memcpy(header_,headerBuffer,APV_ERROR_HEADER_SIZE_IN_BYTES);
1041  }
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 957 of file SiStripFEDBufferComponents.cc.

958  {
959  }
sistrip::FEDAPVErrorHeader::FEDAPVErrorHeader ( const std::vector< bool >  apvsGood = std::vector<bool>(APVS_PER_FED,true))

Definition at line 994 of file SiStripFEDBufferComponents.cc.

References APV_ERROR_HEADER_SIZE_IN_BYTES, sistrip::FEDCH_PER_FED, header_, and setAPVStatusBit().

995  {
997  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
998  setAPVStatusBit(iCh,0,apvsGood[iCh*2]);
999  setAPVStatusBit(iCh,1,apvsGood[iCh*2+1]);
1000  }
1001  }
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 984 of file SiStripFEDBufferComponents.cc.

References checkStatusBits().

985  {
987  }
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 976 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and header_.

Referenced by checkChannelStatusBits().

977  {
978  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
979  const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FEUNIT)*24 + (FEDCH_PER_FEUNIT-1-(internalFEDChannelNum%FEDCH_PER_FEUNIT))*2 + apvNum;
980  //bit high means no error
981  return (header_[bitNumber/8] & (0x01<<(bitNumber%8)) );
982  }
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 971 of file SiStripFEDBufferComponents.cc.

References FEDAPVErrorHeader().

972  {
973  return new FEDAPVErrorHeader(*this);
974  }
FEDAPVErrorHeader(const uint8_t *headerBuffer)
const uint8_t * sistrip::FEDAPVErrorHeader::data ( ) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 989 of file SiStripFEDBufferComponents.cc.

References header_.

990  {
991  return header_;
992  }
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
size_t sistrip::FEDAPVErrorHeader::lengthInBytes ( ) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 961 of file SiStripFEDBufferComponents.cc.

References APV_ERROR_HEADER_SIZE_IN_BYTES.

962  {
964  }
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 966 of file SiStripFEDBufferComponents.cc.

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

967  {
969  }
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]
FEDAPVErrorHeader & sistrip::FEDAPVErrorHeader::setAPVStatusBit ( const uint8_t  internalFEDChannelNum,
const uint8_t  apvNum,
const bool  apvGood 
)

Definition at line 1003 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FED, and header_.

Referenced by FEDAPVErrorHeader(), setAPVStatusBit(), and setChannelStatus().

1004  {
1005  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1006  const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FED)*24 + (FEDCH_PER_FED-1-(internalFEDChannelNum%FEDCH_PER_FED))*2+apvNum;
1007  const uint8_t byteNumber = bitNumber/8;
1008  const uint8_t bitInByte = bitNumber%8;
1009  const uint8_t mask = (0x01 << bitInByte);
1010  header_[byteNumber] = ( (header_[byteNumber] & (~mask)) | (apvGood?mask:0x00) );
1011  return *this;
1012  }
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 1043 of file SiStripFEDBufferComponents.h.

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

1045  {
1046  return setAPVStatusBit(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum,apvGood);
1047  }
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 1041 of file SiStripFEDBufferComponents.cc.

1042  {
1043  return;
1044  }
void sistrip::FEDAPVErrorHeader::setChannelStatus ( const uint8_t  internalFEDChannelNum,
const FEDChannelStatus  status 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1014 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, and setAPVStatusBit().

1015  {
1016  //if channel is unlocked then set both APV bits bad
1017  if ( (!(status & CHANNEL_STATUS_LOCKED)) || (!(status & CHANNEL_STATUS_IN_SYNC)) ) {
1020  return;
1021  } else {
1024  } else {
1026  }
1029  } else {
1031  }
1032  }
1033  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
tuple status
Definition: ntuplemaker.py:245
void sistrip::FEDAPVErrorHeader::setFEUnitLength ( const uint8_t  internalFEUnitNum,
const uint16_t  length 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1045 of file SiStripFEDBufferComponents.cc.

1046  {
1047  return;
1048  }
void sistrip::FEDAPVErrorHeader::setFEUnitMajorityAddress ( const uint8_t  internalFEUnitNum,
const uint8_t  address 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1037 of file SiStripFEDBufferComponents.cc.

1038  {
1039  return;
1040  }

Member Data Documentation

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

Definition at line 434 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 435 of file SiStripFEDBufferComponents.h.

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

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