Clip mixture distributions based on mean times integral #3603
+64
−12
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
I noticed when running an R2S simulation (using #3508) that I was getting lots of warnings about clipping of the decay photon energy distribution. Upon further inspection, I found that this was due to the fact that clipping of discrete distributions is done based on the product of discrete line probabilities and the corresponding values (i.e.,$\sum_i x_i p_i$ ), whereas clipping of mixture distributions is done based on the probabilities alone. There was a check in $\sum_i x_i p_i$ , that check often failed. This PR updates the
Mixture.clip
that the overall probability (intensity) didn't decrease more than the specified threshold, but because the discrete distributions discard points based onMixture.clip
method so that it also uses the product of probability and value (equivalent to the mean of the distribution times the integral of the distrbution), which eliminates the warnings I was seeing.Checklist