An iterative algorithm to estimate the energy spectrum of an electron beam from PDD curves

Electron beam central-axis percentage depth dose (PDD) curves in water phantom are routinely employed to evaluate the electron beam energy at the phantom surface, in particular the mean and most probable energies from the values of R 50 (half-value range) and Rp (practical range). However, these two quantities are not enough to evaluate important details of the energy distribution, such as the FWHM (Full Width Half Maximum) and the possible presence of a low-energy tail. This paper presents a numerical method that allows estimating the shape of the energy spectrum from a PDD curve. The algorithm uses a database consisting of a set of depth dose curves for monochromatic beams computed by FLUKA in the range 0.1-7.0 MeV by steps of 0.1 MeV and, using an adaptive iterative Monte Carlo process, reconstructs the incident energy spectrum by minimizing the distance between the measured PDD and the computed one. Applications of a MATLAB code based on this algorithm to simulated and real measurements of electron beams done at APAM lab (ENEA Frascati) are presented. This approach represents a strong simplification with respect to energy analysis based on the use of a magnetic spectrometer.


Introduction
Compact RF electron linear accelerators are largely used for different types of applications.The energy spectrum of a beam produced by an RF linear accelerator is never monochromatic due to phase dependent longitudinal dynamics and particle interaction with different materials (linac exit window, air, scattering foils, degraders, etc.).For medical linacs some information about the beam energy is usually inferred from specific parameters retrieved by the analysis of PDD (Percentage Depth Dose) curves measured in water phantom [1].These parameters are ordinarily used for the selection of energy dependent dosimetric factors, such as the stopping-power ratios (SPRs) for clinical dosimetry, but no information is derived on the beam energy distribution.However, the features of the energy spectrum are of interest to characterize the performance of the electron accelerators also for further application fields, from space component testing to biodegradation removal, treatment of polymers and metals, and cultural heritage.A complete reconstruction of the spectrum requires the use of a magnetic spectrometer placed at the linac exit.The aim of the present work is to assess the energy distribution of an electron beam by using a practical, rapid and repeatable energy analysis methodology able to avoid the use of a bulky and complex magnetic spectrometer.
This methodology consists of an iterative Monte Carlo process capable to retrieve the energy spectrum from PDD curves using a set of FLUKA [2,3,4] simulations of monochromatic beams up to 7 MeV.An example of experimental application of this approach to the REX (Removable Electron to X-ray target) electron linac [5] operating at ENEA Frascati Research Center is presented.

PDD curves
PDD curves consist of the near surface dose and two regions: the dose build-up region of primary and secondary electrons extending from the entrance surface to the dose maximum, where electrons approach full diffusion and the fluence increases, and the descending region with increasing loss of primary electrons.The second region presents a steep linear dose descent, due to energy and range straggling of the primary electrons, and an electron tail, affected by the photon background.
The shape of a PDD curve depends on the electron energy.Example PDD curves in water of monochromatic beams as computed on central axis by FLUKA at different energies are shown in figure 1.These curves are usually described by specific quality parameters, R 50 and R p , that give information about the mean energy E 0 and the most probable energy E p , respectively.R 50 is the depth at which the absorbed dose decreases to 50% of its peak value and is related to the mean energy by the empirical relation E 0 /MeV = 2.33R 50 /cm.The practical or projected range R p is closely related to the most probable electron energy E p at the phantom surface through the empirical relation [1]: 14th International Particle Accelerator Conference Journal of Physics: Conference Series 2687 (2024) 022016 IOP Publishing doi:10.1088/1742-6596/2687/2/0220163 However, the shape of a PDD curve is also affected by the real electron beam energy spectrum, whose main features can be reproduced throughout by an Exponentially Modified Gaussian (EMG) distribution [6]: This equation describes a negatively skewed Gaussian distribution with a main peak at high energy, corresponding to the above-mentioned most probable energy E p (see equation 1), and an extended low-energy tail.The parameters (µ, σ) take into account the contribution of the Gaussian distribution, λ introduces the effect of the exponential distribution in the low-energy tail, E is the energy, and erf is the error function.
To investigate the sensitivity of PDD curves to the real energy distributions, four FLUKA simulations were performed of electron beams entering water with distinct EMG energy distributions, see figure 2. To compute these EMG distributions, in equation 2 the value of σ was kept fixed to 0.24 MeV and the values of µ and λ were changed gradually to vary the weight of the tail and keep constant the value of E p at the same time.The cases with relevant low-energy tails highlight the contribution of the λ parameter and, for a real beam, could describe the passage of the electrons through a metallic window before the entrance in water.
In figure 3, the corresponding simulated PDD curves in water are plotted and compared with the also simulated PDD of a 3.49 MeV monochromatic beam, showing a significant effect of the energy spread.More specifically, the increase of energy spread produces both a leftward shift in the peak dose, with a consequent slope increase of the linear steep dose descent, and a decrease of the ratio between the maximum dose and the dose at the phantom surface.

