## 2 Materials and Methods  
The \(\pi^{3}\) detector was developed to be part of the instrumentation for the Bern medical cyclotron laboratory. This facility is based on an IBA 18/18 HC cyclotron that provides proton beams with a nominal energy of 18 MeV, and beam currents in the range from a few pA to 150 \(\upmu\)A. It is used for the routine production of \({}^{18}\)F for Positron Emission Tomography (PET) and for multidisciplinary research. These two activities can be both efficiently performed thanks to a 6 m long Beam Transfer Line (BTL), which transports the beam into a separate bunker with an independent access [12], where the experiments described in this paper were conducted. The cyclotron features a Radio Frequency (RF) at 42 MHz, which corresponds to the second harmonic of the proton cyclotron frequency. The effects of the RF are not longitudinally visible, and the beam can be considered to be continuous. Transverse beam dynamics was previously extensively studied with the BTL, as reported in Ref. [13]. In the framework of a research program focused on the production of non-standard medical radioisotopes by means of solid targets [11], a novel active irradiation system is under development. It aims at focusing the proton beam produced by a medical cyclotron (\(\sim\)12 mm FWHM) into a target of 6 mm width, and to keep it in position thanks to the feedback given by a specific beam monitor. To be suitable for any medical cyclotron, this system must be compact (about 1 m long) to fit in existing bunkers of standard dimensions. For this reason, we chose a novel kind of magnet embedding two quadrupoles and two (X and Y) dipoles within the same device. This apparatus was provided by the company D-Pace (Canada) and is called Mini-PET BeamLine (MBL) [14]. As shown in Figure 1, the magnet is 40 cm long and weighs 54 kg. The beam pipe features a peculiar shape to minimize the distance of the poles from the beam axis, while ensuring an optimal transmission considering vertical and horizontal focusing and defocusing. The \(\pi^{3}\) detector has been designed to study the effects of the MBL on the evolution of the beam along its path. The scheme of the \(\pi^{3}\) is shown in Figure 2 (left), where its components are highlighted. A moving support Figure 2 (right) located inside the beam pipe holds the 23.8 mm diameter circular  
Figure 1: The compact 40 cm long magnet of the Mini-PET BeamLine (MBL) (**left**) and the peculiar transverse shape of the beam pipe (**right**). scintillating screen and the miniaturized camera. It is moved along the beam direction by a 660 mm long screw which is connected to a stepper motor by means of a vacuum feed-through. The screw lead is 1 mm per revolution and the stepper motor can perform very small steps down to 1/100 rotations. The screw is maintained parallel to the beam axis by means of specific supports (in yellow in Figure 2, left). The moving support holds the P47 aluminum coated foil on one side and a miniaturized CCD camera on the other, as shown in Figure 2 (right). The P47 scintillating material (Y\({}_{2}\)SiO\({}_{5}\) doped with Ce\({}^{+3}\)) was chosen because it is conductive and has a good light yield with maximum emission around 400 nm (blue) and a decay time of about 70 ns. The aluminum foil and the P47 coating are both about 1 \(\upmu\)m thick, producing an energy loss of about 13 keV for the 18 MeV proton beam. The fixed distance between the screen and the camera (Figure 3) allows for an easier reconstruction of the beam image. The CCD used for the first prototype is a KKmoon USB Endoscope Inspection Camera, with a diameter of 5 mm. The resolution of this camera is 640 \(\times\) 480 pixels and it can record images at 8 frames per second. It features an automatic focusing and white balance. This kind of endoscopic camera was chosen for its dimensions and low cost. Indeed, during operations, radiation damage by protons and neutrons deteriorates the performance of the camera, which can however be easily changed and considered to be a consumable.