I have created a class, “AsapIOV”, which contains the following in the declaration:
This TClonesArray is filled with objects from another class, “AsapResultHeader”, which in turn contains the following declaration:
Finally, that array is filled with objects from a third class, “AsapCorrection”.
After compiling, I issue the following commands in the interpretor:
root  AsapIOV *iov = new AsapIOV ();
root  TTree t("t", "t");
root  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?
upload.tar.gz (854 Bytes)