CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes

sistrip::FEDAPVErrorHeader Class Reference

#include <SiStripFEDBufferComponents.h>

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

List of all members.

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 ()

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

Detailed Description

Definition at line 412 of file SiStripFEDBufferComponents.h.


Constructor & Destructor Documentation

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]);
    }
  }

Member Function Documentation

bool sistrip::FEDAPVErrorHeader::checkChannelStatusBits ( const uint8_t  internalFEDChannelNum) const [virtual]
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]
void sistrip::FEDAPVErrorHeader::print ( std::ostream &  os) const [virtual]
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]
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;
  }

Member Data Documentation

Definition at line 434 of file SiStripFEDBufferComponents.h.

Definition at line 435 of file SiStripFEDBufferComponents.h.

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