TGeoElementTable::Instance

From: Sue Kasahara <schubert_at_hep.umn.edu>
Date: Tue, 19 Apr 2005 21:43:07 -0500


Hi root team,
I'm making use of the TGeo associated classes to build our detector geometries. We need to be able to build more than one geometry in the course of a job, and we store these multiple geometries in a loan pool of geometries available for use. These geometries are to be used within a vmc application, but also for other purposes.
In order to manage multiple geometries in memory, I realize I need to manage the gGeoManager global pointer so that it points to the geometry in use and I've attempted to do this. I've run into my first problem however, in that I find that I receive a complaint when building a second geometry after the first is built which is:

  Error in <TGeoElementTable::ctor>: Element table already instantiated

Investigating a bit, I see that TGeoElementTable is a singleton to hold the default list of elements, but it's not really treated like a singleton.
For example, the TGeoManager destructor will delete the Instance. This is of course a problem when one has multiple geometry in memory, one of which may go out of use before another. Can this behavior be changed?
  A more general question: will I run into other problems trying to manage multiple geometries in memory in this way? How do you recommend handling this problem?
Thanks,
-Sue     Received on Wed Apr 20 2005 - 04:43:49 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:07 MET