TGeoManager handling multiple geometries at the same time

Hello ROOTers,
The documentation for class TGeoManager mentions that “the mechanism of handling multiple geometries at the same time will be soon implemented”… is this idea still being pursued? I would be very interested in a TGeoManager that could handle several geometries at a time!

-T.J.

Hi,
This is now already implemented. You have 2 options: have several geometries in the same root session and/or having several navigators for the same geometry. To create a new geometry one has to:
TGeoManager *oldgeom = gGeoManager; // bvackup in some way
gGeoManager = 0; // Important for not deleting the old geometry
TGeoManager *newgeom = new TGeoManager(…);
When using one or another geometry you just set gGeoManager to it. This stands also for using functionality of some objects in the requested geometry.
To use an additional navigator to a geometry, just create and add a navigator.
TGeoNavigator *nav = new TGeoNavigator(gGeoManager);
gGeoManager->AddNavigator(nav);

Regards,

Thanks! I will give it a shot.