Problem 987 - Endless loop in G4PhotoElectricAngularGeneratorPolarized::PhotoElectronGeneratePhiAndTheta
Summary: Endless loop in G4PhotoElectricAngularGeneratorPolarized::PhotoElectronGenera...
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/electromagnetic/lowenergy (show other problems)
Version: 9.0
Hardware: All All
: P3 normal
Assignee: Sebastien Incerti
URL:
Depends on:
Blocks:
 
Reported: 2007-11-16 01:27 CET by Andreas
Modified: 2010-12-25 19:05 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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