Skip to content

[6.40] [tree] Use the counter of the same object for variable-size arrays - #24263

Open
root-project-bot wants to merge 2 commits into
root-project:v6-40-00-patchesfrom
root-project-bot:BP_6.40_pull_24183
Open

root-project-bot wants to merge 2 commits into
root-project:v6-40-00-patchesfrom
root-project-bot:BP_6.40_pull_24183

Conversation

@root-project-bot

Copy link
Copy Markdown

Backport of #24183, requested by @pcanal. For your information @kr1xh

When two objects of the same class are stored in top-level branches
whose names have no trailing dot, their sub-branches get identical
names, e.g. "fN" and "fX" under both "a" and "b". The counter of a
variable-size array member (`Double_t *fX; //[fN]`) was found with
TTree::GetBranch("fN"), which returns the first match in the tree. So
b.fX used a.fN as its counter, and that link was stored in the file.

Look up the counter among the sub-branches of the array's parent
first, and only fall back to the tree-wide search if it is not there.
This covers basic-type arrays, arrays of objects and the MakeClass
recovery path in ReadLeavesMakeClass.

Files written before this change store the wrong counter and are still
read incorrectly; this is not addressed here.

Assisted-by: claude-code:claude-opus-5-5
(cherry picked from commit d8a37e6)
For a variable-size array member of a split object, TTreeReaderArray
took only the short name of the counter branch ("fN") and looked it up
again in the tree. With two objects of the same class in top-level
branches without a trailing dot, that lookup returns the first "fN" in
the tree, so b.fX was read with a.fN's size even when the file stores
the right counter.

Pass the counter branch itself to the size reader and read the size
through the counter's full name ("b.fN").

Fixes root-project#24146

Assisted-by: claude-code:claude-opus-5-5
(cherry picked from commit 1fa357d)
@github-actions

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 17h 55m 56s ⏱️
 3 884 tests  3 851 ✅ 0 💤 33 ❌
81 295 runs  81 258 ✅ 4 💤 33 ❌

For more details on these failures, see this check.

Results for commit 687671c.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants