CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
65 stars 66 forks source link

Small fix for EMPairProduction when haveElectrons=False and small Optimizations #491

Closed LeanderSchlegel closed 1 month ago

LeanderSchlegel commented 1 month ago

Dear all,

@lukasmerten , @JulienDoerner and me discussed a possible fix of #488 and thought of opening this very small PR. We switched the order of the lines in EMPairProduction.cpp that in the current master-version would prevent the catastrophic energy loss of the pairproduction in the case of haveElectrons=False. We also noticed two very small optimizations that could be done in EMDoublePairProduction.cpp and EMInverseComptonScattering.cpp that we included in this PR, that do not affect the physics and could lead to a little speedup in the runtime of the modules.

Thank you in advance!