CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
FEDTrailer Class Reference

#include <FEDTrailer.h>

Public Member Functions

bool check () const
 Check that the trailer is OK. More...
 
uint32_t conscheck () const
 Return the word containing the consistency checks. More...
 
uint16_t crc () const
 Cyclic Redundancy Code of the event fragment including header and trailer. More...
 
bool crcModified () const
 True if the CRC value has been modified by the S-link sender card. More...
 
uint8_t evtStatus () const
 Event fragment status information. More...
 
 FEDTrailer (const unsigned char *trailer)
 Constructor. More...
 
uint32_t fragmentLength () const
 The length of the event fragment counted in 64-bit words including header and trailer. More...
 
bool moreTrailers () const
 
bool slinkError () const
 True if the FRL has detected a transmission error over the s-link cable. More...
 
uint8_t ttsBits () const
 Current value of the Trigger Throttling System bits. More...
 
bool wrongFedId () const
 True if the FED_ID given by the FED is not the one expected by the FRL. More...
 
virtual ~FEDTrailer ()
 Destructor. More...
 

Static Public Member Functions

static void set (unsigned char *trailer, uint32_t lenght, uint16_t crc, uint8_t evt_stat, uint8_t tts, bool moreTrailers=false)
 Set all fields in the trailer. More...
 

Static Public Attributes

static const uint32_t length = sizeof(fedt_t)
 

Private Attributes

const fedt_structtheTrailer
 

Detailed Description

Helper class to interpret/create FED trailer words.

Author
N. Amapane - CERN, R. Mommsen - FNAL

Definition at line 14 of file FEDTrailer.h.

Constructor & Destructor Documentation

FEDTrailer::FEDTrailer ( const unsigned char *  trailer)

Constructor.

Definition at line 9 of file FEDTrailer.cc.

9 : theTrailer(reinterpret_cast<const fedt_t*>(trailer)) {}
const fedt_struct * theTrailer
Definition: FEDTrailer.h:60
FEDTrailer::~FEDTrailer ( )
virtual

Destructor.

Definition at line 11 of file FEDTrailer.cc.

11 {}

Member Function Documentation

bool FEDTrailer::check ( ) const
uint32_t FEDTrailer::conscheck ( ) const

Return the word containing the consistency checks.

Definition at line 29 of file FEDTrailer.cc.

References fedt_struct::conscheck, and theTrailer.

29 { return theTrailer->conscheck; }
const fedt_struct * theTrailer
Definition: FEDTrailer.h:60
uint32_t conscheck
Definition: fed_trailer.h:21
uint16_t FEDTrailer::crc ( ) const
bool FEDTrailer::crcModified ( ) const

True if the CRC value has been modified by the S-link sender card.

Definition at line 23 of file FEDTrailer.cc.

References fedt_struct::conscheck, FED_CRC_MODIFIED_EXTRACT, and theTrailer.

Referenced by DTDDUData::checkCRCBit().

const fedt_struct * theTrailer
Definition: FEDTrailer.h:60
#define FED_CRC_MODIFIED_EXTRACT(a)
Definition: fed_trailer.h:60
uint32_t conscheck
Definition: fed_trailer.h:21
uint8_t FEDTrailer::evtStatus ( ) const
uint32_t FEDTrailer::fragmentLength ( ) const
bool FEDTrailer::moreTrailers ( ) const

0 -> the current trailer word is the last one. 1 -> other trailer words can follow

Definition at line 21 of file FEDTrailer.cc.

References fedt_struct::conscheck, FED_MORE_TRAILERS_EXTRACT, and theTrailer.

Referenced by ErrorCheckerBase::checkTrailer(), RPixErrorChecker::checkTrailer(), ESUnpacker::interpretRawData(), RPCUnpackingModule::produce(), omtf::OmtfUnpacker::produce(), L1GlobalTriggerEvmRawToDigi::unpackTrailer(), and L1GlobalTriggerRawToDigi::unpackTrailer().

#define FED_MORE_TRAILERS_EXTRACT(a)
Definition: fed_trailer.h:55
const fedt_struct * theTrailer
Definition: FEDTrailer.h:60
uint32_t conscheck
Definition: fed_trailer.h:21
void FEDTrailer::set ( unsigned char *  trailer,
uint32_t  lenght,
uint16_t  crc,
uint8_t  evt_stat,
uint8_t  tts,
bool  moreTrailers = false 
)
static

Set all fields in the trailer.

Definition at line 31 of file FEDTrailer.cc.

