| Summary: | tau=1 singularity | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | lockman |
| Component: | processes/electromagnetic | Assignee: | Michel.Maire |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | other | ||
| Hardware: | All | ||
| OS: | All | ||
The multiplescattering PostStepDoIt should not be called with tau=1, but of course it was a bug . It is fixed now together a similar singularity in the .icc file (AlongStepDoIt) . |
In tag Geant4-01-01, processes/electromagnetic/standard/src/G4MultipleScattering.cc, line 459, the formula for "prob" has a logarithmic singularity at tau=1: else { tau = truestep/range ; if(tau < taulim) prob = exp(-(alpha1-1.)*tau)*(1.+scatteringparameter*tau) ; else here===> prob = exp((alpha1-1.)*log(1.-tau))*(1.+scatteringparameter*tau) ; } I think this should be changed to if (tau < taulim) prob = exp(-(alpha1-1.)*tau)*(1.+scatteringparameter*tau) ; else if (tau < 1.) prob = exp((alpha1-1.)*log(1.-tau))*(1.+scatteringparameter*tau) ; else prob = 0;