Fix inconsistent usage of particle mass definitions for secondary particles coming from PROPOSAL
Within proposal::InteractionModel::doInteraction()
, we loop over all secondary particles produced by PROPOSAL (here) and put them on the stack (here).
Note that the energy returned by PROPOSAL is a total energy. To calculate this total energy, PROPOSAL used its internal definition of the particle mass. When putting the particle on the stack, CORSIKA 8 transforms the total energy back to kinetic energies, but uses the particle mass definition of CORSIKA 8. This is inconsistent.
On the test-high-energy-showers
branch (commit f4e794b4), when switching maxRadians
to 0.1, using proposal/7.5.1
, setting the emcut
to 0.5 MeV, running radio_em_shower.cpp
with 1e4 2723141261
crashed with an arithmetic exception.
The reason for this was that PROPOSAL simulated a compton energy loss, where a photon transferred a very small amount of energy (~eV) to an electron (note that this is very rare). The electron mass within CORSIKA 8 is defined as 0.511MeV, within PROPOSAL as 0.5109989461MeV. Due to the inconsistent usage of the mass definitions, the electron on the stack ended up with a kinetic energy smaller than 0.511MeV (but larger than 0.5109989461MeV). This caused the crash within EnergyMomentumOperations::calculate_momentum
.
With this MR, this inconsistency is solved.