Open amereghe opened 4 years ago
from @rdemaria
Very large angles are caused by a particle entering in a nonlinear element with a large orbit. This is the mechanism of particles loss. We have an aperture check that somehow limits the orbit and therefore the kick to avoid overflows. The exact drift is suffering because being more physical it is does not accept nonphysical coordinates. A solution is to run using a tighter aperture check or rather add an angle check in the exact drift. I think the latter is the correct solution, it should not be expensive because it is enough to loose the particle when
c1e6 - (yv1(j)**2 + yv2(j)**2)
is negative which needs to be computed anyway.What do you think?
to be noted that, in principle, using an aperture more realistic than just 1m everywhere should automatically solve the issue. Nevertheless, I prefer the code to error in these case, but it is true that, if an sensible aperture profile is provided, these particles are lost on the aperture at a suitable moment.
from @vkbo