ARO algorithm 3.1. Description
The proposed best fit algorithm aims to estimate electron energy distributions from measured PDD curves.To achieve this, it compares an experimental PDD curve with a computed curve that consists of a suitable linear combination of monochromatic PDD curves that are generated by interpolating a database of PDD curves; these latter ones were simulated with FLUKA at energies from 0.1 to 7.0 MeV by steps of 0.1 MeV.The coefficients of the linear combination, i. e., the weights of the individual PDD curves at each sampled energy, are fit parameters.At the end of the best fit process, the energy spectrum of the electron beam is graphically represented as a series of energy bins, whose heights are proportional to the values of the fit parameters.
The algorithm, coded in MATLAB [7], relies on the principles of random optimization i. e., localized random search [8] with Gaussian distribution.This numerical, derivative-free optimization technique works by iteratively moving to better positions the fit parameters within an N -dimensional Gaussian distribution surrounding the current position in the parameter space, where N is the dimension of the latter.The best fit process consists of sets of iterations, one following the other.After each set of iterations, the number of sampled energies can be changed -it is typically increased to improve the spectral resolution while converging to the optimal solution -with a consequent new interpolation of the PDD database curves; moreover, each component of the N -dimensional standard deviation vector is recalculated as a constant value partially weighted by the distance of the corresponding parameter from the value it would assume in a smoothed version of the energy spectrum.This weighting technique seems to help in preventing the formation of non-physical gaps in the energy spectrum.We named the algorithm ARO (Adaptive Random Optimization) based on its characteristics.At the very beginning of the best fit process, the fit parameters are initialized with an EMG distribution with µ, σ, λ set according to the E p value retrieved by the measured PDD curve through equation 1.

Numerical validation
To test the accuracy of the ARO algorithm, we simulated a PDD curve in water for 5.5 MeV electrons transmitted through a 5 mm thick aluminium slab using FLUKA.We then used our MATLAB program to perform a best fit of the PDD curve and compared the retrieved energy spectrum to that detected at the entrance of the water phantom in the FLUKA simulation.The results of this test are shown in figure 4. The near-perfect overlap between the FLUKA and the ARO PDD curves in figure 4a suggests that any minor differences between the original FLUKA energy spectrum and the one obtained with the ARO algorithm (see figure 4b) have a very minimal effect on the shape of the PDD curve.

Experimental application
The ARO algorithm was applied to the experimental PDD curves of a real electron beam produced by the REX facility, a 5 MeV S-band on-axis coupled electron linear accelerator [5].This is an RF pulsed standing wave linac driven by 2 MW peak power magnetron, which produces an accelerated electron beam of 3.4 µs pulse length FWHM, maximum pulse repetition frequency of 20 Hz and maximum beam current of 150 mA.It is able to deliver either electrons or X-rays through a removable electron to photon head conversion.For these measurements, EBT3 GafChromic films [9] were placed along the electron beam propagation axis in a tank filled with water.The irradiated films were digitized on a flatbed scanner and numerically analyzed by extracting the PDD profiles on the axis of the selected Regions of Interest (ROIs).
In the experimental setup, the 5 MeV electron beam, extracted through a 50 µm titanium exit window, propagates in air until reaching the EBT3 film.
Figure 5 shows two representative cases that differ in the distance crossed by the electron beam in air, equal to 10 and 30 cm, respectively.The experimental curves start from 1 mm, which is the thickness of the water tank wall.The linear behavior in the first millimeters of the experimental PDD curves is due to the peeling off in the film edge and for this reason is not reproduced by the ARO fit.

Conclusion
An iterative algorithm that relies on the principles of random optimization has been developed to estimate the energy distribution of an electron beam produced by a linac.The algorithm uses a database of PDD curves simulated by FLUKA in the energy range 0.1-7.0MeV.It has been successfully tested on "virtual" and "real" measurements and can be easily extended to higher energies by increasing the number of PDD curves in the database.Further measurements are planned in order to test the accuracy of the method in different experimental conditions.

Figure 1 .
Figure 1.Example PDD curves in water of monochromatic electron beams computed by FLUKA at different energies from 0.5 to 7 MeV.

Figure 2 .
Figure 2. EMG energy distributions for distinct values of their parameters and 3.49 MeV monochromatic spectrum.

Figure 3 .
Figure 3. Simulated PDD curves with the input energy distributions plotted in figure 2.

Figure 4 .
Figure 4. (a) PDD curve in water of a 5.5 MeV electron beam transmitted through a 5 mm thick aluminium slab as simulated with FLUKA (blue thick line) and its best fit obtained with the ARO algorithm (black solid line).(b) Energy spectra of the same beam as simulated with FLUKA (blue thick line) and as obtained by applying the ARO algorithm (black solid line).

Figure 5 .
Figure 5. Experimental PDD curves (blue thick line) extracted within the ROIs in the insets and their best fitting curves (black solid line) for a 5 MeV electron beam crossing (a) d =10 cm and (c) d =30 cm of air; (b) and (d) corresponding energy spectra retrieved by the ARO algorithm.

Table 1 .
The main parameters of the energy spectra extracted with the ARO algorithm are listed in table 1. Parameters of the energy spectra of figures 4 and 5 obtained by applying the ARO algorithm. 6