Add forced-detection estimator to EGS_PlanarFluence and EGS_SphericalFluence - #1438
Open
mainegra wants to merge 2 commits into
Open
Add forced-detection estimator to EGS_PlanarFluence and EGS_SphericalFluence#1438mainegra wants to merge 2 commits into
mainegra wants to merge 2 commits into
Conversation
…lFluence
Extends both planar and spherical fluence scorers with a forced-detection
(FD) estimator. FD deterministically scores w·exp(−μr) at the start of
each photon step, giving variance independent of geometric crossing
probability.
- `scoring method = crossing | FD | both` for both AO types; `both`
keeps separate crossing and FD arrays and reports them side-by-side
- Virtual getMFPInterpolators/getCoheInterpolators/isRayleighOn added to
EGS_Application base (overridden in EGS_AdvancedApplication) to avoid
dynamic_cast DSO link error; falls back to crossing with warning for
non-advanced apps or non-photon particles
- Correlated tot/pri ratio for FD arrays in EGS_SphericalFluence
(fluT_FD_x_p cross-term)
- Test inputs: sph-f-FD-vs-cross-vacuum.egsinp and
sph-f-FD-vs-cross-iron.egsinp
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mainegra
requested review from
ftessier and
rtownson
and removed request for
a team
July 29, 2026 12:06
3 tasks
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.
Summary
Adds a forced-detection (FD) estimator to
EGS_PlanarFluenceandEGS_SphericalFluence, alongside the existing boundary-crossing estimator.scoring methodinput key:crossing(default),forced detection, orboth(separate arrays, allows direct estimator comparison in one run)
boundaries the photon crosses before its next interaction — gated by a
generation-counter (
m_fd_gen/m_fd_slot_gen) that is O(1) to checkand requires no per-history clearing
cross-term arrays, consistent with the volumetric scorer
EGS_Application/EGS_AdvancedApplication:getMFPInterpolators()andisRayleighOn(), used by the FD ray-tracerto compute attenuation along the forced ray; falls back to crossing-only
with a warning when the application does not provide them
needsCallextended to registerUserDiscardand the sixAfterXxxinteraction events when FD is active, so the gate can mark secondaries
and clean up discarded particles correctly
HEN_HOUSE/user_codes/egs_app/:sph-f-FD-vs-cross-iron.egsinp,sph-f-FD-vs-cross-vacuum.egsinpTest plan
egs_fluence_scoringandegs_app; confirm no compilation errorssph-f-FD-vs-cross-iron.egsinpwithscoring method = both:FD and crossing total fluence should agree within statistics at all radii;
FD primary uncertainty should be 0.000% (point source at sphere centre →
deterministic FD score per primary)
sph-f-FD-vs-cross-vacuum.egsinp: crossing and FD agree in vacuum(no attenuation, pure geometry check)
addState) works forscore_botharrays