The measurement of the asymmetry in detecting neutral kaons, $K^0$ and $\overline{K}^0$, produced in charm hadron decays and propagating through detector material is crucial for the search for CP violation in the charm sector. This asymmetry is precisely modeled and measured in the $D^+ \to K_S^0[\to \pi^+\pi^-] \pi^+$ and $D^+ \to \phi[\to K^+K^-] \pi^+$ decay channels. The analysis is based on data collected with the LHCb experiment during Run 2 (2016–2018), corresponding to an integrated luminosity of 5.4 fb$^{-1}$ of \proton\proton collisions at a center-of-mass energy of 13 Tev.
For the first time, the model describing the time-dependent neutral kaon detection asymmetry, \(A_D(K_S^0,t_{K_S^0})\), incorporates an additional source of CP violation arising from the interference between the Cabibbo-favored (CF) and doubly Cabibbo-suppressed (DCS) amplitudes in the $D^+ \to K_S^0 \pi^+$ decay. These interference effects are parameterized by the modulus of the ratio and the relative strong phase of the DCS to CF amplitudes, \(r_\pi\) and \(\delta_\pi\), which are directly measured from data for the first time via a fit to the time dependence of \(A_D(K_S^0,t_{K_S^0})\).
As an application of this study, the CP asymmetry in the $D^+ \to \phi \pi^+$ channel is measured using the full Run 2 data sample, with the $D^+ \to K_S^0 \pi^+$ decay serving as a calibration mode.

