The existing reconstruction algorithm included in the NA62 software did not take into account that:
\begin{itemize}
	\item the vessel of the RICH detector is rotated with respect to the beam line, in order to minimize the possibility that beam particles spill into the detection volume (see \chaptername~\ref{sect:rich}). The rotation angle is tuned on the magnetic kicks due to the GTK and STRAW dipoles.
	\item the two mirrors reflecting photons onto the focal plane are tilted at different angles relative to the vessel axis. This asymmetry is meant to spread light onto the central regions of the photomultipliers flanges.
\end{itemize}

\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{Images/pdf/L0algo/correzioneMirrorsPhi}
\caption{Sketch representing the effects of the tilt of the RICH mirrors.}\label{img:tilt-specchi}
\end{figure}

\figurename~\ref{img:tilt-specchi} illustrates the rotation of the mirrors. The tilts applied to the two mirrors are different, hence I corrected this effect on a hit-by-hit basis. On the contrary, I fixed the global vessel rotation  through a single operation on the position of the centre of the \v{C}erenkov ring, that is the only parameter affected.\\

The 1952 PMTs are placed on the RICH flanges so that the first 976 are on the left-side frame, and the others on the right-side frame. % (in the NA62 jargon, the two sides are referred to as \textit{Jura} and \textit{Sal\`{e}ve} respectively, after the two mountains overlooking the Geneva area).\\
Let $\varphi$ and $\varphi'$ be the Sal\`{e}ve and Jura mirrors angles to the vessel axis, respectively. Hit by hit,
% we check which one of the spots was hit. We then shift the $x$ coordinate of the hit by a quantity $\varphi R$ or $\varphi' R$:
I shift the $x$ coordinate of the hit by a quantity $\varphi R$ or $\varphi' R$ depending on which spot is illuminated:
\begin{align}
&x \equiv \left\lbrace\begin{array}{lcc}
x - 2 f \varphi & & 0 \leq \mbox{Channel ID} < 976\\
x - 2 f \varphi' & & 976 \leq \mbox{Channel ID} < 1052\\
\end{array}\right.\label{eqn:correct-tilt}
\end{align}
where $f = R/2$ is the focal lenght of the device, R being the curvature radius of the mirrors.\\

%Let us now see how to account for the global rotation of the vessel, represented in \figurename~\ref{img:tilt-vessel}.\\
%
\begin{figure}
\centering
\subfigure[]{\includegraphics[width=0.48\textwidth]{Images/pdf/L0algo/correzioneRich}}
\subfigure[]{\includegraphics[width=0.48\textwidth]{Images/pdf/L0algo/correzioneRich2}}
\caption{Sketch representing the effects of the rotation of the RICH vessel.}\label{img:tilt-vessel}
\end{figure}

Let us now see how to account for the global rotation of the vessel, represented in \figurename~\ref{img:tilt-vessel}. I treated this by shifting the centre of the reconstructed \v{C}erenkov ring along the $x-$axis by an adequate quantity. Let $\vec{C} = (x,y)$ be the centre $\vec{C}$ of the ring, $\theta_x$ be the direction of the particle projected onto the $x-$axis of the laboratory frame, and $\theta_x' \equiv \theta_x - \theta_{\rm rich}$ the $x$ component of the direction of the particle in the RICH frame. The following relation holds:
%$\frac{x}{f}$ is the tangent of the angle \textbf{with respect to the RICH axis} $\theta_x' \equiv \theta_x - \theta_{rich}$.
\begin{align}
&\tan \theta_x' = \frac{x}{f}
\end{align}
%Let 
%L'angolo della particella rispetto all'asse del s.d.r del laboratorio (e del MC) è $\theta_x$.
Therefore we can expand $\theta_x$ as:
\begin{align}
&\theta_x = \theta_x' + \theta_{rich} = \arctan\frac{x}{f} + \theta_{\rm rich}\\
&\tan \theta_x \equiv \frac{x'}{f} \Longrightarrow x' = f \tan \left( \arctan \frac{x}{f} + \theta_{\rm rich} \right)\label{eqn:center-shift}
\end{align}

The resulting $x'$ is the coordinate where the centre of the ring should be moved to account for the vessel rotation.
% This way, the vessel rotation is resolved. 
The $y$ coordinate remains unchanged.\\

These two simple geometrical corrections allow the achievement of an angular resolution of the order of $\sigma\left(\theta_x\right) \leq 450$ \si{\micro\radian}. \figurename~\ref{img:theta_x_resolution} shows the reconstruction accuracy achieved for simulated $K^+ \rightarrow \pi^+ \pi^0$ events, computed using 4 different subsets of data:
\begin{itemize}
\item events with hits on one spot only (Jura or Sal\`{e}ve),
\item events with rings spread across the two spots,
\item the complete set of events.
\end{itemize}

\begin{figure}
\centering
\subfigure{ \includegraphics[width=0.47\textwidth]{Images/pdf/L0algo/angoli/saleve} }
\subfigure{ \includegraphics[width=0.47\textwidth]{Images/pdf/L0algo/angoli/jura} }\\
\subfigure{ \includegraphics[width=0.47\textwidth]{Images/pdf/L0algo/angoli/both} }
\subfigure{ \includegraphics[width=0.47\textwidth]{Images/pdf/L0algo/angoli/all} }
\caption{Resolution achieved on the $x$ component of the direction of pions from $K^+ \rightarrow \pi^+ \pi^0$ crossing the RICH detector.}\label{img:theta_x_resolution}
\end{figure}