Problem cloning TTree with TBranchElement

Dear Rootsketeers,

I am using ROOT v4.00/08 and I have a problem with function TTree::CloneTree.
I have a TChain of TTree with TBranch containing collection of object so they are stored within the TBranchElement class. I follow the CloneTree example and I manage to get a new tree identical to the first tree in the chain, so for every cloned TBranchElement it register in variable fMaximum the max number of object in the branches of first tree.
But in general this is not the correct limit of all other trees so when I want to use the whole cloned tree i get an error like:

“Incorrect size read for the container in jet_ The size read is 250 when the maximum is 200 The size is reset to 0 for this entry 1146”

How can I clone the tree with correct maximum?

Thanks a lot for your help,


I think that this has been fixed early 2006, please check with the latest release of ROOT (5.16/00) if you still see the problem.


Thanks for the reply, effectively I don’t see any more this problem with release 5.

Anyway I have found useful to insert an home made method in version 4.00/08 to set manually fMaximum to the value I want (I think there is no such a function neither in rekease 5). In fact I make more TChain of various subset of nearly 4000 files and then I chain the results, in these cases I think can be useful to set the max value previously.

Thanks again