GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » gGeoManager existing?
gGeoManager existing? [message #5241] Thu, 18 October 2007 09:50 Go to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
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
Re: gGeoManager existing? [message #5249 is a reply to message #5241] Thu, 18 October 2007 13:33 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
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

Re: gGeoManager existing? [message #5250 is a reply to message #5249] Thu, 18 October 2007 14:11 Go to previous message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Dear Mohammad,

thank you for your fast reply. I will try the options.

Cheers,

Tobias
Previous Topic: DataFlow
Next Topic: GeoManager questions
Goto Forum:
  


Current Time: Tue Dec 03 01:22:59 CET 2024

Total time taken to generate the page: 0.00625 seconds