Re: merging trees

From: Axel Naumann <axel_at_fnal.gov>
Date: Thu, 24 Feb 2005 13:42:08 -0600


Hi Zdenko,

you can use CloneTree on a TChain, after cd'ing into the target directory. That will give you one TTree containing all (or selected) entries of the source TChain. See the doc of TTree::CloneTree http://root.cern.ch/root/html/TTree#TTree:CloneTree.

Axel.

--On 24.02.2005 13:40 +0100 Zdenko van Kesteren <zkestere_at_nikhef.nl> wrote:

> Hi Rooters,
>
> I'm trying to merge TTrees using TChain::Merge() as follows:
>
>
> TChain* chain = new TChain("CBNT/t4444");
> chain->Add("subfile_1.root");
> chain->Add("subfile_2.root");
> chain->Merge("chainedFile.root");
>
> Then, if I look at chainedFile with a TBrowser it appears to have stored
> the tree in
> chainedFile.root/t4444
> rather than
> chainedFile.root/CBNT/t4444
>
> How can I merge trees without losing my directory-structure?
>
> Thanks, Zdenko van Kesteren
>
>
Received on Thu Feb 24 2005 - 20:45:08 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET