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  virtual void setEventInformation(const CSCDMBHeader & dmbHeader)
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  virtual unsigned crateID() const { return bits.crate_id; };
38  virtual unsigned dmbID() const { return bits.dmb_id; };
39 
40  virtual unsigned dmb_l1a() const { return bits.dmb_l1a; };
41  virtual unsigned dmb_bxn() const { return bits.dmb_bxn; };
42 
43  virtual unsigned alct_endtimeout() const { return bits.alct_endtimeout; };
44  virtual unsigned tmb_endtimeout() const { return bits.tmb_endtimeout; };
45  virtual unsigned cfeb_endtimeout() const { return bits.cfeb_endtimeout; };
46 
47  virtual unsigned alct_starttimeout() const { return bits.alct_starttimeout; };
48  virtual unsigned tmb_starttimeout() const { return bits.tmb_starttimeout; };
49  virtual unsigned cfeb_starttimeout() const { return bits.cfeb_starttimeout; };
50 
51  virtual unsigned cfeb_movlp() const { return bits.cfeb_movlp; };
52  virtual unsigned dmb_l1pipe() const { return bits.dmb_l1pipe; };
53 
54  virtual unsigned alct_empty() const { return bits.alct_empty; };
55  virtual unsigned tmb_empty() const {return bits.tmb_empty; };
56  virtual unsigned cfeb_empty() const { return bits.cfeb_empty; };
57 
58  virtual unsigned alct_half() const { return bits.alct_half; };
59  virtual unsigned tmb_half() const {return bits.tmb_half; };
60  virtual unsigned cfeb_half() const { return bits.cfeb_half; };
61 
62  virtual unsigned alct_full() const { return bits.alct_full; };
63  virtual unsigned tmb_full() const {return bits.tmb_full; };
64  virtual unsigned cfeb_full() const { return bits.cfeb_full; };
65 
66  virtual unsigned crc22() const { return (bits.dmb_crc_1 | (bits.dmb_crc_2 << 11)); };
67  virtual unsigned crc_lo_parity() const { return bits.dmb_parity_1; };
68  virtual unsigned crc_hi_parity() const { return bits.dmb_parity_2; };
69 
70 
71  virtual unsigned short * data() {return (unsigned short *)(&bits);}
72  virtual unsigned short * data() const {return (unsigned short *)(&bits);}
73 
74  bool check() const {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 {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 
virtual unsigned dmb_l1a() const
virtual unsigned tmb_half() const
unsigned l1a() const
Definition: CSCDMBHeader.h:49
virtual unsigned cfeb_full() const
virtual unsigned cfeb_endtimeout() const
virtual unsigned alct_endtimeout() const
CSCDMBTrailer2005(unsigned short *buf)
virtual unsigned dmbID() const
virtual unsigned cfeb_starttimeout() const
virtual unsigned crc_hi_parity() const
virtual unsigned cfeb_empty() const
virtual unsigned alct_empty() const
virtual unsigned short * data()
virtual unsigned crateID() const
virtual unsigned crc22() const
virtual unsigned alct_half() const
virtual unsigned tmb_full() const
virtual unsigned alct_full() const
virtual unsigned crc_lo_parity() const
virtual unsigned tmb_starttimeout() const
virtual unsigned dmb_l1pipe() const
unsigned bxn() const
Definition: CSCDMBHeader.h:47
unsigned crateID() const
Definition: CSCDMBHeader.h:45
struct CSCDMBTrailer2005::@320 bits
virtual unsigned cfeb_movlp() const
virtual unsigned tmb_endtimeout() const
virtual unsigned dmb_bxn() const
unsigned dmbID() const
Definition: CSCDMBHeader.h:46
virtual unsigned alct_starttimeout() const
virtual unsigned cfeb_half() const
virtual void setEventInformation(const CSCDMBHeader &dmbHeader)
@ NEEDS TO BE DONE
virtual unsigned tmb_empty() const
virtual unsigned short * data() const
bool check() const
unsigned sizeInWords() const