Split TClonesArray elements

Hi, I’m saving a TClonesArray as a branch of my output tree:

_outTree->Branch("CHAD", "TClonesArray", &array);

This TClonesArray contains Hit objects which, in turn, have a TClonesArray* member called _partHits, which contain other objects of class PartHit. I would expect that the members of these PartHit objects would be split in different sub branches as well, but if I Print() my output tree I get only this entry relative to _partHits:

*............................................................................*
*Br   18 :CHAD._partHits : TClonesArray* _partHits[CHAD_]                    *
*Entries :       10 : Total  Size=      42335 bytes  File Size  =      22585 *
*Baskets :        2 : Basket Size=      32000 bytes  Compression=   1.85     *
*............................................................................*

It also seems that CHAD._partHits has no sub-branches:

root [3] TBranch *parHitsBranch = EventsTree->GetBranch("CHAD._partHits")
root [4] parHitsBranch
(class TBranch*)0x1521d60
root [5] parHitsBranch->GetName()
(const char* 0x1521d79)"CHAD._partHits"
root [6] parHitsBranch->GetListOfBranches()->GetEntries()
(const Int_t)0

Is there a way to obtain a full split of PartHit members? Or do I have to change my data model to obtain such a result? Thanks.

Hi,

TTree does not support split the content of collection that is held inside a collection (i.e. your case with the TClonesArray inside a TClonesArray).

Cheers,
Philippe.

Thanks Philippe, I suspected that. I modified my data model to reach my goal, namely, place the “collection inside a collection” in a separate branch, to avoid reading it when not needed.