#include <SiStripFEDBufferComponents.h>
Public Member Functions | |
virtual bool | checkChannelStatusBits (const uint8_t internalFEDChannelNum) const |
virtual bool | checkStatusBits (const uint8_t internalFEDChannelNum, const uint8_t apvNum) const |
virtual FEDAPVErrorHeader * | clone () 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 |
FEDAPVErrorHeader & | setAPVStatusBit (const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood) |
FEDAPVErrorHeader & | setAPVStatusBit (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 () |
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 |
Definition at line 412 of file SiStripFEDBufferComponents.h.
sistrip::FEDAPVErrorHeader::FEDAPVErrorHeader | ( | const uint8_t * | headerBuffer | ) | [inline, explicit] |
Definition at line 1038 of file SiStripFEDBufferComponents.h.
References APV_ERROR_HEADER_SIZE_IN_BYTES, and header_.
Referenced by clone().
{ memcpy(header_,headerBuffer,APV_ERROR_HEADER_SIZE_IN_BYTES); }
sistrip::FEDAPVErrorHeader::~FEDAPVErrorHeader | ( | ) | [virtual] |
Definition at line 957 of file SiStripFEDBufferComponents.cc.
{ }
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().
{ memset(header_,0x00,APV_ERROR_HEADER_SIZE_IN_BYTES); for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) { setAPVStatusBit(iCh,0,apvsGood[iCh*2]); setAPVStatusBit(iCh,1,apvsGood[iCh*2+1]); } }
bool sistrip::FEDAPVErrorHeader::checkChannelStatusBits | ( | const uint8_t | internalFEDChannelNum | ) | const [virtual] |
Implements sistrip::FEDFEHeader.
Definition at line 984 of file SiStripFEDBufferComponents.cc.
References checkStatusBits().
{ return (checkStatusBits(internalFEDChannelNum,0) && checkStatusBits(internalFEDChannelNum,1)); }
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().
{ //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FEUNIT)*24 + (FEDCH_PER_FEUNIT-1-(internalFEDChannelNum%FEDCH_PER_FEUNIT))*2 + apvNum; //bit high means no error return (header_[bitNumber/8] & (0x01<<(bitNumber%8)) ); }
FEDAPVErrorHeader * sistrip::FEDAPVErrorHeader::clone | ( | void | ) | const [virtual] |
Implements sistrip::FEDFEHeader.
Definition at line 971 of file SiStripFEDBufferComponents.cc.
References FEDAPVErrorHeader().
{ return new FEDAPVErrorHeader(*this); }
const uint8_t * sistrip::FEDAPVErrorHeader::data | ( | ) | const [virtual] |
Implements sistrip::FEDFEHeader.
Definition at line 989 of file SiStripFEDBufferComponents.cc.
References header_.
{ return header_; }
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.
{ return 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().
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().
{ return setAPVStatusBit(internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum,apvGood); }
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().
{ //3 bytes per FE unit, channel order is reversed in FE unit data, 2 bits per channel const uint16_t bitNumber = (internalFEDChannelNum/FEDCH_PER_FED)*24 + (FEDCH_PER_FED-1-(internalFEDChannelNum%FEDCH_PER_FED))*2+apvNum; const uint8_t byteNumber = bitNumber/8; const uint8_t bitInByte = bitNumber%8; const uint8_t mask = (0x01 << bitInByte); header_[byteNumber] = ( (header_[byteNumber] & (~mask)) | (apvGood?mask:0x00) ); return *this; }
void sistrip::FEDAPVErrorHeader::setBEStatusRegister | ( | const FEDBackendStatusRegister | beStatusRegister | ) | [virtual] |
Implements sistrip::FEDFEHeader.
Definition at line 1041 of file SiStripFEDBufferComponents.cc.
{
return;
}
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().
{ //if channel is unlocked then set both APV bits bad if ( (!(status & CHANNEL_STATUS_LOCKED)) || (!(status & CHANNEL_STATUS_IN_SYNC)) ) { setAPVStatusBit(internalFEDChannelNum,0,false); setAPVStatusBit(internalFEDChannelNum,1,false); return; } else { if ( (status & CHANNEL_STATUS_APV0_ADDRESS_GOOD) && (status & CHANNEL_STATUS_APV0_NO_ERROR_BIT) ) { setAPVStatusBit(internalFEDChannelNum,0,true); } else { setAPVStatusBit(internalFEDChannelNum,0,false); } if ( (status & CHANNEL_STATUS_APV1_ADDRESS_GOOD) && (status & CHANNEL_STATUS_APV1_NO_ERROR_BIT) ) { setAPVStatusBit(internalFEDChannelNum,1,true); } else { setAPVStatusBit(internalFEDChannelNum,1,false); } } }
void sistrip::FEDAPVErrorHeader::setFEUnitLength | ( | const uint8_t | internalFEUnitNum, |
const uint16_t | length | ||
) | [virtual] |
Implements sistrip::FEDFEHeader.
Definition at line 1045 of file SiStripFEDBufferComponents.cc.
{
return;
}
void sistrip::FEDAPVErrorHeader::setFEUnitMajorityAddress | ( | const uint8_t | internalFEUnitNum, |
const uint8_t | address | ||
) | [virtual] |
Implements sistrip::FEDFEHeader.
Definition at line 1037 of file SiStripFEDBufferComponents.cc.
{
return;
}
const size_t sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3 [static, private] |
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 [static, private] |
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] |
Definition at line 436 of file SiStripFEDBufferComponents.h.
Referenced by checkStatusBits(), data(), FEDAPVErrorHeader(), print(), and setAPVStatusBit().