The algorithm developed for this thesis focusses on the suppression of residual $K^+ \rightarrow \pi^+ \pi^0$ background after the standard hardware L0 selection. However, the results shown in the preceding sections suggest that such an approach could allow to drop the hit multiplicity requirement from the standard hardware L0 trigger.\\

A GPU trigger might therefore be optimized to this end, and it should be investigated whether it could be used to suppress both the $\pi^+\pi^0$ and the $3\pi$ backgrounds to the levels currently achieved by the standard trigger (\tablename~\ref{tab:bg_rej_mc}).\\

In particular, a more thorough Montecarlo study should support the design of a $\pi^+\pi^+\pi^-$ rejection trigger. If the average ring multiplicity proves to be sensibly higher than 2 for an important fraction of events, the idea of creating more triplets should be considered. For example, after the definition of the initial \texttt{XMAX}, \texttt{XMIN}, \texttt{YMAX} and \texttt{YMIN} triplets, one could rotate the PMTs frame by 45\degree, and define 4 new triplets as before.\\

A dedicated Montecarlo simulation should be prepared in order to test the ring identification efficiency in 3-ring and 4-ring events.\\

The time performance of the trigger might be further improved in many ways. As a starting point, the framework should be tested with a continuous stream of data (if the TEL62 boards could not be used for this purpose, with controllable simulated data, a very large batch of data could be looped between two Ethernet interfaces of the same PC). In this way one could optimise the maximum number of events processed per batch (\texttt{MAXEVENTS}), that was set to 256 in order not to increase the actual largest latency of the process, i.e. the time elapsed while the host accumulates the data to process on the GPU, that scales almost linearly with the number of events \cite{gtcfelice,epshep-gianluca}.\\

Moreover, alternative designs might be taken into consideration. In the present implementation of the algorithm, during the single-ring fit routine only one thread executes the operations issued, except for the reduction of the arrays. In particular, the \texttt{Taubin} function, listed in Appendix~\ref{app:taub-code}, exploits a Newton method to find the roots of the characteristic polynomial from which the best ring parameters are later extracted. This part of the fitting routine cannot be parallelized, and it might be moved to the host.\\

Another solution was proposed by G. Lamanna: we could exploit workload parallelization only at the event level, dropping the organization in blocks and allocating a thread for each event. This way the code would be serialized, and therefore easier to maintain; however, the number of events processed per batch would be much larger, and tests should be done to verify if the whole process -- accumulation of data plus execution of the trigger process -- exhibits a latency low enough to be used as real-time trigger.\\

From the point of view of the selections that could be performed at the first trigger levels, additional background rejection could be obtained at L1 by relating the information from the RICH to that of another detector able to measure the position of the crossing track, like the CHOD. \figurename~\ref{img:pipi0-l1} shows that most of the residual $\pi^+\pi^0$ content after the L0 selection is characterised by a production vertex very close to the RICH detector, out of the fiducial $z_{vtx}$ region allowed for the signal analysis \cite{gianluca-l1}. The angle information from the RICH and the track impact point on the CHOD could be combined to propagate the track backwards until it crosses the beam axis. This way, even with a relatively poor longitudinal vertex resolution of $\sim$10~\si{\meter}, up to 80\% of the residual $\pi^+\pi^0$ events could be rejected.

\begin{figure}
\centering
\subfigure{\includegraphics[width=0.5\textwidth, trim = 0cm -1.25cm 0cm 0cm]{Images/pdf/gpu_algo/vtx_reco_rich_chod}}
\hfill
\subfigure{\includegraphics[width=0.48\textwidth]{Images/pdf/gpu_algo/zvtx_after_l0}}
\caption{Using RICH and CHOD at the L1 trigger level, it would be possible to reduce the rate of $\pi^+ \pi^0$ down to approximately 20\%, even with a limited resolution on the reconstruction of the decay vertex. Plot from \cite{gianluca-l1}.}\label{img:pipi0-l1}
\end{figure}