You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ITSMFT/ITS3: fix MC labels for clusters after digit squashing - #16098
Digit squashing can remove earlier digits on a chip and reorder the remaining pixels. Looking up a single-pixel cluster's MC label as chipStart + hit can therefore select a discarded digit's label.
Use a shared ChipPixelData::getDigitID() accessor for every cluster-label lookup in ITSMFT and ITS3. It selects the stored mapping when present and otherwise uses contiguous digit indices, independently of the clusterer's squashing setting. Also skip label fetching when the reader has no MC truth.
This PR changes Clusterer::ClustererThread::finishChipSingleHitFast in ITSMFT so that, under squashing, the MC label of a single-pixel cluster is looked up through getOrderedPixId(hit) instead of getStartID() + hit.
The fix looks correct for the ITSMFT DPL workflow, because hit indexes the sorted pixel vector and mPixelsOrder is sorted with the same comparator. It is incomplete, though, because the ITS3 copy keeps the old lookup and the new branch can read empty vectors. Nothing was built or run; the review is from reading the PR head 714cf05.
I suggest fixing ITS3 in the same PR and moving the index choice into ChipPixelData, for example a getDigitID(pos) that returns mStartID + pos when mPixIds is empty and mPixIds[mPixelsOrder[pos]] otherwise. That one change would cover the first three findings below.
ITS3 not fixed.Detectors/Upgrades/ITS3/reconstruction/src/Clusterer.cxx:319 still calls fetchMCLabels(curChipData->getStartID() + hit, ...), while its finishChip already uses getOrderedPixId. ITS3 MC clusterization with squashing keeps producing wrong labels for single-pixel clusters.
Out-of-bounds read without MC truth in the reader. In Detectors/ITSMFT/common/reconstruction/src/Clusterer.cxx:320 the new path is gated on labelsClusPtr and Clusterer::mSquashingDepth only. DigitPixelReader fills mPixIds/mPixelsOrder only when its mDigitsMCTruth is non-null. When ClustererSpec calls reader.setDigitsMCTruth(nullptr) for an empty label container, a single-pixel chip indexes two empty vectors. This may not occur in practice, and before the PR the same case already crashed on the null labelsDigPtr.
Index scheme depends on a copy of the deciding state.Clusterer::mSquashingDepth is kept in sync with DigitPixelReader::mSquashOverflowsDepth only by ClustererSpec.
A caller that sets setMaxROFDepthToSquash(n > 0) without reader.setSquashingDepth (a macro, a test, a non-DPL driver) worked before and now indexes empty vectors.
The opposite mismatch silently keeps the wrong labels.
Duplication. The squashing-versus-contiguous choice now exists three times in this file (finishChip lines 238-242 and 259-263, and here), plus ITS3.
No regression test, empty PR description. A test with two ROFs, one chip, the first digit squashed away and one survivor, asserting the label equals that digit's label, would guard this.
A minor point: the added two-line comment explains the reasoning, whereas the existing one-liner at finishChip line 238 is the precedent in that file.
mpuccio
changed the title
ITSMFT: fix MC labels for single pixel clusters in the labels
ITSMFT/ITS3: fix MC labels for clusters after digit squashing
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Digit squashing can remove earlier digits on a chip and reorder the remaining pixels. Looking up a single-pixel cluster's MC label as
chipStart + hitcan therefore select a discarded digit's label.Use a shared
ChipPixelData::getDigitID()accessor for every cluster-label lookup in ITSMFT and ITS3. It selects the stored mapping when present and otherwise uses contiguous digit indices, independently of the clusterer's squashing setting. Also skip label fetching when the reader has no MC truth.