Appendix A.3. Out-of-plane beam deflection Appendix A.4. Uncertainty estimation A transmission irradiation experiment was performed to ensure that the beam was not deflected out of the film ( x - y -) plane by magnetic field components pointing along the y -axis. For this purpose, the phantom was removed and a pixelated scintillation detector with a resolution of 0 . 5 mm (Lynx, IBA Dosimetry, Schwarzenbruck, Germany) was placed behind the magnet assembly in a distance of 24 cm. As depicted in Extended Data Figure A.9a, the out-of-plane deflection due to the magnetic field was within measurement uncertainty. The deflection in y -direction observed on the scintillation detector y$_{Lynx}$ is depicted in Extended Data Figure A.9b. We note that, assuming a uniform magnetic flux density B = 0 . 95 T between the magnet poles and no magnetic field outside, y$_{Lynx}$ can be easily approximated by trigonometric considerations from the length of the magnet poles x$_{pole}$ and the distance between the magnet and the scintillation device d$_{air}$ as Neglecting relativistic effects and beam energy loss in air, the radius of the beam path inside the magnetic field is r ≈ 14 . 4$^{√}$ E$_{0}$ B$_{0}$ T cm (MeV) − 1 2 , and a function of the initial proton energy E$_{0}$ [16]. Values for y$_{Lynx}$ obtained with this approximation for a nominal distance between magnet and detector screen of d$_{air}$ = 26 cm show excellent agreement with the measured positions (see Extended Data, Figure A.9b). The difference of d$_{air}$ to the measured distance between the magnet and the detector can be ascribed to the distance between the active scintillation layer and the detector’s surface and the non-uniformity of the magnetic field. The influence of the measurement uncertainties on the Bragg peak lateral deflection Δ y$_{80}$ and range retraction Δ R$_{80}$ was assessed as follows (see Table A.1). Statistical uncertainties such as the robustness of the Δ R$_{80}$ - and Δ y$_{80}$ -determination, and possible remaining displacement of the film relative to the phantom and to the scanner have been assessed by repeating the measurement for 180 MeV three times. Mean absolute deviations were used as statistical uncertainties. Film-to-film variations and the film calibration are subject to percentual dose uncertainties. The cali- bration has a relative dose uncertainty of 5 % [28]. Dose uncertainties due to film and scanner variations add up to 0 . 5 % [29]. Being proportional to the dose, these uncertainties were considered to have negligible 14 y$_{Lynx}$ = r − $^{√}$r 2 − x 2 pole + d$_{air}$ √ r 2 − d$_{air}$ . (A.3)