Problem building a TTree with a TClonesArrays

Hello,

I have created a class, “AsapIOV”, which contains the following in the declaration:

TClonesArray resultHeader;

This TClonesArray is filled with objects from another class, “AsapResultHeader”, which in turn contains the following declaration:

TClonesArray correction;

Finally, that array is filled with objects from a third class, “AsapCorrection”.

After compiling, I issue the following commands in the interpretor:

root [0] AsapIOV *iov = new AsapIOV (); root [1] TTree t("t", "t"); root [2] t.Branch("iov", "AsapIOV", &iov);

And get the following error:

*** Break *** segmentation violation Generating stack trace... 0xb6ba301c in TBranchElement::TBranchElement(char const*, TStreamerInfo*, int, char*, int, int, int) + 0xad2 from /usr/lib/root/libTree.so.5.11 0xb6ba4279 in TBranchElement::Unroll(char const*, TClass*, TClass*, int, int, int) + 0x7e9 from /usr/lib/root/libTree.so.5.11 0xb6ba31d2 in TBranchElement::TBranchElement(char const*, TStreamerInfo*, int, char*, int, int, int) + 0xc88 from /usr/lib/root/libTree.so.5.11 0xb6bd7f9b in TTree::Bronch(char const*, char const*, void*, int, int) + 0x8cb from /usr/lib/root/libTree.so.5.11 0xb6bcf6ec in TTree::Branch(char const*, char const*, void*, int, int) + 0x50 from /usr/lib/root/libTree.so.5.11 0xb6b8d72c in <unknown> from /usr/lib/root/libTree.so.5.11 ...

If I comment out the second TClonesArray and related code, the error does not appear.

I am attaching a tar file with the complete code of the three classes for reference.

Does anyone know what I am doing wrong? Have I made an obvious mistake?

What is the correct way to make a tree containing arrays of arrays of objects?

Thanks,

Pierre-François
upload.tar.gz (854 Bytes)

Hi,

I can reproduce the problem and your code seems fine. We’ll work on resolving this issue.
As a work-around use a different type collection for the inner collection or reduce the split level (down to 1 or 2).

Cheers,
Philippe