Problem 1845 - G4EmCalculator::ComputeCrossSectionPerVolume returns NaN when no cut is specified
Summary: G4EmCalculator::ComputeCrossSectionPerVolume returns NaN when no cut is speci...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/electromagnetic (show other problems)
Version: 10.2
Hardware: PC Linux
: P5 trivial
Assignee: Vladimir.Ivantchenko
URL:
Depends on:
Blocks:
 
Reported: 2016-03-14 14:51 CET by Nathanael Lampe
Modified: 2016-04-01 16:55 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Nathanael Lampe 2016-03-14 14:51:59 CET
The function G4EmCalculator::ComputeCrossSectionPerVolume function appears to be able to work without specifying a cut (cut takes 0 as a default parameter).

This works fine for low energy EM models, however in higer energy models NaN is returned by the function. This is seen in the following output, where the Em constructor was G4EmPhysics_option4. Once the high energy model is accessed (above 1 MeV), the returned cross section = -nan. If a cut is specified the function returns a valid value. One solution would be to announce the failure here to the user, another would be to substitute a suitably low energy for the cut value when no cut is specified.


Verbose output from G4EmCalculator:

G4EmCalculator::ComputeXSPerVolume: E(MeV)= 0.9999 cross(cm-1)= 28.7799 cut(keV)= 0  e- in G4_AIR
## G4EmCalculator::FindEmModel for e- (type= lepton) and eIoni at E(MeV)= 1
   Model <PenIoni> Emin(MeV)= 0.0001 for e- and eIoni  0x136e240

G4EmCalculator::ComputeXSPerVolume: E(MeV)= 1 cross(cm-1)= 28.7797 cut(keV)= 0  e- in G4_AIR
## G4EmCalculator::FindEmModel for e- (type= lepton) and eIoni at E(MeV)= 1.0001
   Model <MollerBhabha> Emin(MeV)= 0.0001 for e- and eIoni  0x136e240
 LowEnergy model <PenIoni>

G4EmCalculator::ComputeXSPerVolume: E(MeV)= 1.0001 cross(cm-1)= -nan cut(keV)= 0  e- in G4_AIR
## G4EmCalculator::FindEmModel for e- (type= lepton) and eIoni at E(MeV)= 1.0002
   Model <MollerBhabha> Emin(MeV)= 0.0001 for e- and eIoni  0x136e240
 LowEnergy model <PenIoni>
Comment 1 Vladimir.Ivantchenko 2016-04-01 16:55:41 CEST
Hello,

thank you for pointing to the problem. A protection is now added to G4EmCalculator which should fix the problem. The updated code is available for developers and will be publick in the next public release in June.

VI