Problem 1569 - Do not assign DBL_MAX as lifetime for a stable particle.
Summary: Do not assign DBL_MAX as lifetime for a stable particle.
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/decay (show other problems)
Version: 9.6
Hardware: All All
: P5 normal
Assignee: kurasige
URL:
Depends on:
Blocks:
 
Reported: 2014-02-13 12:06 CET by Alberto.Ribon
Modified: 2014-02-22 06:19 CET (History)
3 users (show)

See Also:


Attachments
The patch to fix the problem in Geant4 9.6 (517 bytes, application/octet-stream)
2014-02-13 12:06 CET, Alberto.Ribon
Details

Note You need to log in before you can comment on or make changes to this problem.
Description Alberto.Ribon 2014-02-13 12:06:04 CET
Created attachment 254 [details]
The patch to fix the problem in Geant4 9.6

Federico Carminati has reported to me the following problem.

Do not assign DBL_MAX as lifetime for a stable particle. 
This gets multiplied by the number of lifetimes to live and therefore exceed the representable number in case it is larger than one.

Federico has also provided a patch (included in attachment) to fix this problem in Geant4 9.6.

My comment: for "normal" use of Geant4, where the overflow exception is not activated, this problem is not seen and does not affect the physics results. However, it would be nice to fix it, so that Geant4 can work in all conditions (including when the overflow exception is activated).
The solution proposed seems quite reasonable: use a lifetime much bigger than the age of the universe (e.g. 10^24 seconds) instead of DBL_MAX.

To apply the patch, it is enough to copy it in the main directory of Geant4 (where source/ appears as a subdirectory) and do:
   patch -p1 < G4corr2.patch 

It would be nice to fix the problem also in G4 10.0, both for the patch and for the development.
Comment 1 kurasige 2014-02-22 06:19:27 CET
Thank you for reporting the problem.

I've fixed the bug and bug-fixed tags are
decay-V09-06-03 (for 9.6.patch)
decay-V10-00-02 (for 10.0.patch)