CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCDMBHeader2013.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 
6 {
7  bzero(data(), sizeInWords()*2);
8  bits.ddu_code_1 = bits.ddu_code_2 = bits.ddu_code_3 = bits.ddu_code_4 = 0xA;
9  bits.newddu_code_1 = bits.newddu_code_2 = bits.newddu_code_3 = bits.newddu_code_4 = 0x9;
10 }
11 
12 CSCDMBHeader2013::CSCDMBHeader2013(unsigned short * buf)
13 {
14  memcpy(data(), buf, sizeInWords()*2);
15 }
16 
17 
18 unsigned CSCDMBHeader2013::cfebMovlp() const
19 {
20  return bits.cfeb_movlp;
21 }
22 
23 
25 {
26  return bits.dmb_cfeb_sync;
27 }
28 
30 {
31  return bits.clct_dav_mismatch;
32 }
33 
35 {
36  return bits.fmt_version;
37 }
38 
39 
41 {
42  return bits.cfeb_dav;
43 }
44 
45 
46 unsigned CSCDMBHeader2013::nalct() const
47 {
48  return bits.alct_dav;
49 }
50 
51 unsigned CSCDMBHeader2013::nclct() const
52 {
53  return bits.tmb_dav;
54 }
55 
56 unsigned CSCDMBHeader2013::crateID() const
57 {
58  return bits.dmb_crate;
59 }
60 
61 unsigned CSCDMBHeader2013::dmbID() const
62 {
63  return bits.dmb_id;
64 }
65 
66 unsigned CSCDMBHeader2013::bxn() const
67 {
68  return bits.dmb_bxn;
69 }
70 
71 unsigned CSCDMBHeader2013::bxn12() const
72 {
73  return bits.dmb_bxn1;
74 }
75 
76 unsigned CSCDMBHeader2013::l1a() const
77 {
78  return bits.dmb_l1a;
79 }
80 
81 unsigned CSCDMBHeader2013::l1a24() const
82 {
83  return (bits.dmb_l1a_lowo | (bits.dmb_l1a_hiwo << 12)) ;
84 }
85 
87 {
88  bits.dmb_l1a = l1a & 0x1F;
89 }
90 
92 {
93  bits.dmb_l1a_lowo = l1a & 0xFFF;
94  bits.dmb_l1a_hiwo = (l1a>>12) & 0xFFF;
95 }
96 
97 
99 {
100  bits.dmb_bxn1 = bxn & 0xFFF;
101  bits.dmb_bxn = bxn & 0x1F;
102 }
103 
104 
105 void CSCDMBHeader2013::setCrateAddress(int crate, int dmbId)
106 {
107  this->bits.dmb_crate = crate;
108  this->bits.dmb_id = dmbId;
109 }
110 
112 {
113  return 8;
114 }
115 
118 {
119  assert (icfeb < 7);
120  return (cfebAvailable() >> icfeb) & 1;
121 }
122 
124 {
125  assert(icfeb < 7);
126  bits.cfeb_dav |= (1 << icfeb);
127  bits.cfeb_clct_sent |= (1 << icfeb);
128 }
129 
131 {
132  bits.tmb_dav = bits.tmb_dav_copy = bits.tmb_dav_copy2 = 1;
133 }
134 
136 {
137  bits.alct_dav = bits.alct_dav_copy = bits.alct_dav_copy2 = 1;
138 }
139 
140 
142 {
143  return (bits.ddu_code_1==0xA && bits.ddu_code_2==0xA &&
144  bits.ddu_code_3==0xA && bits.ddu_code_4==0xA &&
145  bits.newddu_code_1==0x9 && bits.newddu_code_2==0x9 &&
146  bits.newddu_code_3==0x9 && bits.newddu_code_4==0x9);
147 }
148 
virtual void setL1A(int l1a)
bool check() const
virtual unsigned l1a() const
assert(m_qm.get())
virtual unsigned l1a24() const
virtual void setBXN(int bxn)
virtual unsigned format_version() const
virtual void addNCLCT()
virtual unsigned nclct() const
struct CSCDMBHeader2013::@300 bits
virtual void setCrateAddress(int crate, int dmbId)
virtual unsigned crateID() const
virtual unsigned bxn() const
virtual unsigned bxn12() const
virtual void addNALCT()
virtual void addCFEB(int icfeb)
virtual unsigned cfebAvailable() const
virtual unsigned dmbCfebSync() const
virtual unsigned short * data()
virtual unsigned nalct() const
virtual unsigned activeDavMismatch() const
virtual unsigned cfebMovlp() const
virtual void setL1A24(int l1a)
virtual unsigned dmbID() const
unsigned sizeInWords() const