In the documentation for CopyTree:
The examples pointed to are all called “copytree (1,2,3).C” but these do not use CopyTree and in fact use CloneTree and therefore without a selection. Searching the root/tutorials directory I find only one usage of this actually:
tutorials/tree/treefriend.C: TTree *TF = T->CopyTree(“z<10”);
It would perhaps be better to point to a relevant example or name them so. Whilst the doxygen description for the function is adequate, an example is crucial to see how to deal with the ROOT-style memory management.
The important note in the documentation points out that branch address are linked - fine. But does one need to do this or is this only in the case that you are setting branch address on a memory resident object? I want to skim a tree from one file to another new one copying all branches according to a selection. From the example in treefriend.C it looks like this isn’t relevant?
Is this done event by event or all selected events have to be memory-resident first, then written to file?
Cheers,
Laurie