Skip to content
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

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

amandalund
Copy link
Contributor

As we refactor the physics table construction we'll probably move toward replacing the Process::step_limits with macro_xs and energy_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.

@amandalund amandalund added enhancement New feature or request physics Particles, processes, and stepping algorithms labels Dec 10, 2024
@amandalund amandalund requested a review from sethrj December 10, 2024 05:38
Copy link

github-actions bot commented Dec 10, 2024

Test summary

 4 573 files   6 999 suites   13m 21s ⏱️
 1 715 tests  1 709 ✅  6 💤 0 ❌
24 556 runs  24 472 ✅ 84 💤 0 ❌

Results for commit 249bd09.

♻️ This comment has been updated with latest results.

@amandalund amandalund force-pushed the range-calculator branch 2 times, most recently from 60b8f98 to 5e9484b Compare February 8, 2025 20:29
@amandalund amandalund marked this pull request as ready for review February 8, 2025 21:33
@amandalund amandalund requested a review from sethrj February 8, 2025 21:34
@amandalund
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request physics Particles, processes, and stepping algorithms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants