Rework GlobalChi2Fitter internal track representation and conversion
The GlobalChi2Fitter
keeps an internal representation of tracks and track states, which is later converted to more standard formats like Trk::Track
and Trk::TrackStateOnSurface
. This commit modifies this internal representation to make the conversion to Trk::Track
more natural and to allow us to operate on tracks with perigee parameters in the internal representation. Specifically, the following two changes are made:
- Use
TrackStateOnSurface::TrackStateOnSurfaceType
instead ofTrackState::TrackStateType
. The main problem is thatTrackState::TrackStateType
does not allow us to represent perigee states (see next point). As a minor additional point, the track state is converted to the TSOS type anyway at track creation time, so there is no good reason to have the internal representation storeTrackState::TrackStateType
instead ofTrackStateOnSurface::TrackStateOnSurfaceType
. - Store the perigee state in the internal representation. Currently, we don't do this, and we first convert the
GXFTrackState
objects toTrackStateOnSurfaces
, then we create a perigeeTrackStateOnSurfaces
and insert it into the existing list. With this change, we add the perigee to the internal track representation, and convert it toTrackStateOnSurfaces
like any other state. This is a lot clearer, but it also allows us to operate on the entire track in the internal representation including the perigee state.