## 3 Methods
### Clustering Formulation  
The following step of the reconstruction process is proper clustering, which indeed was already formulated as a cellular automaton in the classical implementation. In this case, the algorithm needs to identify the cells that belong to a cluster and the overlap cases where a cell can belong to more than one cluster over the rest. Where the rest of the cells can only be a local maximum already identified by the first reconstruction step or an energy  
\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Region** & \begin{tabular}{c} **Image** \\ **Shape** \\ \end{tabular} & \begin{tabular}{c} **Training** \\ **Samples** \\ \end{tabular} & \begin{tabular}{c} **Neurons** \\ **Per Layer** \\ \end{tabular} & \
\begin{tabular}{c} **Parameters** \\ **Time** \\ \end{tabular} &
\begin{tabular}{c} **Training** \\ **Accuracy** \\ \end{tabular} \\ \hline Outer & \(64\times 52\) & 10,000 & [20, 20, 20, 10, 2] & 1272 & 1354.7 s & 99.96\% \\ Middle & \(64\times 40\) & 10,000 & [20, 20, 20, 10, 2] & 1272 & 1052.3 s & 99.92\% \\ Inner & \(48\times 36\) & 10,000 & [10, 10, 10, 2] & 342 & 461.8 s & 99.93\% \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameter summary of the local maxima finder neural networks.  
Figure 2: Samples of the data used for the training and testing of the local maxima finder network for the inner region of the LHCb calorimeter. The training input sample (**a**) is artificially generated and the output sample for training (**b**) is obtained applying the CA rules on the (**a**) sample. The testing input sample (**c**) is an LHCb simulation and the testing output sample (**d**) again generated applying the CA rules on sample (**c**) and represent the expected output from the network. Then image (**e**) is the real output obtained from the network trained to reproduce the CA when sample (**c**) is on the input, and is compared to sample (**d**) to obtain the accuracy value.  
deposit located too far from a local maximum to be taken into account. We can formulate the mentioned CA characteristics as follows:  
* States: three. Since we need to identify three types of cells: cells that belong to one cluster (1), overlapping cells (\(-1\)), and the rest of them (0).
* Neighborhood: eight cells. In order to differentiate cells as overlapping or belonging to a cluster from the others, the neighborhood at one cell distance needs to be checked.
* Ruleset function: in order to identify the cell states, the algorithm needs to check how many local maxima are in the neighborhood of a cell. Cells that belong to a certain cluster are those that have a single local maximum in its neighborhood of distance one. In the same way, overlap cases are identified when there is more than one local maximum in its neighborhood. If there are no local maxima in a cell neighborhood then it is either a local maximum itself or not relevant for the clustering. This is formulated in Equation (2), where \(K\) is defined as the number of local maxima in the neighborhood of a cell. \[c_{i,j}^{i+1}=\begin{cases}1,&\text{if }K==1\\ -1,&\text{if }K>1\\ 0,&\text{otherwise.}\end{cases}\] (2)  
At the time of designing the formulation of the third step of the reconstruction, we realized that the information provided by this second step was redundant. Since, in order to solve the overlap cases, the number of local maxima also need to be calculated and cannot be transmitted to the third step, we propose formulating the clustering and the overlap solver as a single step in this approach.