# TGeoManager handling multiple geometries at the same time

**URL:** <https://root-forum.cern.ch/t/tgeomanager-handling-multiple-geometries-at-the-same-time/8732>\
**Category:** Geometry\
**Created:** [July 30, 2009, 10:07pm UTC](https://root-forum.cern.ch/t/tgeomanager-handling-multiple-geometries-at-the-same-time/8732 "2009-07-30T22:07:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjcorona](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/e95f7d/32.png) [@tjcorona](https://root-forum.cern.ch/u/tjcorona)\
**Post date:** [July 30, 2009, 10:07pm UTC](https://root-forum.cern.ch/t/tgeomanager-handling-multiple-geometries-at-the-same-time/8732/1 "2009-07-30T22:07:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![agheata](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/agheata/32/37311_2.png) [@agheata](https://root-forum.cern.ch/u/agheata)\
**Post date:** [August 4, 2009, 8:04am UTC](https://root-forum.cern.ch/t/tgeomanager-handling-multiple-geometries-at-the-same-time/8732/2 "2009-08-04T08:04:35Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![tjcorona](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/e95f7d/32.png) [@tjcorona](https://root-forum.cern.ch/u/tjcorona)\
**Post date:** [August 4, 2009, 12:25pm UTC](https://root-forum.cern.ch/t/tgeomanager-handling-multiple-geometries-at-the-same-time/8732/3 "2009-08-04T12:25:10Z")

</div>

Thanks! I will give it a shot.
