Alanine dosimetry in strong magnetic fields: use as a transfer standard in MRI-guided radiotherapy

Reference dosimetry in the presence of a strong magnetic field is challenging. Ionisation chambers have shown to be strongly affected by magnetic fields. There is a need for robust and stable detectors in MRI-guided radiotherapy (MRIgRT). This study investigates the behaviour of the alanine dosimeter in magnetic fields and assesses its suitability to act as a reference detector in MRIgRT. Alanine pellets were loaded in a waterproof holder, placed in an electromagnet and irradiated by 60Co and 6 MV and 8 MV linac beams over a range of magnetic flux densities. Monte Carlo simulations were performed to calculate the absorbed dose, to water and to alanine, with and without magnetic fields. Combining measurements with simulations, the effect of magnetic fields on alanine response was quantified and a correction factor for the presence of magnetic fields on alanine was determined. This study finds that the response of alanine to ionising radiation is modified when the irradiation is in the presence of a magnetic field. The effect is energy independent and may increase the alanine/electron paramagnetic resonance (EPR) signal by 0.2% at 0.35 T and 0.7% at 1.5 T. In alanine dosimetry for MRIgRT, this effect, if left uncorrected, would lead to an overestimate of dose. Accordingly, a correction factor, kQB,Q, is defined. Values are obtained for this correction as a function of magnetic flux density, with a standard uncertainty which depends on the magnetic field and is 0.6% or less. The strong magnetic field has a measurable effect on alanine dosimetry. For alanine which is used to measure absorbed dose to water in a strong magnetic field, but which has been calibrated in the absence of a magnetic field, a small correction to the reported dose is required. With the inclusion of this correction, alanine/EPR is a suitable reference dosimeter for measurements in MRIgRT.


