Problem 1032 - G4Step.IsFirstStepInVolume() always returns false
Summary: G4Step.IsFirstStepInVolume() always returns false
Status: CLOSED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: track (show other problems)
Version: 9.1
Hardware: All All
: P5 minor
Assignee: John Apostolakis
URL:
Depends on:
Blocks:
 
Reported: 2008-11-07 18:37 CET by Kevin Lynch
Modified: 2015-02-27 15:33 CET (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 Kevin Lynch 2008-11-07 18:37:34 CET
Both the G4Step.IsFirstStepInVolume() and G4Step.IsLastStepInVolume() members always return false.

While I just independently discovered this problem using 9.1.p02 and 9.1.p03, there is also a post in the hypernews forum from August 2008:
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/eventtrackmanage/829.html

There is an interaction with G4VParticleChange; it's likely there's a bug in there somewhere.  I can't follow the thread of control well enough to suggest a patch.

In my application, there's a simple user workaround: I check that the physical volumes at the PreStepPoint and PostStepPoint are different in the SensitiveDetector that needs this information.  But it would still be nice if the members worked.
Comment 1 kurasige 2008-11-07 19:54:06 CET
This method is introduced from release 8.1.
G4Step or G4VParticleChange can not know that the step is the first step in the volume by itself. So, This flag is expected set/re-set by G4Transportaion process. But G4Transprotaion and related classes have never set this flag from the method is added.
Comment 2 John Apostolakis 2009-10-21 18:02:24 CEST
Thanks for report.  We will correct this.

John
Comment 3 John Apostolakis 2010-09-13 18:16:42 CEST
A candidate fix has been prepared G4Transportation for the case where a particle does not feel the effect of an EM field (i.e. if it is neutral or is in a location where the EM field is zero.)

The case when a particle must propagate in a field is not yet addressed.
Comment 4 John Apostolakis 2014-12-16 19:51:40 CET
I have identified a number of improvements of G4PropagatorInField and G4Transportation that resolve this issue.

I am creating a tag so that they can be tested. Once they are tested, we can upload a tarball that will work with the most recent Geant4 release(s).
Comment 5 John Apostolakis 2015-01-26 10:41:07 CET
Found that problem persisted in the case that parallel geometries existed.

To correct this, I propagated fixes to G4CoupledTransportation.

Unfortunately a problem persists in this case.  I am investigating it.
Comment 6 John Apostolakis 2015-02-04 18:40:11 CET
I have corrected the problem introduced in the new code.

The fix now works.