CMS 3D CMS Logo

CSCDMBHeader2005.cc
Go to the documentation of this file.
2 #include <iostream>
3 
5  bzero(data(), sizeInWords() * 2);
6  bits.ddu_code_1 = bits.ddu_code_2 = bits.ddu_code_3 = bits.ddu_code_4 = 0xA;
7  bits.newddu_code_1 = bits.newddu_code_2 = bits.newddu_code_3 = bits.newddu_code_4 = 0x9;
8 }
9 
10 CSCDMBHeader2005::CSCDMBHeader2005(const uint16_t* buf) { memcpy(data(), buf, sizeInWords() * 2); }
11 
12 unsigned CSCDMBHeader2005::cfebMovlp() const { return bits.cfeb_movlp; }
13 
14 unsigned CSCDMBHeader2005::dmbCfebSync() const { return bits.dmb_cfeb_sync; }
15 
16 unsigned CSCDMBHeader2005::activeDavMismatch() const { return bits.active_dav_mismatch; }
17 
18 unsigned CSCDMBHeader2005::cfebAvailable() const { return bits.cfeb_dav; }
19 
20 unsigned CSCDMBHeader2005::nalct() const { return bits.alct_dav_1; }
21 
22 unsigned CSCDMBHeader2005::nclct() const { return bits.tmb_dav_1; }
23 
24 unsigned CSCDMBHeader2005::crateID() const { return bits.dmb_crate; }
25 
26 unsigned CSCDMBHeader2005::dmbID() const { return bits.dmb_id; }
27 
28 unsigned CSCDMBHeader2005::bxn() const { return bits.dmb_bxn; }
29 
30 unsigned CSCDMBHeader2005::bxn12() const { return bits.dmb_bxn1; }
31 
32 unsigned CSCDMBHeader2005::l1a() const { return bits.dmb_l1a; }
33 
34 unsigned CSCDMBHeader2005::l1a24() const { return (bits.dmb_l1a_lowo | (bits.dmb_l1a_hiwo << 12)); }
35 
36 void CSCDMBHeader2005::setL1A(int l1a) { bits.dmb_l1a = l1a; }
37 
39  bits.dmb_l1a_lowo = l1a & 0xFFF;
40  bits.dmb_l1a_hiwo = (l1a >> 12) & 0xFFF;
41 }
42 
43 void CSCDMBHeader2005::setBXN(int bxn) {
44  bits.dmb_bxn = bxn & 0x3F;
45  bits.dmb_bxn1 = bxn & 0xFFF;
46 }
47 
48 void CSCDMBHeader2005::setCrateAddress(int crate, int dmbId) {
49  this->bits.dmb_crate = crate;
50  this->bits.dmb_id = dmbId;
51 }
52 
53 unsigned CSCDMBHeader2005::sizeInWords() const { return 8; }
54 
56 bool CSCDMBHeader2005::cfebAvailable(unsigned icfeb) {
57  assert(icfeb < 5);
58  return (cfebAvailable() >> icfeb) & 1;
59 }
60 
61 unsigned CSCDMBHeader2005::format_version() const { return 0; }
62 
63 void CSCDMBHeader2005::addCFEB(int icfeb) {
64  assert(icfeb < 5);
65  bits.cfeb_dav |= (1 << icfeb);
66  bits.cfeb_active |= (1 << icfeb);
67 }
68 
69 void CSCDMBHeader2005::addNCLCT() { bits.tmb_dav_1 = bits.tmb_dav_2 = bits.tmb_dav_4 = 1; }
70 
71 void CSCDMBHeader2005::addNALCT() { bits.alct_dav_1 = bits.alct_dav_2 = bits.alct_dav_4 = 1; }
72 
74  return (bits.ddu_code_1 == 0xA && bits.ddu_code_2 == 0xA && bits.ddu_code_3 == 0xA && bits.ddu_code_4 == 0xA &&
75  bits.newddu_code_1 == 0x9 && bits.newddu_code_2 == 0x9 && bits.newddu_code_3 == 0x9 &&
76  bits.newddu_code_4 == 0x9);
77 }
unsigned activeDavMismatch() const override
unsigned bxn() const override
unsigned l1a() const override
assert(be >=bs)
void setL1A24(int l1a) override
void addNALCT() override
void addCFEB(int icfeb) override
unsigned short * data() override
void setBXN(int bxn) override
unsigned bxn12() const override
unsigned dmbID() const override
void setL1A(int l1a) override
unsigned crateID() const override
void setCrateAddress(int crate, int dmbId) override
void addNCLCT() override
unsigned sizeInWords() const override
unsigned nclct() const override
unsigned cfebAvailable() const override
bool check() const override
unsigned format_version() const override
struct CSCDMBHeader2005::@488 bits
unsigned cfebMovlp() const override
unsigned l1a24() const override
unsigned nalct() const override
unsigned dmbCfebSync() const override