CMS 3D CMS Logo

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