CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCDMBHeader.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 
6 {
7  bzero(this, sizeInWords()*2);
10 }
11 
12 CSCDMBHeader::CSCDMBHeader(unsigned short * buf)
13 {
14  memcpy(this, buf, sizeInWords()*2);
15 }
16 
17 
18 unsigned CSCDMBHeader::cfebMovlp() const
19 {
20  return cfeb_movlp;
21 }
22 
23 
24 unsigned CSCDMBHeader::dmbCfebSync() const
25 {
26  return dmb_cfeb_sync;
27 }
28 
30 {
31  return active_dav_mismatch;
32 }
33 
34 
35 unsigned CSCDMBHeader::cfebAvailable() const
36 {
37  return cfeb_dav;
38 }
39 
40 
41 unsigned CSCDMBHeader::nalct() const
42 {
43  return alct_dav_1;
44 }
45 
46 unsigned CSCDMBHeader::nclct() const
47 {
48  return tmb_dav_1;
49 }
50 
51 unsigned CSCDMBHeader::crateID() const
52 {
53  return dmb_crate;
54 }
55 
56 unsigned CSCDMBHeader::dmbID() const
57 {
58  return dmb_id;
59 }
60 
61 unsigned CSCDMBHeader::bxn() const
62 {
63  return dmb_bxn;
64 }
65 
66 unsigned CSCDMBHeader::bxn12() const
67 {
68  return dmb_bxn1;
69 }
70 
71 
72 
73 
74 unsigned CSCDMBHeader::l1a() const
75 {
76  return dmb_l1a;
77 }
78 
79 
80 void CSCDMBHeader::setL1A(int l1a)
81 {
82  dmb_l1a = l1a;
83 }
84 
85 void CSCDMBHeader::setBXN(int bxn)
86 {
87  dmb_bxn = bxn;
88 }
89 
90 
91 void CSCDMBHeader::setCrateAddress(int crate, int dmbId)
92 {
93  this->dmb_crate = crate;
94  this->dmb_id = dmbId;
95 }
96 
97 unsigned CSCDMBHeader::sizeInWords() const
98 {
99  return 8;
100 }
101 
103 bool CSCDMBHeader::cfebAvailable(unsigned icfeb)
104 {
105  assert (icfeb < 5);
106  return (cfebAvailable() >> icfeb) & 1;
107 }
108 
109 void CSCDMBHeader::addCFEB(int icfeb)
110 {
111  assert(icfeb < 5);
112  cfeb_dav |= (1 << icfeb);
113 }
114 
116 {
117  tmb_dav_1 = tmb_dav_2 = tmb_dav_4 = 1;
118 }
119 
121 {
123 }
124 
125 
126 bool CSCDMBHeader::check() const
127 {
128  return (ddu_code_1==0xA && ddu_code_2==0xA &&
129  ddu_code_3==0xA && ddu_code_4==0xA &&
130  newddu_code_1==0x9 && newddu_code_2==0x9 &&
131  newddu_code_3==0x9 && newddu_code_4==0x9);
132 }
133 
unsigned active_dav_mismatch
Definition: CSCDMBHeader.h:78
unsigned tmb_dav_1
Definition: CSCDMBHeader.h:79
bool check() const
unsigned l1a() const
Definition: CSCDMBHeader.cc:74
unsigned nclct() const
Definition: CSCDMBHeader.cc:46
unsigned newddu_code_3
constant, should be 1001
Definition: CSCDMBHeader.h:69
unsigned dmb_crate
Definition: CSCDMBHeader.h:88
unsigned nalct() const
Definition: CSCDMBHeader.cc:41
void setL1A(int l1a)
Definition: CSCDMBHeader.cc:80
unsigned cfebMovlp() const
Definition: CSCDMBHeader.cc:18
unsigned tmb_dav_2
Definition: CSCDMBHeader.h:83
void setBXN(int bxn)
Definition: CSCDMBHeader.cc:85
unsigned dmb_l1a
Definition: CSCDMBHeader.h:102
unsigned alct_dav_1
Definition: CSCDMBHeader.h:77
unsigned alct_dav_4
Definition: CSCDMBHeader.h:66
unsigned newddu_code_2
constant, should be 1001
Definition: CSCDMBHeader.h:62
unsigned cfeb_movlp
Definition: CSCDMBHeader.h:98
unsigned ddu_code_1
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:85
unsigned sizeInWords() const
Definition: CSCDMBHeader.cc:97
void addCFEB(int icfeb)
unsigned bxn12() const
Definition: CSCDMBHeader.cc:66
unsigned newddu_code_4
constant, should be 1001
Definition: CSCDMBHeader.h:74
unsigned ddu_code_2
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:90
void setCrateAddress(int crate, int dmbId)
Definition: CSCDMBHeader.cc:91
unsigned dmb_bxn1
Definition: CSCDMBHeader.h:72
unsigned alct_dav_2
Definition: CSCDMBHeader.h:81
unsigned bxn() const
Definition: CSCDMBHeader.cc:61
unsigned crateID() const
Definition: CSCDMBHeader.cc:51
unsigned tmb_dav_4
Definition: CSCDMBHeader.h:67
unsigned dmb_bxn
Definition: CSCDMBHeader.h:95
unsigned cfebAvailable() const
Definition: CSCDMBHeader.cc:35
unsigned dmbID() const
Definition: CSCDMBHeader.cc:56
unsigned cfeb_dav
Definition: CSCDMBHeader.h:76
unsigned dmb_id
Definition: CSCDMBHeader.h:87
unsigned activeDavMismatch() const
Definition: CSCDMBHeader.cc:29
unsigned ddu_code_3
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:100
unsigned newddu_code_1
constant, should be 1001
Definition: CSCDMBHeader.h:58
unsigned ddu_code_4
constant, should be &#39;1010&#39;
Definition: CSCDMBHeader.h:105
unsigned dmbCfebSync() const
Definition: CSCDMBHeader.cc:24
unsigned dmb_cfeb_sync
Definition: CSCDMBHeader.h:103