src
EventFilter
CSCRawToDigi
src
CSCDMBHeader2013.cc
Go to the documentation of this file.
1
#include "
EventFilter/CSCRawToDigi/interface/CSCDMBHeader2013.h
"
2
#include "
DataFormats/CSCDigi/interface/CSCConstants.h
"
3
#include <iostream>
4
5
CSCDMBHeader2013::CSCDMBHeader2013
() {
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
41
void
CSCDMBHeader2013::setL1A24
(
int
l1a) {
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) {
60
assert
(icfeb <
CSCConstants::MAX_CFEBS_RUN2
);
61
return
(
cfebAvailable
() >> icfeb) & 1;
62
}
63
64
void
CSCDMBHeader2013::addCFEB
(
int
icfeb) {
65
assert
(icfeb <
CSCConstants::MAX_CFEBS_RUN2
);
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
74
bool
CSCDMBHeader2013::check
()
const
{
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
}
CSCDMBHeader2013::bxn
unsigned bxn() const override
Definition:
CSCDMBHeader2013.cc:31
CSCDMBHeader2013::cfebAvailable
unsigned cfebAvailable() const override
Definition:
CSCDMBHeader2013.cc:21
CSCDMBHeader2013::CSCDMBHeader2013
CSCDMBHeader2013()
Definition:
CSCDMBHeader2013.cc:5
CSCDMBHeader2013::bxn12
unsigned bxn12() const override
Definition:
CSCDMBHeader2013.cc:33
CSCConstants.h
CSCDMBHeader2013::sizeInWords
unsigned sizeInWords() const override
Definition:
CSCDMBHeader2013.cc:56
cms::cuda::assert
assert(be >=bs)
CSCDMBHeader2013::format_version
unsigned format_version() const override
Definition:
CSCDMBHeader2013.cc:19
CSCDMBHeader2013::crateID
unsigned crateID() const override
Definition:
CSCDMBHeader2013.cc:27
CSCDMBHeader2013::activeDavMismatch
unsigned activeDavMismatch() const override
Definition:
CSCDMBHeader2013.cc:17
CSCDMBHeader2013::l1a
unsigned l1a() const override
Definition:
CSCDMBHeader2013.cc:35
CSCDMBHeader2013::setL1A
void setL1A(int l1a) override
Definition:
CSCDMBHeader2013.cc:39
visDQMUpload.buf
buf
Definition:
visDQMUpload.py:153
CSCDMBHeader2013::addNALCT
void addNALCT() override
Definition:
CSCDMBHeader2013.cc:72
CSCConstants::MAX_CFEBS_RUN2
Definition:
CSCConstants.h:24
CSCDMBHeader2013::setL1A24
void setL1A24(int l1a) override
Definition:
CSCDMBHeader2013.cc:41
CSCDMBHeader2013::dmbID
unsigned dmbID() const override
Definition:
CSCDMBHeader2013.cc:29
CSCDMBHeader2013::addCFEB
void addCFEB(int icfeb) override
Definition:
CSCDMBHeader2013.cc:64
CSCDMBHeader2013::dmbCfebSync
unsigned dmbCfebSync() const override
Definition:
CSCDMBHeader2013.cc:15
CSCDMBHeader2013::check
bool check() const override
Definition:
CSCDMBHeader2013.cc:74
CSCDMBHeader2013::nalct
unsigned nalct() const override
Definition:
CSCDMBHeader2013.cc:23
CSCDMBHeader2013::nclct
unsigned nclct() const override
Definition:
CSCDMBHeader2013.cc:25
CSCDMBHeader2013::bits
struct CSCDMBHeader2013::@486 bits
CSCDMBHeader2013::data
unsigned short * data() override
Definition:
CSCDMBHeader2013.h:86
CSCDMBHeader2013.h
CSCDMBHeader2013::setBXN
void setBXN(int bxn) override
Definition:
CSCDMBHeader2013.cc:46
CSCDMBHeader2013::cfebMovlp
unsigned cfebMovlp() const override
Definition:
CSCDMBHeader2013.cc:13
CSCDMBHeader2013::addNCLCT
void addNCLCT() override
Definition:
CSCDMBHeader2013.cc:70
CSCDMBHeader2013::setCrateAddress
void setCrateAddress(int crate, int dmbId) override
Definition:
CSCDMBHeader2013.cc:51
CSCDMBHeader2013::l1a24
unsigned l1a24() const override
Definition:
CSCDMBHeader2013.cc:37
Generated for CMSSW Reference Manual by
1.8.14