Skip to content

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

@pcanal

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

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions