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
CSCDMBTrailer2005::cfeb_full
unsigned cfeb_full
Definition: CSCDMBTrailer2005.h:99
CSCDMBTrailer2005::ddu_code_1
unsigned ddu_code_1
Definition: CSCDMBTrailer2005.h:77
CSCVDMBTrailerFormat.h
CSCDMBTrailer2005::dmb_l1pipe
unsigned dmb_l1pipe() const override
Definition: CSCDMBTrailer2005.h:46
CSCDMBTrailer2005::dmb_parity_2
unsigned dmb_parity_2
Definition: CSCDMBTrailer2005.h:113
CSCDMBTrailer2005::ddu_code_5
unsigned ddu_code_5
Definition: CSCDMBTrailer2005.h:102
CSCDMBTrailer2005::tmb_half
unsigned tmb_half() const override
Definition: CSCDMBTrailer2005.h:53
CSCDMBTrailer2005::ddu_code_7
unsigned ddu_code_7
Definition: CSCDMBTrailer2005.h:110
CSCDMBHeader::l1a
unsigned l1a() const
Definition: CSCDMBHeader.h:39
CSCDMBTrailer2005::dmb_l1a
unsigned dmb_l1a() const override
Definition: CSCDMBTrailer2005.h:34
CSCDMBTrailer2005::ddu_code_4
unsigned ddu_code_4
Definition: CSCDMBTrailer2005.h:96
CSCDMBStatusDigi.h
CSCDMBTrailer2005::alct_endtimeout
unsigned alct_endtimeout
Definition: CSCDMBTrailer2005.h:94
CSCDMBTrailer2005::dmb_bxn
unsigned dmb_bxn
Definition: CSCDMBTrailer2005.h:76
CSCDMBTrailer2005::cfeb_movlp
unsigned cfeb_movlp
Definition: CSCDMBTrailer2005.h:82
CSCVDMBTrailerFormat
Definition: CSCVDMBTrailerFormat.h:10
CSCDMBTrailer2005::tmb_starttimeout
unsigned tmb_starttimeout
Definition: CSCDMBTrailer2005.h:85
CSCDMBTrailer2005
Definition: CSCDMBTrailer2005.h:8
CSCDMBTrailer2005::data
unsigned short * data() override
Definition: CSCDMBTrailer2005.h:64
CSCDMBTrailer2005::tmb_half
unsigned tmb_half
Definition: CSCDMBTrailer2005.h:80
CSCDMBTrailer2005::alct_empty
unsigned alct_empty() const override
Definition: CSCDMBTrailer2005.h:48
CSCDMBTrailer2005::cfeb_empty
unsigned cfeb_empty() const override
Definition: CSCDMBTrailer2005.h:50
CSCDMBTrailer2005::dmb_crc_2
unsigned dmb_crc_2
Definition: CSCDMBTrailer2005.h:112
CSCDMBTrailer2005::tmb_empty
unsigned tmb_empty() const override
Definition: CSCDMBTrailer2005.h:49
CSCDMBTrailer2005::cfeb_empty
unsigned cfeb_empty
Definition: CSCDMBTrailer2005.h:98
CSCDMBTrailer2005::dmb_bxn
unsigned dmb_bxn() const override
Definition: CSCDMBTrailer2005.h:35
CSCDMBTrailer2005::check
bool check() const override
Definition: CSCDMBTrailer2005.h:67
CSCDMBTrailer2005::crate_id
unsigned crate_id
Definition: CSCDMBTrailer2005.h:105
CSCDMBTrailer2005::tmb_endtimeout
unsigned tmb_endtimeout
Definition: CSCDMBTrailer2005.h:93
CSCDMBTrailer2005::tmb_starttimeout
unsigned tmb_starttimeout() const override
Definition: CSCDMBTrailer2005.h:42
CSCDMBTrailer2005::cfeb_endtimeout
unsigned cfeb_endtimeout
Definition: CSCDMBTrailer2005.h:95
CSCDMBTrailer2005::crateID
unsigned crateID() const override
Definition: CSCDMBTrailer2005.h:31
CSCDMBTrailer2005::dmb_parity_1
unsigned dmb_parity_1
Definition: CSCDMBTrailer2005.h:109
CSCDMBTrailer2005::ddu_code_3
unsigned ddu_code_3
Definition: CSCDMBTrailer2005.h:90
CSCDMBTrailer2005::crc_hi_parity
unsigned crc_hi_parity() const override
Definition: CSCDMBTrailer2005.h:62
CSCDMBTrailer2005::alct_starttimeout
unsigned alct_starttimeout
Definition: CSCDMBTrailer2005.h:86
CSCDMBHeader.h
CSCDMBTrailer2005::tmb_endtimeout
unsigned tmb_endtimeout() const override
Definition: CSCDMBTrailer2005.h:38
CSCDMBTrailer2005::dmb_id
unsigned dmb_id
Definition: CSCDMBTrailer2005.h:104
CSCDMBTrailer2005::alct_half
unsigned alct_half
Definition: CSCDMBTrailer2005.h:81
CSCDMBTrailer2005::alct_full
unsigned alct_full
Definition: CSCDMBTrailer2005.h:101
CSCDMBTrailer2005::setEventInformation
void setEventInformation(const CSCDMBHeader &dmbHeader) override
@ NEEDS TO BE DONE
Definition: CSCDMBTrailer2005.h:24
CSCDMBTrailer2005::ddu_code_6
unsigned ddu_code_6
Definition: CSCDMBTrailer2005.h:106
CSCDMBTrailer2005::crc_lo_parity
unsigned crc_lo_parity() const override
Definition: CSCDMBTrailer2005.h:61
CSCDMBTrailer2005::cfeb_endtimeout
unsigned cfeb_endtimeout() const override
Definition: CSCDMBTrailer2005.h:39
CSCDMBHeader::crateID
unsigned crateID() const
Definition: CSCDMBHeader.h:35
CSCDMBTrailer2005::cfeb_full
unsigned cfeb_full() const override
Definition: CSCDMBTrailer2005.h:58
CSCDMBTrailer2005::crc22
unsigned crc22() const override
Definition: CSCDMBTrailer2005.h:60
CSCDMBTrailer2005::alct_half
unsigned alct_half() const override
Definition: CSCDMBTrailer2005.h:52
CSCDMBTrailer2005::CSCDMBTrailer2005
CSCDMBTrailer2005(const uint16_t *buf)
Definition: CSCDMBTrailer2005.h:16
CSCDMBTrailer2005::cfeb_half
unsigned cfeb_half
Definition: CSCDMBTrailer2005.h:79
CSCDMBTrailer2005::alct_endtimeout
unsigned alct_endtimeout() const override
Definition: CSCDMBTrailer2005.h:37
CSCDMBHeader::bxn
unsigned bxn() const
Definition: CSCDMBHeader.h:37
CSCDMBTrailer2005::cfeb_half
unsigned cfeb_half() const override
Definition: CSCDMBTrailer2005.h:54
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCDMBTrailer2005::ddu_code_2
unsigned ddu_code_2
Definition: CSCDMBTrailer2005.h:83
CSCDMBTrailer2005::dmbID
unsigned dmbID() const override
Definition: CSCDMBTrailer2005.h:32
CSCDMBTrailer2005::dmb_l1pipe
unsigned dmb_l1pipe
Definition: CSCDMBTrailer2005.h:89
CSCDMBHeader
Definition: CSCDMBHeader.h:15
CSCDMBTrailer2005::data
unsigned short * data() const override
Definition: CSCDMBTrailer2005.h:65
CSCDMBTrailer2005::tmb_empty
unsigned tmb_empty
Definition: CSCDMBTrailer2005.h:87
CSCDMBTrailer2005::tmb_full
unsigned tmb_full
Definition: CSCDMBTrailer2005.h:100
CSCDMBTrailer2005::tmb_full
unsigned tmb_full() const override
Definition: CSCDMBTrailer2005.h:57
CSCDMBTrailer2005::bits
struct CSCDMBTrailer2005::@418 bits
CSCDMBTrailer2005::cfeb_starttimeout
unsigned cfeb_starttimeout() const override
Definition: CSCDMBTrailer2005.h:43
CSCDMBTrailer2005::alct_full
unsigned alct_full() const override
Definition: CSCDMBTrailer2005.h:56
CSCDMBTrailer2005::dmb_crc_1
unsigned dmb_crc_1
Definition: CSCDMBTrailer2005.h:108
CSCDMBTrailer2005::dmb_l1a
unsigned dmb_l1a
Definition: CSCDMBTrailer2005.h:75
CSCDMBTrailer2005::ddu_code_8
unsigned ddu_code_8
Definition: CSCDMBTrailer2005.h:114
CSCDMBTrailer2005::alct_starttimeout
unsigned alct_starttimeout() const override
Definition: CSCDMBTrailer2005.h:41
CSCDMBHeader::dmbID
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
CSCDMBTrailer2005::sizeInWords
unsigned sizeInWords() const override
Definition: CSCDMBTrailer2005.h:72
CSCDMBTrailer2005::cfeb_starttimeout
unsigned cfeb_starttimeout
Definition: CSCDMBTrailer2005.h:92
CSCDMBTrailer2005::alct_empty
unsigned alct_empty
Definition: CSCDMBTrailer2005.h:88
CSCDMBTrailer2005::CSCDMBTrailer2005
CSCDMBTrailer2005()
Definition: CSCDMBTrailer2005.h:10
CSCDMBTrailer2005::cfeb_movlp
unsigned cfeb_movlp() const override
Definition: CSCDMBTrailer2005.h:45