Add root file together in a tree

Hi there,
I try to add trees in many files together. Here I do:

TChain *tree=new TChain("MyTree"); tree->Add("aa.root"); tree->Add("ab.root"); tree->Add("ac.root"); tree->Add("ad.root");
When I loop entries in the added tree to do something, my code always crashed at the end of the first file. It seems the left trees cannot be added together. All the root files have the same structure. I don’t know why the code always crashed at the end of the first file (maybe at the beginning of the 2nd file).


Please read:


Sorry for my unclear question above.

In order to re-produce my problem, I change my question. I try to merge some root files together. I use:

TChain *tree=new TChain("RjetTree"); tree->Add("RjetTree-aj.root"); tree->Add("RjetTree-aj.root"); tree->Merge("test.root");

ROOT version: v4_04_02b_v2_eh

RjetTree-aj.root (42.2 KB)

You seem to have an inconsistency in your file. When I execute your statements to merge the two copies of the same file, I get a complaint
about vectorTMBCellContainer::Indext_t.
I would need the class to make progress.
I think that you should check what you are doing with somebody from D0



Jeroen Hegeman has given me a test case (thanks, Jeroen!), which does work for ROOT’s current CVS version, but not for D0’s v4_04_02b_v2_eh-GCC_3_4_3-opt. So whatever it was - it got fixed.

Cheers, Axel.