Through the assessment of the parameters of the \v{C}erenkov ring, we can now compute the components of the direction of the particle crossing the RICH:
\begin{align}
&\theta_x = \arctan \left(x/f\right)\label{eqn:theta-x}\\
&\theta_y = \arctan \left(y/f\right)\label{eqn:theta-y}
\end{align}
where $x$ and $y$ are the coordinates of the ring centre, already corrected for the RICH geometry as explained in Section~\ref{app:geometry}.\\

In order to trace the decay angle $\theta_{K\pi}$ back, we must propagate the detected track backwards to the decay vertex. This implies reverting the magnetic kick due to the dipole of the downstream spectrometer. If we assume that the particle is a pion, we can compute the kick given to it through the approximate formula
\begin{align}
&\theta_{\rm kick} = \frac{P_{\rm kick}}{P_{\pi}(\beta)} \label{eqn:theta-kick}
\end{align}
valid for small deflections ($|P_{\rm kick} / P_{\pi}| \approx 10^{-2}$ in the fiducial momentum region), where $P_{\pi}(\beta) = \beta m_{\pi} / \sqrt{1-\beta^2}$. Notice that we are using the value of $\beta$ computed from the radius of the detected \v{C}erenkov ring (see \chaptername~\ref{sect:rich}), introducing therefore an experimental uncertainty.\\

A sketch representing the original direction of the charged particle and its direction after the spectrometer magnet is shown in \figurename~\ref{img:propagate-mnp33}. Once $\theta_{\rm kick}$ is computed, we may trace the original direction $\theta_{x,{\rm orig}}$ back by subtracting $\theta_{\rm kick}$ from the direction $\theta_x$ at the RICH:
\begin{align}
&\theta_x = \theta_{x,{\rm orig}} + \theta_{\rm kick}
\end{align}

Like those described in the previous section, the corrections shown here only modify the $x$ component of the direction of the particle.\\

%\textbf{Measure $\theta_x$}. Assume particle is a $\pi^+$ to trace back its original direction $\theta_{x,{\rm orig}}$.%Assumo che la particella sia un pione, per risalire alla sua direzione originale.
%\begin{align}
%&\theta_x = \theta_{x,{\rm orig}} + \theta_{\rm kick} = \arctan \frac{x'}{f} \Longrightarrow \theta_{x,{\rm orig}} = \arctan \frac{x'}{f} - \frac{P_{\rm kick}}{P}\\
%&\tan \theta_{x,{\rm orig}} \equiv \frac{x''}{f} \Longrightarrow x'' = f \tan \left( \frac{P_{\rm kick}}{P} + \arctan \frac{x'}{f} \right)
%\end{align}
\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{Images/pdf/L0algo/correzioneMnp33}
\caption{Sketch showing the effect of the spectrometer magnet on the direction of charged particles.}\label{img:propagate-mnp33}
\end{figure}

Let us now assert the physical meaning of the angle we have just found. Downstream of the Gigatracker, the beam spectrometer described in \chaptername~\ref{ch:exp-setup}, the emerging $K^+$ beam is bent at an angle $\theta_K$ on the $x$--$z$ plane. The angle $\theta_{x,{\rm orig}}$ we have just computed does not represent the decay angle, i.e. the angle between the decaying beam kaon and its charged daughter. All the directions defined so far are relative to the $z-$axis of the laboratory frame, that coincides with the direction of the beam upstream of the Gigatracker. The relationship between the computed angle and the $x$ component of the true decay angle $\theta_{K\pi}$ is shown in \figurename~\ref{img:propagate-trim5}, where I used the following labels:
% original $K-\pi$ decay angle along the $x$ direction is shown in \figurename~\ref{img:propagate-trim5}, where the directions are named as follows:
\begin{itemize}
\item ${\theta_x}_\pi$ is the $x$ component of the decay angle, i.e. of the angle measured in the laboratory frame between the kaon and pion tracks;
% relevant decay angle, measured between the decaying and the emerging charged track;
\item $\theta_x$ is the angle measured between the direction of the detected particle and the $z-$axis of the laboratory frame ($\theta_{x,{\rm orig}}$ in the above formulas);
\item $\theta_K$ is the direction of the beam, after being bent by the GTK magnet, relative to the laboratory frame.
\end{itemize}

Reverting to the notation I have used so far, we observe that the original decay angle $\theta_{K\pi}$ can be obtained with the following formula:
\begin{align}
&{\theta_x}_{(K\pi)} = \theta_{x,{\rm orig}} - \theta_{\rm kick} - \theta_K\label{eqn:theta-x-final}
\end{align}
where $\theta_{x,{\rm orig}}$ was defined in Eqn.~\ref{eqn:theta-x}, $\theta_{\rm kick}$ is computed as in Eqn.~\ref{eqn:theta-kick}, and $\theta_K$ was defined above.\\
%We measure $\theta_x$, but we want to trace back the \textbf{original decay angle} $\theta_{x,\pi}$.
%%Il fascio di $K^+$ a valle del GTK ha un angolo $\theta_K$ sul piano $x-z$. Noi misuriamo $\theta_x$, ma vogliamo risalire al \textbf{vero angolo di decadimento $\theta_{x,\pi}$}.
%\begin{align}
%&\theta_x = \theta_{x,\pi} + \theta_K\\
%&\tan \theta_x = \frac{x''}{f}\\
%&\theta_{x,\pi} = \arctan \frac{x''}{f} - \theta_K\\
%&\tan \theta_{x,\pi} \equiv \frac{x'''}{f} \Longrightarrow x''' = f \tan \left( \arctan\frac{x''}{f} - \theta_K \right)
%\end{align}

\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{Images/pdf/L0algo/correzioneTrim5}
\caption{Sketch representing the decay angle $\theta_{K\pi}$ in the laboratory frame and in the rest frame of the decaying kaon.}\label{img:propagate-trim5}
\end{figure}

%Next slide shows $M_{\rm miss}^2$ computed with zero, one, two and all three corrections respectively.
%
%\begin{figure}
%\centering
%\subfigure{ \includegraphics[width=0.45\textwidth]{Images/pdf/L0algo/2-mm-Corr-0} }
%\subfigure{ \includegraphics[width=0.45\textwidth]{Images/pdf/L0algo/2-mm-Corr-1} }\\
%\subfigure{ \includegraphics[width=0.45\textwidth]{Images/pdf/L0algo/2-mm-Corr-2} }
%\subfigure{ \includegraphics[width=0.45\textwidth]{Images/pdf/L0algo/2-mm-Corr-3} }
%\end{figure}
%
%	Reconstruction issue: RICH mirror reflects photons to two different spots, which mess up during the analysis.
%$\longrightarrow$ divide data in two subsets ($x'''>0$ and $x'''<0$): first subset data reasonably matches expectations ($m_{\pi^0}^2 = 0.01822$~GeV$^2$).
%		\begin{figure}
%				\centering
%				\includegraphics[width=0.7\textwidth]{Images/pdf/L0algo/3-mm-Corr-3}
%		\end{figure}
%%Il primo set è in ragionevole accordo con la massa mancante attesa ($m_{\pi^0}^2 = 0.01822$~GeV$^2$).
%