celeritas-project / celeritas

Celeritas is a new Monte Carlo transport code designed to accelerate scientific discovery in high energy physics by improving detector simulation throughput and energy efficiency using GPUs.
https://celeritas-project.github.io/celeritas/user/index.html
Other
62 stars 33 forks source link

Fix polar angle sampling and Mott factor in Wentzel distribution #1212

Closed amandalund closed 5 months ago

amandalund commented 5 months ago

This fixes what I think are a couple small errors in the Wentzel distribution:

It would be good if @hhollenb could confirm that these changes are correct and I'm not missing something.

sethrj commented 5 months ago

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.

hhollenb commented 5 months ago

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 $|\cos\theta| \leq 1$ and there being small rounding errors. More than happy to replace it with an ensure post-condition.

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.