Accessing the nodes at TGeoManager after importing from GDML file

Hi,

we load a GDML geometry with several physical volumes placed at different positions. When I load the geometry into TGeoManager using ::Import it creates the object normally.

I am able to access each volume using Geometry->GetVolume(x) however it looks as I am only able to identify one node (the one corresponding to the world volume).

root [4] Geometry->GetVolume(0)->GetNode(0)->GetMatrix()->Print()
matrix  - tr=1  rot=0  refl=0  scl=0 shr=0 reg=1 own=0
  1.000000    0.000000    0.000000    Tx =   0.000000
  0.000000    1.000000    0.000000    Ty =   0.000000
  0.000000    0.000000    1.000000    Tz =   0.000000

I get this when calling the number of nodes

root [1] Geometry->GetListOfNodes()->GetEntries()
(int) 1

but when the geometry loads it says there are 7 nodes:

Info in <TGeoManager::CloseGeometry>: 7 nodes/ 6 volume UID's in Geometry imported from GDML
Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
stOfNodes()->GetEntries()

I tried to find in the documentation a way to find the positions of those volumes/nodes but I dont find the exact answer. Could I get some insight on that?

Thanks!

@agheata could you please take a look? Thank you in advance! Oksana.

Hi,
The geometry manager holds a list of volumes (having a shape+material). Volumes have ‘daughters’ which are called logical nodes, there is only one top node held by the manager class. A node is a ‘positioned’ volume with respect to its ‘mother’ volume. This creates a hierarchy structure, the number of ‘physical’ nodes reported by the manager is the number of different paths in this hierarchy. You should really go through the docs to get the concepts. You can access the top logical node using:

TGeoNode *node = gGeoManager->GetTopNode();

To navigate to the daughter nodes, you can do:

node->GetVolume()->GetNode(i); // to get daughter 'i'

You can use TGeoNode::InspectNode() to get info about it. You can use also a TBrowser to navigate the geometry tree.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.