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

Better use of safety. #322

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Better use of safety. #322

wants to merge 3 commits into from

Conversation

agheata
Copy link
Contributor

@agheata agheata commented Nov 29, 2024

Implementing two safety features:

  1. Safety caching: the tracks hold the point where safety is computed, and the safety value in that point. When safety is needed in a different point, the method track.GetSafety(new_point) will subtract from the cached value and return the positive remainder or zero otherwise. The GetSafety method can take an accurate limit value, and when the remainder is smaller than this limit the returned safety is zero. It is the user responsibility to call track.SetSafety(pos, safety) whenever the safety is fully recomputed in a new position.

  2. Safety calculation uses a new surface model feature only to compute safety accurately when close to boundaries, and only use the aligned bounding box safety when far away. The distance limit is passed as a third parameter to AdePTNavigator::ComputeSafety, and must be typically equal to the discrete interaction step.

@phsft-bot
Copy link

Can one of the admins verify this patch?

Implementing two safety features:

1. Safety caching: the tracks hold the point where safety is computed, and the safety value in that point. When safety is needed in a different point, the method track.GetSafety(new_point) will subtract from the cached value and return the positive remainder or zero otherwise. The GetSafety method can take an accurate limit value, and when the remainder is smaller than this limit the returned safety is zero. It is the user responsibility to call track.SetSafety(pos, safety) whenever the safety is fully recomputed in a new position.

2. Safety calculation usses a new surface model feature to only compute safety accurately when close to boundaries, and only use the aligned bounding box safety when far away. The distance limit is passed as third parameter to AdePTNavigator::ComputeSafety, and must be typically equal to the discrete interaction step.
In this mode the electrons will still do the full physics, but secondaries are supressed. Useful in particular for debugging safety for a single track.
@agheata agheata marked this pull request as ready for review December 20, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants