Several instances of TGeoManager


Is it possible to have several instances of TGeoManager at the same time?
Now, if i’m trying to create a new TGeoManager the already created TGeoManager is destroyed.
Even if i’m trying to create TGeoVolumes, TGeoMedium etc.,without adding then to the TGeoManager. And then create a new TGeoMenager all the TGeoVolumes etc are distroyed.

Thanks in advance

Yes, you just have to backup the gGeoManager pointer, then set it to 0 before creating a new geometry. Like

TGeoManager *geom1 = new TGeoManager(…)

gGeoManager = 0;
TGeoManager *geom2 = new TGeoManager(…)

Then, if you want to work with one, do :
gGeoManager = geom1;
… call geometry methods