[tree] Clear error when calling CopyTree on a chain with friends#21260
Open
dpiparo wants to merge 1 commit intoroot-project:masterfrom
Open
[tree] Clear error when calling CopyTree on a chain with friends#21260dpiparo wants to merge 1 commit intoroot-project:masterfrom
dpiparo wants to merge 1 commit intoroot-project:masterfrom
Conversation
hageboeck
reviewed
Feb 12, 2026
Member
hageboeck
left a comment
There was a problem hiding this comment.
Could you also add the "known limitation" as a paragraph at the end of the doxygen docstring?
Such as:
/// <b> Known limitations </b>: For a TChain with friends ...
Test Results 20 files 20 suites 2d 21h 55m 20s ⏱️ Results for commit ec1dfb8. ♻️ This comment has been updated with latest results. |
Member
|
This seems to render even better: /// \par Known limitations
/// When friend trees are in use, ...
///
/// Other textSee preview here. |
Addresses ROOT-10778
75fb3b4 to
ec1dfb8
Compare
Member
Author
|
Thanks for the suggestions: all implemented. |
hageboeck
approved these changes
Feb 12, 2026
| /// NOTE that only the active branches are copied. | ||
| /// | ||
| /// ### Known limitations | ||
| /// - This method is not supported if the TChain instance has friends |
Member
There was a problem hiding this comment.
Suggested change
| /// - This method is not supported if the TChain instance has friends | |
| /// - This method is not supported if used on a TChain instance with friends |
Member
Author
There was a problem hiding this comment.
good idea. I will add it once the jobs succeed after flagging this PR [skip-ci] to conserve a bit the resources of the CI.
pcanal
reviewed
Feb 13, 2026
| TTree* TTree::CopyTree(const char* selection, Option_t* option /* = 0 */, Long64_t nentries /* = TTree::kMaxEntries */, Long64_t firstentry /* = 0 */) | ||
| { | ||
| // A clear error for ROOT-10778 | ||
| if (GetListOfFriends() && 0 == strcmp(this->ClassName(), "TChain")) { |
Member
There was a problem hiding this comment.
Suggested change
| if (GetListOfFriends() && 0 == strcmp(this->ClassName(), "TChain")) { | |
| if (GetListOfFriends() && IsA()->InheritsFrom("TChain")) { |
or 'better yet' move this code into a (new) TChain::CopyTree.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses ROOT-10778 by printing a clear, meaningful message about an unsupported operation being carried out.