-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix polar angle sampling and Mott factor in Wentzel distribution #1212
Fix polar angle sampling and Mott factor in Wentzel distribution #1212
Conversation
Fails with: ``` BernoulliDistribution.hh:69: celeritas: precondition failed: p_true >= 0 && p_true <= 1" ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find! Good to justify our general avoidance of clamp
and its ilk...
Darn it, I guess we'll never replace multiple scattering with single coulomb at this rate... I'm happy either to wait for @hhollenb 's double check before merging this or to let you go ahead and merge yourself. |
This looks great, and may fix some of the small discrepancies in the scattering angle. I used clamp out of a concern for other parts of the code requiring I'll approve it and merge it into the tests I have right now. Finding that source for @amandalund coulomb limit made me want to revisit the weird false scattering code and make sure its assumptions are correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revisit the Coulomb scattering limit with Soon once he returns and I review the paper.
This fixes what I think are a couple small errors in the Wentzel distribution:
With
The sampled angle should now always be in [-1, 1), so we can remove the
clamp
.p_true
in the Bernoulli distribution was greater than one.It would be good if @hhollenb could confirm that these changes are correct and I'm not missing something.