From ab33b9751883940050df1d2bb835bfac2e51b634 Mon Sep 17 00:00:00 2001 From: shahoian Date: Mon, 23 Nov 2026 13:40:44 +0100 Subject: [PATCH] Fix in ITS/MFT/ITS3 predigits labeling Fix from @atriolo: instead of walking down the chain of labels for predigit and appending new label in the end, the loop was keeping only 1st and last distinct labels. --- Detectors/ITSMFT/common/simulation/src/Digitizer.cxx | 10 +++++----- Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx b/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx index 8eaf5e700cf60..2c40c62fccc4c 100644 --- a/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx +++ b/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx @@ -461,20 +461,20 @@ void Digitizer::registerDigits(ChipDigitsContainer& chip, uint32_t roFrame, floa continue; } ExtraDig* extra = getExtraDigBuffer(roFr); - int& nxt = pd->labelRef.next; + int* nxt = &pd->labelRef.next; bool skip = false; - while (nxt >= 0) { - if ((*extra)[nxt].label == lbl) { // don't store the same label twice + while (*nxt >= 0) { + if ((*extra)[*nxt].label == lbl) { // don't store the same label twice skip = true; break; } - nxt = (*extra)[nxt].next; + nxt = &(*extra)[*nxt].next; } if (skip) { continue; } // new predigit will be added in the end of the chain - nxt = extra->size(); + *nxt = extra->size(); extra->emplace_back(lbl); } } diff --git a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx index d07fb53b7220e..fd17641d20154 100644 --- a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx @@ -457,20 +457,20 @@ void Digitizer::registerDigits(o2::its3::ChipDigitsContainer& chip, uint32_t roF continue; } ExtraDig* extra = getExtraDigBuffer(roFr); - int& nxt = pd->labelRef.next; + int* nxt = &pd->labelRef.next; bool skip = false; - while (nxt >= 0) { - if ((*extra)[nxt].label == lbl) { // don't store the same label twice + while (*nxt >= 0) { + if ((*extra)[*nxt].label == lbl) { // don't store the same label twice skip = true; break; } - nxt = (*extra)[nxt].next; + nxt = &(*extra)[*nxt].next; } if (skip) { continue; } // new predigit will be added in the end of the chain - nxt = extra->size(); + *nxt = extra->size(); extra->emplace_back(lbl); } }