Message: Re: Position Information Of An Object Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Position Information Of An Object 

Forum: Geometry
Re: Question Position Information Of An Object (Odera Dim)
Date: 14 Aug, 2018
From: Michael H. Kelsey <Michael H. Kelsey>

On Tue, 14 Aug 2018 14:32:44 GMT, Odera Dim wrote:
> I have a model of a small box contained in a big box (the big box is in
> the world volume or frame). However, I need the position of the small
> box relative to the world volume. I have tried the GetTranslation()
> method but that returns the position of the small box in the big box. In
> summary is there a way to get the small box position in the world frame
> and not its mothers frame (big box frame)?

That is what the G4VTouchable (and concrete subclasses) provides. After you close the geometry, Geant4 processes it to determine which volume in the hierarchy is active at each point in the world volume. You can then acquire a "touchable" which provides the sequence of placements from the World down to the active volume, including the cumulative set of transforms between world and local coordinates.

If you have a G4Track or G4Step, you can get the touchable associated with the current position already built. If all you have is the closed geometry, then you have to build the touchable yourself, which is non-trivial in general.

In your case, your geometry is simple enough that you can do it directly: you know the placement of the big box in World, and you know the placement of the small box in the big box. The product of those two transform is what you're requesting.

  -- Michael Kelsey

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

1 Question: Re: Position Information Of An Object   (Odera Dim - 14 Aug, 2018)
1 More: Re: Position Information Of An Object   (Michael H. Kelsey - 14 Aug, 2018)
(_ None: Re: Position Information Of An Object   (Odera Dim - 14 Aug, 2018)
2 Question: Re: Position Information Of An Object   (Odera Dim - 14 Aug, 2018)
1 Question: Re: Position Information Of An Object   (Odera Dim - 20 Aug, 2018)
1 Feedback: Re: Position Information Of An Object   (Pedro Arce - 20 Aug, 2018)
... 2 Message(s)
2 None: Re: Position Information Of An Object   (John Apostolakis - 21 Aug, 2018)
... 1 Message(s)
3 None: Re: Position Information Of An Object   (Odera Dim - 20 Aug, 2018)
 Add Message Add Message
to: "Re: Position Information Of An Object"

 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 ]