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
sistrip::FEDDAQHeader Class Reference

#include <SiStripFEDBufferComponents.h>

Public Member Functions

uint8_t boeNibble () const
 
uint16_t bxID () const
 
const uint8_t * data () const
 
FEDDAQEventType eventType () const
 
uint8_t eventTypeNibble () const
 
 FEDDAQHeader ()
 
 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)
 
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 147 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

sistrip::FEDDAQHeader::FEDDAQHeader ( )
inline

Definition at line 150 of file SiStripFEDBufferComponents.h.

150 { }
sistrip::FEDDAQHeader::FEDDAQHeader ( const uint8_t *  header)
inlineexplicit

Definition at line 1216 of file SiStripFEDBufferComponents.h.

References header_.

1217  {
1218  memcpy(header_,header,8);
1219  }
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 871 of file SiStripFEDBufferComponents.cc.

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

872  {
873  //clear everything (FOV,H,x,$ all set to 0)
874  memset(header_,0x0,8);
875  //set the BoE nibble to indicate this is the last fragment
876  header_[7] = 0x50;
877  //set variable fields vith values supplied
878  setEventType(evtType);
879  setL1ID(l1ID);
880  setBXID(bxID);
882  }
FEDDAQHeader & setEventType(const FEDDAQEventType evtType)
FEDDAQHeader & setL1ID(const uint32_t l1ID)
FEDDAQHeader & setSourceID(const uint16_t sourceID)
FEDDAQHeader & setBXID(const uint16_t bxID)

Member Function Documentation

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

Definition at line 1221 of file SiStripFEDBufferComponents.h.

References header_.

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

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

Definition at line 1236 of file SiStripFEDBufferComponents.h.

References header_.

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

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

Definition at line 1261 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by cuy.FindIssue::__init__(), and sistrip::FEDBufferGenerator::fillBuffer().

1262  {
1263  return header_;
1264  }
FEDDAQEventType sistrip::FEDDAQHeader::eventType ( ) const

Definition at line 827 of file SiStripFEDBufferComponents.cc.

References sistrip::DAQ_EVENT_TYPE_CALIBRATION, sistrip::DAQ_EVENT_TYPE_ERROR, sistrip::DAQ_EVENT_TYPE_INVALID, sistrip::DAQ_EVENT_TYPE_PHYSICS, sistrip::DAQ_EVENT_TYPE_SIMULATED, sistrip::DAQ_EVENT_TYPE_TECHNICAL, sistrip::DAQ_EVENT_TYPE_TEST, sistrip::DAQ_EVENT_TYPE_TRACED, and eventTypeNibble().

Referenced by sistrip::FEDBufferBase::daqEventType(), and sistrip::FEDBufferGenerator::getDAQEventType().

uint8_t sistrip::FEDDAQHeader::eventTypeNibble ( ) const
inline

Definition at line 1226 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by eventType().

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

Definition at line 1251 of file SiStripFEDBufferComponents.h.

References header_.

Referenced by lastHeader().

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

Definition at line 1231 of file SiStripFEDBufferComponents.h.

References header_.

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

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

Definition at line 1256 of file SiStripFEDBufferComponents.h.

References hBit().

1257  {
1258  return !hBit();
1259  }
void sistrip::FEDDAQHeader::print ( std::ostream &  os) const
inline

Definition at line 1266 of file SiStripFEDBufferComponents.h.

References header_, and sistrip::printHex().

Referenced by sistrip::operator<<().

1267  {
1268  printHex(header_,8,os);
1269  }
void printHex(const void *pointer, const size_t length, std::ostream &os)
FEDDAQHeader & sistrip::FEDDAQHeader::setBXID ( const uint16_t  bxID)

Definition at line 857 of file SiStripFEDBufferComponents.cc.

References header_.

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

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

Definition at line 843 of file SiStripFEDBufferComponents.cc.

References header_.

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

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

Definition at line 849 of file SiStripFEDBufferComponents.cc.

References header_.

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

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

Definition at line 864 of file SiStripFEDBufferComponents.cc.

References header_.

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

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

Definition at line 1241 of file SiStripFEDBufferComponents.h.

References header_.

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

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

Definition at line 1246 of file SiStripFEDBufferComponents.h.

References header_.

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

Member Data Documentation

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