From 3b0f28f1433582adb36b1c5f902d18433c9ce44f Mon Sep 17 00:00:00 2001 From: Antonio Franco Date: Fri, 1 Dec 2023 12:58:32 +0100 Subject: [PATCH 1/2] Fix the bug jira ticket O2-4243 --- Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx | 3 ++- Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx b/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx index d4c09615ccd5c..c76d6fd641869 100644 --- a/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx +++ b/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx @@ -133,6 +133,7 @@ void HmpidDecoder2::init() for (int i = 0; i < mNumberOfEquipments; i++) { mTheEquipments[i]->init(); mTheEquipments[i]->resetPadMap(); + mTheEquipments[i]->resetErrors(); } mDigits.clear(); @@ -1276,7 +1277,7 @@ bool HmpidDecoder2::setUpStream(void* Buffer, long BufferLen) } mActualStreamPtr = (uint32_t*)Buffer; // sets the pointer to the Buffer - mEndStreamPtr = ((uint32_t*)Buffer) + wordsBufferLen; // sets the End of buffer + mEndStreamPtr = ((uint32_t*)Buffer) + wordsBufferLen -1; // sets the End of buffer mStartStreamPtr = ((uint32_t*)Buffer); return (true); } diff --git a/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx b/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx index 61051ab48577e..898dc65748ea3 100644 --- a/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx +++ b/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx @@ -203,7 +203,7 @@ void DataDecoderTask2::decodeTF(framework::ProcessingContext& pc) int pointerToTheFirst = mDeco->mDigits.size(); uint32_t* theBuffer = (uint32_t*)it.raw(); mDeco->setUpStream(theBuffer, it.size() + it.offset()); - try { + try { if (mFastAlgorithm) { mDeco->decodePageFast(&theBuffer); } else { @@ -213,7 +213,7 @@ void DataDecoderTask2::decodeTF(framework::ProcessingContext& pc) // The stream end ! LOG(debug) << "End Page decoding !"; } - // std::cout << ">>>>" << pointerToTheFirst << "," << mDeco->mDigits.size() << std::endl; + // std::cout << " fDigit=" << pointerToTheFirst << " lDigit=," << mDeco->mDigits.size() << " nDigit=" << mDeco->mDigits.size()-pointerToTheFirst << std::endl; mTriggers.push_back(o2::hmpid::Trigger(mDeco->mIntReco, pointerToTheFirst, mDeco->mDigits.size() - pointerToTheFirst)); mTotalFrames++; } From a9a9be4511854c35436d6c2e246b00160d7f6468 Mon Sep 17 00:00:00 2001 From: Antonio Franco Date: Mon, 4 Dec 2023 12:51:56 +0100 Subject: [PATCH 2/2] Fix CLang error --- Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx | 2 +- Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx b/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx index c76d6fd641869..af0e51583cab2 100644 --- a/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx +++ b/Detectors/HMPID/reconstruction/src/HmpidDecoder2.cxx @@ -1277,7 +1277,7 @@ bool HmpidDecoder2::setUpStream(void* Buffer, long BufferLen) } mActualStreamPtr = (uint32_t*)Buffer; // sets the pointer to the Buffer - mEndStreamPtr = ((uint32_t*)Buffer) + wordsBufferLen -1; // sets the End of buffer + mEndStreamPtr = ((uint32_t*)Buffer) + wordsBufferLen - 1; // sets the End of buffer mStartStreamPtr = ((uint32_t*)Buffer); return (true); } diff --git a/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx b/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx index 898dc65748ea3..8d24cc43d8ed6 100644 --- a/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx +++ b/Detectors/HMPID/workflow/src/DataDecoderSpec2.cxx @@ -203,7 +203,7 @@ void DataDecoderTask2::decodeTF(framework::ProcessingContext& pc) int pointerToTheFirst = mDeco->mDigits.size(); uint32_t* theBuffer = (uint32_t*)it.raw(); mDeco->setUpStream(theBuffer, it.size() + it.offset()); - try { + try { if (mFastAlgorithm) { mDeco->decodePageFast(&theBuffer); } else {