CMS 3D CMS Logo

Public Member Functions | Private Attributes

sistrip::FEDDAQHeader Class Reference

#include <SiStripFEDBufferComponents.h>

List of all members.

Public Member Functions

uint8_t boeNibble () const
uint16_t bxID () const
const uint8_t * data () const
FEDDAQEventType eventType () const
uint8_t eventTypeNibble () const
 FEDDAQHeader (const uint8_t *header)
 FEDDAQHeader (const uint32_t l1ID, const uint16_t bxID, const uint16_t sourceID, const FEDDAQEventType evtType=DAQ_EVENT_TYPE_PHYSICS)
 FEDDAQHeader ()
bool hBit () const
uint32_t l1ID () const
bool lastHeader () const
void print (std::ostream &os) const
FEDDAQHeadersetBXID (const uint16_t bxID)
FEDDAQHeadersetEventType (const FEDDAQEventType evtType)
FEDDAQHeadersetL1ID (const uint32_t l1ID)
FEDDAQHeadersetSourceID (const uint16_t sourceID)
uint16_t sourceID () const
uint8_t version () const

Private Attributes

uint8_t header_ [8]

Detailed Description

Definition at line 146 of file SiStripFEDBufferComponents.h.


Constructor & Destructor Documentation

sistrip::FEDDAQHeader::FEDDAQHeader ( ) [inline]

Definition at line 149 of file SiStripFEDBufferComponents.h.

{ }
sistrip::FEDDAQHeader::FEDDAQHeader ( const uint8_t *  header) [inline, explicit]

Definition at line 1203 of file SiStripFEDBufferComponents.h.

References header_.

    {
      memcpy(header_,header,8);
    }
sistrip::FEDDAQHeader::FEDDAQHeader ( const uint32_t  l1ID,
const uint16_t  bxID,
const uint16_t  sourceID,
const FEDDAQEventType  evtType = DAQ_EVENT_TYPE_PHYSICS 
)

Definition at line 856 of file SiStripFEDBufferComponents.cc.

References header_, setBXID(), setEventType(), setL1ID(), and setSourceID().

  {
    //clear everything (FOV,H,x,$ all set to 0)
    memset(header_,0x0,8);
    //set the BoE nibble to indicate this is the last fragment
    header_[7] = 0x50;
    //set variable fields vith values supplied
    setEventType(evtType);
    setL1ID(l1ID);
    setBXID(bxID);
    setSourceID(sourceID);
  }

Member Function Documentation

uint8_t sistrip::FEDDAQHeader::boeNibble ( ) const [inline]

Definition at line 1208 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by sistrip::FEDBufferBase::checkNoExtraHeadersOrTrailers().

    {
      return ( (header_[7] & 0xF0) >> 4 );
    }
uint16_t sistrip::FEDDAQHeader::bxID ( ) const [inline]

Definition at line 1223 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by sistrip::FEDBufferBase::daqBXID(), and sistrip::FEDBufferGenerator::getBXID().

    {
      return ( (header_[3]<<4) | ((header_[2]&0xF0)>>4) );
    }
const uint8_t * sistrip::FEDDAQHeader::data ( ) const [inline]

Definition at line 1248 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by sistrip::FEDBufferGenerator::fillBuffer().

    {
      return header_;
    }
FEDDAQEventType sistrip::FEDDAQHeader::eventType ( ) const
uint8_t sistrip::FEDDAQHeader::eventTypeNibble ( ) const [inline]

Definition at line 1213 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by eventType().

    {
      return (header_[7] & 0x0F);
    }
bool sistrip::FEDDAQHeader::hBit ( ) const [inline]

Definition at line 1238 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by lastHeader().

    {
      return (header_[0] & 0x8);
    }
uint32_t sistrip::FEDDAQHeader::l1ID ( ) const [inline]

Definition at line 1218 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by sistrip::FEDBufferBase::daqLvl1ID(), and sistrip::FEDBufferGenerator::getL1ID().

    {
      return ( header_[4] | (header_[5]<<8) | (header_[6]<<16) );
    }
bool sistrip::FEDDAQHeader::lastHeader ( ) const [inline]

Definition at line 1243 of file SiStripFEDBufferComponents.h.

References hBit().

    {
      return !hBit();
    }
void sistrip::FEDDAQHeader::print ( std::ostream &  os) const [inline]

Definition at line 1253 of file SiStripFEDBufferComponents.h.

References header_, and sistrip::printHex().

Referenced by sistrip::operator<<().

    {
      printHex(header_,8,os);
    }
FEDDAQHeader & sistrip::FEDDAQHeader::setBXID ( const uint16_t  bxID)

Definition at line 842 of file SiStripFEDBufferComponents.cc.

References header_.

Referenced by FEDDAQHeader(), and sistrip::FEDBufferGenerator::setBXID().

  {
    header_[3] = ( (bxID & 0x0FF0) >> 4);
    header_[2] = ( (header_[2] & 0x0F) | ( (bxID & 0x000F) << 4) );
    return *this;
  }
FEDDAQHeader & sistrip::FEDDAQHeader::setEventType ( const FEDDAQEventType  evtType)

Definition at line 828 of file SiStripFEDBufferComponents.cc.

References header_.

Referenced by FEDDAQHeader(), and sistrip::FEDBufferGenerator::setDAQEventType().

  {
    header_[7] = ((header_[7] & 0xF0) | evtType);
    return *this;
  }
FEDDAQHeader & sistrip::FEDDAQHeader::setL1ID ( const uint32_t  l1ID)

Definition at line 834 of file SiStripFEDBufferComponents.cc.

References header_.

Referenced by FEDDAQHeader(), and sistrip::FEDBufferGenerator::setL1ID().

  {
    header_[4] = (l1ID & 0x000000FF);
    header_[5] = ( (l1ID & 0x0000FF00) >> 8);
    header_[6] = ( (l1ID & 0x00FF0000) >> 16);
    return *this;
  }
FEDDAQHeader & sistrip::FEDDAQHeader::setSourceID ( const uint16_t  sourceID)

Definition at line 849 of file SiStripFEDBufferComponents.cc.

References header_.

Referenced by FEDDAQHeader(), and sistrip::FEDBufferGenerator::generateBuffer().

  {
    header_[2] = ( (header_[2] & 0xF0) | ( (sourceID & 0x0F00) >> 8) );
    header_[1] = (sourceID & 0x00FF);
    return *this;
  }
uint16_t sistrip::FEDDAQHeader::sourceID ( ) const [inline]

Definition at line 1228 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by sistrip::FEDBufferBase::daqSourceID().

    {
      return ( ((header_[2]&0x0F)<<8) | header_[1] );
    }
uint8_t sistrip::FEDDAQHeader::version ( ) const [inline]

Definition at line 1233 of file SiStripFEDBufferComponents.h.

References header_.

    {
      return ( (header_[0] & 0xF0) >> 4 );
    }

Member Data Documentation

uint8_t sistrip::FEDDAQHeader::header_[8] [private]