## 2 Materials and Methods  
### Detector Design  
The current prototype of the LaGEMPix combines a triple-GEM detector with an area of 100 \(\times\) 100 mm\({}^{2}\), and an optical readout by means of a thin-film imager composed of a thin-film transistor (TFT) backplane, an OPD frontplane, and a transparent thin-film encapsulation [9], the latter serving as protection against ambient conditions. The imager consists of a matrix of 480 \(\times\) 640 pixels at a resolution of 200 ppi. A schematic diagram of the LaGEMPix is depicted in Figure 1.  
The triple-GEM detector includes a 3.5 mm drift gap between the top GEM electrode (GEM1) and the cathode, which is a 15 \(\upmu\)m thick Mylar window. The drift gap is large enough to minimize inefficiencies in charged particle detection [10] but not large enough to affect the time performance. The transfer gaps between GEM1 and the second GEM foil (GEM2) and between GEM2 and the last GEM foil (GEM3) have a thickness of 1 and 2 mm, respectively. This asymmetrical configuration does not compromise the temporal performance of the detector thanks to a first transfer gap of 1 mm, while reducing the probability of discharge by increasing the second transfer gap by 1 mm [10]. Each GEM  
Figure 1: Schematic drawing of the LaGEMPix (to scale). Electrons produced in the drift gap between the Mylar window and the top GEM (GEM1) are multiplied in the triple-GEM stack and collected on the transparent indium tin oxide (ITO) glass anode. Scintillation photons of certain wavelengths pass through the ITO glass and are detected by the image sensor. foil consists of a 50 \(\upmu\)m Kapton layer electroplated with a 5 \(\upmu\)m thick copper layer on both sides and pierced with holes of 70 \(\upmu\)m diameter and 140 \(\upmu\)m pitch. An ITO transparent electrode, coated on a 1.1 mm-thick fused quartz substrate with a resistivity of 100 \(\Omega\)/sq, is used both as an anode and as an optical window [11; 12]. The last gas region between GEM3 and the anode, known as the induction gap, is 1.9 mm thick. The triple-GEM detector is operated in a continuous flow of Ar/CF4 (90/10) gas mixture supplied at a rate of 5 1/h. We chose Ar/CF4 because it has the highest light yield among the typically used gas mixtures (He/CF4, Ne/CF4, Ar/CO2, Ar-TEA (trimethylamine), Xe-TEA). The reported light yield varies between 0.1 and 0.5 photons per secondary electron [11; 13; 14]. The addition of CF4 gas acting as quencher allows a stable detector operation. Furthermore, it features other attractive properties, such as high electron drift velocity, low electron diffusion and fast scintillation time (of the order of a few ns) [15]. Additionally, Ar/CF4 has a strong visible emission band of around 630 nm, which is well suited for standard optical readout systems [16; 17]. GEM-based detectors coupled to CCD/CMOS cameras were previously studied for particle therapy [11; 18; 19]. However, the degradation of the camera due to radiation requires placing it outside the beam, leading to a more complex system with, for example, mirrors or lenses. In contrast to CCD/CMOS-based detectors, in the LaGEMPix, the highly pixelated readout is adjacent to the GEM anode. This allows for a more compact, relatively easy-to-build and low material budget set-up. A first LaGEMPix prototype (Figure 2) was successfully assembled as a preliminary step toward the development of a 200 \(\times\) 200 mm\({}^{2}\) detector. The sensor array of the LaGEMPix has a resolution of 200 pixels per inch (ppi). It comprises 480 \(\times\) 640 pixels resulting in a total sensor area of 60 \(\times\) 80 mm\({}^{2}\). Each individual pixel has a photodiode with a size of 103 \(\times\) 103 \(\upmu\)m\({}^{2}\) (actual active area of 10522 \(\upmu\)m\({}^{2}\)) at a pixel pitch of 126 \(\upmu\)m. The OPD frontplane is directly fabricated on top of the TFT backplane, and the organic light-absorbing layer of the OPD is deposited by slot-die coating. The TFT backplane has a self-aligned dual-gate architecture and is based on indium gallium zinc oxide (IGZO) [20].