CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCDCCTrailer.h
Go to the documentation of this file.
1 // Authors Rick W and Alex T 9/24/94
2 //
3 #ifndef EventFilter_CSCRawToDigi_CSCDCCTrailer_h
4 #define EventFilter_CSCRawToDigi_CSCDCCTrailer_h
5 
6 #include <iostream>
7 #include <cstdint>
8 #include <cstring> // bzero
10 
14 struct CSCDCCTrailer {
16  bzero(this, sizeInWords() * 2);
17  dcc_trail1 = 0xEF;
18  EOE_1 = 0XA;
19  XXXX_1 = 0X0; //@@ Actually a reserved bit. We should not test on it.
20  }
21 
22  CSCDCCTrailer(const CSCDCCStatusDigi& digi) { memcpy(this, digi.trailer(), sizeInWords() * 2); }
23 
24  void setFromBuffer(uint16_t const* buf) { memcpy(this, buf, sizeInWords() * 2); }
25 
28  unsigned fifo_status : 8;
29  unsigned ddu_data_status2 : 24;
30  unsigned ddu_data_status1 : 16;
31  unsigned readout_time : 8;
32  unsigned dcc_trail1 : 8;
33 
36  unsigned dollardollar : 1;
37  unsigned Tx : 3;
38  unsigned TTS : 4;
39  unsigned Evt_stat : 4;
40  unsigned XXXX_2 : 4;
41  unsigned CRC : 16;
42  unsigned Evt_lgth : 24;
43  unsigned XXXX_1 : 4;
44  unsigned EOE_1 : 4;
45 
46  static unsigned sizeInWords() { return 8; }
47  //@@ The XXXX_1 is a reserved bit in CMS format - we really should not be testing it
48  bool check() const { return (dcc_trail1 == 0xEF) && (EOE_1 == 0XA) && (XXXX_1 == 0X0); }
49  unsigned short* data() { return (unsigned short*)this; }
50 };
51 #endif
unsigned ddu_data_status1
Definition: CSCDCCTrailer.h:30
bool check() const
Definition: CSCDCCTrailer.h:48
unsigned short * data()
Definition: CSCDCCTrailer.h:49
static const double X0
unsigned ddu_data_status2
Definition: CSCDCCTrailer.h:29
unsigned Evt_stat
Definition: CSCDCCTrailer.h:39
unsigned dcc_trail1
Definition: CSCDCCTrailer.h:32
const uint16_t * trailer() const
unsigned CRC
Definition: CSCDCCTrailer.h:41
unsigned XXXX_1
Definition: CSCDCCTrailer.h:43
CSCDCCTrailer(const CSCDCCStatusDigi &digi)
Definition: CSCDCCTrailer.h:22
unsigned Evt_lgth
Definition: CSCDCCTrailer.h:42
unsigned dollardollar
Definition: CSCDCCTrailer.h:36
unsigned fifo_status
Definition: CSCDCCTrailer.h:28
void setFromBuffer(uint16_t const *buf)
Definition: CSCDCCTrailer.h:24
static unsigned sizeInWords()
Definition: CSCDCCTrailer.h:46
unsigned readout_time
Definition: CSCDCCTrailer.h:31
unsigned EOE_1
Definition: CSCDCCTrailer.h:44
unsigned XXXX_2
Definition: CSCDCCTrailer.h:40
unsigned TTS
Definition: CSCDCCTrailer.h:38