## 3 Thickness Determination
### Differential Attenuation  
The excited atoms of each element emit X-ray photons at different energies that can be synthetically categorized into the so called K\({}_{\alpha}\) and K\({}_{\beta}\) or L\({}_{\alpha}\), L\({}_{\beta}\) and L\({}_{\gamma}\) lines when K and L shells are involved. When a sample is said to be infinitely thin, i.e., when secondary interactions are negligible, the ratio between these lines for a single element can be calculated and are tabulated [25]. When considering secondary interactions and matrix effects, the ratio between the emission lines changes exponentially with increasing material thickness until reaching a plateau; from this point onwards, the sample can be considered infinitely thick. If the element is in a mixture, the _thick ratio_ can still be calculated, but the weight percentage of each present element must be known. An alternative method is to directly measure the intensity ratios from an XRF spectrum taken from the exposed substrate which applies for samples for which the exact composition cannot be fully constrained.  
If the emitted X-rays from the sample's substrate traverse a superimposing layer, they will be attenuated proportionally to their energy and the superimposing layer's thickness and composition. In this way, by comparing the ratio between two distinct lines before and after attenuation, one can estimate the thickness of the traversed superimposing layer. The differential attenuation theoretical background has been extensively discussed elsewhere [8; 12; 18; 26].  
In the present work, the ratios between Ti-K\({}_{\alpha}\) and Ti-K\({}_{\beta}\) were evaluated. Figure 2 shows the areas sampled for measuring the _thick ratio_. For the direct substrate, it was measured as an average mean of several spots from Region D and from one spectrum taken with a longer acquisition time (30 s). The mean value obtained was 5.31 and that from the single spectrum was 5.32. When measuring the substrate with resin (AoI A) the mean value was slightly lower: 5.20.  
The gold leaf thickness at each point was calculated following Equation (1) [9; 18]:  
\[d=\frac{sin\Psi}{-\mu_{L}(E_{K_{\alpha}})+\mu_{L}\big{(}E_{K_{\beta}}\big{)}} ln\Bigg{[}\frac{\Big{(}I_{K_{\alpha}}/I_{K_{\beta}}\Big{)}_{thick}}{\Big{]}} \tag{1}\]  
where \(\Psi\) is the X-ray tube and detector angle with the sample surface, \(\mu_{L}\) is surface layer linear attenuation coefficient, \(\big{(}I_{K_{\alpha}}/I_{K_{\beta}}\big{)}\) is the Ti K\({}_{\alpha}\)/K\({}_{\beta}\) ratio recorded at the pixel and \(\big{(}I_{K_{\alpha}}/I_{K_{\beta}}\big{)}_{thick}\) is the corresponding _thick ratio_.  
The statistical error on the measured Ti K\({}_{\alpha}\)/K\({}_{\beta}\) ratio is:  
\[\Delta\text{R }=\frac{R}{\sqrt{I_{K_{\alpha}}}}\sqrt{1+R} \tag{2}\]  
where R = \(\Big{(}\frac{I_{K_{\alpha}}}{I_{K_{\beta}}}\Big{)}\).  
Figure 2: Sampled areas from region A and region D for measuring the Ti matrix _thick ratio_.  
Therefore, the resolving power and error can be calculated through Equations (3) and (4) below:  
\[\Delta d=\frac{\sqrt{1+R}}{\sqrt{I_{\kappa_{a}}}}\frac{sin\Psi}{-\mu_{L}(E_{K_{a} })+\mu_{L}\Big{(}E_{K_{g}}\Big{)}} \tag{3}\]  
\[\sigma_{Aol}=\sqrt{\sigma_{stat}^{2}+\sigma_{samp}^{2}+\sigma_{inst}^{2}} \tag{4}\]  
where, in Equation (4), subindexes _stat_, _samp_, and _inst_ correspond to the statistical, sample, and instrumentation variances, respectively. The latter is the variance sum of geometrical factors and calibration (matrix _thick ratio_) uncertainties.