ALPHA-g-Experiment / alpha-g

MIT License
1 stars 1 forks source link

Bug in track fitting when initial `h` parameter of the helix is `0.0` #93

Closed DJDuque closed 1 year ago

DJDuque commented 1 year ago

The h = 0.0 makes everything blow up in the closes_t calculation.

I first though that an initial guess of exactly 0.0 was extremely unlikely, but now that I think about it, I currently just assign spacepoints a z value of a pad center (which is discrete). So it is fairly easy that 2 spacepoints have exactly the same z value.

To fix this:

  1. Deal with the case h = 0.0 in Helix::closest_t.
  2. Deal with an initial parameter equal to exactly 0.0 in exactly the same way as scipy does it (they have a fixed variation rather than the 5% which wouldn't have an effect.