Message: Obtaining position vectors relative to local G4PVPlacement Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Obtaining position vectors relative to local G4PVPlacement 

Keywords: relative origin coordinates physical volume
Forum: Event and Track Management
Date: 12 Jul, 2004
From: Kareem Kazkaz <>

Hello everyone.

I am working on a geometry that includes a large number of germanium detectors. In
G4SteppingAction, I would like to obtain the position of the energy deposition relative to
the origin of the germanium detector physical volume, rather than relative to the origin
of the world volume.

Assuming all germanium detectors are named "Detector001", "Detector002", etc., ideally 
what I am looking for is to be able to do this:

theTrack = theStep->GetTrack();
if( strstr( theTrack->GetVolume()->GetName(), "Detector") )
  G4cout << theStep->GetLocalPostStepPoint()->GetPosition.x()
      << " " << theStep->GetLocalPostStepPoint()->GetPosition.y()
      << " " << theStep->GetLocalPostStepPoint()->GetPosition.z()
      << G4endl;

where GetLocalPostStepPoint, again, returns the position relative to the origin of the 
G4PhysicalVolume in which the hit occurred, rather than relative to the origin of the world

Does such an implementation exist? Would using a sensitive detector solve this issue, or
would I still have to find some way to figure out the G4PhysicalVolume-specific offsets?
Given the large number of detectors I'm working with, coupled with no way of knowing
a priori where, e.g., Detector001 will actually be (the simulation is built to be highly
customizable), I have not been terribly successful in my search for an answer. Perhaps this
is covered in one of the examples, and I just haven't recognized it?

Thanks for any information or advice.

      Kareem Kazkaz

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Obtaining position vectors relative to local G4PVPlacement"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]