Message: Re: Find Point in volume Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Find Point in volume 

Forum: Geometry
Re: None Find Point in volume (Phil Jones)
Date: 17 Sep, 2012
From: John Apostolakis <John Apostolakis>

Dear Phil,

You can get what is a kind of 'center' of the current volume by using the local coordinates of your current position.  This is the case for many CSG solids - i.e. a box, a sphere, a tube.  

If you are at position   Px, Py, Pz at the start of a step, you can use the Touchable History from the current step ( PreStep point typically) to get the transformation between global and local coordinates.

( Please see the Application Developers Guide for details on how to get these - the Touchable History and the transformation. )

Typically you apply the global to local to the current position, to get its position in local coordinates.  But you can apply the reverse transformation (local to global) to find the location in global coordinates of the origin (0,0,0) of local coordinates.  If I understand correctly this method is what you are looking for.

In case you are working without a track, the Navigator can create a G4TouchableHistory for you, after you have located the point.  And you can do the same.

Best regards,
John
===================================================
John Apostolakis, SFT (SoFTware) Group, PH Department, CERN
Email:  john.apostolakis@cern.ch       Office Tel:  +41-22-767-7239
------------------------------------------------------------------------------------------

On Sep 14, 2012, at 4:35 PM, Phil Jones wrote:

> 
> *** Discussion title: Geometry
> 
> It seems easy enough using the navigator to find out the volume a point is in.

> However is it possible to find a point within a given volume, e.g. the local centre?
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1223.html 

 Add Message Add Message
to: "Re: Find Point in volume"

 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 ]