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 }
CSCDMBHeader2005::cfebMovlp
unsigned cfebMovlp() const override
Definition: CSCDMBHeader2005.cc:12
CSCDMBHeader2005::check
bool check() const override
Definition: CSCDMBHeader2005.cc:73
CSCDMBHeader2005::cfebAvailable
unsigned cfebAvailable() const override
Definition: CSCDMBHeader2005.cc:18
CSCDMBHeader2005::bits
struct CSCDMBHeader2005::@453 bits
cms::cuda::assert
assert(be >=bs)
CSCDMBHeader2005::activeDavMismatch
unsigned activeDavMismatch() const override
Definition: CSCDMBHeader2005.cc:16
CSCDMBHeader2005::bxn
unsigned bxn() const override
Definition: CSCDMBHeader2005.cc:28
CSCDMBHeader2005::setL1A24
void setL1A24(int l1a) override
Definition: CSCDMBHeader2005.cc:38
CSCDMBHeader2005::l1a
unsigned l1a() const override
Definition: CSCDMBHeader2005.cc:32
CSCDMBHeader2005::CSCDMBHeader2005
CSCDMBHeader2005()
Definition: CSCDMBHeader2005.cc:4
CSCDMBHeader2005::addNALCT
void addNALCT() override
Definition: CSCDMBHeader2005.cc:71
CSCDMBHeader2005::bxn12
unsigned bxn12() const override
Definition: CSCDMBHeader2005.cc:30
CSCDMBHeader2005::data
unsigned short * data() override
Definition: CSCDMBHeader2005.h:53
CSCDMBHeader2005::setL1A
void setL1A(int l1a) override
Definition: CSCDMBHeader2005.cc:36
CSCDMBHeader2005::addNCLCT
void addNCLCT() override
Definition: CSCDMBHeader2005.cc:69
CSCDMBHeader2005.h
CSCDMBHeader2005::dmbID
unsigned dmbID() const override
Definition: CSCDMBHeader2005.cc:26
CSCDMBHeader2005::addCFEB
void addCFEB(int icfeb) override
Definition: CSCDMBHeader2005.cc:63
CSCDMBHeader2005::nclct
unsigned nclct() const override
Definition: CSCDMBHeader2005.cc:22
CSCDMBHeader2005::setBXN
void setBXN(int bxn) override
Definition: CSCDMBHeader2005.cc:43
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCDMBHeader2005::crateID
unsigned crateID() const override
Definition: CSCDMBHeader2005.cc:24
CSCDMBHeader2005::sizeInWords
unsigned sizeInWords() const override
Definition: CSCDMBHeader2005.cc:53
CSCDMBHeader2005::l1a24
unsigned l1a24() const override
Definition: CSCDMBHeader2005.cc:34
CSCDMBHeader2005::format_version
unsigned format_version() const override
Definition: CSCDMBHeader2005.cc:61
CSCDMBHeader2005::nalct
unsigned nalct() const override
Definition: CSCDMBHeader2005.cc:20
CSCDMBHeader2005::setCrateAddress
void setCrateAddress(int crate, int dmbId) override
Definition: CSCDMBHeader2005.cc:48
CSCDMBHeader2005::dmbCfebSync
unsigned dmbCfebSync() const override
Definition: CSCDMBHeader2005.cc:14