TArray as member of a class used in a TClonesArray

I would like to use a TArrayI (and, by the way, a TMatrixFSym) as member variables of a class which is meant to be stored in a TClonesArray. I am wondering about the following things:

  1. Both TArray and TMatrix can hold arbitrarily many entries. So the size is not fixed. By recursion, the size of the class having those as member variables is not fixed either. Am I allowed to use it in a TClonesArray?

  2. Most probably, TArray and TMatrix administer their entries by a pointer to the first element. In this way, the size of these classes would be fixed irrespectively of the number of entries. However, when I write the TClonesArray to a file, will these pointers be persistent, i. e. will I recover the data correctly when later reading the file?

Thanks in advance for your advice,


Both TArrayI and Tmatrixxxx should work inside a TClonesArray.
See $ROOTSYS/test/Event.h,cxx where the Track class shows this situation
with the 2 following members:
Double32_t* fPointValue; //[fNsp] a special quantity for some point.
TBits fTriggerBits; //Bits triggered by this track.