CMS 3D CMS Logo

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