## 3 Methods
### Clustering and Overlap Formulation
Obtained from the output of the local maxima finder network. With values from 0 to 1. - Central cluster information. Obtained from the masking of the central cell on each \(7\times 7\) window from the image. With values from 0 to 1. At this point, the ruleset function for this step defines the fractioning of a cell's energy in case of overlap in Equation (3). In the same equation, _num_clusters_ refers to the number of local maxima that could be causing overlap. As an example, if we look at the purple circle in Figure 3 to account for _num_clusters_, the positions marked with a purple X should be checked. Figure 3: Diagram representing the possible cluster centre positions overlapping with the central cluster in a \(7\times 7\) window. The maxima positions are marked with crosses and the two overlap cells that need to be predicted are marked with a circle. \[c_{i,j}^{t+1}= \begin{cases}\frac{c_{i,j}^{t}C_{0}}{\sum_{k=0}^{k}C_{k}},&\text{ for }K=num\_clusters\text{ if }K>1\\ c_{i,j}^{t},&\text{ otherwise,}\end{cases}  \tag{3}\]  
where  
\[C_{k}=\sum_{m=-1}^{1}\sum_{n=-1}^{1}c_{o+m,p+n}^{t} \tag{4}\]  
and variables \(o\) and \(p\) stand for the local maxima coordinates of cluster \(k\) in the \(5\times 5\) image. For \(k=0\) the cluster is specifically the marked as central cluster, the one in the center of the \(7\times 7\) window. Before starting with the network training, there is a key aspect on the ruleset function that affects the learning capacity of a convolutional network, like the ones used on the first step. It can be seen that, for the second condition, there is a division that transforms the function into a non-linear behavior. Following the universal approximation theorem [18], there needs to be at least one hidden layer to approximate non-linear functions. However, the previous used convolutional architectures had in fact two and three hidden layers, yet the convolutional layer itself does not have a hidden layer structure on the convolution operation. The convolution is performed through the multiplication between the data and a linear kernel of parametric values; hence, there is no chance for this convolution to be able to learn the desired non-linear behavior before losing the neighborhood information on the dense layers. Therefore, the strategy for the network architecture is to use a multilayer perceptron (MLP) structure and train it to be the kernel of the convolution. Following this strategy, one MLP network is enough for the three regions, since the sampling into \(5\times 5\) windows normalizes the input beyond the different region granularity. In this case, the network architecture consists of four dense layers and the output layer is a single neuron representing the predicted value of the central input cell. Hence, the network will be trained as a regressor. The output values need to be aggregated in groups of nine concerning the predicted values from a cluster at all cells of the calorimeter. As an example of the data used for the training of this network, see Figure 4.  
Regarding the training dataset generation, the same numerical value independence from the first formulation is observed in this ruleset function. However, in this case, the conditions of the function are not so simple to achieve in a homogeneous scenario using randomly generated samples. At this point, we decided to take a set of only 2000 samples of LHCb simulation data and take a selected subset of approximately 30,000 windows of \(7\times 7\) centered on a cluster. The selection has taken into account the balancing of the dataset between six different cases specified in Table 2. Case 6 was included to enhance the training of the fraction operation when clusters have a big energy difference between them because on these cases big clusters tend to mask completely smaller clusters on its surroundings. Since case 5 has the lowest number of samples, we chose to increase its samples rotating each window by \(90^{\circ}\), \(180^{\circ}\) and \(270^{\circ}\), reaching more than 5000 different samples for that case.