CMS 3D CMS Logo

CSCDMBTrailer2005.h
Go to the documentation of this file.
1 #ifndef CSCDMBTrailer2005_h
2 #define CSCDMBTrailer2005_h
3 
7 
9  // public:
11  bzero(data(), sizeInWords() * 2);
12  bits.ddu_code_1 = bits.ddu_code_2 = bits.ddu_code_3 = bits.ddu_code_4 = 0xF;
13  bits.ddu_code_5 = bits.ddu_code_6 = bits.ddu_code_7 = bits.ddu_code_8 = 0xE;
14  }
15 
16  CSCDMBTrailer2005(const uint16_t *buf) { memcpy(data(), buf, sizeInWords() * 2); };
17  /*
18  CSCDMBTrailer2005(const CSCDMBStatusDigi & digi)
19  {
20  memcpy(this, digi.trailer(), sizeInWords()*2);
21  }
22 */
24  void setEventInformation(const CSCDMBHeader &dmbHeader) override {
25  bits.dmb_id = dmbHeader.dmbID();
26  bits.crate_id = dmbHeader.crateID();
27  bits.dmb_l1a = dmbHeader.l1a();
28  bits.dmb_bxn = dmbHeader.bxn();
29  };
30 
31  unsigned crateID() const override { return bits.crate_id; };
32  unsigned dmbID() const override { return bits.dmb_id; };
33 
34  unsigned dmb_l1a() const override { return bits.dmb_l1a; };
35  unsigned dmb_bxn() const override { return bits.dmb_bxn; };
36 
37  unsigned alct_endtimeout() const override { return bits.alct_endtimeout; };
38  unsigned tmb_endtimeout() const override { return bits.tmb_endtimeout; };
39  unsigned cfeb_endtimeout() const override { return bits.cfeb_endtimeout; };
40 
41  unsigned alct_starttimeout() const override { return bits.alct_starttimeout; };
42  unsigned tmb_starttimeout() const override { return bits.tmb_starttimeout; };
43  unsigned cfeb_starttimeout() const override { return bits.cfeb_starttimeout; };
44 
45  unsigned cfeb_movlp() const override { return bits.cfeb_movlp; };
46  unsigned dmb_l1pipe() const override { return bits.dmb_l1pipe; };
47 
48  unsigned alct_empty() const override { return bits.alct_empty; };
49  unsigned tmb_empty() const override { return bits.tmb_empty; };
50  unsigned cfeb_empty() const override { return bits.cfeb_empty; };
51 
52  unsigned alct_half() const override { return bits.alct_half; };
53  unsigned tmb_half() const override { return bits.tmb_half; };
54  unsigned cfeb_half() const override { return bits.cfeb_half; };
55 
56  unsigned alct_full() const override { return bits.alct_full; };
57  unsigned tmb_full() const override { return bits.tmb_full; };
58  unsigned cfeb_full() const override { return bits.cfeb_full; };
59 
60  unsigned crc22() const override { return (bits.dmb_crc_1 | (bits.dmb_crc_2 << 11)); };
61  unsigned crc_lo_parity() const override { return bits.dmb_parity_1; };
62  unsigned crc_hi_parity() const override { return bits.dmb_parity_2; };
63 
64  unsigned short *data() override { return (unsigned short *)(&bits); }
65  unsigned short *data() const override { return (unsigned short *)(&bits); }
66 
67  bool check() const override {
68  return bits.ddu_code_1 == 0xF && bits.ddu_code_2 == 0xF && bits.ddu_code_3 == 0xF && bits.ddu_code_4 == 0xF &&
69  bits.ddu_code_5 == 0xE && bits.ddu_code_6 == 0xE && bits.ddu_code_7 == 0xE && bits.ddu_code_8 == 0xE;
70  }
71 
72  unsigned sizeInWords() const override { return 8; }
73 
74  struct {
75  unsigned dmb_l1a : 8;
76  unsigned dmb_bxn : 4;
77  unsigned ddu_code_1 : 4;
78 
79  unsigned cfeb_half : 5;
80  unsigned tmb_half : 1;
81  unsigned alct_half : 1;
82  unsigned cfeb_movlp : 5;
83  unsigned ddu_code_2 : 4;
84 
85  unsigned tmb_starttimeout : 1;
86  unsigned alct_starttimeout : 1;
87  unsigned tmb_empty : 1;
88  unsigned alct_empty : 1;
89  unsigned dmb_l1pipe : 8;
90  unsigned ddu_code_3 : 4;
91 
92  unsigned cfeb_starttimeout : 5;
93  unsigned tmb_endtimeout : 1;
94  unsigned alct_endtimeout : 1;
95  unsigned cfeb_endtimeout : 5;
96  unsigned ddu_code_4 : 4;
97 
98  unsigned cfeb_empty : 5;
99  unsigned cfeb_full : 5;
100  unsigned tmb_full : 1;
101  unsigned alct_full : 1;
102  unsigned ddu_code_5 : 4;
103 
104  unsigned dmb_id : 4;
105  unsigned crate_id : 8;
106  unsigned ddu_code_6 : 4;
107 
108  unsigned dmb_crc_1 : 11;
109  unsigned dmb_parity_1 : 1;
110  unsigned ddu_code_7 : 4;
111 
112  unsigned dmb_crc_2 : 11;
113  unsigned dmb_parity_2 : 1;
114  unsigned ddu_code_8 : 4;
115  } bits;
116 };
117 
118 #endif
unsigned dmb_l1pipe() const override
unsigned dmbID() const override
unsigned tmb_empty() const override
unsigned cfeb_half() const override
unsigned l1a() const
Definition: CSCDMBHeader.h:39
unsigned alct_half() const override
unsigned dmb_bxn() const override
unsigned cfeb_starttimeout() const override
unsigned tmb_endtimeout() const override
CSCDMBTrailer2005(const uint16_t *buf)
unsigned short * data() const override
unsigned tmb_full() const override
bool check() const override
unsigned tmb_starttimeout() const override
unsigned tmb_half() const override
unsigned alct_empty() const override
unsigned crc_hi_parity() const override
void setEventInformation(const CSCDMBHeader &dmbHeader) override
@ NEEDS TO BE DONE
unsigned cfeb_movlp() const override
unsigned dmb_l1a() const override
unsigned bxn() const
Definition: CSCDMBHeader.h:37
unsigned crateID() const
Definition: CSCDMBHeader.h:35
unsigned alct_endtimeout() const override
unsigned short * data() override
unsigned alct_full() const override
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
unsigned crc22() const override
unsigned alct_starttimeout() const override
unsigned cfeb_full() const override
unsigned sizeInWords() const override
unsigned cfeb_endtimeout() const override
struct CSCDMBTrailer2005::@414 bits
unsigned cfeb_empty() const override
unsigned crateID() const override
unsigned crc_lo_parity() const override