## 2 Materials and Methods
### The STEAM Protocol
#### 2.3.1 STEAM vs. SAMs  
As evident by the acronym, STEAM is inspired by SAM [43]. As mappers, the protocol processes X-ray spectra as \(N\)-dimensional vectors, where \(N\) is the number of acquisition channels of the spectrometer and assesses the similarity between a specific spectrum, \(\rho_{\text{K}}\), and the \(\rho^{\prime}_{(\text{ij})}\) spectra belonging to the mapped region(s) by calculating the angle \(\alpha_{(i,j)_{k}}\) between the spectra, that, accordingly to Equation (2), is:  
\[\alpha_{(i,j)_{k}}=arccos\left(\frac{\sum_{l=1}^{N}\rho_{\text{k}}\rho^{\prime }_{(i,j)_{l}}}{L_{\rho_{\text{k}}}L_{\rho^{\prime}_{(i,j)}}}\right) \tag{3}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline Right Angels & Right Angels & Right Angels & Right Angels & \\ Green dress (1) & Blue dress (2) & Face of the green & Hair of the green & Halo of the \\ dressed (3) & dressed (4) & green dressed (5) & green dressed (5) \\ \hline Right Angels & Right Angels & Right Angels & Left Angels & Left Angels \\ Sleeve of the & Red dress (7) & Hair of the blue & Green dress (9) & Blue dress (10) \\ \hline Left Angels & Left Angels & Left Angels & & Book \\ Sleeve of the & Red dress (12) & Face of the red & Black Ink (14) & White of the \\ bleu dressed (11) & & dressed (13) & & pages (15) \\ \hline Book & God the Father & God the Father & God the Father & God the Father \\ Red ink (16) & Yellow dress (17) & Blue hat I (18) & Blue hat II (19) & Pupil (20) \\ \hline God the father & God the Father & God the Father & & \\ Iris (21) & Sclera (22) & Face (23) & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Points of the gable of San Diego where the punctual XRF spectra have been collected. The numbers between the parentheses refer to Figure 1 (from 20 to 23) and Figure 2 (1 to 19). where:  
\[L_{\rho_{k}}=\sqrt{\sum_{l=1}^{N}\rho_{k_{l}}^{2}} \tag{4}\]  
and  
\[L_{\rho_{(i,j)}^{\prime}}=\sqrt{\sum_{l=1}^{N}\rho_{(i,j)_{l}}^{2}} \tag{5}\]  
are the lengths of the vectors, and \(\rho_{k_{l}}\), \(\rho_{(i,j)_{l}}^{\prime}\), are the counts at the l-th channel of the spectrometer (i.e., the l-th coordinate of the vectors). In SAMs, \(L_{\rho_{k}}\) refers to the length of the k-th endmember where k is an integer between one and the number of identified endmembers; i.e., the idealized members of the elements' classes recognized within the data [52]. The task of SAMs is to reformulate the \(\rho_{(i,j)}^{\prime}\) as linear combinations of \(\rho_{k}\) with coefficients dependent on the angles \(\alpha_{(i,j)_{k}}\). When mapping refers to paintings, the set of \(\rho_{k}\) is a pool of independent spectra identified by the user as the best descriptors of the investigated palette [53], while the \(\rho_{(i,j)}^{\prime}\) are MA-XRF acquisition organized into a 3D spatial-energy matrix. Therefore, every endmember corresponds to a so-called similarity map [A]\({}_{\text{K}}\), an image that describes the spatial affinity of the k-th endmember with the spectra within the scanned region(s) [54]. The lower is the angle \(\alpha_{(i,j)_{k}}\) the higher is the brightness of the image (i.e., of the matrix element \(\alpha_{(i,j)_{k}}\) in [A]\({}_{\text{K}}\)) and the higher is the similarity of the k-th endmember with that point of the scan. Since the endmembers are independent of each other, the [A]\({}_{\text{K}}\) identifies the map distribution of the pigments chosen as k-th endmembers for the dataset. STEAM still evaluates angles between vectors in \(N\) dimensions, but it does not refer to endmembers; \(\rho_{k}\) are the spectra of k uncharacterized isolated points that can be equally acquired within the mapped zone, into another area of the same sample or, even, derived from other object(s) of interest.