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
Phase2Tracker::FEDDAQTrailer Class Reference

#include <Phase2TrackerFEDDAQTrailer.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
 
void setBadSourceIDBit (const bool bitSet)
 
void setCRC (const uint16_t crc)
 
void setEventLengthIn64BitWords (const uint32_t eventLengthIn64BitWords)
 
void setEventStatusNibble (const uint8_t eventStatusNibble)
 
void setSLinkCRCErrorBit (const bool bitSet)
 
void setSLinkTransmissionErrorBit (const bool bitSet)
 
void setTTSBits (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 29 of file Phase2TrackerFEDDAQTrailer.h.

Constructor & Destructor Documentation

Phase2Tracker::FEDDAQTrailer::FEDDAQTrailer ( )
inline

Definition at line 32 of file Phase2TrackerFEDDAQTrailer.h.

32 { }
Phase2Tracker::FEDDAQTrailer::FEDDAQTrailer ( const uint8_t *  trailer)
inlineexplicit

Definition at line 87 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

88  { memcpy(trailer_,trailer,8); }
Phase2Tracker::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 60 of file Phase2TrackerFEDDAQTrailer.cc.

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

65  {
66  //clear everything (T,x,$ all set to 0)
67  memset(trailer_,0x0,8);
68  //set the EoE nibble to indicate this is the last fragment
69  trailer_[7] = 0xA0;
70  //set variable fields vith values supplied
74  setCRC(crc);
76  setBadSourceIDBit(badFEDID);
78  }
void setSLinkCRCErrorBit(const bool bitSet)
void setSLinkTransmissionErrorBit(const bool bitSet)
void setEventStatusNibble(const uint8_t eventStatusNibble)
void setTTSBits(const FEDTTSBits ttsBits)
void setEventLengthIn64BitWords(const uint32_t eventLengthIn64BitWords)
void setBadSourceIDBit(const bool bitSet)

Member Function Documentation

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

Definition at line 46 of file Phase2TrackerFEDDAQTrailer.h.

References fBit().

46 { return fBit(); }
bool Phase2Tracker::FEDDAQTrailer::cBit ( ) const
inline

Definition at line 102 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by slinkTransmissionError().

103  { return (trailer_[1] & 0x80); }
uint16_t Phase2Tracker::FEDDAQTrailer::crc ( void  ) const
inline

Definition at line 99 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqCRC().

100  { return ( trailer_[2] | (trailer_[3]<<8) ); }
const uint8_t * Phase2Tracker::FEDDAQTrailer::data ( ) const
inline

Definition at line 123 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by cuy.FindIssue::__init__().

124  { return trailer_; }
uint8_t Phase2Tracker::FEDDAQTrailer::eoeNibble ( ) const
inline

Definition at line 90 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

91  { return ( (trailer_[7] & 0xF0) >> 4 ); }
uint32_t Phase2Tracker::FEDDAQTrailer::eventLengthIn64BitWords ( ) const
inline

Definition at line 93 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by Phase2Tracker::Phase2TrackerFEDBuffer::daqEventLengthIn64bitWords(), and eventLengthInBytes().

94  { return ( trailer_[4] | (trailer_[5]<<8) | (trailer_[6]<<16) ); }
uint32_t Phase2Tracker::FEDDAQTrailer::eventLengthInBytes ( ) const
inline
uint8_t Phase2Tracker::FEDDAQTrailer::eventStatusNibble ( ) const
inline

Definition at line 108 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

109  { return (trailer_[1] & 0x0F); }
bool Phase2Tracker::FEDDAQTrailer::fBit ( ) const
inline

Definition at line 105 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by badSourceID().

106  { return (trailer_[1] & 0x40); }
bool Phase2Tracker::FEDDAQTrailer::lastTrailer ( ) const
inline

Definition at line 52 of file Phase2TrackerFEDDAQTrailer.h.

References tBit().

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

Definition at line 120 of file Phase2TrackerFEDDAQTrailer.h.

References Phase2Tracker::printHex(), and trailer_.

121  { printHex(trailer_,8,os); }
void printHex(const void *pointer, const size_t lengthInBytes, std::ostream &os)
Definition: utils.h:60
bool Phase2Tracker::FEDDAQTrailer::rBit ( ) const
inline

Definition at line 117 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by slinkCRCError().

118  { return (trailer_[0] & 0x04); }
void Phase2Tracker::FEDDAQTrailer::setBadSourceIDBit ( const bool  bitSet)

Definition at line 99 of file Phase2TrackerFEDDAQTrailer.cc.

References trailer_.

Referenced by FEDDAQTrailer().

100  {
101  if (bitSet) trailer_[1] |= 0x40;
102  else trailer_[1] &= (~0x40);
103  }
void Phase2Tracker::FEDDAQTrailer::setCRC ( const uint16_t  crc)

Definition at line 87 of file Phase2TrackerFEDDAQTrailer.cc.

References trailer_.

Referenced by FEDDAQTrailer().

88  {
89  trailer_[2] = (crc & 0x00FF);
90  trailer_[3] = ( (crc >> 8) & 0x00FF );
91  }
void Phase2Tracker::FEDDAQTrailer::setEventLengthIn64BitWords ( const uint32_t  eventLengthIn64BitWords)

Definition at line 80 of file Phase2TrackerFEDDAQTrailer.cc.

References trailer_.

Referenced by FEDDAQTrailer().

81  {
82  trailer_[4] = (eventLengthIn64BitWords & 0x000000FF);
83  trailer_[5] = ( (eventLengthIn64BitWords & 0x0000FF00) >> 8);
84  trailer_[6] = ( (eventLengthIn64BitWords & 0x00FF0000) >> 16);
85  }
void Phase2Tracker::FEDDAQTrailer::setEventStatusNibble ( const uint8_t  eventStatusNibble)

Definition at line 111 of file Phase2TrackerFEDDAQTrailer.cc.

References trailer_.

Referenced by FEDDAQTrailer().

112  {
113  trailer_[1] = ( (trailer_[1] & 0xF0) | (eventStatusNibble & 0x0F) );
114  }
void Phase2Tracker::FEDDAQTrailer::setSLinkCRCErrorBit ( const bool  bitSet)

Definition at line 105 of file Phase2TrackerFEDDAQTrailer.cc.

References trailer_.

Referenced by FEDDAQTrailer().

106  {
107  if (bitSet) trailer_[0] |= 0x04;
108  else trailer_[0] &= (~0x40);
109  }
void Phase2Tracker::FEDDAQTrailer::setSLinkTransmissionErrorBit ( const bool  bitSet)

Definition at line 93 of file Phase2TrackerFEDDAQTrailer.cc.

References trailer_.

Referenced by FEDDAQTrailer().

94  {
95  if (bitSet) trailer_[1] |= 0x80;
96  else trailer_[1] &= (~0x80);
97  }
void Phase2Tracker::FEDDAQTrailer::setTTSBits ( const FEDTTSBits  ttsBits)

Definition at line 116 of file Phase2TrackerFEDDAQTrailer.cc.

References trailer_.

Referenced by FEDDAQTrailer().

117  {
118  trailer_[0] = ( (trailer_[0] & 0x0F) | (ttsBits & 0xF0) );
119  }
bool Phase2Tracker::FEDDAQTrailer::slinkCRCError ( ) const
inline

Definition at line 56 of file Phase2TrackerFEDDAQTrailer.h.

References rBit().

56 { return rBit(); }
bool Phase2Tracker::FEDDAQTrailer::slinkTransmissionError ( ) const
inline

Definition at line 43 of file Phase2TrackerFEDDAQTrailer.h.

References cBit().

43 { return cBit(); }
bool Phase2Tracker::FEDDAQTrailer::tBit ( ) const
inline

Definition at line 114 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by lastTrailer().

115  { return (trailer_[0] & 0x08); }
FEDTTSBits Phase2Tracker::FEDDAQTrailer::ttsBits ( ) const
uint8_t Phase2Tracker::FEDDAQTrailer::ttsNibble ( ) const
inline

Definition at line 111 of file Phase2TrackerFEDDAQTrailer.h.

References trailer_.

Referenced by ttsBits().

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

Member Data Documentation

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