Conversation
process_charged_secondary returned early for charged particles below their energy cutoff before reaching the positron annihilation step. With a nonzero positron cutoff, positrons from pair production below the cutoff therefore never produced their two 511 keV annihilation photons, losing that energy from the photon field (source positrons, handled in sample_positron_reaction, always annihilated). The cutoff now only suppresses thick-target bremsstrahlung, and positrons always annihilate. Behavior with the default cutoff of zero is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Positrons created by pair production are handled at the photon collision site by
process_charged_secondary. That function returned immediately for any charged particle below its energy cutoff, before reaching the positron annihilation step. With a nonzeroenergy_positroncutoff, positrons below the cutoff therefore never produced their two 511 keV annihilation photons. That energy was silently lost from the photon field. Positrons from a source were not affected, sincesample_positron_reactionalways annihilates.The energy cutoff now only suppresses thick-target bremsstrahlung for a charged particle below the cutoff; its kinetic energy is deposited locally as before. A positron always annihilates, whatever its kinetic energy. Behavior with the default positron cutoff of 0 is unchanged.
I also clarified the
energy_positroncutoff description in the settings documentation.The new test
test_positron_cutoff_annihilationruns a 10 MeV photon source in lead with local energy deposition, without a positron cutoff and with one above the source energy. With local energy deposition the positron cutoff should have no effect, so the photon flux tallies must match. Ondevelop, the flux in the bin containing 511 keV drops from 0.33 to 0.004 when the cutoff is set; with this fix the two runs give identical results.Checklist