Skip to content

TTree/TChain ResetBranchAddress does not propagate the reset to the clones #19402

Description

@pcanal

Check duplicate issues.

  • Checked for duplicates

Description

As discovered in https://root-forum.cern.ch/t/possible-issue-when-cloning-trees/63873/15, neither TChain::ResetBranchAddresses nor TTree::ResetBranchAddresses seems to reset the address of their current list of clones.

Reproducer

In pseudo code.

auto newtree = chain->CloneTree(0);
chain->SetBranchAddress(branchname, &ptr);
chain->ResetBranchAdress();
assert( chain->GetBranch(branchname)->GetAddress() == newtree->GetBranch(branchname)->GetAddress() );  

The current code will fail the assert and 'worse' we have newtree->GetBranch(branchname)->GetAddress() == &ptr

ROOT version

master, v6.36, v6.32

Installation method

any

Operating system

any

Additional context

No response

Activity

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

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions