-
Notifications
You must be signed in to change notification settings - Fork 21
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
Propagation can stall at border transitions #332
Comments
I do not completely get the problem. When the difference between the proposed distance and the distance to the sector border is smaller than the particle resolution, then the distance to propagate is set to the distance to the border, as implemented here: |
Nevertheless, I think it is a good idea to introduce a limit on the number of iterations, which the user can adapt. |
The values for the proposed distance and the distance to the sector border are |
I tried to debug the problem a bit more: For the example here, the particle makes a propagation step of over 10 km. For this step, we calculate the intersection with a huge sphere. In the algorithm, this intersection is calculated for two very similar direction vectors ( I believe that this calculation is just not precise enough (numerical cancellation due to multiplication with large numbers maybe?). If I calculate the interaction points for these two different directions, I receive
and if I numerically calculate the distance of these two interactions points to our sphere, the results are numerically identical. Therefore I guess that the propagation stalls because calculating the intersection points over a 10km step with two directions that vary only by ~1e-6° just numerically can't provide the accuracy that we require in the algorithm (1e-3 cm). As soon as a user choses to propagate particle with large propagation steps, high energies, multiple scattering enabled and border transitions, this problem is very likely to come up. Therefore, something better than a quick fix might be necessary. Maybe we should introduce something like a "relative accuracy", in addition to the current "absolute accuracy" (1e-3 cm) in the algorithm. So something like a combination using |
a relative accuracy parameter, next to the absolute |
I propagate this muon
with the following config file:
click to show config file
This propagation immediately stalls and does not finish.
The reason for this appears to be the
AdvanceParticle
method, where the algorithm tries to find a combination of energy and distance in such a way that the particle hits a sector border. If the difference between the proposed step distance and the actual distance to the sector border is smaller thanPARTICLE_POSITION_RESOLUTION
(1e-3 cm), we accept this step.In this case however, the algorithm gets stuck with a step where the difference is ~0.0044cm.
This is related to issue #267.
As a quick solution, one might want to limit the maximum number of iterations for the
AdvanceParticle
method. However, it is not entirely clear what do if we hit this iteration limit. Discard the random numbers? Raise an error? Just accept the current step (which, in the case of this example, would be the preferred solution).The text was updated successfully, but these errors were encountered: