Track fitting is an everyday repetitive task in the high energy physics detector reconstruction chains. The precision and stability of the fitter depend on the available computing resources. A fit might cost up to half of the CPU time, that is spent on reconstruction. Kalman filters are a widespread solution for the track fitting. A classical Kalman filter is a powerful tool, that is applicable to the linear problems with Gaussian-like errors. However, in reality one has to deal with non-linear problems and sometimes with non-Gaussian errors. The numerical overheat results in instabilities and slows down the convergence. Physics and reparametrisation can help to improve the fit performance. Starting from the simple Kalman filter, we build up a more realistic Kalman filter, discussing practical tricks and possible issues of implementation. We then talk about implementation differences if using CPU or GPU.
In these two lectures, we start from the points on planes and follow the entire track-fitting chain up to the high-level particle parameters. We discuss the connection between the geometry of the detector and the track model, as well as, the track-fitting chain. We also discuss physics-driven optimization of the algorithms based on the effect of the changes on the high-level parameters.
In the end, we discuss possible implementations of track fitting on CPU and GPU, highlighting the importance of a trade-off between speed and precision.