References fedt_struct::conscheck, fedt_struct::eventsize, FED_CRCS_MASK, FED_CRCS_SHIFT, FED_EVSZ_MASK, FED_EVSZ_SHIFT, FED_MORE_TRAILERS_SHIFT, FED_MORE_TRAILERS_WIDTH, FED_SLINK_END_MARKER, FED_STAT_MASK, FED_STAT_SHIFT, FED_TCTRLID_SHIFT, FED_TTSI_MASK, FED_TTSI_SHIFT, and submitPVValidationJobs::t.

Referenced by ESDataFormatterV1_1::DigiToRaw(), ESDataFormatterV4::DigiToRaw(), DaqFakeReader::fillFEDs(), DaqFakeReader::fillTCDSFED(), l1t::AMCDumpToRaw::formatRaw(), l1t::MP7BufferDumpToRaw::formatRaw(), CTPPSTotemDataFormatter::formatRawData(), PixelDataFormatter::formatRawData(), CTPPSPixelDataFormatter::formatRawData(), CastorPacker::pack(), CastorCtdcPacker::pack(), HcalPacker::pack(), L1GTEvmDigiToRaw::packTrailer(), L1GTDigiToRaw::packTrailer(), DTDigiToRawModule::produce(), CSCTFPacker::produce(), RPCTwinMuxDigiToRaw::produce(), GctDigiToRaw::produce(), HcalDigiToRawuHTR::produce(), l1t::L1TDigiToRaw::produce(), omtf::OmtfPacker::produce(), and RPCPackingModule::rawData().

32  {
33  // FIXME: should check that input ranges are OK!!!
34  fedt_t* t = reinterpret_cast<fedt_t*>(trailer);
35 
37 
40 
41  if (moreTrailers)
43 }
uint16_t crc() const
Cyclic Redundancy Code of the event fragment including header and trailer.
Definition: FEDTrailer.cc:15
bool moreTrailers() const
Definition: FEDTrailer.cc:21
#define FED_TTSI_MASK
Definition: fed_trailer.h:49
#define FED_TCTRLID_SHIFT
Definition: fed_trailer.h:28
uint32_t eventsize
Definition: fed_trailer.h:22
#define FED_TTSI_SHIFT
Definition: fed_trailer.h:48
uint32_t conscheck
Definition: fed_trailer.h:21
#define FED_MORE_TRAILERS_SHIFT
Definition: fed_trailer.h:53
#define FED_CRCS_SHIFT
Definition: fed_trailer.h:38
uint8_t ttsBits() const
Current value of the Trigger Throttling System bits.
Definition: FEDTrailer.cc:19
#define FED_SLINK_END_MARKER
Definition: fed_trailer.h:25
#define FED_CRCS_MASK
Definition: fed_trailer.h:39
#define FED_MORE_TRAILERS_WIDTH
Definition: fed_trailer.h:52
uint8_t evtStatus() const
Event fragment status information.
Definition: FEDTrailer.cc:17
#define FED_STAT_SHIFT
Definition: fed_trailer.h:43
#define FED_EVSZ_SHIFT
Definition: fed_trailer.h:33
#define FED_EVSZ_MASK
Definition: fed_trailer.h:34
#define FED_STAT_MASK
Definition: fed_trailer.h:44
bool FEDTrailer::slinkError ( ) const

True if the FRL has detected a transmission error over the s-link cable.

Definition at line 25 of file FEDTrailer.cc.

References fedt_struct::conscheck, FED_SLINK_ERROR_EXTRACT, and theTrailer.

25 { return (FED_SLINK_ERROR_EXTRACT(theTrailer->conscheck) != 0); }
const fedt_struct * theTrailer
Definition: FEDTrailer.h:60
uint32_t conscheck
Definition: fed_trailer.h:21
#define FED_SLINK_ERROR_EXTRACT(a)
Definition: fed_trailer.h:65
uint8_t FEDTrailer::ttsBits ( ) const
bool FEDTrailer::wrongFedId ( ) const

True if the FED_ID given by the FED is not the one expected by the FRL.

Definition at line 27 of file FEDTrailer.cc.

References fedt_struct::conscheck, FED_WRONG_FEDID_EXTRACT, and theTrailer.

27 { return (FED_WRONG_FEDID_EXTRACT(theTrailer->conscheck) != 0); }
const fedt_struct * theTrailer
Definition: FEDTrailer.h:60
#define FED_WRONG_FEDID_EXTRACT(a)
Definition: fed_trailer.h:70
uint32_t conscheck
Definition: fed_trailer.h:21

Member Data Documentation

const uint32_t FEDTrailer::length = sizeof(fedt_t)
static
const fedt_struct* FEDTrailer::theTrailer
private