Introduction
Magnetic resonance imaging (MRI)-guided radiotherapy (RT) (MRIgRT), a state-of-the-art cancer treatment, is delivered by an MRI-linac which combines a linear accelerator (linac) with an MRI scanner. An MRI-linac provides real-time images during a patient's treatment and greatly enhanced soft-tissue image contrast, while completely avoiding the radiation dose associated with treatment integrated imaging x-ray systems. MRIgRT is expected to facilitate real-time adaptive RT planned based on high contrast anatomical images, visualising anatomical changes of the patient, to explore the possibilities of an advanced personalised RT.
A novel but known feature of this technology is that the external magnetic field affects the response of dosimeters and the dose distribution in medium. The lack of a standard for reference dosimetry of RT beams in a magnetic field, motivates our investigation.
Reference dosimetry for conventional RT is usually performed with ionisation chambers. In practice, secondary chambers are calibrated against a primary standard for absorbed dose to water (based on ionometry, water calorimetry, graphite calorimetry, etc) and then used to calibrate the output of RT machines. In the presence of a magnetic field, the charged particles traversing the air-cavity of an ionisation chamber experience the additional Lorentz force induced by the magnetic field, which strongly modifies the chambers dose response and makes it challenging to perform beam output measurements in MRI-linacs. Recent works have shown that the uncertainty of ionisation chamber-based dosimetry is significantly increased by the presence of strong magnetic fields. Measurements and Monte Carlo (MC) calculations have previously been made to characterise the response of different type of ionisation chambers (Meijsing et al 2009, Smit et al 2013, Reynolds et al 2013, O'Brien et al 2016, Spindeldreier et al 2017, Pojtinger et al 2018. These works investigated the optimal chamber orientation with respect to magnetic field and radiation beam, parallel (||) or perpendicular (⊥), as well as the magnetic field correction factor at different flux densities. Considering the change of a Farmer-type chamber (mostly used as a reference detector) response in magnetic flux densities ranging from 0.35 T to 1.5 T relative to its response at 0 T, these studies found that when the long axis of the ionisation chamber is: • ⊥ to the magnetic field and the radiation beam is ⊥ to the magnetic field the changes range from 4%-11.3%. • || to the magnetic field and the radiation beam is ⊥ to the magnetic field the change is ⩽1%.
• || or ⊥ to the magnetic field and the radiation beam is || to the magnetic field the change increases near to 2%.
In the presence of the strong magnetic fields the radius of the circular motion of a charged particle vary with the mass density. The higher the mass density the higher the radius of the particle trajectory. Therefore, although the effect of the magnetic field is more pronounced in air cavities, it is also affecting the distribution of dose in water (Raaymakers et al 2004, Raaijmakers et al 2005, 2007, O'Brien et al 2016. A study by O'Brien et al (2016) characterised depth-dose curves with an Elekta Unity MR-linac beam quality and showed that the presence of the magnetic field changes the absorbed dose at a reference depth by −0.5%. This effect needs to be taken into account and corrected for or it can be a part of the quality correction factor for the presence of magnetic field, k QB,Q , which has been discussed by O'Brien et al (2016) and van Asselen et al (2018) and is further described on section 2.2 of this paper. Both mentioned studies have used the analogy of radiation beam quality correction factor, which is defined as the ratio between the calibration coefficient in standard conditions and the calibration coefficient in user conditions, as stated in International Atomic Energy Agency (IAEA) Technical Reports Series (TRS) 398 (Andreo et al 2000). In section 2.2, k QB,Q is expressed as a product of the effect of the magnetic field on dose to water and on detector response. For different Farmer-type chambers, k QB,Q ranges from 0.992 to 1.006 when the long axis of the chamber is parallel to magnetic field and 0.953 to 0.976 when the long axis is directed perpendicular to magnetic field.
Among other effects of ionisation chambers in magnetic fields, which increase the uncertainty on dose measurement, are the air gaps around the cavity (Hackett et al 2016, Agnew et al 2017. This will restrict the use of ionisation chambers in water phantoms to avoid a significant signal variation, i.e. 3.8% for a Farmer-type chamber (Agnew et al 2017). It has been shown by Rogers (2017), Spindeldreier et al (2017) and Pojtinger et al (2019) that dead volumes (or the true sensitive volume) should be taken into account when performing MC simulations. Small changes in the collecting volumes can lead to a deviation of 1.4% between the simulated and the experimentally determined dose response in magnetic fields (Pojtinger et al 2019), on Farmer-type chambers. This, together with the intra-type chamber variation (i.e. non-radial symmetry), will result in significant disagreement with experimental data and will increase the uncertainty on tabulated MC calculated quality correction factors for the presence of magnetic field for specific chambers.
Alanine is an α-amino acid with the chemical formula: CH 3 -CH(NH 2 )-COOH. When an alanine molecule is irradiated, it produces a stable free radical, CH 3 -C•H-COOH. The concentration of the stable free radicals can be measured as a signal (a dosimetric signal) using electron paramagnetic resonance (EPR) spectroscopy and is proportional to the absorbed dose. A detailed description of alanine as a dosimeter has been given in the literature Ross 2009, Malinen 2014) and some primary points have been emphasised by McEwen et al (2015).
Alanine dosimeters provide an alternative to standard dosimetry systems, such as ionisation chambers. McEwen et al (2015) has pinpointed the advantages of alanine dosimetry as a reference detector against an ionisation chamber in conventional RT. The National Physical Laboratory (NPL) provides an alanine reference dosimetry service (Sharpe et al 1996, Sharpe and Sephton 2000, 2006, which can be used to measure therapy level absorbed dose in reference and non-reference conditions. Alanine has been used as a transfer standard for comparison of the absorbed dose measured from national standards laboratories in a 60 Co beam (Burns et al 2011) and in megavoltage electron beams (McEwen et al 2015) with a precision of 0.1%. The use of alanine in dosimetry audits for megavoltage photons and electrons under standard conditions has been proven by Thomas et al (2003) to be an essential detector to ensure national consistency in RT dosimetry. In non-standard conditions, such as small field beams (Ramirez et al 2011, Massillon et al 2013, Dimitriadis et al 2017 and flattening filter free beams (Budgell et al 2016) alanine has been used for absolute dosimetry measurements transfering traceability to a primary standard.
Currently, the only primary standard that can provide traceability for reference dosimetry in magnetic field is the VSL (Van Swinden Laboratory, which is the Dutch Metrology Institute) water calorimeter (de Prez et al 2019). To our knowledge, this is the only MRI-safe primary standard, which can also fit in the bore of the MRI scanner, that has performed direct measurements of absorbed dose to water in an Elekta Unity MR-linac and cross calibrated ionisation chambers to act as transfer standards. Nevertheless, as already explained above, the strong magnetic field modifies the response of air-filled ionisation chambers, and the correction k QB,Q for this effect may significantly increase the uncertainty of reference dosimetry. On the other hand, alanine/EPR offers an alternative to ionisation chamber-based reference dosimetry, in which the magnitude of the electron return effect (ERE) may be reduced compared to the effect in an air-filled ionisation chamber.
Taking into account (a) the disadvantages of the ionisation chamber response in magnetic field, (b) the need to find a traceable dosimeter which will allow for MR safety, robustness, stability and dose response and (c) the wide use of alanine as a reference detector for standard and non-standard radiation beams, the aim of this work is to investigate the performance of alanine in the presence of strong magnetic field and to explore its suitability to act as a reference class detector for MRIgRT systems.
The use of alanine as a transfer standard implies that it is used in the same conditions that it has been calibrated (primary condition). Where these conditions do not match the measurement conditions (i.e. alanine is irradiated in a different beam quality) a correction to account for changes in the response relative to those under calibration conditions need to be applied. For instance, the alanine/EPR signal depends on the energy spectrum of the radiation beam. Corrections for this effect have been well quantified in the literature (Sharpe 2003, Bergstrand et al 2003, Zeng et al 2004, Anton et al 2013. When alanine is used to measure dose in the presence of a strong magnetic field (such as in MRI-linac systems), and an alanine calibration is available only in the absence of the magnetic field, then a correction factor that would account for the effect of the magnetic field needs to be applied. This factor will correct for both the effect of the magnetic field on dose to water and on alanine response. In the present study, we perform measurements and MC simulations to quantify the effect of the magnetic field on alanine response (described as alanine intrinsic sensitivity) and generate magnetic field correction factors for alanine. A statistical analysis, including an investigation of the effect of the air gaps associated with the alanine holder, is also presented.

Alanine dosimetry
Alanine pellets comprise of 90% L-α-alanine and 10% high melting point paraffin wax (m.p. 98 • C), by weight (Sharpe et al 1996). Alanine is near water-equivalent, but not waterproof, with a density of about 1.2 g cm −3 and it has a linear response to dose. It also has good reproducibility (0.3% variation between individual dosimeter pellets) and a small energy dependence, less than 1% relative to a 60 Co beam (Sharpe 2003, Bergstrand et al 2003, Zeng et al 2004, Anton et al 2013. EPR spectroscopy is used to detect and quantify the number of the stable free radicals that are created by the ionising radiation. The alanine/EPR signal is the corrected alanine peak-to-peak intensity per unit dosimeter mass, expressed in Gy to water, using a calibration curve derived from reading out alanine irradiated under reference conditions in 60 Co. The corrections include effects such as temperature during irradiation and spectrometer sensitivity. If alanine is irradiated in some other conditions, then a correction may be needed to account for any change in the intrinsic sensitivity of alanine, which may be defined as the alanine/EPR signal per unit absorbed dose to alanine.

Alanine reference dosimetry in a magnetic field
The reference measurement of absorbed dose to water, in the presence of a magnetic field B, D w,QB , using alanine, is given by: where, M al,QB and N D,w,QB are the alanine/EPR signal and the calibration coefficient, respectively, of the alanine detector in the presence of magnetic field. The magnetic field affects the absorbed dose to water at the measurement point, D w,Q , the absorbed dose to the alanine pellet, D al,Q , and may also affect the intrinsic sensitivity of the alanine, R al,Q , which is defined by: Note that this relation is analogous to the definition of detector dose response (or sensitivity) proposed by Bouchard and Seuntjens (2013).
If the alanine calibration is only available for a beam quality Q in the absence of any magnetic field, N D,w,Q , then a correction factor for the effect of the magnetic field is needed: This correction factor is defined, by analogy with the usual quality dependent correction factor, k Q,Q0 (Andreo et al 2000), by: The absorbed dose to water, with magnetic field, D w,QB , and without magnetic field, D w,Q , was calculated by using MC simulations. The alanine/EPR signal at a quality Q, M al,Q , can be derived from equation (2) as the product of the absorbed dose to alanine at a quality Q, D al,Q , and the alanine intrinsic sensitivity at the same quality Q, R al,Q . The effect of the magnetic field on the alanine intrinsic sensitivity may be represented by the ratio, F QB,Q , and is defined as relative intrinsic sensitivity: This was determined by combining measurements of the alanine/EPR signal with the absorbed dose to the alanine pellet, determined by MC simulation of the dosimeter setup:

Experimental setup
Alanine pellets, of approximately 2.3 mm height and 5 mm diameter, were placed in a waterproof holder of polyether ether ketone (PEEK) material shaped like a Farmer-type ionisation chamber, in an electromagnet (GMW 3474-140) and irradiated by either a 60 Co source or conventional 6 MV and 8 MV Elekta Synergy linac beams. A disassembled view of the NPL alanine holder is shown in figure 1. The external dimensions of this holder are designed to match a PTW/30013 Farmer chamber. The holder has internal dimensions of 5.2 mm diameter (tolerance of 0.2 mm to allow the loading and unloading of the pellets) and a length of 20.5 mm. The measurement reference point of the PTW/30013 Farmer-type chamber is very close to the centre of the third pellet from the tip of the holder. Thus, in this study, the first five pellets from the tip of the holder were used for analysis. In 60 Co the alanine dosimeters were irradiated in an in-house poly-methyl methacrylate (PMMA) phantom, 2 cm × 5 cm × 26 cm, with a drilled insert to enable the alanine holder to fit in. Any air gap between the insert and the holder was carefully filled with water to avoid the ERE. The phantom was . Front schematic view (cross-section) of the experimental setup. PMMA or water phantom fits between the two magnetic poles with a gap of either 5 cm or 7 cm that gives a maximum magnetic flux density of either 2 T or 1.6 T, respectively. Both magnetic field and radiation beam are orientated perpendicular to the long axis of the alanine holder.
designed to fit in the 5 cm gap between the two poles of the magnet (figure 2), which provide a maximum magnetic flux density of 2 T. The distance between the 60 Co source to the centre of the magnetic poles (measurement point) was 162 cm and alanine pellets were irradiated at a depth of 1 cm at five magnetic flux densities (0 T, 0.5 T, 1 T, 1.5 T and 2 T).
In the Elekta Synergy linac setup, a water phantom, 7 cm × 18 cm × 19 cm, was designed to place the alanine holder between the 7 cm gap of the magnetic poles (figure 2), which provide a maximum magnetic flux density of 1.6 T. An insert frame-holder was built to set up the alanine holder in the water tank and between the two poles of the magnet. The surface to source distance (SSD) was 305 cm, with alanine irradiated at a water equivalent depth of 5 cm and magnetic flux densities of 0 T, 0.35 T, 0.5 T, 1 T and 1.5 T.
In both 60 Co and Elekta Synergy linac radiation beams, the long axis of the alanine holder was positioned in (a) the centre of the two magnetic poles, (b) perpendicular orientation to the radiation beam, along the z-axis, and (c) perpendicular orientation to the magnetic field, along the x-axis. The magnetic field uniformity in an area of 3 cm 2 along the centre of the two magnetic poles (in z and y direction) was found to be within ±0.5 mT. The radiation field was collimated to fill the gap between the two magnetic poles. A calibrated thermistor was placed close to the holder to record the ambient temperature needed to correct the effect of the alanine signal due to temperature.
The effect of the magnetic field on the photon beam symmetry of the linac was checked. A Sun Nuclear IC Profiler was set at 100 cm iso-centre (using the same gantry angle as the experimental setup) and irradiated with a 10 cm × 10 cm beam field. With a magnetic flux density of 0 T, initial beam steering adjustment was performed to give zero tilt using the IC Profiler. The 2 T (crossline) and 2 R (inline) error values, which indicate if there is any asymmetry of the beam, were set to zero. The magnetic flux density was set to 1.5 T and it was found that symmetry was different by 1.5% compared to profiles without magnetic field (crossline and Inline profiles with magnetic flux densities set at 0 T and 1.5 T are shown on figure 3). Beam steering was adjusted to eliminate the tilt (2 T and 2 R error values set back to zero) and the profile symmetry matched the beam without magnetic field. Therefore, it was concluded that zeroing the 2 T and 2 R error values was a good method to restore the symmetry of the photon beam when the magnetic field was on.
Here, we should mention, that the magnetic flux density at the iso-centre was less than 0.05 mT, when the electromagnet was set up to give 1.5 T between the poles, and any effect on the IC profiler signal due to the magnetic field was found to be negligible.

Air gaps on the farmer compatible alanine holder
Alanine is a solid-state detector and is expected not to have a similar strong effect on ERE as air filled ionisation chambers. However, air gaps exist inside the holder where the alanine pellets are located, and two cases of air gaps were identified and investigated:  (a) Bevel-air-gap: alanine pellets do not have a flat surface, but instead they form a bevelled edge (figure 4), which introduces air gaps when loaded in the holder. This creates a maximum of 0.052 cm air gap around the bevelled edge between the two pellets. The first (close to the tip) and the last (close to the stem) pellet form the half of this air gap (0.026 cm). (b) Cylindrical-air-gap: the internal diameter of the holder has a tolerance of 0.02 cm to allow the pellets to be loaded and unloaded in the holder. This forms an air gap between the inner holder wall and the pellets of 0.01 cm (figure 4).
MC simulations were performed for both cases to investigate the effect of air gaps on the alanine signal. This effect must be included as a component in the measurement uncertainty, when alanine is used as a dosimeter in the presence of the magnetic field. This is further explained in section 3.8.2. In any case, any effect (including the fluence perturbation by the PEEK holder) will be part of the alanine magnetic field correction factor, explained in section 2.2.

Monte Carlo simulations
MC simulations of detector response play a major and increasingly important role in accurate radiation dosimetry, including the characterisation of physical properties of beams and of radiation detectors. MC radiation transport codes, such as EGSnrc and PENELOPE have demonstrated a self-consistency test, by performing a Fano cavity test on MV beams, at a level of 0.1%. It has also been shown that the level of agreement with ionisation chamber experimental data, being the most difficult challenge for such a technique, is of the order of 0.3%.
In the presence of the magnetic field, studies (Bouchard et al 2015, Bouchard and Bielajew 2015, de Pooter et al 2015 have demonstrated that is necessary to define special conditions under which the Fano cavity test can be performed to check the consistency of MC transport algorithms. One of the key transport parameters in EGSnrc that needs to be adjusted to ensure more accurate MC simulations in the presence of magnetic field, is EM ESTEPE. This parameter sets a value for an additional step size restriction based on magnetic field change and direction change for charged particle transport in an electromagnetic field. Research undertaken in the European Metrology Programme for Innovation and Research (EMPIR) project of MR-guided RT (EMPIR 15HLT08 MRgRT 2019), has shown that the EM ESTEPE parameter needs to be reduced from its default value when the material density is low (i.e. for air the EM ESTEPE = 0.01) in order to achieve the desired level of internal consistency of around 0.1% with EGSnrc (MRgRT 2019).
In this study, MC simulations were performed to include calculations of absorbed dose to water and to alanine, the investigation on the effect of the air gaps around the alanine pellets and the uncertainty estimation due to the random position of the alanine pellets inside the holder.
The usercode cavity that forms part of the EGSnrc code system (Kawrakow I et al,2011) (development version: GitHub: August 2017) was used. An accurate model of the experimental setup consisting of the two magnetic poles, the bespoke water tank, the holder and the alanine pellets was first constructed. The dimensions and material specifications used were taken from the associated manuals, test certificates and in-house dimensional measurements. In the MC simulation, the pellet medium was set to be a 90:10 mixture of alanine and paraffin wax binder. The medium density was set to the measured pellet bulk density (1.23 g cm −3 ), and the alanine stopping power density effect correction was based on the crystalline density (1.42 g cm −3 ). Following Zeng et al (2005) the alanine/EPR signal was replaced by dose to the pellet mixture since, over the relevant range of electron energy, variations in the paraffin/alanine stopping power ratio are confined within a range of ±0.15%. The effect of this approximation on the calculation of the dose to alanine ratio, with and without the magnetic field, is expected to be negligible.
The cut-off energy for electrons (AE and ECUT) was set to 0.521 MeV and for photons (AP and PCUT) to 0.01 MeV. For the simulations of the external magnetic field, the default electromagnetic field macros (EMF_MACROS) were enabled, and EM ESTEPE was set to 0.01. All other parameters were set to their default values.
Phase space data of the 6 MV and 8 MV Elekta Synergy x-ray beams were generated at 270 cm from the target, using the BEAMnrc usercode, for the purpose of the detector simulations. For beam validation at 0 T, depth dose and profile measurements were performed at 279 cm from the target. The radiation beam was collimated, at the machine isocentre, by 1.9 cm and 4.4 cm in the crossline and inline direction, respectively. A parallel plate chamber (NACP-02) was placed in a water tank for depth dose measurements, and profiles were measured by irradiating EBT-3 films with a 5 cm build-up. Films were processed and analysed using a method developed by Bouchard et al (2009). A model of a previously validated 60 Co beam (Costa et al 2018), which configures the same beam characteristics as in this study, was used for the MC simulations.
The following three sections (2.5.1-2.5.3) will describe the MC simulations that were performed to support investigations in this study.

Experimental setup model validation.
For the model validation of the experimental setup, including the electromagnet, alanine and holder, measurements were performed using the setup explained in section 2.3. In this case, measurement and MC simulations were performed with the holder partially loaded with alanine pellets, so that an air gap of nominal 0.44 cm occurs between the stem and the first pellet (figure 5). In this air gap, the electrons follow on average a curved trajectory in accordance with the Lorentz force by increasing the dose on the first pellet, which is distributed along the long axis of the holder towards the tip. The magnetic flux density was 1.5 T and alanine pellets were irradiated with 6 MV and 8 MV delivering 20 Gy in each case. In the simulations, the total dose per incident particle was scored in each pellet. Unfortunately, it was not possible to perform similar measurements to validate the experimental setup at 1.5 T in the 60 Co beam during the study. Nevertheless, the characteristics of the 60 Co beam model, used in this study, have been benchmarked by Costa et al (2018).

Monte Carlo model for the air gap effect.
MC simulations were performed to determine the effect of the air gaps around the alanine pellets. A model of the holder loaded with alanine pellets was used and three sets of simulations were performed: (a) full model including both air gaps (bevel and cylindrical), (b) full model with the air gaps created from the bevelled edge of the alanine pellets (bevel-air-gaps only) filled with alanine medium and (c) full model with no air gaps (both air gaps filled with alanine medium). Figure 6 depicts the three models. Simulations were performed for all beam qualities at all examined magnetic flux densities. For each combination, the total dose per incident particle was scored to the first five pellets from the tip of the holder. Any effect of the magnetic field on the dose distribution in alanine medium was removed (for 1.5 T the dose was found to be negatively deviated by 0.03%, 0.3% and 0.4% from the dose at 0 T for 60 Co, 6 MV and 8 MV, respectively). Thus, only the air gap effect is considered for the comparison.

Uncertainty due to the air gaps.
When alanine pellets are loaded inside the holder, they will not be located symmetrically but rather randomly due to the air gap of 0.02 cm (see section 2.4). Depending on the position of the air gaps inside the holder with respect to the magnetic field, the ERE will either increase or decrease the dose in each alanine   pellet. Due to the unpredictable location of the pellets, it is difficult to calculate what the effect would be and correct for it. However, known air gaps of 0.02 cm, which is the maximum between the holder and the alanine pellets, can be modelled by MC simulations to estimate the effect and include it in the uncertainties (see section 3.8.2). For that purpose, a model of the holder loaded with nine alanine pellets was built and MC simulations were performed by shifting the pellets in the x-and z-axis as shown in figure 7 (dimensions not to scale), allowing the maximum achievable air gap (0.02 cm). The total dose per incident particle was scored to the first five pellets from the tip of the holder for each of the three beam energies, for all magnetic flux densities and all five combinations.

Validation of the beam models
The 6 MV and 8 MV beam models were validated by comparing the simulated with the experimental dose profiles and depth doses as shown in figure 8. For each plot, the data were normalised to the integral of the curve to minimise the effect of point-to-point variations in film sensitivity. The MC profiles agree with the film measurements within the uncertainty of the single channel analysis made of the film data, which in this study was estimated to be 2%.

Alanine model and experimental set up validation in a magnetic field
The validation of the experimental setup model for 6 MV and 8 MV with experiments was performed at a magnetic flux density of 1.5 T. It was found that the thickness of the air gap between the PEEK stem and the first alanine pellet, depends on the force that is applied to adjust the screw cap shown in figure 1, which is used to secure the pellets inside the holder. Further measurements of five actual holders and pellets showed typical variations of the air gap in the order of 0.35 ± 0.02 cm, and so additional simulations with air gaps of 0.30 cm and 0.40 cm were made. Figure 9 shows the MC results (for three different air gaps) and the measurement results of the dose deposited at each alanine pellet, normalised to the average dose of all pellets, for 6 MV and 8 MV. The experimental data points for both energies agree with the MC calculated points of the two additional simulations, of 0.30 cm and 0.40 cm air gaps, within the measurement uncertainties. The error bars on the experimental data represent the combined standard uncertainty of an alanine pellet (0.6%) and the uncertainty due to the air gaps as explained in section 3.8.2. The uncertainty on the MC data is in the order of 0.15%. For clarity, error bars are not included on the MC data. Figure 10 shows the effect of the air gaps on the calculated dose to alanine for the three beam energies and all tested magnetic flux densities, based on the three sets of simulations described in section 2.5.2. Calculated data show how the dose to alanine changes when the air gaps created from the bevelled edge are simulated  with alanine replacing the air, figure 10(a), and when both bevel-and cylindrical-air-gaps are replaced with alanine medium, i.e. full model with no air gaps, figure 10(b). In both cases, data were normalised to the MC results of the full model (including both air gaps). In figure 10(b), the maximum deviation from the full model was found to be 0.45% and 0.55% for 6 MV and 8 MV, respectively, at 1.5 T. In figure 10(a), the maximum deviation was found to be at 1 T and 1.5 T and was less than 0.4% for both 6 MV and 8 MV. For the 60 Co beam all data from both figures were found to be less than 0.4%.

Effect of the magnetic field on absorbed dose to water
The effect of the magnetic field on absorbed dose to water at the measurement point, D w,Q , is needed to determine the alanine magnetic field quality correction factor and its relative intrinsic sensitivity, as explained in section 2.2. For that purpose, depth doses in water for each beam energy and at magnetic flux densities up to 3 T were calculated by using MC simulations. Figure 11 shows the MC calculated D w,QB /D w,Q ratios as a function of magnetic flux density for the three beam energies. After d max , for all beam energies, depth doses in the presence of a magnetic field, although systematically lower compared to 0 T, were found to be similar. Therefore, the D w,QB /D w,Q ratios at each magnetic flux density were determined from the average ratios after d max , which results in a level of standard uncertainty of 0.04%. Figure 12. Box plots presenting the ratio between the alanine/EPR signal for alanine measurements in a magnetic field, M al,QB , and without magnetic field, M al,Q , for 60 Co, 6 MV and 8 MV. Data at each energy and each magnetic flux density represent measurements over three days. Crosses (x) show the mean value of the normalised alanine signal for each magnetic flux density over three days. Figure 12 summarises the alanine/EPR signal for measurements in a magnetic field, M al,QB , normalised to the signal at zero magnetic field, M al,Q , as a function of magnetic flux density for the three beam energies. For each plot and each magnetic flux density, data represent measurements over three days and their distribution is displayed in a form of box plot. Note that crosses (x) on each box plot indicate the mean value of the normalised alanine signal for each magnetic flux density over three days.

Alanine response in a magnetic field
For zero magnetic field and for each energy, the pellet-to-pellet variation of the signal has a standard deviation of up to 0.52%. This results in a standard uncertainty of the mean of 0.13% or better, considering the number of the pellets used in this study. However, as the magnetic flux density is increased, for each energy, the standard deviation also increases, up to 0.85% (standard uncertainty of the mean of 0.22%).

Quality correction factor for the presence of a magnetic field on alanine
The alanine quality correction factor as a function of a magnetic flux density is shown in figure 13 and table 1, for the three beam energies. The error bars denote the overall combined standard uncertainty (ranging from 0.2% to 0.6%), as quoted in section 3.8, and include the effects of measurement repeatability, air gaps, linac drift and MC uncertainties. Figure 13 shows how the correction factor for each energy decreases with increasing magnetic flux density. Except for the data point at 0.5 T (1.0014) for 8 MV, all the remaining data points lie below unity, ranging from 0.9933 to 0.9998 with an average of 0.9967 ± 0.0027. Note that this  correction includes both the effect of the magnetic field on absorbed dose to water and its effect on alanine intrinsic sensitivity. The latter effect is isolated in the following.

The effect of the magnetic field on alanine response
The magnetic field effect on alanine intrinsic sensitivity may be represented by the quantity F QB,Q , relative intrinsic sensitivity, which is defined as the ratio of the alanine intrinsic sensitivity with and without magnetic field (equations (5) and (6) in section 2.2). This was obtained by combining measurements with MC simulations and is shown in figure 14 and table 2, for the three beam energies. The alanine over-response tends to increase with magnetic flux density, up to 1.0099 at 8 MV in 1.5 T, but without any obvious trend as a function of energy.

Uncertainties
The analysis of uncertainty here follows the Joint Committee for Guides in Metrology (JCGM) Guide to the Expression of Uncertainty in Measurement (JCGM 2008). Uncertainties evaluated by statistical analysis are grouped as type A and the rest are grouped as type B. These are added in quadrature to give a combined standard uncertainty with coverage factor k = 1. The quoted relative standard uncertainties are shown in Table 3. This includes the overall combined relative standard uncertainties in k QB,Q at 0.35 T and 1.5 T for 6 MV and 8 MV. For 60 Co, uncertainties are presented at 0.5 T and 1.5 T. For the rest of the magnetic flux densities at all three energy beams, the relative standard uncertainties are between the stated uncertainties in table 3. For 60 Co and 2 T, the uncertainty was found to be 0.56%.

Measurement uncertainty and repeatability.
The uncertainty on the repeatability of the measurements is evaluated by considering the behaviour of the averaged signal over the alanine pellets at each magnetic flux density for each energy, over all experiments. The standard deviation of the mean was found to be ranging from 0.05% to 0.22%.

Uncertainty due to air gaps.
Uncertainties due to the unknown spatial distribution of the alanine pellets in the PEEK holder were estimated using MC simulations as explained in section 2.5.3. Figure 15(a) shows the MC calculated dose to alanine for each energy, when pellets are shifted in the x-and z-axis inside the alanine holder (see figure 6). For clarity, figure 15(a), only includes data for 1.5 T, which are normalised with respect to when the pellets are centrally-located in the holder. This figure shows how the ERE is varying the dose to alanine at the different positions. The type A uncertainties were based on the root mean square (RMS) error of the four different distributions of the alanine pellets inside the holder. The uncertainties, for each energy, were found to increase with magnetic flux density up to 0.52% and 0.47% for 6 MV and 8 MV at 1.5 T, respectively. The uncertainty due to the air gaps is the dominant component in the uncertainty budget and is applicable to the absorbed dose to water measured with the alanine detector, in the presence of a magnetic field using the holder designed for this study.

Uncertainty due to linac output.
The short term (over one day) behaviour of the output from the Elekta Synergy linac beams was investigated during the alanine irradiation. The output was measured several times in between the alanine irradiations using an ionisation chamber with the same experimental set up and always at 0 T. For each day of irradiation, the output (dose rate) was found to diverge by an average of −0.07% per hour. This deviation was considered, and used to correct the alanine signal, based on a linear fit between the ionisation chamber signal and the time. The uncertainty was estimated from the gradient of the residuals of the fit (RMS error) and estimated to be less than 0.1%, on average.

Monte Carlo uncertainties.
In the MC simulations, the Type A uncertainties in the determination of the absorbed dose to water, and of the absorbed dose to alanine, with and without magnetic field, were typically 0.1%. For self-consistency and transport parameters we estimated a Type B uncertainty of 0.1% (Kawrakow 2000, Malkov andRogers 2016). The combined standard uncertainty on the MC simulations resulted in 0.15%.

Discussion
The performance of the alanine dosimeter in the presence of a magnetic field has been investigated at three different photon beam energies over a range of magnetic flux densities. Alanine pellets were placed in a waterproof PEEK holder, developed in-house and shaped to match a Farmer-type chamber, in an electromagnet and irradiated by either a 60 Co source or conventional 6 MV and 8 MV Elekta Synergy linac beams. The long axis of the alanine holder was positioned in the centre of the magnetic poles of the electromagnet and in perpendicular orientation relative to both radiation beam and the magnetic field.

MC simulations and air gap effects
MC simulations were performed to: (a) investigate the effect of the air gaps on dose to alanine (found around the pellets when loaded in the PEEK holder), (b) investigate the uncertainty due to the random position of the pellets inside the holder and (c) calculate the absorbed dose to water and absorbed dose to alanine at the three beam qualities, with and without magnetic field, for the determination of the quality correction factor for the presence of magnetic field on alanine. The linac 6 MV and 8 MV photon beam MC models were validated by comparing simulated with experimental beam profiles and depth doses. For both energies a very good agreement was found between the simulations and the measurements. In validating the MC simulations of the experimental set up, for both energies at 1.5 T, the holder was loaded with alanine pellets, creating an air gap between the holder's stem and the first pellet. It became apparent that the thickness of the air gap varies with respect to the force that is applied on the screw cap (figure 1) to secure the pellets in the holder. Thus, MC simulations were performed for different air gaps and it was demonstrated that at least two of the MC models reproduced well the deviated behaviour of the dose along the pellets towards the tip of the holder.
The results of the MC simulations show that the air gaps affect the alanine response, due to the ERE caused by the magnetic field, by as much as 0.45% and 0.55% for 6 MV and 8 MV, respectively, and less than 0.40% for 60 Co over all the magnetic flux densities. The air gaps around other dosimeters, such as ionisation chambers, will increase the variation on the dose measurement, which can be as much as 3.8% for a Farmer-type chamber (Agnew et al 2017). This can be eliminated by immersing the dosimeters in water (if waterproof). Alanine, however, is not waterproof and needs to be placed in a watertight holder for dose measurements in water. Due to the structure of the alanine pellets (they form bevelled edges) and the possible asymmetry in the positions of them inside the holder, it is difficult to avoid the effect caused by the existing air gaps. However, we can include this effect as a component in the measurement uncertainty, which increases with magnetic flux density and reaches 0.52% for 6 MV and 0.47% for 8 MV at 1.5 T. For 60 Co the highest uncertainty was 0.52% at 2 T (0.29% at 1.5 T).
The maximum pellet-to-pellet variation of the measured alanine EPR/signal at 0 T, based on the number of the pellets considered in this study for the three energies, was found to be 0.52%, which results in a standard uncertainty of the mean of 0.13% or less. This is in line with previous studies (Anton 2006, Sharpe and Sephton 2006, McEwen et al 2015, which investigated alanine dosimetry at therapy level energy beams. Nevertheless, for each energy, the variation was found to increase with the magnetic flux density up to 0.85%, reaching a standard uncertainty of the mean of 0.22% at 1.5 T. The increase in variation is mainly attributable to the air gaps, which vary in size, based on the random locations of the pellets inside the holder. Figure 15. MC simulations to investigate the uncertainty estimation due to the random position of the alanine pellets inside the PEEK holder. The MC calculated dose to alanine for all examined magnetic flux densities, when pellets are shifted in four different positions, with respect to the x-and z-axis inside the alanine holder, are shown for 60 Co, 6 MV and 8 MV at 1.5 T (a). All data are normalised with respect to when the pellets are centrally-located in the holder. The average normalised dose over the four shifted positions, at the examined magnetic flux densities, are shown for 60 Co (b), 6 MV (c) and 8 MV (d).
In this case, the ERE will diverge the alanine EPR/signal, as the path length of the secondary electrons will follow a curved trajectory due to the Lorentz force. These affected electrons will either deposit their energy to alanine or will curve back 'exiting' the holder.

Quality correction factor for the presence of a magnetic field on alanine
The alanine quality correction factor for the presence of a magnetic field was determined by combining measurements of the alanine/EPR signal with calculations of the absorbed dose, to water and to alanine, in the presence of a magnetic field, by MC simulations. Figure 13 shows that the correction factor tends to decrease with increasing magnetic flux density. For each energy the correction, averaged over all non-zero magnetic flux densities, is 0.9946 ± 0.0019 for 60 Co, 0.9973 ± 0.0018 for 6 MV and 0.9982 ± 0.0033 for 8 MV. Although the change in the average correction factor with energy is monotonic, the uncertainties are too large to allow a more precise conclusion regarding energy dependence. The overall correction factor, k QB,Q , takes account of all the effects of the magnetic field, on dose to water, dose to alanine, alanine sensitivity, and the fluence perturbation by the PEEK holder and by the air gaps. These effects are built in the k QB,Q , which can be used to correct the dose to water measured with alanine in the presence of a magnetic field, when alanine is calibrated in the absence of a magnetic field. If a different holder was used (holder material, air gap details, etc), it would be necessary to recalculate the k QB,Q correction factor. This correction factor is holder-dependent.

The effect of the magnetic field on alanine response
The effect on the alanine intrinsic sensitivity due to the magnetic field, F QB,Q , can be calculated by using the experimental data and the MC simulations as defined in equation (6). The intrinsic sensitivity describes the yield of stable free radicals per unit dose to alanine. It can be seen from figure 14, that the alanine intrinsic sensitivity increases with magnetic flux density for all examined beam energies, without any obvious energy dependence. All F QB,Q values lie above unity with the highest being 1.0099 ± 0.0056 at 8 MV and at 1.5 T. A common linear fit F QB,Q ∼ (1 + aB) was made to the data, for all energies, and this indicates that the effect of a magnetic field on alanine is to increase its relative intrinsic sensitivity by a = 0.0047 ± 0.0005 per T. This value, a, may be used to estimate the required correction factor, k QB,Q , for different flux densities, B, by combining the fit value of F QB,Q with MC simulations of absorbed dose, to water and to alanine.

Conclusion
This study successfully characterised the performance of alanine irradiated in the presence of a magnetic field. It was found that the effect of the magnetic field on an alanine/EPR signal is energy independent and may be increased by 0.2% at 0.35 T and 0.7% at 1.5 T. Neglecting this effect may introduce systematic errors in the measured absorbed dose to water in commercially available MRI linacs. Therefore, if alanine is calibrated in the absence of any magnetic field, a correction factor, k QB,Q , needs to be applied for the determination of the true absorbed dose to water in the presence of a magnetic field. This correction factor, which depends on the geometry and material of the alanine holder, varies with magnetic flux density. Not applying this correction factor would result in an overestimation of the dose to water. With the inclusion of k QB,Q , alanine as an MR safe, robust and stable dosimeter with comparable uncertainties to a Farmer-type chamber, is a suitable dosimeter to act as a reference class detector for MRIgRT.