Hi Alexander,
OK, you really have 9152 cells in each CRDL. This means
you have 4(1 + 9152*4) = 148436 TNode objects.
The way g2root works is totally clumsy. You get about two C++
statements per node!! This is not very clever. One should instead
generate loops corresponding to each level and pass a position array.
This has to be done. Your structure in memory (in Root) will take
about 4 Mbytes. One could also gain (may be a factor 2) in making
a more compact structure.
In the existing g2root, in addition, I stop generating the C++
files when I find more than 50000 nodes. I have changed this limit
and can generate your phos.C file (but it is around 300000 lines).
Conclusion, I have to make several changes in g2root. I also want
to pass the address of the referenced objects, instead of their name.
This is on my shopping list (a long one).
Very likely, on your machine, g2root crashes because of the
limitation on 50000 objects.
In your case, it should be much simpler, for the time being
to recode the geometry (via TNode) in the same way that you
invoke gsvolu/gspos in your nested loops.
Rene Brun