CMS 3D CMS Logo

FEDTrailer.cc
Go to the documentation of this file.
1 
8 
9 FEDTrailer::FEDTrailer(const unsigned char* trailer) : theTrailer(reinterpret_cast<const fedt_t*>(trailer)) {}
10 
12 
14 
15 uint16_t FEDTrailer::crc() const { return FED_CRCS_EXTRACT(theTrailer->conscheck); }
16 
18 
20 
22 
24 
26 
28 
29 uint32_t FEDTrailer::conscheck() const { return theTrailer->conscheck; }
30 
32  unsigned char* trailer, uint32_t lenght, uint16_t crc, uint8_t evtStatus, uint8_t ttsBits, bool moreTrailers) {
33  // FIXME: should check that input ranges are OK!!!
34  fedt_t* t = reinterpret_cast<fedt_t*>(trailer);
35 
36  t->eventsize = (FED_SLINK_END_MARKER << FED_TCTRLID_SHIFT) | ((lenght << FED_EVSZ_SHIFT) & FED_EVSZ_MASK);
37 
38  t->conscheck = ((crc << FED_CRCS_SHIFT) & FED_CRCS_MASK) | ((evtStatus << FED_STAT_SHIFT) & FED_STAT_MASK) |
40 
41  if (moreTrailers)
43 }
44 
46 
47 const uint32_t FEDTrailer::length = sizeof(fedt_t);
#define FED_MORE_TRAILERS_EXTRACT(a)
Definition: fed_trailer.h:55
#define FED_CRCS_EXTRACT(a)
Definition: fed_trailer.h:40
struct fedt_struct fedt_t
uint32_t conscheck() const
Return the word containing the consistency checks.
Definition: FEDTrailer.cc:29
static const uint32_t length
Definition: FEDTrailer.h:57
uint8_t ttsBits() const
Current value of the Trigger Throttling System bits.
Definition: FEDTrailer.cc:19
virtual ~FEDTrailer()
Destructor.
Definition: FEDTrailer.cc:11
const fedt_struct * theTrailer
Definition: FEDTrailer.h:60
bool slinkError() const
True if the FRL has detected a transmission error over the s-link cable.
Definition: FEDTrailer.cc:25
#define FED_CRC_MODIFIED_EXTRACT(a)
Definition: fed_trailer.h:60
#define FED_WRONG_FEDID_EXTRACT(a)
Definition: fed_trailer.h:70
#define FED_TTSI_EXTRACT(a)
Definition: fed_trailer.h:50
#define FED_TCTRLID_EXTRACT(a)
Definition: fed_trailer.h:30
#define FED_EVSZ_EXTRACT(a)
Definition: fed_trailer.h:35
#define FED_TTSI_MASK
Definition: fed_trailer.h:49
#define FED_TCTRLID_SHIFT
Definition: fed_trailer.h:28
uint32_t fragmentLength() const
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:13
bool crcModified() const
True if the CRC value has been modified by the S-link sender card.
Definition: FEDTrailer.cc:23
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.
Definition: FEDTrailer.cc:31
uint32_t eventsize
Definition: fed_trailer.h:22
bool wrongFedId() const
True if the FED_ID given by the FED is not the one expected by the FRL.
Definition: FEDTrailer.cc:27
#define FED_TTSI_SHIFT
Definition: fed_trailer.h:48
uint32_t conscheck
Definition: fed_trailer.h:21
uint16_t crc() const
Cyclic Redundancy Code of the event fragment including header and trailer.
Definition: FEDTrailer.cc:15
#define FED_MORE_TRAILERS_SHIFT
Definition: fed_trailer.h:53
#define FED_STAT_EXTRACT(a)
Definition: fed_trailer.h:45
#define FED_SLINK_ERROR_EXTRACT(a)
Definition: fed_trailer.h:65
uint8_t evtStatus() const
Event fragment status information.
Definition: FEDTrailer.cc:17
#define FED_CRCS_SHIFT
Definition: fed_trailer.h:38
#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
#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
FEDTrailer(const unsigned char *trailer)
Constructor.
Definition: FEDTrailer.cc:9
#define FED_STAT_MASK
Definition: fed_trailer.h:44
bool check() const
Check that the trailer is OK.
Definition: FEDTrailer.cc:45
bool moreTrailers() const
Definition: FEDTrailer.cc:21