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

References trailer_.

1294  {
1295  memcpy(trailer_,trailer,8);
1296  }
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 942 of file SiStripFEDBufferComponents.cc.

References setBadSourceIDBit(), setCRC(), setEventLengthIn64BitWords(), setEventStatusNibble(), setSLinkCRCErrorBit(), setSLinkTransmissionErrorBit(), setTTSBits(), and trailer_.

945  {
946  //clear everything (T,x,$ all set to 0)
947  memset(trailer_,0x0,8);
948  //set the EoE nibble to indicate this is the last fragment
949  trailer_[7] = 0xA0;
950  //set variable fields vith values supplied
954  setCRC(crc);
956  setBadSourceIDBit(badFEDID);
958  }
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.

References fBit().

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

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

Definition at line 1318 of file SiStripFEDBufferComponents.h.

References trailer_.

Referenced by slinkTransmissionError().

1319  {
1320  return (trailer_[1] & 0x80);
1321  }
uint16_t sistrip::FEDDAQTrailer::crc ( void  ) const
inline

Definition at line 1313 of file SiStripFEDBufferComponents.h.

References trailer_.

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

1314  {
1315  return ( trailer_[2] | (trailer_[3]<<8) );
1316  }
const uint8_t * sistrip::FEDDAQTrailer::data ( ) const
inline

Definition at line 1353 of file SiStripFEDBufferComponents.h.

References trailer_.

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

1354  {
1355  return trailer_;
1356  }
uint8_t sistrip::FEDDAQTrailer::eoeNibble ( ) const
inline

Definition at line 1298 of file SiStripFEDBufferComponents.h.

References trailer_.

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

1299  {
1300  return ( (trailer_[7] & 0xF0) >> 4 );
1301  }
uint32_t sistrip::FEDDAQTrailer::eventLengthIn64BitWords ( ) const
inline

Definition at line 1303 of file SiStripFEDBufferComponents.h.

References trailer_.

Referenced by sistrip::FEDBufferBase::daqEventLengthIn64bitWords(), and eventLengthInBytes().

1304  {
1305  return ( trailer_[4] | (trailer_[5]<<8) | (trailer_[6]<<16) );
1306  }
uint32_t sistrip::FEDDAQTrailer::eventLengthInBytes ( ) const
inline

Definition at line 1308 of file SiStripFEDBufferComponents.h.

References eventLengthIn64BitWords().

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

1309  {
1310  return eventLengthIn64BitWords()*8;
1311  }
uint8_t sistrip::FEDDAQTrailer::eventStatusNibble ( ) const
inline

Definition at line 1328 of file SiStripFEDBufferComponents.h.

References trailer_.

1329  {
1330  return (trailer_[1] & 0x0F);
1331  }
bool sistrip::FEDDAQTrailer::fBit ( ) const
inline

Definition at line 1323 of file SiStripFEDBufferComponents.h.

References trailer_.

Referenced by badSourceID().

1324  {
1325  return (trailer_[1] & 0x40);
1326  }
bool sistrip::FEDDAQTrailer::lastTrailer ( ) const
inline

Definition at line 225 of file SiStripFEDBufferComponents.h.

References tBit().

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

Definition at line 1348 of file SiStripFEDBufferComponents.h.

References sistrip::printHex(), and trailer_.

Referenced by sistrip::operator<<().

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

Definition at line 1343 of file SiStripFEDBufferComponents.h.

References trailer_.

Referenced by slinkCRCError().

1344  {
1345  return (trailer_[0] & 0x04);
1346  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setBadSourceIDBit ( const bool  bitSet)

Definition at line 982 of file SiStripFEDBufferComponents.cc.

References trailer_.

Referenced by FEDDAQTrailer().

983  {
984  if (bitSet) trailer_[1] |= 0x40;
985  else trailer_[1] &= (~0x40);
986  return *this;
987  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setCRC ( const uint16_t  crc)

Definition at line 968 of file SiStripFEDBufferComponents.cc.

References trailer_.

Referenced by FEDDAQTrailer(), and sistrip::FEDBufferGenerator::fillBuffer().

969  {
970  trailer_[2] = (crc & 0x00FF);
971  trailer_[3] = ( (crc >> 8) & 0x00FF );
972  return *this;
973  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setEventLengthIn64BitWords ( const uint32_t  eventLengthIn64BitWords)

Definition at line 960 of file SiStripFEDBufferComponents.cc.

References trailer_.

Referenced by FEDDAQTrailer(), and sistrip::FEDBufferGenerator::fillBuffer().

961  {
962  trailer_[4] = (eventLengthIn64BitWords & 0x000000FF);
963  trailer_[5] = ( (eventLengthIn64BitWords & 0x0000FF00) >> 8);
964  trailer_[6] = ( (eventLengthIn64BitWords & 0x00FF0000) >> 16);
965  return *this;
966  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setEventStatusNibble ( const uint8_t  eventStatusNibble)

Definition at line 996 of file SiStripFEDBufferComponents.cc.

References trailer_.

Referenced by FEDDAQTrailer().

997  {
998  trailer_[1] = ( (trailer_[1] & 0xF0) | (eventStatusNibble & 0x0F) );
999  return *this;
1000  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setSLinkCRCErrorBit ( const bool  bitSet)

Definition at line 989 of file SiStripFEDBufferComponents.cc.

References trailer_.

Referenced by FEDDAQTrailer().

990  {
991  if (bitSet) trailer_[0] |= 0x04;
992  else trailer_[0] &= (~0x40);
993  return *this;
994  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setSLinkTransmissionErrorBit ( const bool  bitSet)

Definition at line 975 of file SiStripFEDBufferComponents.cc.

References trailer_.

Referenced by FEDDAQTrailer().

976  {
977  if (bitSet) trailer_[1] |= 0x80;
978  else trailer_[1] &= (~0x80);
979  return *this;
980  }
FEDDAQTrailer & sistrip::FEDDAQTrailer::setTTSBits ( const FEDTTSBits  ttsBits)

Definition at line 1002 of file SiStripFEDBufferComponents.cc.

References trailer_.

Referenced by FEDDAQTrailer().

1003  {
1004  trailer_[0] = ( (trailer_[0] & 0x0F) | (ttsBits & 0xF0) );
1005  return *this;
1006  }
bool sistrip::FEDDAQTrailer::slinkCRCError ( ) const
inline

Definition at line 228 of file SiStripFEDBufferComponents.h.

References rBit().

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

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

Definition at line 216 of file SiStripFEDBufferComponents.h.

References cBit().

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

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

Definition at line 1338 of file SiStripFEDBufferComponents.h.

References trailer_.

Referenced by lastTrailer().

1339  {
1340  return (trailer_[0] & 0x08);
1341  }
FEDTTSBits sistrip::FEDDAQTrailer::ttsBits ( ) const
uint8_t sistrip::FEDDAQTrailer::ttsNibble ( ) const
inline

Definition at line 1333 of file SiStripFEDBufferComponents.h.

References trailer_.

Referenced by ttsBits().

1334  {
1335  return ( (trailer_[0] & 0xF0) >> 4);
1336  }

Member Data Documentation

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