Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:27

0001 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h"
0002 #include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h"
0003 #include "EventFilter/CSCRawToDigi/interface/cscPackerCompare.h"
0004 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h"
0005 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h"
0006 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h"
0007 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h"
0008 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_TMB.h"
0009 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_CCLUT.h"
0010 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_GEM.h"
0011 #include "EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_Run2.h"
0012 #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h"
0013 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
0014 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0015 #include <cmath>
0016 #include <cstring>  // memcpy
0017 
0018 #ifdef LOCAL_UNPACK
0019 bool CSCTMBHeader::debug = false;
0020 #else
0021 std::atomic<bool> CSCTMBHeader::debug{false};
0022 #endif
0023 
0024 CSCTMBHeader::CSCTMBHeader(int firmwareVersion, int firmwareRevision)
0025     : theHeaderFormat(), theFirmwareVersion(firmwareVersion) {
0026   if (firmwareVersion == 2020) {
0027     if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) { /* New (O)TMB firmware revision format */
0028       bool isGEM_fw = false;
0029       bool isCCLUT_HMT_fw = false;
0030       bool isOTMB_Run2_fw = false;
0031       bool isTMB_Run3_fw = false;
0032       bool isTMB_Run2_fw = false;
0033       bool isTMB_hybrid_fw = false;  /// Copper TMB hybrid fw Run2 CLCT + Run3 LCT/MPC + anode-only HMT (March 2022)
0034       bool isRun2_df = false;
0035       unsigned df_version = (firmwareRevision >> 9) & 0xF;  // 4-bits Data Format version
0036       unsigned major_ver = (firmwareRevision >> 5) & 0xF;   // 4-bits major version part
0037       // unsigned minor_ver = firmwareRevision & 0x1F;         // 5-bits minor version part
0038       switch (df_version) {
0039         case 0x4:
0040           isTMB_hybrid_fw = true;
0041           break;
0042         case 0x3:
0043           isGEM_fw = true;
0044           break;
0045         case 0x2:
0046           isCCLUT_HMT_fw = true;
0047           break;
0048         case 0x1:
0049           isOTMB_Run2_fw = true;
0050           break;
0051         case 0x0:
0052           if (major_ver == 1)
0053             isTMB_Run2_fw = true;
0054           else
0055             isTMB_Run3_fw = true;
0056           break;
0057         default:
0058           isGEM_fw = true;
0059       }
0060       if (major_ver == 1) {
0061         isRun2_df = true;
0062       }
0063 
0064       if (isGEM_fw) {
0065         if (isRun2_df) {
0066           theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_Run2(firmwareRevision));
0067         } else {
0068           theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_GEM());
0069         }
0070       } else if (isCCLUT_HMT_fw) {
0071         if (isRun2_df) {
0072           theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_Run2(firmwareRevision));
0073         } else {
0074           theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_CCLUT());
0075         }
0076       } else if (isOTMB_Run2_fw || isTMB_Run2_fw || isRun2_df) {
0077         theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_Run2(firmwareRevision));
0078       } else if (isTMB_Run3_fw) {
0079         theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_CCLUT());
0080       } else if (isTMB_hybrid_fw) {
0081         theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_TMB());
0082       }
0083     }
0084   } else if (firmwareVersion == 2013) {
0085     theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2013());
0086   } else if (firmwareVersion == 2006) {
0087     theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2006());
0088   } else if (firmwareVersion == 2007) {
0089     /* Checks for TMB2007 firmware revisions ranges to detect data format
0090        * rev.0x50c3 - first revision with changed format
0091        * rev.0x42D5 - oldest known from 06/21/2007
0092        * There is 4-bits year value rollover in revision number (0 in 2016)
0093        */
0094     if ((firmwareRevision >= 0x50c3) || (firmwareRevision < 0x42D5)) {
0095       // if (firmwareRevision >= 0x7a76) // First OTMB firmware revision with 2013 format
0096       /* Revisions > 0x6000 - OTMB firmwares, < 0x42D5 - new TMB revisions in 2016 */
0097       if ((firmwareRevision >= 0x6000) || (firmwareRevision < 0x42D5)) {
0098         bool isGEMfirmware = false;
0099         /* There are OTMB2013 firmware versions exist, which reports firmwareRevision code = 0x0 */
0100         if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) { /* New (O)TMB firmware revision format */
0101           if (((firmwareRevision >> 9) & 0x3) == 0x3)
0102             isGEMfirmware = true;
0103           if (isGEMfirmware) {
0104             theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_GEM());
0105           } else {
0106             theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2013());
0107           }
0108         }
0109       } else {
0110         theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2007_rev0x50c3());
0111       }
0112     } else {
0113       theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2007());
0114     }
0115   } else {
0116     edm::LogError("CSCTMBHeader|CSCRawToDigi") << "failed to determine TMB firmware version!!";
0117   }
0118 }
0119 
0120 //CSCTMBHeader::CSCTMBHeader(const CSCTMBStatusDigi & digi) {
0121 //  CSCTMBHeader(digi.header());
0122 //}
0123 
0124 CSCTMBHeader::CSCTMBHeader(const unsigned short *buf) : theHeaderFormat() {
0125   ///first determine the format
0126   if (buf[0] == 0xDB0C) {
0127     theFirmwareVersion = 2007;
0128     theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2007(buf));
0129     /* Checks for TMB2007 firmware revisions ranges to detect data format
0130        * rev.0x50c3 - first revision with changed format
0131        * rev.0x42D5 - oldest known from 06/21/2007
0132        * There is 4-bits year value rollover in revision number (0 in 2016)
0133        */
0134     if ((theHeaderFormat->firmwareRevision() >= 0x50c3) || (theHeaderFormat->firmwareRevision() < 0x42D5)) {
0135       // if (theHeaderFormat->firmwareRevision() >= 0x7a76) // First OTMB firmware revision with 2013 format
0136       /* Revisions > 0x6000 - OTMB firmwares, < 0x42D5 - new TMB revisions in 2016 */
0137       if ((theHeaderFormat->firmwareRevision() >= 0x6000) || (theHeaderFormat->firmwareRevision() < 0x42D5)) {
0138         theFirmwareVersion = 2013;
0139         bool isGEM_fw = false;        /// Run3 ME11+GE11 OTMB fw with CCLUT and HMT
0140         bool isCCLUT_HMT_fw = false;  /// Run3 MEx1 OTMB fw with CCLUT and HMT
0141         bool isOTMB_Run2_fw = false;  /// Run2-compatible data format OTMB fw with Run3 revision code format
0142         bool isTMB_Run3_fw = false;
0143         bool isTMB_Run2_fw = false;
0144         bool isTMB_hybrid_fw = false;  /// Copper TMB hybrid fw Run2 CLCT + Run3 LCT/MPC + anode-only HMT (March 2022)
0145         bool isRun2_df = false;
0146         unsigned firmwareRevision = theHeaderFormat->firmwareRevision();
0147         /* There are OTMB2013 firmware versions exist, which reports firmwareRevision code = 0x0 */
0148         if ((firmwareRevision < 0x4000) && (firmwareRevision > 0x0)) { /* New (O)TMB firmware revision format */
0149           theFirmwareVersion = 2020;
0150           unsigned df_version = (firmwareRevision >> 9) & 0xF;  // 4-bits Data Format version
0151           unsigned major_ver = (firmwareRevision >> 5) & 0xF;   // 4-bits major version part
0152           // unsigned minor_ver = firmwareRevision & 0x1F;         // 5-bits minor version part
0153           switch (df_version) {
0154             case 0x4:
0155               isTMB_hybrid_fw = true;
0156               break;
0157             case 0x3:
0158               isGEM_fw = true;
0159               break;
0160             case 0x2:
0161               isCCLUT_HMT_fw = true;
0162               break;
0163             case 0x1:
0164               isOTMB_Run2_fw = true;
0165               break;
0166             case 0x0:
0167               if (major_ver == 1)
0168                 isTMB_Run2_fw = true;
0169               else
0170                 isTMB_Run3_fw = true;
0171               break;
0172             default:
0173               isGEM_fw = true;
0174           }
0175           if (major_ver == 1) {
0176             isRun2_df = true;
0177           }
0178         }
0179         if (theFirmwareVersion == 2020) {
0180           if (isGEM_fw) {
0181             if (isRun2_df) {
0182               theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_Run2(buf));
0183             } else {
0184               theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_GEM(buf));
0185             }
0186           } else if (isCCLUT_HMT_fw) {
0187             if (isRun2_df) {
0188               theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_Run2(buf));
0189             } else {
0190               theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_CCLUT(buf));
0191             }
0192           } else if (isOTMB_Run2_fw || isTMB_Run2_fw || isRun2_df) {
0193             theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_Run2(buf));
0194           } else if (isTMB_Run3_fw) {
0195             theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_CCLUT(buf));
0196           } else if (isTMB_hybrid_fw) {
0197             theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2020_TMB(buf));
0198           }
0199 
0200         } else {
0201           theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2013(buf));
0202         }
0203 
0204       } else {
0205         theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2007_rev0x50c3(buf));
0206       }
0207     }
0208 
0209   } else if (buf[0] == 0x6B0C) {
0210     theFirmwareVersion = 2006;
0211     theHeaderFormat = std::shared_ptr<CSCVTMBHeaderFormat>(new CSCTMBHeader2006(buf));
0212   } else {
0213     edm::LogError("CSCTMBHeader|CSCRawToDigi") << "failed to determine TMB firmware version!!";
0214   }
0215 }
0216 
0217 /*
0218 void CSCTMBHeader::swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2)
0219 {
0220   bool me11 = (theChamberId.station() == 1 &&
0221            (theChamberId.ring() == 1 || theChamberId.ring() == 4));
0222   if (!me11) return;
0223 
0224   int cfeb1 = digi1.getCFEB();
0225   int cfeb2 = digi2.getCFEB();
0226   if (cfeb1 != cfeb2) return;
0227 
0228   bool me1a = (cfeb1 == 4);
0229   bool me1b = (cfeb1 != 4);
0230   bool zplus = (theChamberId.endcap() == 1);
0231 
0232   if ( (me1a && zplus) || (me1b && !zplus)) {
0233     // Swap CLCTs if they have the same quality and pattern # (priority
0234     // has to be given to the lower key).
0235     if (digi1.getQuality() == digi2.getQuality() &&
0236     digi1.getPattern() == digi2.getPattern()) {
0237       CSCCLCTDigi temp = digi1;
0238       digi1 = digi2;
0239       digi2 = temp;
0240 
0241       // Also re-number them.
0242       digi1.setTrknmb(1);
0243       digi2.setTrknmb(2);
0244     }
0245   }
0246 }
0247 */
0248 
0249 //FIXME Pick which LCT goes first
0250 void CSCTMBHeader::add(const std::vector<CSCCLCTDigi> &digis) {
0251   // sort???
0252   if (!digis.empty()) {
0253     addCLCT0(digis[0]);
0254   }
0255   if (digis.size() > 1)
0256     addCLCT1(digis[1]);
0257 }
0258 
0259 void CSCTMBHeader::add(const std::vector<CSCCorrelatedLCTDigi> &digis) {
0260   // sort???
0261   if (!digis.empty())
0262     addCorrelatedLCT0(digis[0]);
0263   if (digis.size() > 1)
0264     addCorrelatedLCT1(digis[1]);
0265 }
0266 
0267 void CSCTMBHeader::add(const std::vector<CSCShowerDigi> &digis) {
0268   if (!digis.empty())
0269     theHeaderFormat->addShower(digis[0]);
0270 }
0271 
0272 CSCTMBHeader2007 CSCTMBHeader::tmbHeader2007() const {
0273   CSCTMBHeader2007 *result = dynamic_cast<CSCTMBHeader2007 *>(theHeaderFormat.get());
0274   if (result == nullptr) {
0275     throw cms::Exception("Could not get 2007 TMB header format");
0276   }
0277   return *result;
0278 }
0279 
0280 CSCTMBHeader2007_rev0x50c3 CSCTMBHeader::tmbHeader2007_rev0x50c3() const {
0281   CSCTMBHeader2007_rev0x50c3 *result = dynamic_cast<CSCTMBHeader2007_rev0x50c3 *>(theHeaderFormat.get());
0282   if (result == nullptr) {
0283     throw cms::Exception("Could not get 2007 rev0x50c3 TMB header format");
0284   }
0285   return *result;
0286 }
0287 
0288 CSCTMBHeader2013 CSCTMBHeader::tmbHeader2013() const {
0289   CSCTMBHeader2013 *result = dynamic_cast<CSCTMBHeader2013 *>(theHeaderFormat.get());
0290   if (result == nullptr) {
0291     throw cms::Exception("Could not get 2013 TMB header format");
0292   }
0293   return *result;
0294 }
0295 
0296 CSCTMBHeader2020_TMB CSCTMBHeader::tmbHeader2020_TMB() const {
0297   CSCTMBHeader2020_TMB *result = dynamic_cast<CSCTMBHeader2020_TMB *>(theHeaderFormat.get());
0298   if (result == nullptr) {
0299     throw cms::Exception("Could not get 2020 TMB Run3 header format");
0300   }
0301   return *result;
0302 }
0303 
0304 CSCTMBHeader2020_CCLUT CSCTMBHeader::tmbHeader2020_CCLUT() const {
0305   CSCTMBHeader2020_CCLUT *result = dynamic_cast<CSCTMBHeader2020_CCLUT *>(theHeaderFormat.get());
0306   if (result == nullptr) {
0307     throw cms::Exception("Could not get 2020 (O)TMB CCLUT header format");
0308   }
0309   return *result;
0310 }
0311 
0312 CSCTMBHeader2020_GEM CSCTMBHeader::tmbHeader2020_GEM() const {
0313   CSCTMBHeader2020_GEM *result = dynamic_cast<CSCTMBHeader2020_GEM *>(theHeaderFormat.get());
0314   if (result == nullptr) {
0315     throw cms::Exception("Could not get 2020 (O)TMB GEM header format");
0316   }
0317   return *result;
0318 }
0319 
0320 CSCTMBHeader2020_Run2 CSCTMBHeader::tmbHeader2020_Run2() const {
0321   CSCTMBHeader2020_Run2 *result = dynamic_cast<CSCTMBHeader2020_Run2 *>(theHeaderFormat.get());
0322   if (result == nullptr) {
0323     throw cms::Exception("Could not get 2020 (O)TMB legacy Run2 header format");
0324   }
0325   return *result;
0326 }
0327 
0328 CSCTMBHeader2006 CSCTMBHeader::tmbHeader2006() const {
0329   CSCTMBHeader2006 *result = dynamic_cast<CSCTMBHeader2006 *>(theHeaderFormat.get());
0330   if (result == nullptr) {
0331     throw cms::Exception("Could not get 2006 TMB header format");
0332   }
0333   return *result;
0334 }
0335 
0336 void CSCTMBHeader::selfTest(int firmwareVersion, int firmwareRevision) {
0337   constexpr bool debug = false;
0338 
0339   // tests packing and unpacking
0340   for (int station = 1; station <= 4; ++station) {
0341     for (int iendcap = 1; iendcap <= 2; ++iendcap) {
0342       CSCDetId detId(iendcap, station, 1, 1, 0);
0343 
0344       // the next-to-last is the BX, which only gets
0345       // saved in two bits and must be the same for clct0 and clct1.
0346       //CSCCLCTDigi clct0(1, 1, 4, 0, 0, 30, 3, 0, 1); // valid for 2006
0347       // In 2007 firmware, there are no distrips, so the 4th argument (strip
0348       // type) should always be set to 1 (halfstrips).
0349       CSCCLCTDigi clct0(1, 1, 4, 1, 0, 30, 4, 2, 1);  // valid for 2007
0350       CSCCLCTDigi clct1(1, 1, 3, 1, 1, 31, 1, 2, 2);
0351 
0352       // BX of LCT (8th argument) is 1-bit word (the least-significant bit
0353       // of ALCT's bx).
0354       CSCCorrelatedLCTDigi lct0(1, 1, 2, 10, 98, 5, 0, 1, 0, 0, 0, 0);
0355       CSCCorrelatedLCTDigi lct1(2, 1, 2, 20, 15, 9, 1, 0, 0, 0, 0, 0);
0356 
0357       // Use Run3 format digis for TMB firmwareVersion 2020
0358       // and revision codes for MEx1 CCLUT, ME11 CCLUT/GEM
0359       if (firmwareVersion >= 2020) {
0360         bool isGEM_fw = false;
0361         bool isCCLUT_HMT_fw = false;
0362         bool isOTMB_Run2_fw = false;
0363         bool isTMB_Run3_fw = false;
0364         bool isTMB_Run2_fw = false;
0365         bool isTMB_hybrid_fw = false;
0366         bool isRun2_df = false;
0367         unsigned df_version = (firmwareRevision >> 9) & 0xF;  // 4-bits Data Format version
0368         unsigned major_ver = (firmwareRevision >> 5) & 0xF;   // 4-bits major version part
0369         // unsigned minor_ver = firmwareRevision & 0x1F;         // 5-bits minor version part
0370         switch (df_version) {
0371           case 0x4:
0372             isTMB_hybrid_fw = true;
0373             break;
0374           case 0x3:
0375             isGEM_fw = true;
0376             break;
0377           case 0x2:
0378             isCCLUT_HMT_fw = true;
0379             break;
0380           case 0x1:
0381             isOTMB_Run2_fw = true;
0382             break;
0383           case 0x0:
0384             if (major_ver == 1)
0385               isTMB_Run2_fw = true;
0386             else
0387               isTMB_Run3_fw = true;
0388             break;
0389           default:
0390             isGEM_fw = true;
0391         }
0392         if (major_ver == 1) {
0393           isRun2_df = true;
0394         }
0395         if ((isGEM_fw || isCCLUT_HMT_fw || isTMB_Run3_fw) && !isRun2_df && !isOTMB_Run2_fw && !isTMB_Run2_fw &&
0396             !isTMB_hybrid_fw) {
0397           clct0 = CSCCLCTDigi(
0398               1, 6, 6, 1, 0, (120 % 32), (120 / 32), 2, 1, 3, 0xebf, CSCCLCTDigi::Version::Run3, true, false, 2, 6);
0399           clct1 = CSCCLCTDigi(
0400               1, 6, 3, 1, 1, (132 % 32), (132 / 32), 2, 2, 3, 0xe54, CSCCLCTDigi::Version::Run3, false, true, 1, 15);
0401         }
0402         if ((isGEM_fw || isCCLUT_HMT_fw || isTMB_Run3_fw) && !isRun2_df && !isOTMB_Run2_fw && !isTMB_Run2_fw &&
0403             !isTMB_hybrid_fw) {
0404           lct0 = CSCCorrelatedLCTDigi(
0405               1, 1, 3, 85, 120, 6, 0, 0, 0, 0, 0, 0, CSCCorrelatedLCTDigi::Version::Run3, true, false, 2, 6);
0406           lct1 = CSCCorrelatedLCTDigi(
0407               2, 1, 2, 81, 132, 3, 1, 0, 0, 0, 0, 0, CSCCorrelatedLCTDigi::Version::Run3, false, true, 0, 15);
0408         }
0409         if (isTMB_hybrid_fw) {
0410           lct0 = CSCCorrelatedLCTDigi(
0411               1, 1, 3, 85, 120, 6, 0, 0, 0, 0, 0, 0, CSCCorrelatedLCTDigi::Version::Run3, false, false, 0, 0);
0412           lct1 = CSCCorrelatedLCTDigi(
0413               2, 1, 2, 81, 132, 3, 1, 0, 0, 0, 0, 0, CSCCorrelatedLCTDigi::Version::Run3, false, false, 0, 0);
0414         }
0415       }
0416 
0417       CSCTMBHeader tmbHeader(firmwareVersion, firmwareRevision);
0418       tmbHeader.addCLCT0(clct0);
0419       tmbHeader.addCLCT1(clct1);
0420       tmbHeader.addCorrelatedLCT0(lct0);
0421       tmbHeader.addCorrelatedLCT1(lct1);
0422       std::vector<CSCCLCTDigi> clcts = tmbHeader.CLCTDigis(detId.rawId());
0423       // guess they got reordered
0424       assert(cscPackerCompare(clcts[0], clct0));
0425       assert(cscPackerCompare(clcts[1], clct1));
0426       if (debug) {
0427         std::cout << "Match for: " << clct0 << "\n";
0428         std::cout << "           " << clct1 << "\n \n";
0429       }
0430 
0431       std::vector<CSCCorrelatedLCTDigi> lcts = tmbHeader.CorrelatedLCTDigis(detId.rawId());
0432       assert(cscPackerCompare(lcts[0], lct0));
0433       assert(cscPackerCompare(lcts[1], lct1));
0434       if (debug) {
0435         std::cout << "Match for: " << lct0 << "\n";
0436         std::cout << "           " << lct1 << "\n";
0437       }
0438 
0439       // try packing and re-packing, to make sure they're the same
0440       unsigned short int *data = tmbHeader.data();
0441       CSCTMBHeader newHeader(data);
0442       clcts = newHeader.CLCTDigis(detId.rawId());
0443       assert(cscPackerCompare(clcts[0], clct0));
0444       assert(cscPackerCompare(clcts[1], clct1));
0445       lcts = newHeader.CorrelatedLCTDigis(detId.rawId());
0446       assert(cscPackerCompare(lcts[0], lct0));
0447       assert(cscPackerCompare(lcts[1], lct1));
0448     }
0449   }
0450 }
0451 
0452 std::ostream &operator<<(std::ostream &os, const CSCTMBHeader &hdr) {
0453   hdr.theHeaderFormat->print(os);
0454   return os;
0455 }