Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the npsim front-end defaults for Geant4 magnetic field integration to use the DormandPrince745 stepper and retunes several field accuracy/geometry tolerances to better match pixel-scale detector resolutions.
Changes:
- Switch default magnetic field stepper to
DormandPrince745. - Tighten
eps_maxanddelta_chord, and loosendelta_intersectionto new target tolerances. - Introduce
g4unitsusage for mm-based configuration values in the script.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Briefly, what does this PR introduce?
This PR changes the default stepper from:
to
The differences are for the following reasons:
DormandPrince745has 6 evaluations per step instead of ClassicalRK4 which has 11 per stepeps_maxis reduced because it sets the relative scale of maximum accumulated step errors, and for a 2 m radius 1 GeV particle in a 1.7 T field this results in 2 mm, much larger than the pixel size,delta_chordis reduced because it is the sagitta between the step chord and the true curved track, and at 0.25 mm this is much larger than a pixel,delta_intersectionis increased because a precision of 1 um is much smaller than the size of pixels we care about.Note: to explore these on the command line, pass them as bare numbers in mm without explicit units, e.g.
--field.delta_chord=0.025.This PR, in preliminary testing (with tracking_only) increases throughput by about 5%.
What kind of change does this PR introduce?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No.
Does this PR change default behavior?
No.