TClonesArray IN a TClonesArray

Hello,
I’ve got some problem storing detector data in root files.

Here is my data structure:
Event(personal object) Branch that got a datamember constitued by a TClonesArray of Detectors(personal object)
Each Detector have a TCLones Array of Hits(another personnal obj)

In a more schematik way:
Event1->Detector1->Hit1
->Hit2
->Hit3

      ->Detector2->Hit1
                        ->Hit2
                        ->...

Event2->…

I could fill this structure, but the Hit’s TCLonesArray appear as a leaf in the Detector’s Branch, when I use the TBrowser.

My question is: Am I wrong in my filling code? Or is it just an imposible thing to do, to create TClonesArray in TClonesArray?

Thanks a lot for your help.

Robert Kieffer

[quote]Or is it just an imposible thing to do, to create TClonesArray in TClonesArray? [/quote]It is possible and you probably have succeeded in doing so.

However, a nested TClonesArray can not be split (which is probably what you are expecting).

To split the 2nd TClonesArray you will need to have it at the same level (in your object hierarchy) as the 1st one … and you will need to use either a TRefArray or a array of indices to keep track of which hit ‘belongs’ to which detectors.

Cheers,
Philippe.