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

Constructor & Destructor Documentation

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

Definition at line 1039 of file SiStripFEDBufferComponents.h.

References APV_ERROR_HEADER_SIZE_IN_BYTES, and header_.

Referenced by clone().

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

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

Definition at line 1009 of file SiStripFEDBufferComponents.cc.

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

1010  {
1012  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
1013  setAPVStatusBit(iCh,0,apvsGood[iCh*2]);
1014  setAPVStatusBit(iCh,1,apvsGood[iCh*2+1]);
1015  }
1016  }
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 999 of file SiStripFEDBufferComponents.cc.

References checkStatusBits().

1000  {
1002  }
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 991 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, and header_.

Referenced by checkChannelStatusBits().

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

References FEDAPVErrorHeader().

987  {
988  return new FEDAPVErrorHeader(*this);
989  }
FEDAPVErrorHeader(const uint8_t *headerBuffer)
const uint8_t * sistrip::FEDAPVErrorHeader::data ( ) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1004 of file SiStripFEDBufferComponents.cc.

References header_.

Referenced by cuy.FindIssue::__init__().

1005  {
1006  return header_;
1007  }
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
size_t sistrip::FEDAPVErrorHeader::lengthInBytes ( ) const
virtual

Implements sistrip::FEDFEHeader.

Definition at line 976 of file SiStripFEDBufferComponents.cc.

References APV_ERROR_HEADER_SIZE_IN_BYTES.

977  {
979  }
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 981 of file SiStripFEDBufferComponents.cc.

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

982  {
984  }
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 1018 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FED, and header_.

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

1019  {
1020  //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel
1021  const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FED)*24 + (FEDCH_PER_FED-1-(internalFEDChannelNum%FEDCH_PER_FED))*2+apvNum;
1022  const uint8_t byteNumber = bitNumber/8;
1023  const uint8_t bitInByte = bitNumber%8;
1024  const uint8_t mask = (0x01 << bitInByte);
1025  header_[byteNumber] = ( (header_[byteNumber] & (~mask)) | (apvGood?mask:0x00) );
1026  return *this;
1027  }
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 1044 of file SiStripFEDBufferComponents.h.

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

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

1057  {
1058  return;
1059  }
void sistrip::FEDAPVErrorHeader::setChannelStatus ( const uint8_t  internalFEDChannelNum,
const FEDChannelStatus  status 
)
virtual

Implements sistrip::FEDFEHeader.

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

1030  {
1031  //if channel is unlocked then set both APV bits bad
1032  if ( (!(status & CHANNEL_STATUS_LOCKED)) || (!(status & CHANNEL_STATUS_IN_SYNC)) ) {
1035  return;
1036  } else {
1039  } else {
1041  }
1044  } else {
1046  }
1047  }
1048  }
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 1060 of file SiStripFEDBufferComponents.cc.

1061  {
1062  return;
1063  }
void sistrip::FEDAPVErrorHeader::setFEUnitMajorityAddress ( const uint8_t  internalFEUnitNum,
const uint8_t  address 
)
virtual

Implements sistrip::FEDFEHeader.

Definition at line 1052 of file SiStripFEDBufferComponents.cc.

1053  {
1054  return;
1055  }

Member Data Documentation

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

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

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

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