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 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)
 
 FEDDAQTrailer (const uint8_t *trailer)
 
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 230 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

◆ FEDDAQTrailer() [1/3]

sistrip::FEDDAQTrailer::FEDDAQTrailer ( )
inline

Definition at line 232 of file SiStripFEDBufferComponents.h.

232 {}

◆ FEDDAQTrailer() [2/3]

sistrip::FEDDAQTrailer::FEDDAQTrailer ( const uint8_t *  trailer)
inlineexplicit

Definition at line 1365 of file SiStripFEDBufferComponents.h.

1365 { memcpy(trailer_, trailer, 8); }

References trailer_.

◆ FEDDAQTrailer() [3/3]

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 979 of file SiStripFEDBufferComponents.cc.

985  {
986  //clear everything (T,x,$ all set to 0)
987  memset(trailer_, 0x0, 8);
988  //set the EoE nibble to indicate this is the last fragment
989  trailer_[7] = 0xA0;
990  //set variable fields vith values supplied
994  setCRC(crc);
996  setBadSourceIDBit(badFEDID);
998  }

References crc(), eventLengthIn64BitWords(), eventStatusNibble(), setBadSourceIDBit(), setCRC(), setEventLengthIn64BitWords(), setEventStatusNibble(), setSLinkCRCErrorBit(), setSLinkTransmissionErrorBit(), setTTSBits(), slinkCRCError(), slinkTransmissionError(), trailer_, and ttsBits().

Member Function Documentation

◆ badSourceID()

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

Definition at line 244 of file SiStripFEDBufferComponents.h.

244 { return fBit(); }

References fBit().

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

◆ cBit()

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

Definition at line 1377 of file SiStripFEDBufferComponents.h.

1377 { return (trailer_[1] & 0x80); }

References trailer_.

Referenced by slinkTransmissionError().

◆ crc()

uint16_t sistrip::FEDDAQTrailer::crc ( void  ) const
inline

Definition at line 1375 of file SiStripFEDBufferComponents.h.

1375 { return (trailer_[2] | (trailer_[3] << 8)); }

References trailer_.

Referenced by sistrip::FEDBufferBase::daqCRC(), FEDDAQTrailer(), and setCRC().

◆ data()

const uint8_t * sistrip::FEDDAQTrailer::data ( ) const
inline

Definition at line 1391 of file SiStripFEDBufferComponents.h.

1391 { return trailer_; }

References trailer_.

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

◆ eoeNibble()

uint8_t sistrip::FEDDAQTrailer::eoeNibble ( ) const
inline

Definition at line 1367 of file SiStripFEDBufferComponents.h.

1367 { return ((trailer_[7] & 0xF0) >> 4); }

References trailer_.

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

◆ eventLengthIn64BitWords()

uint32_t sistrip::FEDDAQTrailer::eventLengthIn64BitWords ( ) const
inline

Definition at line 1369 of file SiStripFEDBufferComponents.h.

1369  {
1370  return (trailer_[4] | (trailer_[5] << 8) | (trailer_[6] << 16));
1371  }

References trailer_.

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

◆ eventLengthInBytes()

uint32_t sistrip::FEDDAQTrailer::eventLengthInBytes ( ) const
inline

Definition at line 1373 of file SiStripFEDBufferComponents.h.

1373 { return eventLengthIn64BitWords() * 8; }

References eventLengthIn64BitWords().

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

◆ eventStatusNibble()

uint8_t sistrip::FEDDAQTrailer::eventStatusNibble ( ) const
inline

Definition at line 1381 of file SiStripFEDBufferComponents.h.

1381 { return (trailer_[1] & 0x0F); }

References trailer_.

Referenced by FEDDAQTrailer(), and setEventStatusNibble().

◆ fBit()

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

Definition at line 1379 of file SiStripFEDBufferComponents.h.

1379 { return (trailer_[1] & 0x40); }

References trailer_.

Referenced by badSourceID().

◆ lastTrailer()

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

Definition at line 250 of file SiStripFEDBufferComponents.h.

250 { return !tBit(); }

References tBit().

◆ print()

void sistrip::FEDDAQTrailer::print ( std::ostream &  os) const
inline

Definition at line 1389 of file SiStripFEDBufferComponents.h.

1389 { printHex(trailer_, 8, os); }

References sistrip::printHex(), and trailer_.

◆ rBit()

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

Definition at line 1387 of file SiStripFEDBufferComponents.h.

