Message: Re: Custom solid behavior on daughters and surfaces Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Custom solid behavior on daughters and surfaces 

Forum: Geometry
Re: Question Custom solid behavior on daughters and surfaces (Juan-Pablo Yanez)
Date: 03 Dec, 2017
From: Michael H. Kelsey <Michael H. Kelsey>

On Sat, 02 Dec 2017 02:30:27 GMT, Juan-Pablo Yanez wrote:
> I'm a little new to Geant4 and I've been tasked with a project that
> involves custom-made solids. The specific problem I'm having is with a C
> shaped solid (custom) with some finite thickness. The solid is placed in
> a water volume as a daughter.
> I want to track photons that start inside the C region (mother volume).
> In the first step, they check the DistanceToIn of the daughters, and
> detect the solid boundary. If they are reflected, however, they start as
> being in the surface of the C (daughter), and the code does not check
> any more intersections with the other walls. Does anyone know what am I
> doing wrong?

When a track is reflected, the tracking system creates a special "zero-length" step, with the preStep volume being the outside, and the postStep volume being the original inside volume. This is done in order to handle the momentum reversal and trajectory management properly. The G4Op* processes in the toolkit recognize and protect against this special case automatically. In your own code, you will want to add a test to just ignore a zero-length step where the track has finite energy (i.e., not stopped).

  -- Michael Kelsey

 Add Message Add Message
to: "Re: Custom solid behavior on daughters and surfaces"

 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 ]