Append one tree to another

Can I append one tree to another without copying the tree contents?

You might be looking for TChain:

TChain c("treename");
// use it as a TTree, it will loop over the trees in both files transparently

Hope this helps!

No, it doesn’t help as my trees are in the same file, have different names but have the same structure.

You can add two trees from the same file, as per TChain::Add docs:

TChain c("treename");
// use `c` as you would use a TTree
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.