Dear Geant4 Community,
in a calorimeter simulation, I am currently taking the (X,Y,Z) position of the volume where the step is located with respect to the (0,0,0) position, as follows:
G4ThreeVector origin(0.,0.,0.);
G4ThreeVector sliceorigin = step->GetPreStepPoint()->GetTouchable()->
GetHistory()->GetTopTransform().Inverse().TransformPoint(origin);
The same approach was followed here: Retrieve the position in global X,Y,Z coordinates of a hit sensitive volume - #3 by DavidSarria89
How should I modify this code to get the (X,Y,Z) position of the center of the mother volume of the volume where the step is located with respect to (0,0,0)?
Or, equivalently, if a step in the “active” volume returns 4 from step->GetPreStepPoint()->GetTouchableHandle()->GetHistoryDepth();
How can I get the same position for any of the 4 touchables in the History?
Thank you. Best regards. Lorenzo