CMS 3D CMS Logo

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

Constructor & Destructor Documentation

sistrip::FEDDAQHeader::FEDDAQHeader ( )
inline
sistrip::FEDDAQHeader::FEDDAQHeader ( const uint8_t *  header)
inlineexplicit

Definition at line 1243 of file SiStripFEDBufferComponents.h.

1244  {
1245  memcpy(header_,header,8);
1246  }
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 961 of file SiStripFEDBufferComponents.cc.

962  {
963  //clear everything (FOV,H,x,$ all set to 0)
964  memset(header_,0x0,8);
965  //set the BoE nibble to indicate this is the last fragment
966  header_[7] = 0x50;
967  //set variable fields vith values supplied
968  setEventType(evtType);
969  setL1ID(l1ID);
970  setBXID(bxID);
972  }
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 1248 of file SiStripFEDBufferComponents.h.

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

Definition at line 1263 of file SiStripFEDBufferComponents.h.

Referenced by sistrip::RawToDigiUnpacker::updateEventSummary().

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

Definition at line 1288 of file SiStripFEDBufferComponents.h.

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

1289  {
1290  return header_;
1291  }
FEDDAQEventType sistrip::FEDDAQHeader::eventType ( ) const

Definition at line 917 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, and sistrip::DAQ_EVENT_TYPE_TRACED.

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

Definition at line 1253 of file SiStripFEDBufferComponents.h.

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

Definition at line 1278 of file SiStripFEDBufferComponents.h.

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

Definition at line 1258 of file SiStripFEDBufferComponents.h.

Referenced by sistrip::RawToDigiUnpacker::updateEventSummary().

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

Definition at line 1283 of file SiStripFEDBufferComponents.h.

1284  {
1285  return !hBit();
1286  }
void sistrip::FEDDAQHeader::print ( std::ostream &  os) const
inline

Definition at line 1293 of file SiStripFEDBufferComponents.h.

References sistrip::printHex().

Referenced by sistrip::operator<<().

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

Definition at line 947 of file SiStripFEDBufferComponents.cc.

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

Definition at line 933 of file SiStripFEDBufferComponents.cc.

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

Definition at line 939 of file SiStripFEDBufferComponents.cc.

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

Definition at line 954 of file SiStripFEDBufferComponents.cc.

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

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

Definition at line 1268 of file SiStripFEDBufferComponents.h.

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

Definition at line 1273 of file SiStripFEDBufferComponents.h.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

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

Member Data Documentation

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

Definition at line 200 of file SiStripFEDBufferComponents.h.