Hi Olivier,
I suggest you look at the tutorials/copytree and copytree2 macros
to get some inspiration. These two macros use TTree::CloneTree.
The default is to copy all entries. Specify
TTree *newtree = oldtree->CloneTree(0);
then loop on all entries, and fill the newtree with the selected entries
only.
See example of loop at the end of TTree::CloneTree.
Rene Brun