25 : theHeaderFormat(), theFirmwareVersion(firmwareVersion) {
26 if (firmwareVersion == 2020) {
27 if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) {
28 bool isGEM_fw =
false;
29 bool isCCLUT_HMT_fw =
false;
30 bool isOTMB_Run2_fw =
false;
31 bool isTMB_Run3_fw =
false;
32 bool isTMB_Run2_fw =
false;
33 bool isRun2_df =
false;
34 unsigned df_version = (firmwareRevision >> 9) & 0xF;
35 unsigned major_ver = (firmwareRevision >> 5) & 0xF;
42 isCCLUT_HMT_fw =
true;
45 isOTMB_Run2_fw =
true;
66 }
else if (isCCLUT_HMT_fw) {
72 }
else if (isOTMB_Run2_fw || isTMB_Run2_fw || isRun2_df) {
74 }
else if (isTMB_Run3_fw) {
78 }
else if (firmwareVersion == 2013) {
80 }
else if (firmwareVersion == 2006) {
82 }
else if (firmwareVersion == 2007) {
88 if ((firmwareRevision >= 0x50c3) || (firmwareRevision < 0x42D5)) {
91 if ((firmwareRevision >= 0x6000) || (firmwareRevision < 0x42D5)) {
92 bool isGEMfirmware =
false;
94 if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) {
95 if (((firmwareRevision >> 9) & 0x3) == 0x3)
110 edm::LogError(
"CSCTMBHeader|CSCRawToDigi") <<
"failed to determine TMB firmware version!!";
120 if (buf[0] == 0xDB0C) {
133 bool isGEM_fw =
false;
134 bool isCCLUT_HMT_fw =
false;
135 bool isOTMB_Run2_fw =
false;
136 bool isTMB_Run3_fw =
false;
137 bool isTMB_Run2_fw =
false;
138 bool isRun2_df =
false;
141 if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) {
143 unsigned df_version = (firmwareRevision >> 9) & 0xF;
144 unsigned major_ver = (firmwareRevision >> 5) & 0xF;
146 switch (df_version) {
151 isCCLUT_HMT_fw =
true;
154 isOTMB_Run2_fw =
true;
158 isTMB_Run2_fw =
true;
160 isTMB_Run3_fw =
true;
165 if (major_ver == 1) {
176 }
else if (isCCLUT_HMT_fw) {
182 }
else if (isOTMB_Run2_fw || isTMB_Run2_fw || isRun2_df) {
184 }
else if (isTMB_Run3_fw) {
197 }
else if (buf[0] == 0x6B0C) {
201 edm::LogError(
"CSCTMBHeader|CSCRawToDigi") <<
"failed to determine TMB firmware version!!";
240 if (!digis.empty()) {
243 if (digis.size() > 1)
251 if (digis.size() > 1)
262 if (result ==
nullptr) {
270 if (result ==
nullptr) {
271 throw cms::Exception(
"Could not get 2007 rev0x50c3 TMB header format");
278 if (result ==
nullptr) {
286 if (result ==
nullptr) {
287 throw cms::Exception(
"Could not get 2020 TMB Run3 header format");
294 if (result ==
nullptr) {
295 throw cms::Exception(
"Could not get 2020 (O)TMB CCLUT header format");
302 if (result ==
nullptr) {
303 throw cms::Exception(
"Could not get 2020 (O)TMB GEM header format");
310 if (result ==
nullptr) {
311 throw cms::Exception(
"Could not get 2020 (O)TMB legacy Run2 header format");
318 if (result ==
nullptr) {
325 constexpr
bool debug =
false;
329 for (
int iendcap = 1; iendcap <= 2; ++iendcap) {
342 CSCCorrelatedLCTDigi lct0(1, 1, 2, 10, 98, 5, 0, 1, 0, 0, 0, 0);
343 CSCCorrelatedLCTDigi lct1(2, 1, 2, 20, 15, 9, 1, 0, 0, 0, 0, 0);
347 if (firmwareVersion >= 2020) {
348 bool isGEM_fw =
false;
349 bool isCCLUT_HMT_fw =
false;
350 bool isOTMB_Run2_fw =
false;
351 bool isTMB_Run3_fw =
false;
352 bool isTMB_Run2_fw =
false;
353 bool isRun2_df =
false;
354 unsigned df_version = (firmwareRevision >> 9) & 0xF;
355 unsigned major_ver = (firmwareRevision >> 5) & 0xF;
357 switch (df_version) {
362 isCCLUT_HMT_fw =
true;
365 isOTMB_Run2_fw =
true;
369 isTMB_Run2_fw =
true;
371 isTMB_Run3_fw =
true;
376 if (major_ver == 1) {
379 if ((isGEM_fw || isCCLUT_HMT_fw) && !isRun2_df && !isOTMB_Run2_fw && !isTMB_Run2_fw) {
381 1, 6, 6, 1, 0, (120 % 32), (120 / 32), 2, 1, 3, 0xebf,
CSCCLCTDigi::Version::Run3,
true,
false, 2, 6);
383 1, 6, 3, 1, 1, (132 % 32), (132 / 32), 2, 2, 3, 0xe54,
CSCCLCTDigi::Version::Run3,
false,
true, 1, 15);
385 if ((isGEM_fw || isCCLUT_HMT_fw || isTMB_Run3_fw) && !isRun2_df && !isOTMB_Run2_fw && !isTMB_Run2_fw) {
387 1, 1, 3, 85, 120, 6, 0, 0, 0, 0, 0, 0,
CSCCorrelatedLCTDigi::Version::Run3,
true,
false, 2, 6);
389 2, 1, 2, 81, 132, 3, 1, 0, 0, 0, 0, 0,
CSCCorrelatedLCTDigi::Version::Run3,
false,
true, 0, 15);
393 CSCTMBHeader tmbHeader(firmwareVersion, firmwareRevision);
398 std::vector<CSCCLCTDigi> clcts = tmbHeader.
CLCTDigis(detId.
rawId());
403 std::cout <<
"Match for: " << clct0 <<
"\n";
411 std::cout <<
"Match for: " << lct0 <<
"\n";
416 unsigned short int *
data = tmbHeader.
data();
constexpr uint32_t rawId() const
get the raw id
Log< level::Error, false > LogError
std::ostream & operator<<(std::ostream &out, const ALILine &li)
bool cscPackerCompare(const T &t1, const T &t2)