CMS 3D CMS Logo

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