Skip to content

Dispatch GetMinum,GetMaximum calculations to friend when necessary - #22677

Merged
vepadulano merged 3 commits into
root-project:masterfrom
vepadulano:gh-22652
Sep 2, 2026
Merged

Dispatch GetMinum,GetMaximum calculations to friend when necessary#22677
vepadulano merged 3 commits into
root-project:masterfrom
vepadulano:gh-22652

Conversation

@vepadulano

Copy link
Copy Markdown
Member

Fixes #22652

@vepadulano vepadulano self-assigned this Jun 22, 2026
@vepadulano
vepadulano force-pushed the gh-22652 branch 2 times, most recently from 1bd9d16 to 9990ddf Compare June 22, 2026 09:57
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

Test Results

    18 files      18 suites   2d 20h 54m 58s ⏱️
 3 859 tests  3 858 ✅ 0 💤 1 ❌
61 136 runs  61 135 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit cc4a87a.

♻️ This comment has been updated with latest results.

@dpiparo
dpiparo self-requested a review June 27, 2026 10:22
@pcanal pcanal closed this Aug 6, 2026
@pcanal pcanal reopened this Aug 6, 2026
@pcanal pcanal closed this Aug 7, 2026
@pcanal pcanal reopened this Aug 7, 2026
@pcanal pcanal closed this Aug 10, 2026
@pcanal pcanal reopened this Aug 10, 2026
@pcanal pcanal closed this Aug 13, 2026
@pcanal pcanal reopened this Aug 25, 2026
Comment thread tree/tree/src/TChain.cxx Outdated
Comment thread tree/tree/test/TTreeRegressions.cxx Outdated
Comment thread tree/tree/src/TTree.cxx
Comment thread tree/tree/src/TTree.cxx Outdated
Comment thread tree/tree/src/TChain.cxx Outdated
Comment thread tree/tree/src/TChain.cxx Outdated
Comment thread tree/tree/src/TChain.cxx Outdated
This commit introduces testing for GetMinimum,GetMaximum in case the requested column belongs to a friend tree.

Two tests are taken directly from the reproducer reported by a user at https://root-forum.cern.ch/t/ttree-getminimum-getmaximum-only-scan-one-file-of-a-friend-tchain/64905

A third test exercises in particular the correct updating of the branch addresses of the friend TChain when it switches to another file even though the main TChain is still traversing the same file.
Implement a similar strategy to what was done for GetBranch in
root-project@30860f3
.

This commit introduces non-functional changes, but a better code organization.

This commit also introduces a description of the search order of
TTree::GetLeaf(const char* branchname, const char *leafname) in its
documentation.
…ombinations

The processing logic for the methods is factorised out into an internal helper
method. TChain does not override the methods anymore, the whole implementation
is in TTree.

The methods take into account the following situations:

* The dataset is a TTree and contains the input column
* The dataset is a TChain and contains the input column, in which case the methods detect file switching and update the leaf pointer correctly.
* The dataset is a TChain, contains the input column, but some files miss it, in which case the methods skip the entries from those files.
* The dataset has a friend TTree which contains the input column
* The dataset is a TChain and has a friend TChain which contains the input column, in which case the methods detect file switching on the friend and update the leaf pointer correctly.
* The dataset is a TChain and has a friend TChain. The input column is partially available in either the main or the friend chain. This can happen for example if the main chain has some files missing the input column and the user knowingly injects the input column in the files of the friend chain. In this case, the methods detect file switching at the boundary between files of the main chain, but also detect if there are file switches in the friend chain. Notably, the entries must still be overall aligned between the main chain and the friend one.

Co-authored-by: Philippe Canal <pcanal@fnal.gov>

@pcanal pcanal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@vepadulano
vepadulano merged commit 8dee834 into root-project:master Sep 2, 2026
29 of 31 checks passed
@vepadulano

Copy link
Copy Markdown
Member Author

/backport to 6.40

@root-project-bot

Copy link
Copy Markdown

Preparing to backport PR #22677 to branch 6.40 requested by vepadulano

@root-project-bot

Copy link
Copy Markdown

This PR has been backported to branch 6.40: #23236

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong behaviour in TTree::[GetMinimum,GetMaximum]

4 participants