Getting a Particular PhysicalPlacedVolume in ROOT

Hello Rooters,
I have load a geometry file in root using

Now i want to get the pointer to a particular PhysicalPlacedVolume, so that i will
get volume along with its transformation matrix.

I have tried gGeoManager->GetListOfVolumes() but that will give me the list of LogicalVolumes
and in that case i will not have information about it placements.

Could you please help me in getting the pointer to physically Placed Volumes.

Thanks and with Regards,

Hi Raman,

Physical nodes are not stored transiently in the geometry, as their number can easily reach millions and this would be to expensive in terms of memory. One can force creating transiently a limited number of physical volumes represented by the class TGeoPhysicalNode using the provided API: but this is to be done only for very particular purposes (such as mis-alignment).

To answer more practically to your question, you can get a pointer to the transformation matrix corresponding to the physical node. For this you need to know the path to the physical node, in terms of logical nodes names: path = “/Top_1/A_1/B_2/…”

const char *path = "/Top_1/A_1/B_2/...";
TGeoMatrix *matrix = gGeoManager->GetCurrentMatrix();
TGeoNode *node = gGeoManager->GetCurrentNode(); // points to last logical node in the path


Thank you very much Andrei.