CMS 3D CMS Logo

CSCALCTHeader2007.h
Go to the documentation of this file.
1 #ifndef CSCRawToDigi_CSCALCTHeader2007_h
2 #define CSCRawToDigi_CSCALCTHeader2007_h
3 
9 #include <bitset>
10 #include <vector>
12 #include <boost/dynamic_bitset.hpp>
13 #include <cstring>
14 
15 class CSCDMBHeader;
16 
17 struct CSCALCT {
18  CSCALCT();
19  CSCALCT(const CSCALCTDigi & alctDigi);
20 
21  void setFromBuffer(unsigned short const* buf) {
22  memcpy(this, buf, sizeInWords()*2);
23  }
24 
25  static short unsigned int sizeInWords() {return 1; }
26 
27  unsigned valid : 1;
28  unsigned quality : 2;
29  unsigned accel : 1;
30  unsigned pattern : 1;
31  unsigned keyWire : 7;
32  unsigned reserved: 4;
33 };
34 
35 
38  explicit CSCALCTHeader2007(int chamberType);
39 
40  void setFromBuffer(unsigned short const* buf) {
41  memcpy(this, buf, sizeInWords()*2);
42  }
43 
44  void setEventInformation(const CSCDMBHeader &);
45 
46  short unsigned int sizeInWords() const {
47  return 8;
48  }
49 
50  unsigned flag1 : 16;
51 
52  unsigned bxnL1A : 12;
53  unsigned reserved1 : 4;
54 
55  unsigned l1aCounter : 12;
56  unsigned reserved2 : 4;
57 
58  unsigned readoutCounter : 12;
59  unsigned reserved3 : 4;
60 
61  unsigned bxnCount : 12;
62  unsigned rawOverflow : 1;
63  unsigned lctOverflow : 1;
64  unsigned configPresent : 1;
65  unsigned flag3 : 1;
66 
67  unsigned bxnBeforeReset : 12;
68  unsigned flag2 : 4;
69 
70  unsigned boardType : 3;
71  unsigned backwardForward : 1;
72  unsigned negativePositive : 1;
73  unsigned mirrored : 1;
74  unsigned qualityCancell : 1;
75  unsigned latencyClocks : 1;
76  unsigned patternB : 1;
77  unsigned widePattern : 1;
78  unsigned reserved0 : 2;
79  unsigned flag0 : 4;
80 
81  unsigned rawBins : 5;
82  unsigned lctBins : 4;
83  unsigned firmwareVersion : 6;
84  unsigned flag4 : 1;
85 };
86 
87 struct CSCVirtexID {
89  bzero(this, sizeInWords()*2);
90  }
91 
92  void setFromBuffer(unsigned short const* buf) {
93  memcpy(this, buf, sizeInWords()*2);
94  }
95 
96  short unsigned int sizeInWords() const {
97  return 3;
98  }
99 
100  unsigned virtexIDLow : 15;
101  unsigned flag0 : 1;
102 
103  unsigned virtexIDMed : 15;
104  unsigned flag1 : 1;
105 
106  unsigned virtexIDHigh : 10;
107  unsigned trReg : 3;
108  unsigned reserved : 2;
109  unsigned flag2 : 1;
110 };
111 
114  bzero(this, sizeInWords()*2);
115  }
116 
117  void setFromBuffer(unsigned short const* buf) {
118  memcpy(this, buf, sizeInWords()*2);
119  }
120 
121  short unsigned int sizeInWords() const {
122  return 5;
123  }
124 
125 
126  unsigned configRegister0 : 15;
127  unsigned flag0 : 1;
128 
129  unsigned configRegister1 : 15;
130  unsigned flag1 : 1;
131 
132  unsigned configRegister2 : 15;
133  unsigned flag2 : 1;
134 
135  unsigned configRegister3 : 15;
136  unsigned flag3 : 1;
137 
138  unsigned configRegister4 : 9;
139  unsigned reserved : 6;
140  unsigned flag4 : 1;
141 };
142 
145  bzero(this, sizeInWords()*2);
146  }
147 
148  void setFromBuffer(unsigned short const* buf) {
149  memcpy(this, buf, sizeInWords()*2);
150  }
151 
152  short unsigned int sizeInWords() const {
153  return 1;
154  }
155 
156  unsigned collisionMaskRegister : 14;
157  unsigned reserved : 1;
158  unsigned flag : 1;
159 };
160 
163  bzero(this, sizeInWords()*2);
164  }
165 
166  void setFromBuffer(unsigned short const* buf) {
167  memcpy(this, buf, sizeInWords()*2);
168  }
169 
170  short unsigned int sizeInWords() const {
171  return 1;
172  }
173 
174  unsigned hotChannelMask : 12;
175  unsigned reserved : 3;
176  unsigned flag : 1;
177 };
178 
179 #endif
void setFromBuffer(unsigned short const *buf)
short unsigned int sizeInWords() const
void setFromBuffer(unsigned short const *buf)
short unsigned int sizeInWords() const
static short unsigned int sizeInWords()
void setFromBuffer(unsigned short const *buf)
void setFromBuffer(unsigned short const *buf)
void setFromBuffer(unsigned short const *buf)
unsigned valid
unsigned pattern
unsigned reserved
unsigned accel
short unsigned int sizeInWords() const
void setFromBuffer(unsigned short const *buf)
unsigned quality
short unsigned int sizeInWords() const
short unsigned int sizeInWords() const
for packing
unsigned keyWire