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) { memcpy(this, buf, sizeInWords() * 2); }
22 
23  static short unsigned int sizeInWords() { return 1; }
24 
25  unsigned valid : 1;
26  unsigned quality : 2;
27  unsigned accel : 1;
28  unsigned pattern : 1;
29  unsigned keyWire : 7;
30  unsigned reserved : 4;
31 };
32 
35  explicit CSCALCTHeader2007(int chamberType);
36 
37  void setFromBuffer(unsigned short const* buf) { memcpy(this, buf, sizeInWords() * 2); }
38 
39  void setEventInformation(const CSCDMBHeader&);
40 
41  short unsigned int sizeInWords() const {
42  return 8;
43  }
44 
45  unsigned flag1 : 16;
46 
47  unsigned bxnL1A : 12;
48  unsigned reserved1 : 4;
49 
50  unsigned l1aCounter : 12;
51  unsigned reserved2 : 4;
52 
53  unsigned readoutCounter : 12;
54  unsigned reserved3 : 4;
55 
56  unsigned bxnCount : 12;
57  unsigned rawOverflow : 1;
58  unsigned lctOverflow : 1;
59  unsigned configPresent : 1;
60  unsigned flag3 : 1;
61 
62  unsigned bxnBeforeReset : 12;
63  unsigned flag2 : 4;
64 
65  unsigned boardType : 3;
66  unsigned backwardForward : 1;
67  unsigned negativePositive : 1;
68  unsigned mirrored : 1;
69  unsigned qualityCancell : 1;
70  unsigned latencyClocks : 1;
71  unsigned patternB : 1;
72  unsigned widePattern : 1;
73  unsigned reserved0 : 2;
74  unsigned flag0 : 4;
75 
76  unsigned rawBins : 5;
77  unsigned lctBins : 4;
78  unsigned firmwareVersion : 6;
79  unsigned flag4 : 1;
80 };
81 
82 struct CSCVirtexID {
84  bzero(this, sizeInWords() * 2);
85  }
86 
87  void setFromBuffer(unsigned short const* buf) { memcpy(this, buf, sizeInWords() * 2); }
88 
89  short unsigned int sizeInWords() const {
90  return 3;
91  }
92 
93  unsigned virtexIDLow : 15;
94  unsigned flag0 : 1;
95 
96  unsigned virtexIDMed : 15;
97  unsigned flag1 : 1;
98 
99  unsigned virtexIDHigh : 10;
100  unsigned trReg : 3;
101  unsigned reserved : 2;
102  unsigned flag2 : 1;
103 };
104 
106  CSCConfigurationRegister() { bzero(this, sizeInWords() * 2); }
107 
108  void setFromBuffer(unsigned short const* buf) { memcpy(this, buf, sizeInWords() * 2); }
109 
110  short unsigned int sizeInWords() const {
111  return 5;
112  }
113 
114  unsigned configRegister0 : 15;
115  unsigned flag0 : 1;
116 
117  unsigned configRegister1 : 15;
118  unsigned flag1 : 1;
119 
120  unsigned configRegister2 : 15;
121  unsigned flag2 : 1;
122 
123  unsigned configRegister3 : 15;
124  unsigned flag3 : 1;
125 
126  unsigned configRegister4 : 9;
127  unsigned reserved : 6;
128  unsigned flag4 : 1;
129 };
130 
132  CSCCollisionMask() { bzero(this, sizeInWords() * 2); }
133 
134  void setFromBuffer(unsigned short const* buf) { memcpy(this, buf, sizeInWords() * 2); }
135 
136  short unsigned int sizeInWords() const {
137  return 1;
138  }
139 
140  unsigned collisionMaskRegister : 14;
141  unsigned reserved : 1;
142  unsigned flag : 1;
143 };
144 
146  CSCHotChannelMask() { bzero(this, sizeInWords() * 2); }
147 
148  void setFromBuffer(unsigned short const* buf) { memcpy(this, buf, sizeInWords() * 2); }
149 
150  short unsigned int sizeInWords() const {
151  return 1;
152  }
153 
154  unsigned hotChannelMask : 12;
155  unsigned reserved : 3;
156  unsigned flag : 1;
157 };
158 
159 #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