Conversation
sudojan
reviewed
Oct 8, 2025
| // reached geometry border | ||
| advancement_type = ReachedBorder; | ||
| distance = distance_to_border; | ||
| distance += GEOMETRY_PRECISION; // avoid particles getting stuck in front of border |
Contributor
There was a problem hiding this comment.
In this way, the GEOMETRY_PRECISION will always be added to the distance, when the border is reached. Is this necessary to always make this adaption. Or would it be better to just adapt the distance, if the mentioned issue arise?
Member
Author
There was a problem hiding this comment.
I am not sure whether there is an easy way to see that the issue arises.
Since this problem only occurred for large propagation steps (see my description), one could only add this GEOMETRY_PRECISION in case the propagation step (i.e., 'distance'), is large? But then one would have to decide for some (arbitrary) value for that
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.
Testing #338, I encountered (another) bug in the Propagator which can cause it to stuck.
The problem is the following situation: We do a large propagation step (in this case: 5000 km (!) in air) towards a border.
Since the step is very big, our particle is not exactly on the sector border in this step (remember that PROPOSAL saves distances in cm), but just slightly before the detector (~ 1e-7 cm). Since we have already propagated very far, we can't properly distinguish between the position before and after the sector border - Adding this remaining distance to the particle position doesn't actually change the particle position anymore.
Apparently, this is working again when we add a very small extra distance to our propagation step (GEOMETRY_PRECISION, 1e-9) so that we are always behind the sector border after a propagation step.
I have added a UnitTest, which got stuck within the first 5 particles without the bugfix, but runs through now.
I don't think that this should break other stuff, since the particle position resolution (which is relevant for other, non-geometric calculations) is much higher (1e-4cm)