CMS 3D CMS Logo

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