Skip to content

Conversation

paulromano
Copy link
Contributor

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 Mixture.clip that the overall probability (intensity) didn't decrease more than the specified threshold, but because the discrete distributions discard points based on $\sum_i x_i p_i$, that check often failed. This PR updates the Mixture.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

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant