Copy subsets of Trees from different files into one file

Hi,

similar to what is done in tutorial copytree3.C I want to copy a subset of a tree into a new tree and save it in a separat file. However, in my case the original data are contained in several files whereas I would like to save the copied subsets all to the same file. Is this possible?

Regards, Alexander

Yes use a TChain as input. TChain is a TTree, so CopyTree works for a TChain too.

Rene

Thanks for the help. Is there any other option? My program is not as simple as the example and using TChain would require some major changes.

Regards, Alexander

Hi,

Most likely all you need to do is:nexttree->AddClone(newtree); nexttree->CopyAddresses(newtree);

Cheers,
Philippe.