1387 { return (trailer_[0] & 0x04); }

References trailer_.

Referenced by slinkCRCError().

◆ setBadSourceIDBit()

FEDDAQTrailer & sistrip::FEDDAQTrailer::setBadSourceIDBit ( const bool  bitSet)

Definition at line 1021 of file SiStripFEDBufferComponents.cc.

1021  {
1022  if (bitSet)
1023  trailer_[1] |= 0x40;
1024  else
1025  trailer_[1] &= (~0x40);
1026  return *this;
1027  }

References trailer_.

Referenced by FEDDAQTrailer().

◆ setCRC()

FEDDAQTrailer & sistrip::FEDDAQTrailer::setCRC ( const uint16_t  crc)

Definition at line 1007 of file SiStripFEDBufferComponents.cc.

1007  {
1008  trailer_[2] = (crc & 0x00FF);
1009  trailer_[3] = ((crc >> 8) & 0x00FF);
1010  return *this;
1011  }

References crc(), and trailer_.

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

◆ setEventLengthIn64BitWords()

FEDDAQTrailer & sistrip::FEDDAQTrailer::setEventLengthIn64BitWords ( const uint32_t  eventLengthIn64BitWords)

Definition at line 1000 of file SiStripFEDBufferComponents.cc.

1000  {
1001  trailer_[4] = (eventLengthIn64BitWords & 0x000000FF);
1002  trailer_[5] = ((eventLengthIn64BitWords & 0x0000FF00) >> 8);
1003  trailer_[6] = ((eventLengthIn64BitWords & 0x00FF0000) >> 16);
1004  return *this;
1005  }

References eventLengthIn64BitWords(), and trailer_.

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

◆ setEventStatusNibble()

FEDDAQTrailer & sistrip::FEDDAQTrailer::setEventStatusNibble ( const uint8_t  eventStatusNibble)

Definition at line 1037 of file SiStripFEDBufferComponents.cc.

1037  {
1038  trailer_[1] = ((trailer_[1] & 0xF0) | (eventStatusNibble & 0x0F));
1039  return *this;
1040  }

References eventStatusNibble(), and trailer_.

Referenced by FEDDAQTrailer().

◆ setSLinkCRCErrorBit()

FEDDAQTrailer & sistrip::FEDDAQTrailer::setSLinkCRCErrorBit ( const bool  bitSet)

Definition at line 1029 of file SiStripFEDBufferComponents.cc.

1029  {
1030  if (bitSet)
1031  trailer_[0] |= 0x04;
1032  else
1033  trailer_[0] &= (~0x40);
1034  return *this;
1035  }

References trailer_.

Referenced by FEDDAQTrailer().

◆ setSLinkTransmissionErrorBit()

FEDDAQTrailer & sistrip::FEDDAQTrailer::setSLinkTransmissionErrorBit ( const bool  bitSet)

Definition at line 1013 of file SiStripFEDBufferComponents.cc.

1013  {
1014  if (bitSet)
1015  trailer_[1] |= 0x80;
1016  else
1017  trailer_[1] &= (~0x80);
1018  return *this;
1019  }

References trailer_.

Referenced by FEDDAQTrailer().

◆ setTTSBits()

FEDDAQTrailer & sistrip::FEDDAQTrailer::setTTSBits ( const FEDTTSBits  ttsBits)

Definition at line 1042 of file SiStripFEDBufferComponents.cc.

1042  {
1043  trailer_[0] = ((trailer_[0] & 0x0F) | (ttsBits & 0xF0));
1044  return *this;
1045  }

References trailer_, and ttsBits().

Referenced by FEDDAQTrailer().

◆ slinkCRCError()

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

Definition at line 253 of file SiStripFEDBufferComponents.h.

253 { return rBit(); }

References rBit().

Referenced by sistrip::FEDBufferBase::checkNoSlinkCRCError(), and FEDDAQTrailer().

◆ slinkTransmissionError()

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

Definition at line 241 of file SiStripFEDBufferComponents.h.

241 { return cBit(); }

References cBit().

Referenced by sistrip::FEDBufferBase::checkNoSLinkTransmissionError(), and FEDDAQTrailer().

◆ tBit()

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

Definition at line 1385 of file SiStripFEDBufferComponents.h.

1385 { return (trailer_[0] & 0x08); }

References trailer_.

Referenced by lastTrailer().

◆ ttsBits()

FEDTTSBits sistrip::FEDDAQTrailer::ttsBits ( ) const

