Message: Re: Access material from coordinates Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Access material from coordinates 

Forum: Geometry
Re: Question Access material from coordinates (Lara Mason)
Date: 09 Aug, 2018
From: Michael H. Kelsey <Michael H. Kelsey>

On Thu, 09 Aug 2018 13:49:31 GMT, Lara Mason wrote:
> I would like to know the material in which a given track vertex occurred.
> I get the vertex position from G4ThreeVector pos = theTrack->GetVertexPosition();
> and then is there a way to access the material at that vertex position? I know this is
> possible with for pre- and post-step points!

You can, but not as easily as with the step points. In our experiment, we wrote a utility function:

G4VPhysicalVolume* G4CMP::GetVolumeAtPoint(const G4ThreeVector& pos) {
  G4TransportationManager* transMan =
  G4Navigator* nav = transMan->GetNavigatorForTracking();
  G4VPhysicalVolume* volume = nav->LocateGlobalPointAndSetup(pos,0,false);

  return volume;

With the returned pointer, you can go from PV to LV to material.

    -- Michael Kelsey

 Add Message Add Message
to: "Re: Access material from coordinates"

 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 ]