Skip to content

TPC: read rule for the old ClusterNative::qTot - #16107

Merged
sawenzel merged 1 commit into
AliceO2Group:devfrom
matthias-kleiner:tpc-clusternative-qtot-read-rule
Nov 16, 2026
Merged

sawenzel merged 1 commit into
AliceO2Group:devfrom
matthias-kleiner:tpc-clusternative-qtot-read-rule

Conversation

@matthias-kleiner

Copy link
Copy Markdown
Contributor

Files written before #15523 store the charge as qTot and were read back with qTotPacked = 0. The rule is bound to the checksum of the old layout.

Files written before AliceO2Group#15523 store the charge as qTot and were read back with
qTotPacked = 0. The rule is bound to the checksum of the old layout.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sawenzel

Copy link
Copy Markdown
Collaborator

I tested this with files from daily-20260601 and daily-20260620, reading them with daily-20261116. Without the rule, qTotPacked reads back as 0, confirming the issue. With the rule, it fires for both split and unsplit std::vector branches, and the checksum is correct.

One caveat: files produced between #15472 (2026-06-03) and #15523 (2026-07-02) already have the saturation encoding in qTot, while older files store the plain charge. Both share the same checksum, so the rule cannot tell them apart. An alternative to the clipping in your PR is a plain copy:

// Read files written before ClusterNative::qTot was renamed to qTotPacked
#pragma read \
  sourceClass = "o2::tpc::ClusterNative" targetClass = "o2::tpc::ClusterNative" checksum = "[4114055202]" source = "UShort_t qTot" target = "qTotPacked" code = "{ qTotPacked = onfile.qTot; }"

The two only differ for clusters with a stored value above 25600:

June files older files, charge > 25600
clipping (your PR) saturated clusters lost, capped at 25600 up to 2.6× too low, flag correct
copy exact up to ~5× too high, falsely saturated

Such clusters are rare (none in 15.8M clusters in our May MC). Note that tpc-native-clusters.root is read as raw buffers by ClusterNativeHelper, so it is not affected by the rule and already behaves like the copy.

We could consider using the copy, which recovers the June files exactly. If no files from that window need to be read, the clipping in your PR is the safer choice for the older files. What do you think?

@sawenzel

Copy link
Copy Markdown
Collaborator

Following up: I checked all RAW productions in MonaLisa against the ClusterNative layout of their software version. Only three Pb-Pb test passes (LHC25as with async-DataRec-2026-v7, LHC23zzh with daily-20260623) were produced with the June layout, and no cosmics pass. So the clipping in your PR is the better choice, and I am fine with it as is.

@sawenzel
sawenzel merged commit 5cc7845 into AliceO2Group:dev Nov 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants