CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
sistrip::FEDDAQTrailer Class Reference

#include <SiStripFEDBufferComponents.h>

Public Member Functions

bool badSourceID () const
 
bool cBit () const
 
uint16_t crc () const
 
const uint8_t * data () const
 
uint8_t eoeNibble () const
 
uint32_t eventLengthIn64BitWords () const
 
uint32_t eventLengthInBytes () const
 
uint8_t eventStatusNibble () const
 
bool fBit () const
 
 FEDDAQTrailer ()
 
 FEDDAQTrailer (const uint8_t *trailer)
 
 FEDDAQTrailer (const uint32_t eventLengthIn64BitWords, const uint16_t crc=0, const FEDTTSBits ttsBits=TTS_READY, const bool slinkTransmissionError=false, const bool badFEDID=false, const bool slinkCRCError=false, const uint8_t eventStatusNibble=0)
 
bool lastTrailer () const
 
void print (std::ostream &os) const
 
bool rBit () const
 
FEDDAQTrailersetBadSourceIDBit (const bool bitSet)
 
FEDDAQTrailersetCRC (const uint16_t crc)
 
FEDDAQTrailersetEventLengthIn64BitWords (const uint32_t eventLengthIn64BitWords)
 
FEDDAQTrailersetEventStatusNibble (const uint8_t eventStatusNibble)
 
FEDDAQTrailersetSLinkCRCErrorBit (const bool bitSet)
 
FEDDAQTrailersetSLinkTransmissionErrorBit (const bool bitSet)
 
FEDDAQTrailersetTTSBits (const FEDTTSBits ttsBits)
 
bool slinkCRCError () const
 
bool slinkTransmissionError () const
 
bool tBit () const
 
FEDTTSBits ttsBits () const
 
uint8_t ttsNibble () const
 

Private Attributes

uint8_t trailer_ [8]
 

Detailed Description

Definition at line 204 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

sistrip::FEDDAQTrailer::FEDDAQTrailer ( )
inline

Definition at line 207 of file SiStripFEDBufferComponents.h.

207 { }
sistrip::FEDDAQTrailer::FEDDAQTrailer ( const uint8_t *  trailer)
inlineexplicit

Definition at line 1300 of file SiStripFEDBufferComponents.h.

1301  {
1302  memcpy(trailer_,trailer,8);
1303  }
sistrip::FEDDAQTrailer::FEDDAQTrailer ( const uint32_t  eventLengthIn64BitWords,
const uint16_t  crc = 0,
const FEDTTSBits  ttsBits = TTS_READY,
const bool  slinkTransmissionError = false,
const bool  badFEDID = false,
const bool  slinkCRCError = false,
const uint8_t  eventStatusNibble = 0 
)

Definition at line 993 of file SiStripFEDBufferComponents.cc.

996  {
997  //clear everything (T,x,$ all set to 0)
998  memset(trailer_,0x0,8);
999  //set the EoE nibble to indicate this is the last fragment
1000  trailer_[7] = 0xA0;
1001  //set variable fields vith values supplied
1005  setCRC(crc);
1007  setBadSourceIDBit(badFEDID);
1009  }
FEDDAQTrailer & setSLinkCRCErrorBit(const bool bitSet)
FEDDAQTrailer & setTTSBits(const FEDTTSBits ttsBits)
FEDDAQTrailer & setSLinkTransmissionErrorBit(const bool bitSet)
FEDDAQTrailer & setEventLengthIn64BitWords(const uint32_t eventLengthIn64BitWords)
FEDDAQTrailer & setEventStatusNibble(const uint8_t eventStatusNibble)
FEDDAQTrailer & setCRC(const uint16_t crc)
FEDDAQTrailer & setBadSourceIDBit(const bool bitSet)

Member Function Documentation

bool sistrip::FEDDAQTrailer::badSourceID ( ) const
inline

Definition at line 219 of file SiStripFEDBufferComponents.h.

219 { return fBit(); }
bool sistrip::FEDDAQTrailer::cBit ( ) const
inline

Definition at line 1325 of file SiStripFEDBufferComponents.h.

1326  {
1327  return (trailer_[1] & 0x80);
1328  }
uint16_t sistrip::FEDDAQTrailer::crc ( void  ) const
inline

Definition at line 1320 of file SiStripFEDBufferComponents.h.

1321  {
1322  return ( trailer_[2] | (trailer_[3]<<8) );
1323  }
const uint8_t * sistrip::FEDDAQTrailer::data ( ) const
inline

Definition at line 1360 of file SiStripFEDBufferComponents.h.

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

1361  {
1362  return trailer_;
1363  }
uint8_t sistrip::FEDDAQTrailer::eoeNibble ( ) const
inline

Definition at line 1305 of file SiStripFEDBufferComponents.h.

1306  {
1307  return ( (trailer_[7] & 0xF0) >> 4 );
1308  }
uint32_t sistrip::FEDDAQTrailer::eventLengthIn64BitWords ( ) const
inline

Definition at line 1310 of file SiStripFEDBufferComponents.h.

