The positions of the nearly twenty-thousands silicon sensors of the CMS central tracking system must be determined with a precision better than their intrinsic resolution in order to provide an optimal reconstruction of charged particle trajectories. The procedure, referred as the alignment, includes also the adjustment of the orientations and the determination of the deviation from flatness of the sensor surfaces.
Data-driven methods used to carefully align the detector and validate the alignment will be presented with CMS Run-2 data, collected from 2016 to 2018. Systematic distortions such as weak modes are discussed, as well as the impact of the variation of the conditions during data taking over time, in particular effects related to the radiation damage.
Finally, we illustrate the impact on physics of the recent developments included in the legacy reprocessing, which was performed with the aim to greatly improve the physics potential for precision measurements, such as the reconstruction of the invariant mass spectrum of the dilepton systems.