Skip to content

Avoid stuck particles#341

Open
Jean1995 wants to merge 2 commits intomasterfrom
avoid_stuck_particles
Open

Avoid stuck particles#341
Jean1995 wants to merge 2 commits intomasterfrom
avoid_stuck_particles

Conversation

@Jean1995
Copy link
Copy Markdown
Member

@Jean1995 Jean1995 commented Jan 20, 2023

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)

@Jean1995 Jean1995 added the bug label Jan 20, 2023
// reached geometry border
advancement_type = ReachedBorder;
distance = distance_to_border;
distance += GEOMETRY_PRECISION; // avoid particles getting stuck in front of border
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants