-
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
Add a calculator to integrate range from energy loss #1544
base: develop
Are you sure you want to change the base?
Conversation
Test summary 4 573 files 6 999 suites 13m 21s ⏱️ Results for commit 249bd09. ♻️ This comment has been updated with latest results. |
60b8f98
to
5e9484b
Compare
5e9484b
to
a7b9386
Compare
I've updated this to use spline interpolation, and the calculated range values match the imported ones. The only tests where the results changed are the mock tests (since we're calculating the range in the physics params instead of constructing it in the mock process) and a few float tests. One thing I noticed is spline interpolation does not work well if there are a small number of grid points and the scale of the x grid is large. Hopefully Geant4 always uses a dense enough grid, and at least this should give us a little more control of the calculation. |
As we refactor the physics table construction we'll probably move toward replacing the
Process::step_limits
withmacro_xs
andenergy_loss
(initially the process-integrated energy loss, but eventually letting each process provide its own and summing them) and then integrating the range from the energy loss ourselves. This adds a calculator for integrating the range from a dedx grid and uses it in the physics grid construction.I'm leaving this as a draft for now because it changes a lot of test results. I think this could be because of differences in the spline interpolation, but it would be good to understand and discuss what we want to do before I go too far with it. I added a failing test comparing range values calculated from the imported dedx to the imported range to get a rough idea of the magnitude of the differences.