From f9309bf09094445c9bca3c42bdf2d5c93fe77dc9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 5 Dec 2022 22:09:52 -0600 Subject: [PATCH] Check for valid binding energy for photoelectric effect --- src/photon.cpp | 1 - src/physics.cpp | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/photon.cpp b/src/photon.cpp index 590e0cc9f..c4beff019 100644 --- a/src/photon.cpp +++ b/src/photon.cpp @@ -154,7 +154,6 @@ PhotonInteraction::PhotonInteraction(hid_t group) // TODO: Move to ElectronSubshell constructor - // Read binding energy and number of electrons hid_t tgroup = open_group(rgroup, designator.c_str()); // Read binding energy energy and number of electrons if atomic relaxation diff --git a/src/physics.cpp b/src/physics.cpp index ae59b49cb..7d391fdf6 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -366,7 +366,14 @@ void sample_photon_reaction(Particle& p) xs_lower(i_shell) + f * (xs_upper(i_shell) - xs_lower(i_shell))); if (prob > cutoff) { - double E_electron = p.E() - shell.binding_energy; + // Determine binding energy based on whether atomic relaxation data is + // present (if not, use value from Compton profile data) + double binding_energy = element.has_atomic_relaxation_ + ? shell.binding_energy + : element.binding_energy_[i_shell]; + + // Determine energy of secondary electron + double E_electron = p.E() - binding_energy; // Sample mu using non-relativistic Sauter distribution. // See Eqns 3.19 and 3.20 in "Implementing a photon physics