From 9d7583ac310d0997d9e98f0d2980a41e29fc61f8 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 14 Jun 2023 00:24:30 +0200 Subject: [PATCH] [13_1_X] backport. CSC Unpacker fix for handling of rare data corruption, related to invalid CSC DMB header/trailer data --- EventFilter/CSCRawToDigi/src/CSCDDUEventData.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/EventFilter/CSCRawToDigi/src/CSCDDUEventData.cc b/EventFilter/CSCRawToDigi/src/CSCDDUEventData.cc index 0aec292d7f11e..62a1e357f4e9f 100644 --- a/EventFilter/CSCRawToDigi/src/CSCDDUEventData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCDDUEventData.cc @@ -193,11 +193,18 @@ void CSCDDUEventData::unpack_data(const uint16_t* buf, CSCDCCExaminer* examiner) if (cscid != -1) { const uint16_t* pos = (const uint16_t*)csc_itr->second; + if (pos == nullptr) { + if (debug) + LogTrace("CSCDDUEventData|CSCRawToDigi") + << "skip unpacking of CSC " << cscid << " due to format errors (NULL pointer to chamber data)"; + continue; + } + ExaminerStatusType errors = examiner->errorsForChamber(cscid); if ((errors & examiner->getMask()) > 0) { if (debug) LogTrace("CSCDDUEventData|CSCRawToDigi") - << "skip unpacking of CSC " << cscid << " due format errors: 0x" << std::hex << errors << std::dec; + << "skip unpacking of CSC " << cscid << " due to format errors: 0x" << std::hex << errors << std::dec; continue; }