Double array of char*

Hello,

I’m trying to interface my geant4 application with root.
I need need to store the name of each particle going through each pixel of my detector into a TTree.
So I get a double array of char[100] (one dimension for the number of pixel hit, one dimension for the biggest number of particles per pixel). The second dimension can be allowed to be constant (using a high number) but the first one has to be variable.
I spent my day trying to do this, finally my only conclusion is that storing a double array of char[100] is not the good way.
I tried also to store names in TClonesArray containing TObjString but it didn’t work either, even at one dimension. Moreover a TClonesArray containing a TObjString is only a one dimensional array. Going to the second dimension would imply doing TClonesArray of TClonesArray of TObjString … and that scared me :s

So my question is:
What is the proper way of storing in a TTree a bi-dimensional array of names whose one dimension is variable ?

Any suggestion is welcomed (using a Event class, a TList, your grandma or whatever you want !)

Thank you very much

Hi,

You could try vector<vector > (for which you will need to generate a dictionary).

Cheers,
Philippe

I finally gave up the storage of string and used an other method but your suggestion should work.

Thank you