GSI Forum - RDF feed
type: channel
description: GSI Helmholtzzentrum für Schwerionenforschung
items: gGeoManager existing?
items: Re: gGeoManager existing?

gGeoManager existing?
type: item
description: Dear pandaRooters, I am looking for a way to figure out if a GeoManager is existing in a root session or not without crashing the program. Unfortunately I have not found anything up to now, so I wonder if one of you can help me? Looking forward for a positive reply, Tobias
creator: Tobias Stockmanns
date: 2007-10-18T07:50:09-00:00

Re: gGeoManager existing?
type: item
description: Hallo Tobias, There is two ways to do this: 1. if you know the name of the TGeoManager object, you can use: gROOT->FindObjectAny("ObjectName") this will return a pointer to TGeo if it exist or a zero if not. in case of PandaRoot it is always created with the default name "CBMGeom". 2. In case you do not no the name, you can call: gROOT->GetListOfGeometries() which will return you a TSeqCollection of existing geometries (TGeoManager objects) which you can check if it is empty or has some entries which will be the existing geometries. regards Mohammad
creator: Mohammad Al-Turany
date: 2007-10-18T11:33:01-00:00

Re: gGeoManager existing?
type: item
description: Dear Mohammad, thank you for your fast reply. I will try the options. Cheers, Tobias
creator: Tobias Stockmanns
date: 2007-10-18T12:11:40-00:00