Problem 1449 - Particle not scored when step length proposed by StepLimiter lands exactly on a geometry boundary
Summary: Particle not scored when step length proposed by StepLimiter lands exactly on...
Status: RESOLVED WORKSFORME
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/transportation (show other problems)
Version: 9.6
Hardware: All All
: P5 major
Assignee: John Apostolakis
URL:
Depends on:
Blocks:
 
Reported: 2013-02-26 07:46 CET by perl
Modified: 2018-07-09 09:20 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description perl 2013-02-26 07:46:01 CET
I reported this bug privately some time ago. I still see the same strange behavior in 4.9.6.p01.

A particle is not scored when step length proposed by StepLimiter lands exactly on a geometry boundary.
One can produce this bug as follows:
Send a proton though vacuum at a sensitive volume with boundary exactly 100 cm from the source.
Include the step limiter process in your physics.
Set step limitation to 100 cm (or any even division of 100, such as 10. cm).
The sensitive volume will not record the particle.
Change step limitation to 99. cm (or some other number such that the proposed step will not exactly line up with the sensitive detector).
The sensitive volume will record the particle.

The following is the last analysis from Hisaya when he was studying the issue:

If the step length proposed by StepLimiter is equal to the length to
the next boundary, the volume in the post-step points to the volume over
the boundary (i.e. Touchable has been updated), but the StepStatus is
not set to 'GeomBoundary'. It causes serious effects to scoring and
optical processes.

I investigated and found the origin of this problem.
'GeomBoundary' is set by SteppingManager if the process which propose
the shortest step length is transportation. If one more processes
propose the same shortest step length, the first process in sequence of
PostStepGPIL and AlongStep is selected as the process which defines the
step length. (Note that: AlongStepGPIL of transportation is invoked at
last and proposed step length is always equal to shortest step length. )
So, StepLimiter is selected in the above case and the step status is set
to 'PostStepDoItProc'. In the PostSetpDoIt of transportation, However,
the touchable is updated because G4Transportation::fGeometryLimitedStep
flag is set in AlongStepGPIL.

I'd propose to modify PostStepDoIt of transportation as follows in
order to solve this problem.

if(fGeometryLimitedStep)
{
// fCurrentTouchable will now become the previous touchable,
// and what was the previous will be freed.

should be

if ( (aStep.GetPostStepPoint()->GetStepStatus() == fGeomBoundary) ||
(aStep.GetPostStepPoint()->GetStepStatus() == fGeomBoundary) )
{
// fCurrentTouchable will now become the previous touchable,
// and what was the previous will be freed.

I've checked that the strange step disappears with above modification.
But I'm not sure that this modification works in all cases and there
is no side effect.
Comment 1 John Apostolakis 2014-06-02 17:15:28 CEST
This is a challenging issue at the 'interface' between tracking and geometry.  In principle it should happen in 'measure 0' cases, and not affect results.  I understand that in practical simulations it can occur, and that it is necessary to try to find a solution.

A robust solution, though, will likely require changes not just in Transportation, but also in the SteppingManager.

I have tried to understand how/whether the suggested change (or a simple variant) could improve the situation, but until now failed.
Comment 2 Gabriele Cosmo 2014-12-03 09:56:59 CET
Can someone please verify if this problem still holds with the latest version of Geant4 ?
Comment 3 asai 2016-12-12 09:09:14 CET
The issue should be reexamined with latest versions. Report should be reopened if the issue persists.