CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FEDTrailer.cc
Go to the documentation of this file.
1 
9 
10 #define FED_MORE_TRAILERS 0x00000008
11 #define FED_TCTRLID 0xA0000000
12 
13 
14 FEDTrailer::FEDTrailer(const unsigned char* trailer) :
15  theTrailer(reinterpret_cast<const fedt_t*>(trailer)) {}
16 
17 
19 
20 
21 
22 int FEDTrailer::lenght(){
24 }
25 
26 
27 int FEDTrailer::crc(){
29 }
30 
31 
34 }
35 
36 
39 }
40 
41 
43  return ((theTrailer->conscheck & FED_MORE_TRAILERS)!=0);
44 }
45 
46 
47 void FEDTrailer::set(unsigned char* trailer,
48  int evt_lgth,
49  int crc,
50  int evt_stat,
51  int tts,
52  bool T){
53  // FIXME: should check that input ranges are OK!!!
54  fedt_t* t = reinterpret_cast<fedt_t*>(trailer);
55 
56  t->eventsize =
57  FED_TCTRLID |
58  evt_lgth << FED_EVSZ_SHIFT;
59 
60  t->conscheck =
61  crc << FED_CRCS_SHIFT |
62  evt_stat << FED_STAT_SHIFT |
63  tts << FED_TTSI_SHIFT;
64 
65  if (T) t->conscheck |= FED_MORE_TRAILERS;
66 }
67 
68 
69 bool FEDTrailer::check(){
70  // ...may report with finer detail
71  bool result = true;
73 
74  return result;
75 }
bool check()
Definition: FEDTrailer.cc:66
#define FED_TCTRLID_MASK
Definition: fed_trailer.h:37
#define FED_TCTRLID
Definition: FEDTrailer.cc:11
int evtStatus()
Event fragment status information.
Definition: FEDTrailer.cc:29
virtual ~FEDTrailer()
Destructor.
Definition: FEDTrailer.cc:15
bool moreTrailers()
Definition: FEDTrailer.cc:39
const fedt_struct * theTrailer
Definition: FEDTrailer.h:52
static void set(unsigned char *trailer, int evt_lgth, int crc, int evt_stat, int tts, bool T=false)
Set all fields in the trailer.
Definition: FEDTrailer.cc:44
#define FED_MORE_TRAILERS
Definition: FEDTrailer.cc:10
unsigned int conscheck
Definition: fed_trailer.h:32
#define FED_TTSI_MASK
Definition: fed_trailer.h:42
#define FED_TTSI_SHIFT
Definition: fed_trailer.h:53
tuple result
Definition: query.py:137
#define FED_CRCS_SHIFT
Definition: fed_trailer.h:51
int ttsBits()
Current value of the Trigger Throttling System bitsAQ).
Definition: FEDTrailer.cc:34
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:19
#define FED_CRCS_MASK
Definition: fed_trailer.h:40
string const
Definition: compareJSON.py:14
#define FED_STAT_SHIFT
Definition: fed_trailer.h:52
unsigned int eventsize
Definition: fed_trailer.h:33
#define FED_EVSZ_SHIFT
Definition: fed_trailer.h:49
#define FED_EVSZ_MASK
Definition: fed_trailer.h:38
int crc()
Cyclic Redundancy Code of the event fragment including header and trailer.
Definition: FEDTrailer.cc:24
FEDTrailer(const unsigned char *trailer)
Constructor.
Definition: FEDTrailer.cc:11
#define FED_STAT_MASK
Definition: fed_trailer.h:41
long double T