CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCDMBHeader2005.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 CSCDMBHeader2005::CSCDMBHeader2005(unsigned short * buf)
13 {
14  memcpy(data(), buf, sizeInWords()*2);
15 }
16 
17 
18 unsigned CSCDMBHeader2005::cfebMovlp() const
19 {
20  return bits.cfeb_movlp;
21 }
22 
23 
25 {
26  return bits.dmb_cfeb_sync;
27 }
28 
30 {
31  return bits.active_dav_mismatch;
32 }
33 
34 
36 {
37  return bits.cfeb_dav;
38 }
39 
40 
41 unsigned CSCDMBHeader2005::nalct() const
42 {
43  return bits.alct_dav_1;
44 }
45 
46 unsigned CSCDMBHeader2005::nclct() const
47 {
48  return bits.tmb_dav_1;
49 }
50 
51 unsigned CSCDMBHeader2005::crateID() const
52 {
53  return bits.dmb_crate;
54 }
55 
56 unsigned CSCDMBHeader2005::dmbID() const
57 {
58  return bits.dmb_id;
59 }
60 
61 unsigned CSCDMBHeader2005::bxn() const
62 {
63  return bits.dmb_bxn;
64 }
65 
66 unsigned CSCDMBHeader2005::bxn12() const
67 {
68  return bits.dmb_bxn1;
69 }
70 
71 
72 
73 
74 unsigned CSCDMBHeader2005::l1a() const
75 {
76  return bits.dmb_l1a;
77 }
78 
79 unsigned CSCDMBHeader2005::l1a24() const
80 {
81  return (bits.dmb_l1a_lowo | (bits.dmb_l1a_hiwo << 12)) ;
82 }
83 
84 
86 {
87  bits.dmb_l1a = l1a;
88 }
89 
91 {
92  bits.dmb_l1a_lowo = l1a & 0xFFF;
93  bits.dmb_l1a_hiwo = (l1a>>12) & 0xFFF;
94 }
95 
96 
98 {
99  bits.dmb_bxn = bxn & 0x3F;
100  bits.dmb_bxn1 = bxn & 0xFFF;
101 }
102 
103 
104 void CSCDMBHeader2005::setCrateAddress(int crate, int dmbId)
105 {
106  this->bits.dmb_crate = crate;
107  this->bits.dmb_id = dmbId;
108 }
109 
111 {
112  return 8;
113 }
114 
117 {
118  assert (icfeb < 5);
119  return (cfebAvailable() >> icfeb) & 1;
120 }
121 
123 {
124  return 0;
125 }
126 
128 {
129  assert(icfeb < 5);
130  bits.cfeb_dav |= (1 << icfeb);
131  bits.cfeb_active |= (1 << icfeb);
132 }
133 
135 {
136  bits.tmb_dav_1 = bits.tmb_dav_2 = bits.tmb_dav_4 = 1;
137 }
138 
140 {
141  bits.alct_dav_1 = bits.alct_dav_2 = bits.alct_dav_4 = 1;
142 }
143 
144 
146 {
147  return (bits.ddu_code_1==0xA && bits.ddu_code_2==0xA &&
148  bits.ddu_code_3==0xA && bits.ddu_code_4==0xA &&
149  bits.newddu_code_1==0x9 && bits.newddu_code_2==0x9 &&
150  bits.newddu_code_3==0x9 && bits.newddu_code_4==0x9);
151 }
152 
virtual void addNALCT()
virtual unsigned activeDavMismatch() const
virtual void addCFEB(int icfeb)
virtual unsigned cfebAvailable() const
virtual unsigned format_version() const
assert(m_qm.get())
virtual unsigned cfebMovlp() const
virtual unsigned dmbCfebSync() const
virtual unsigned bxn() const
virtual unsigned nalct() const
virtual unsigned l1a24() const
virtual unsigned short * data()
virtual void setCrateAddress(int crate, int dmbId)
virtual unsigned bxn12() const
virtual unsigned crateID() const
virtual void addNCLCT()
virtual unsigned nclct() const
virtual void setL1A24(int l1a)
unsigned sizeInWords() const
virtual bool check() const
virtual unsigned l1a() const
virtual void setL1A(int l1a)
virtual unsigned dmbID() const
struct CSCDMBHeader2005::@304 bits
virtual void setBXN(int bxn)