Fix rare sorting issue in output states in PrKalman
Following #275 (closed), sometimes firstState()
of the track is found to be at z>4m
. In rare cases, when the track is parallel to the beamline, it might happen that ClosestToBeam
state is far away and therefore is not the same as firstState()
.
In this MR I make sure that CTB state is always present for relevant track types and is sorted inside the vector of states.
Edited by Andrii Usachov