Issue with TrackStateProvider cache when refitting tracks
When a track is refitted, the TrackStateProvider cache should be invalidated. This is currently not happening, and leads to problems in the alignment monitoring when aligning with tracks taken from the DST.
It turns out that the problem is exposed when TrackParticleRefitter is called on two candidates in an event that share a track. TrackParticleRefitter fits the track, and then accesses the states via TrackStateProvider. TrackStateProvider builds a trajectory that contains pointers to states on track. The track refit, invalidates these states and makes them again. Consequently, the cache is pointing to non-existing states.
Edited by Wouter Hulsbergen