Problem 2356 - Missing unit in G4AtomicShells::GetNumberOfFreeElectrons
Summary: Missing unit in G4AtomicShells::GetNumberOfFreeElectrons
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: materials (show other problems)
Version: 10.7
Hardware: All All
: P4 minor
Assignee: Vladimir.Ivantchenko
URL:
Depends on:
Blocks:
 
Reported: 2021-04-07 13:37 CEST by Valentin
Modified: 2021-04-19 09:02 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 Valentin 2021-04-07 13:37:00 CEST
In method ComputeDerivedQuantities of G4Material.cc, at line:

https://gitlab.cern.ch/geant4/geant4/-/blob/master/source/materials/src/G4Material.cc#L318

G4AtomicShells::GetNumberOfFreeElectrons is called with a threshold elecTh given as `15 * CLHEP::eV` i.e. 15E-06 (MeV). However, in the corresponding method at line:

https://gitlab.cern.ch/geant4/geant4/-/blob/master/source/materials/src/G4AtomicShells.cc#L792

elecTh (th) is compared to fBindingEnergies which is expressed raw in eV, e.g. 13.6 for H. As a result the comparison always fails. Instead, the previous line should be:

if (fBindingEnergies[i] * CLEHP::eV <= th) ...

E.g. as here:

https://gitlab.cern.ch/geant4/geant4/-/blob/master/source/materials/src/G4AtomicShells.cc#L763
Comment 1 Vladimir.Ivantchenko 2021-04-19 09:02:29 CEST
Hello,

thank you very much for this very detailed and clear bug report. The fix is merged to the current master of Geant4 and prepared for the next patch for Geant4 10.7. The date of this patch is not yet defined.

Vladimir