\begin{figure}[t]
\centering
\includegraphics[width=\textwidth]{Images/pdf/gpu_algo/c1a_algo}
\caption{Kernel execution time per single-ring event (20 hits) as a function of the number of events processed in one batch on a NVIDIA Tesla C1060 GPU \cite{Collazuol201249}.}\label{img:gianluca}
\end{figure}

For the ring fitting stage, several single-ring fitting algorithms were previously examined in \cite{Collazuol201249}. Five non-iterative procedures were implemented and tested using Montecarlo generated data with rings of variable position, radius and number of hits.\\

Two of the tested algorithms, nicknamed ``POMH'' (Problem-Optimized Multi-Histograms) and ``DOMH'' (Device-Optimized Multi-Histograms), employed parallelization at the algorithm level only, with approximately 1000 GPU cores being used concurrently to process a single event.\\

Another tested algorithm (``HOUGH'') was based on a series of Hough Transforms\footnote{The Hough Transform is a pattern extraction technique aimed at finding instances of objects of a certain shape in a noisy environment, by means of a voting procedure.} and reduced the problem to that of finding intersections between circles centred on each hit photomultiplier.\\

A geometrical approach was examined with the ``TRIPL'' algorithm, for which the centre is determined by the intersection of the mid-points axes of pairs of segments defined by randomly chosen triplets of hits. In order to achieve a good resolution and to gain robustness against the noise, several triplets had to be used for each event, averaging the results.\\

Finally, a simple approach was tested, which used a least square method to identify the best circle parameters (``MATH''). In this case, parallelization was exploited only by processing several events at the same time.\\

The best results in terms of fit accuracy and execution time per event, shown in \figurename~\ref{img:gianluca}, were obtained with this last algorithm, suggesting that simple geometrical or algebraic approaches are most advisable in a context where reliability of results is a key issue.\\%to the success of the experiment.\\

For the above reason, I examined a number of algebraic ring fitting methods, mostly described in \cite{chernov}, in order to select the best one in terms of robustness and execution time. A procedure devised by Gabriel Taubin in 1991 \cite{journals/pami/Taubin91} turns out to be the most computationally safe algorithm, being also quite robust with respect to noise that could affect the estimation of the radius, which ``MATH'' is not. A mathematical description of the ``MATH'' and Taubin algorithms is available in Appendix~\ref{app:fits}.\\

I implemented both procedures in a simple test framework and measured their execution times, in order to check if the Taubin algorithm could be used in our kernel in place of MATH. The two kernels were executed on a Nvidia Tesla K20 GPU with an increasing number of single-ring events per execution batch. The result, shown in \figurename~\ref{img:cfr-taub-math}, highlights the negligible time difference between the two. As a consequence, we could safely decide to adopt the Taubin algorithm to perform the single-ring fitting part of our program.

\begin{figure}
\centering
\includegraphics[width=\textwidth]{Images/pdf/gpu_algo/math-taubin-pmXthread8-noG}
\caption{Execution times of the \textit{MATH} and \textit{Taubin} kernels as a function of the number of events processed in one batch on a NVIDIA Tesla K20c GPU.}\label{img:cfr-taub-math}
\end{figure}