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