of 0 . 1 mm. The same parameters were found as for the model building (5 mm for the world production threshold, and 0 . 1 mm for the phantom production threshold, step limiter and scorer resolution). The film dosimeter was not explicitly simulated to avoid boundary artefacts. The most relevant simulation parameters are summarized in table B.3. We note that in the depth-dose curves (see figure 3) of the 180 MeV beams, a small peak is observed at a depth of about 2 . 5 cm both with and without magnetic field. The peak was not reproduced when the two collimators were replaced by one collimator of their combined thickness. Furthermore, the proton energy spectrum at the phantom entrance showed a steep maximum around 180 MeV and a small maximum around 60 MeV. Thus, a probable explanation for the small peak are low energy protons having traversed only one of the two collimators. A model of the magnetic field was generated using finite-element modelling (COMSOL Multiphysics, COMSOL AB, Stockholm, Sweden). The geometry of the magnet assembly was implemented as given by the manufacturer (Vacuumschmelze GmbH, Hanau, Germany) and surrounded by the pre-defined material ’Air’. The remanent field strength of the magnetic poles was set to B$_{r}$ = 1 . 37 T, as specified for the VACODYM 764 TP material by the manufacturer [26]. The hysteresis curve B ( H ) for the yoke was inherited from the COMSOL material library using the predefined material ’Soft Iron (without losses)’. The model was validated comprehensively using an automated magnetometry setup comprising a robotic positioning device and a Hall probe (MMTB-6J04-VG, Lake Shore Cryotronics, Westerville, USA) connected to a Gaussmeter (Model 421, Lake Shore Cryotronics). Predicted and measured magnetic flux densities agreed within 2 % [21]. In air, the field of the magnet is mainly limited to the gap between its two poles, and has a maximum magnetic flux density of 0 . 95 T (see Figure A.7). Its main component B$_{z}$ is aligned parallel to the z -axis, Appendix B.3. Magnetic field model 20 Table B.3: Geant4 simulation parameters. Geant4 version 10.2.p02 Physics list QGSP BERT HP EMZ Production threshold in world 5 mm Production threshold in phantom 0 . 1 mm Step limiter 0 . 1 mm Scorer resolution 0 . 1 mm Water mean excitation energy 78 eV Random number generator RANMAR