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 isTMB_hybrid_fw =
false;
34 bool isRun2_df =
false;
35 unsigned df_version = (firmwareRevision >> 9) & 0xF;
36 unsigned major_ver = (firmwareRevision >> 5) & 0xF;
40 isTMB_hybrid_fw =
true;
46 isCCLUT_HMT_fw =
true;
49 isOTMB_Run2_fw =
true;
70 }
else if (isCCLUT_HMT_fw) {
76 }
else if (isOTMB_Run2_fw || isTMB_Run2_fw || isRun2_df) {
78 }
else if (isTMB_Run3_fw) {
80 }
else if (isTMB_hybrid_fw) {
94 if ((firmwareRevision >= 0x50c3) || (firmwareRevision < 0x42D5)) {
97 if ((firmwareRevision >= 0x6000) || (firmwareRevision < 0x42D5)) {
98 bool isGEMfirmware =
false;
100 if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) {
101 if (((firmwareRevision >> 9) & 0x3) == 0x3)
102 isGEMfirmware =
true;
116 edm::LogError(
"CSCTMBHeader|CSCRawToDigi") <<
"failed to determine TMB firmware version!!";
126 if (
buf[0] == 0xDB0C) {
139 bool isGEM_fw =
false;
140 bool isCCLUT_HMT_fw =
false;
141 bool isOTMB_Run2_fw =
false;
142 bool isTMB_Run3_fw =
false;
143 bool isTMB_Run2_fw =
false;
144 bool isTMB_hybrid_fw =
false;
145 bool isRun2_df =
false;
148 if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) {
150 unsigned df_version = (firmwareRevision >> 9) & 0xF;
151 unsigned major_ver = (firmwareRevision >> 5) & 0xF;
153 switch (df_version) {
155 isTMB_hybrid_fw =
true;
161 isCCLUT_HMT_fw =
true;
164 isOTMB_Run2_fw =
true;
168 isTMB_Run2_fw =
true;
170 isTMB_Run3_fw =
true;
175 if (major_ver == 1) {
186 }
else if (isCCLUT_HMT_fw) {
192 }
else if (isOTMB_Run2_fw || isTMB_Run2_fw || isRun2_df) {
194 }
else if (isTMB_Run3_fw) {
196 }
else if (isTMB_hybrid_fw) {
209 }
else if (
buf[0] == 0x6B0C) {
213 edm::LogError(
"CSCTMBHeader|CSCRawToDigi") <<
"failed to determine TMB firmware version!!";
252 if (!digis.empty()) {
255 if (digis.size() > 1)
263 if (digis.size() > 1)
283 throw cms::Exception(
"Could not get 2007 rev0x50c3 TMB header format");
299 throw cms::Exception(
"Could not get 2020 TMB Run3 header format");
307 throw cms::Exception(
"Could not get 2020 (O)TMB CCLUT header format");
315 throw cms::Exception(
"Could not get 2020 (O)TMB GEM header format");
323 throw cms::Exception(
"Could not get 2020 (O)TMB legacy Run2 header format");
337 constexpr
bool debug =
false;
341 for (
int iendcap = 1; iendcap <= 2; ++iendcap) {
354 CSCCorrelatedLCTDigi lct0(1, 1, 2, 10, 98, 5, 0, 1, 0, 0, 0, 0);
355 CSCCorrelatedLCTDigi lct1(2, 1, 2, 20, 15, 9, 1, 0, 0, 0, 0, 0);
360 bool isGEM_fw =
false;
361 bool isCCLUT_HMT_fw =
false;
362 bool isOTMB_Run2_fw =
false;
363 bool isTMB_Run3_fw =
false;
364 bool isTMB_Run2_fw =
false;
365 bool isTMB_hybrid_fw =
false;
366 bool isRun2_df =
false;
367 unsigned df_version = (firmwareRevision >> 9) & 0xF;
368 unsigned major_ver = (firmwareRevision >> 5) & 0xF;
370 switch (df_version) {
372 isTMB_hybrid_fw =
true;
378 isCCLUT_HMT_fw =
true;
381 isOTMB_Run2_fw =
true;
385 isTMB_Run2_fw =
true;
387 isTMB_Run3_fw =
true;
392 if (major_ver == 1) {
395 if ((isGEM_fw || isCCLUT_HMT_fw || isTMB_Run3_fw) && !isRun2_df && !isOTMB_Run2_fw && !isTMB_Run2_fw &&
398 1, 6, 6, 1, 0, (120 % 32), (120 / 32), 2, 1, 3, 0xebf,
CSCCLCTDigi::Version::Run3,
true,
false, 2, 6);
400 1, 6, 3, 1, 1, (132 % 32), (132 / 32), 2, 2, 3, 0xe54,
CSCCLCTDigi::Version::Run3,
false,
true, 1, 15);
402 if ((isGEM_fw || isCCLUT_HMT_fw || isTMB_Run3_fw) && !isRun2_df && !isOTMB_Run2_fw && !isTMB_Run2_fw &&
405 1, 1, 3, 85, 120, 6, 0, 0, 0, 0, 0, 0,
CSCCorrelatedLCTDigi::Version::Run3,
true,
false, 2, 6);
407 2, 1, 2, 81, 132, 3, 1, 0, 0, 0, 0, 0,
CSCCorrelatedLCTDigi::Version::Run3,
false,
true, 0, 15);
409 if (isTMB_hybrid_fw) {
411 1, 1, 3, 85, 120, 6, 0, 0, 0, 0, 0, 0,
CSCCorrelatedLCTDigi::Version::Run3,
false,
false, 0, 0);
413 2, 1, 2, 81, 132, 3, 1, 0, 0, 0, 0, 0,
CSCCorrelatedLCTDigi::Version::Run3,
false,
false, 0, 0);
422 std::vector<CSCCLCTDigi> clcts = tmbHeader.
CLCTDigis(
detId.rawId());
427 std::cout <<
"Match for: " << clct0 <<
"\n";
435 std::cout <<
"Match for: " << lct0 <<
"\n";
440 unsigned short int *
data = tmbHeader.
data();
Log< level::Error, false > LogError
bool cscPackerCompare(const T &t1, const T &t2)