1311  {
1312  return ( trailer_[4] | (trailer_[5]<<8) | (trailer_[6]<<16) );
1313  }
uint32_t sistrip::FEDDAQTrailer::eventLengthInBytes ( ) const
inline

Definition at line 1315 of file SiStripFEDBufferComponents.h.

1316  {
1317  return eventLengthIn64BitWords()*8;
1318  }
uint8_t sistrip::FEDDAQTrailer::eventStatusNibble ( ) const
inline

Definition at line 1335 of file SiStripFEDBufferComponents.h.

1336  {
1337  return (trailer_[1] & 0x0F);
1338  }
bool sistrip::FEDDAQTrailer::fBit ( ) const
inline

Definition at line 1330 of file SiStripFEDBufferComponents.h.

1331  {
1332  return (trailer_[1] & 0x40);
1333  }
bool sistrip::FEDDAQTrailer::lastTrailer ( ) const
inline

Definition at line 225 of file SiStripFEDBufferComponents.h.

225 { return !tBit(); }
void sistrip::FEDDAQTrailer::print ( std::ostream &  os) const
inline

Definition at line 1355 of file SiStripFEDBufferComponents.h.

References sistrip::printHex().

Referenced by sistrip::operator<<().

1356  {
1357  printHex(trailer_,8,os);
1358  }
void printHex(const void *pointer, const size_t length, std::ostream &os)
bool sistrip::FEDDAQTrailer::rBit ( ) const
inline

Definition at line 1350 of file SiStripFEDBufferComponents.h.

1351  {
1352  return (trailer_[0] & 0x04);
1353  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setBadSourceIDBit ( const bool  bitSet)

Definition at line 1033 of file SiStripFEDBufferComponents.cc.

1034  {
1035  if (bitSet) trailer_[1] |= 0x40;
1036  else trailer_[1] &= (~0x40);
1037  return *this;
1038  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setCRC ( const uint16_t  crc)

Definition at line 1019 of file SiStripFEDBufferComponents.cc.

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

1020  {
1021  trailer_[2] = (crc & 0x00FF);
1022  trailer_[3] = ( (crc >> 8) & 0x00FF );
1023  return *this;
1024  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setEventLengthIn64BitWords ( const uint32_t  eventLengthIn64BitWords)

Definition at line 1011 of file SiStripFEDBufferComponents.cc.

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

1012  {
1013  trailer_[4] = (eventLengthIn64BitWords & 0x000000FF);
1014  trailer_[5] = ( (eventLengthIn64BitWords & 0x0000FF00) >> 8);
1015  trailer_[6] = ( (eventLengthIn64BitWords & 0x00FF0000) >> 16);
1016  return *this;
1017  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setEventStatusNibble ( const uint8_t  eventStatusNibble)

Definition at line 1047 of file SiStripFEDBufferComponents.cc.

1048  {
1049  trailer_[1] = ( (trailer_[1] & 0xF0) | (eventStatusNibble & 0x0F) );
1050  return *this;
1051  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setSLinkCRCErrorBit ( const bool  bitSet)

Definition at line 1040 of file SiStripFEDBufferComponents.cc.

1041  {
1042  if (bitSet) trailer_[0] |= 0x04;
1043  else trailer_[0] &= (~0x40);
1044  return *this;
1045  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setSLinkTransmissionErrorBit ( const bool  bitSet)

Definition at line 1026 of file SiStripFEDBufferComponents.cc.

1027  {
1028  if (bitSet) trailer_[1] |= 0x80;
1029  else trailer_[1] &= (~0x80);
1030  return *this;
1031  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setTTSBits ( const FEDTTSBits  ttsBits)

Definition at line 1053 of file SiStripFEDBufferComponents.cc.

1054  {
1055  trailer_[0] = ( (trailer_[0] & 0x0F) | (ttsBits & 0xF0) );
1056  return *this;
1057  }
bool sistrip::FEDDAQTrailer::slinkCRCError ( ) const
inline

Definition at line 228 of file SiStripFEDBufferComponents.h.

References data, edm::print(), and sistrip::TTS_READY.

228 { return rBit(); }
bool sistrip::FEDDAQTrailer::slinkTransmissionError ( ) const
inline

Definition at line 216 of file SiStripFEDBufferComponents.h.

216 { return cBit(); }
bool sistrip::FEDDAQTrailer::tBit ( ) const
inline

Definition at line 1345 of file SiStripFEDBufferComponents.h.

1346  {
1347  return (trailer_[0] & 0x08);
1348  }
FEDTTSBits sistrip::FEDDAQTrailer::ttsBits ( ) const
uint8_t sistrip::FEDDAQTrailer::ttsNibble ( ) const
inline

Definition at line 1340 of file SiStripFEDBufferComponents.h.

1341  {
1342  return ( (trailer_[0] & 0xF0) >> 4);
1343  }

Member Data Documentation

uint8_t sistrip::FEDDAQTrailer::trailer_[8]
private

Definition at line 243 of file SiStripFEDBufferComponents.h.