Problem 987

Summary: Endless loop in G4PhotoElectricAngularGeneratorPolarized::PhotoElectronGeneratePhiAndTheta
Product: Geant4 Reporter: Andreas <zog>
Component: processes/electromagnetic/lowenergyAssignee: Sebastien Incerti <incerti>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 9.0   
Hardware: All   
OS: All   

Description Andreas 2007-11-16 01:27:13 CET
Hello!

Symptoms:
========

In some cases (one out of 1000 20 keV photons) my simulation of a pure Germanium detector (only material: Germanium) enters an infinite loop in
G4PhotoElectricAngularGeneratorPolarized::PhotoElectronGeneratePhiAndTheta(XX)
when using: 

G4LowEnergyPhotoElectric* Photo = new G4LowEnergyPhotoElectric();
Photo->SetAngularGenerator("polarized");

The other two angular generators seem to work fine.


Cause:
=====

In G4PhotoElectricAngularGeneratorPolarized::PhotoElectronGeneratePhiAndTheta(XX)
the following loop is executed for ever:

do {

(...)

  maxBeta=rand3*aBeta*crossSectionMajorantFunctionValue;

} while(maxBeta > crossSectionValue);

The reason is that maxBeta is a very small value ~10^-10 because already aBeta, which is calculated in  G4PhotoElectricAngularGeneratorPolarized::PhotoElectronGetMajorantSurfaceAandCParameters is extremely small.


I have done no further investigation.

Thanks for fixing this problem,
Andreas Zoglauer
Comment 1 Sebastien Incerti 2009-09-25 09:54:26 CEST
Gerardo Depaola is investigating the problem