I have constructed inside my DectorConstruction a Capsule located at “position” inside a mother volume “Union1b”.
G4VPhysicalVolume*PhyCapsule = new G4PVPlacement(0,position,“LogCapsule”,Capsule,Union1b,false,0,fCheckOverlaps);
I would like to get the global position of this Capsule, i.e the position w.r.t the world.
How can I do ? by advance thank you…
Olivier
Ah. OK. Well, you have to work your way up or down the geometry hierarchy accumulating transformations. Bear in mind that a given physical volume may be placed multiple times and similarly its mother and grandmother, etc. So you need to be precise about which physical volume - this is known as a “touchable”.
So, we have a similar problem in visualisation. On the back of that we have developed some commands. For example, in exampleB2a, the following commands give you loads of information (probably too much):
/vis/drawTree
(This reminds you of the names of volumes in your geometry hierarchy.)
/vis/set/touchable World 0 Tracker 0 Chamber_PV 3
(This defines the touchable associated with one of the placements.)
Thank you Allison. I think I will retrieve the position of my volume using the tracking of a
geantino particle.
But I am disappointed that there no method to retrieve this position inside my Detector Construction …