◆ ttsNibble()

uint8_t sistrip::FEDDAQTrailer::ttsNibble ( ) const
inline

Definition at line 1383 of file SiStripFEDBufferComponents.h.

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

References trailer_.

Referenced by ttsBits().

Member Data Documentation

◆ trailer_

uint8_t sistrip::FEDDAQTrailer::trailer_[8]
private
sistrip::FEDDAQTrailer::tBit
bool tBit() const
Definition: SiStripFEDBufferComponents.h:1385
sistrip::FEDDAQTrailer::setSLinkCRCErrorBit
FEDDAQTrailer & setSLinkCRCErrorBit(const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:1029
sistrip::FEDDAQTrailer::fBit
bool fBit() const
Definition: SiStripFEDBufferComponents.h:1379
sistrip::FEDDAQTrailer::eventLengthIn64BitWords
uint32_t eventLengthIn64BitWords() const
Definition: SiStripFEDBufferComponents.h:1369
sistrip::FEDTTSBits
FEDTTSBits
Definition: SiStripFEDBufferComponents.h:108
sistrip::FEDDAQTrailer::ttsNibble
uint8_t ttsNibble() const
Definition: SiStripFEDBufferComponents.h:1383
sistrip::FEDDAQTrailer::slinkCRCError
bool slinkCRCError() const
Definition: SiStripFEDBufferComponents.h:253
sistrip::TTS_OUT_OF_SYNC
Definition: SiStripFEDBufferComponents.h:111
sistrip::FEDDAQTrailer::setSLinkTransmissionErrorBit
FEDDAQTrailer & setSLinkTransmissionErrorBit(const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:1013
sistrip::TTS_INVALID
Definition: SiStripFEDBufferComponents.h:116
sistrip::FEDDAQTrailer::ttsBits
FEDTTSBits ttsBits() const
Definition: SiStripFEDBufferComponents.cc:964
sistrip::FEDDAQTrailer::eventStatusNibble
uint8_t eventStatusNibble() const
Definition: SiStripFEDBufferComponents.h:1381
sistrip::TTS_READY
Definition: SiStripFEDBufferComponents.h:113
sistrip::FEDDAQTrailer::trailer_
uint8_t trailer_[8]
Definition: SiStripFEDBufferComponents.h:273
sistrip::TTS_DISCONNECTED1
Definition: SiStripFEDBufferComponents.h:115
sistrip::FEDDAQTrailer::slinkTransmissionError
bool slinkTransmissionError() const
Definition: SiStripFEDBufferComponents.h:241
sistrip::FEDDAQTrailer::cBit
bool cBit() const
Definition: SiStripFEDBufferComponents.h:1377
sistrip::FEDDAQTrailer::setEventLengthIn64BitWords
FEDDAQTrailer & setEventLengthIn64BitWords(const uint32_t eventLengthIn64BitWords)
Definition: SiStripFEDBufferComponents.cc:1000
sistrip::FEDDAQTrailer::setTTSBits
FEDDAQTrailer & setTTSBits(const FEDTTSBits ttsBits)
Definition: SiStripFEDBufferComponents.cc:1042
sistrip::FEDDAQTrailer::setEventStatusNibble
FEDDAQTrailer & setEventStatusNibble(const uint8_t eventStatusNibble)
Definition: SiStripFEDBufferComponents.cc:1037
sistrip::FEDDAQTrailer::setBadSourceIDBit
FEDDAQTrailer & setBadSourceIDBit(const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:1021
sistrip::FEDDAQTrailer::rBit
bool rBit() const
Definition: SiStripFEDBufferComponents.h:1387
sistrip::TTS_ERROR
Definition: SiStripFEDBufferComponents.h:114
sistrip::printHex
void printHex(const void *pointer, const size_t length, std::ostream &os)
Definition: SiStripFEDBufferComponents.cc:26
sistrip::TTS_WARN_OVERFLOW
Definition: SiStripFEDBufferComponents.h:110
sistrip::TTS_BUSY
Definition: SiStripFEDBufferComponents.h:112
sistrip::FEDDAQTrailer::setCRC
FEDDAQTrailer & setCRC(const uint16_t crc)
Definition: SiStripFEDBufferComponents.cc:1007
sistrip::FEDDAQTrailer::crc
uint16_t crc() const
Definition: SiStripFEDBufferComponents.h:1375
sistrip::TTS_DISCONNECTED0
Definition: SiStripFEDBufferComponents.h:109