Single-shot MHz velocity-map-imaging using two Timepix3 cameras

We demonstrate the application of event-driven Timepix3-based detectors in combination with a double-sided velocity-map-imaging spectrometer to record the full 3D momentum of charged particles at the free-electron-laser facility FLASH. We measured the XUV induced fragmentation of $\text{N}_2$ using 250 kHz FLASH bursts with sub-pixel spatial resolution and up to 1.7~ns temporal resolution for photoelectrons. To further demonstrate the capabilities of this camera at even higher repetition rates we measured single-shot images of He($1s$) photoelectrons for bursts with a repetition rate of 1 MHz. Overall, with the Timepix3 camera we overcome limitations of standard-camera technology for advanced-imaging experiments with requirements on high event-rates and high spatio-temporal resolution.


INTRODUCTION
The underlying theme of the Grand Challenges being posed to physics, chemistry, biology, and materials science is to understand, predict, and ultimately control the properties of matter [1,2]. To help us in this quest, in recent years ever more advanced light sources have been developed. After the success of the first superconducting free-electron-laser (FEL), the Free-electron LASer in Hamburg (FLASH) [3], the next generation of FELs, such as the European X-ray Free-Electron Laser facility (XFEL) [4,5] and the upcoming Linac Coherent Light Source II (LCLS-II) [6], operates with repetition rates of up to 4.5 MHz which are far higher than those of normalconducting FELs, potentially allowing for more data to be collected at a much faster pace. However, exploiting the advantages provided by these next-generation light sources requires detectors to collect data at the same rate. This need created a drive for new detectors to match the potential of the new FELs, with a few developments being reflected in AGIPD [7], ePix [8], tPix [9], and DSSC [10].
Whilst these new facilities provide opportunities for a vast range of experiments, those investigating the chemical dynamics of molecules and clusters in the gas phase often utilize ion and electron imaging [11]. Ion imaging [12] traditionally uses 2D position-sensitive detectors in tandem with velocity-map-imaging (VMI) techniques [13] to map the transverse momenta of charged particles. This method allowed for a deeper insight into the dynamics of molecules [14][15][16]. Common VMI applications use a wide range of light sources, such as gas-discharge lamps [17], pico-and femtosecond laser systems [18][19][20], high-harmonics sources [21][22][23] as well as studies performed on large-scale facilities such as synchrotron-radiation sources [24,25] and FELs [26][27][28][29] and even enabled the investigations of chemical-reactiondynamics [11,30].
Many 2D detectors for VMI purposes are realized through the use of microchannel plates (MCPs) in combination with a phosphor screen and a camera [31][32][33]. Alternative methods use delay-line-detectors (DLDs) [34] instead of the camera-phosphor combination [35], which potentially allow even for 3D ion momentum detection [35]. However, these detectors come at the disadvantage of a poorer multi-hit capability compared to the phosphorscreen approach, which limits the applications for high flux experiments as typically performed at FELs. This has pushed experiments that use the more traditional 2D detectors to find novel ways to obtain full 3D momentum distributions. For example, methods like Abel inversion [36][37][38] can be utilized, but come at the cost of requiring a cylindrical symmetry of the observed physical problem. An alternative experimental approach to inversion techniques for capturing the 3D momentum is slice imaging [39]. It requires to sequentially gate or slice on the time-of-flight distribution for the charged particles under investigation for a fraction of its flight time over as many slices as needed [40].
In parallel to the emergence of VMI, coincidence momentum-imaging methods, such as cold target recoilion momentum spectroscopy (COLTRIMS) [41][42][43] and related techniques [44][45][46], also developed into powerful methods for imaging gas-phase photoionization and photofragmentation dynamics. With the detection of both electrons and cations emitted from the same atom, molecule, or cluster, the technique allows access to the full kinematics of a single reaction and, therefore, systematic studies of the underlying physical mechanisms.
In the last decade, several methods were established to record the photons emitted from a phosphor screen outside the vacuum chamber with nanosecond time resolution. Two important devices providing such capabilities for visible-light detection are the Pixel Imaging Mass Spectrometry (PImMS) camera [60][61][62] and Timepix-based cameras [63][64][65][66][67]. Both PImMS and Timepix cameras employ a silicon-based sensor technology and are event triggered, i. e., only pixels which collected charges above a certain threshold are read out and contribute to the data stream. For PImMS II, a maximum rate of 60 Hz with a temporal resolution of 12.5 ns can be achieved [40]. The performance of the current Timepix generation cameras, Timepix3, is given by a maximum event rate of 80 Mpixel/s with a temporal resolution of 1.6 ns [66]. With few nanosecond time resolution, it has become possible to measure the full 3D momenta of ions also in experiments without cylindrical symmetry [32,40,68,69].
Furthermore, it allows for the recording of data at high repetition rates, e. g., provided by synchrotrons, Optical Parametric Chirped-pulse Amplificatiers (OPC-PAs) [70], FELs providing trains of individual pulses at high-repetition-rates in bursts, such as FLASH [3] or the European XFEL [4], and the upcoming LCLS-II FEL [6] with a plain 1 MHz repetition rate. Therefore, timeresolving pixelated detectors permit the combination of position-sensitive phosphor-screen based detectors with high repetition rate light sources.
Here, we present results from an experimental setup utilizing a double-sided VMI spectrometer with two Timepix3 cameras to capture the signals from both ions and electrons simultaneously at FLASH. We captured the 3D momenta of ions and electrons produced from nitrogen and helium by XUV ionization at repetition rates up to 1 MHz bursts for electrons and 250 kHz bursts for ions.

METHOD
The experiments were conducted using the CAMP endstation [28] at beamline BL1 at FLASH [3,71]. The setup comprises a double-sided VMI spectrometer capable of simultaneously measuring ions and electrons [28]. Details on the experimental setup were published elsewhere [28] and only a brief summary is provided here. Figure 1 shows a sketch of the detection setup.
Nitrogen or helium gases were expanded through a 30 µm diameter orifice from a stagnation pressure of ∼1 bar into vacuum forming a continuous supersonic jet. After 5 mm the jet was collimated by two skimmers with orifice diameters of 150 µm and 350 µm with a distance of 18 mm of one another. The interaction region was ∼78 cm downstream of the 2nd skimmer. The sample and XUV-photon beams crossed each other in the interaction center of a double-sided VMI. The wavelength of the FEL was 8.37 nm (148.1 eV) with an averaged pulse energy of 0.9 ± 0.2 µJ and 0.7 ± 0.1 µJ for the helium and N 2 measurements, respectively, focused to a nominal diameter of 10 µm. For the N 2 measurements the FEL was configured to provide 8 pulses at a repetition rate of 250 kHz within the pulse train, limited by the available duration of the radiofrequency window of ∼30 µs. Datasets were recorded for 72007 FEL pulse trains with on average 6.5 detected ions per FEL pulse. For the electrons from He, 30 pulses at a repetition rate of 1 MHz within the train were used with the same limitation on the radiofrequency window as for the ions. Overall, electron data of 6287 pulse trains was recorded. Here, on average, ∼9 electrons were detected for a single FEL pulse. The charged particles were detected by positionsensitive detectors consisting of two MCPs in chevron configuration and a fast P47 phosphor screen (Photonis, APD 2 PS 75/32/25/8 I 60:1 NR P47). Both detectors had a diameter of 80 mm. The photons emitted by the phosphors were recorded by two time-stamping cameras consisting of an optical-imaging element and an assembly of a light-sensitive silicon sensor on the Timepix3 chip (Amsterdam Scientific Instruments, TPX3CAM). Both Timepix3 cameras were synchronized with a trigger from the FEL. To match the data from the cameras with the diagnostics provided by the facility and the beamline, the "Train ID" from the FEL corresponding to each specific XUV shot was recorded simultaneously and stored alongside the Timepix data [72]. This allowed for later correlation, sorting, and normalization based on individual triggers and FEL parameters read from the data acquisition of the FEL [73,74]. Timepix3 itself is an event driven detector where the data from each pixel consists of a tuple with 4 elements, namely the x and y position of the pixel on the camera sensor, the time-of-arrival (ToA), which gets translated into the time-of-flight (ToF) of the particle in the VMI by taking into account the simultaneously recorded trigger event, and the time-over-threshold (ToT), a measure of the pixel intensity [63].
Event-based detectors can record VMI images not only for a single arrival time, but for the complete ToF spectrum [75,76]. Figure 2 shows the ToF spectrum recorded for the XUV ionization of the N 2 beam. The insets with 2D images show the corresponding VMIs from the highlighted ToF-ranges, which were all recorded simultane-ously. The control of the Timepix3 camera and online analysis of data stream was performed using an updated version of the open-source library PymePix [77]. Data analysis made use of numerous Python packages, most importantly NumPy [78], Scikit-learn [79], SciPy.ndimage [80], Dask, Jupyter, Matplotlib [81], Pandas [82], HoloViews, and PyAbel [83].
Hit positions were determined by clustering and centroiding of triggered-pixel events. The position was defined as the center of mass of the individual blobs of triggered pixels. For determination of the ToF, the temporal information of the individual pixels was time-walk corrected by a pixel-based correlation curve between ToT and ToA [84][85][86]. The correlation curve was obtained from electron data for both detectors using the assumption that all electrons arrive at the same time within the resolution of the Timepix3 camera. The ToT-weighted expectation value of ToF was calculated from the timewalk corrected data, taking into account all pixels in a blob. This value was time-walk corrected making use of a second mean ToT-ToA correlation curve.
The spatio-temporal (x, y, ToF) data was used to determine the initial 3D velocity vector of all ions in the interaction region. Assuming ideal velocity mapping, each (x, y) position of an ion on the 2D detector was converted to its initial parallel velocity components v x and v y [31]: The conversion depends on the velocity origin in spatial coordinates (x 0 , y 0 ), which itself depends on the massover-charge ratio of the specific ion and the transverse velocity of the molecular beam. Furthermore, it depends on the specific ToF as well as a spatial magnification factor C s = 1.18, which was determined from simulations [87]. The velocity component v z , perpendicular to the detector surface, was evaluated from the specific temporal deviation ∆t from the mean of the individual ToF-peak t 0 . This is in first order given by [88]: with the electric field strength in the interaction region perpendicular to the detector surface E z , the Coulomb constant e, and the mass m of the specific ion. E z = 269.6 V/cm was determined from simulations. Combining (1) and (2) yielded all three components of the initial-ionvelocity vector in the interaction center.

Spatial resolution of the detection system
To classify the scientific results obtained, we first discuss the spatio-temporal resolution of the detection system after centroiding. To provide an upper limit for the spatial resolution, the smallest structures observed in our data were taken into account. Figure 3 a shows a zoom into the bright N ++ 2 peak shown in the corresponding inset of Figure 2, which reveals a rhomboid structure. This is visible throughout the whole detector area, and results from the mesh placed in front of the electron detector, which has a pitch of 224 µm and a wire thickness of 30 µm. The image shown in Figure 3 a was rotated by 7 • to align one row of gaps with the y axis. The size of the overall structure along the x axis is attributed to the size of the molecular beam with a diameter of 6 mm and non-perfect VMI conditions. The finite spread along the y axis is ascribed to the recoil from the leaving electrons with kinetic energies up to 130 eV. This gain in resolution due to centroiding, by about one order of magnitude in a single spatial dimension, is similar to the ones observed before [89][90][91]. In our case, on average 8.8 pixel were illuminated for a single ion impinging onto the detector. Obtaining such an increase in resolution by calculating the intensity-weighted center of mass of the blob distribution clearly indicates that the ToT is a good measure of the energy deposited in a specific single pixel. Overall, an effective spatial resolution of the detector equivalent to 8 Mpixel without centroiding was achieved, compared to the 65 kpixel sensor array of the Timepix3 chip. Temporal resolution of the detection system Ion and electron data were used to determine the temporal resolution of the detection system. On the timescales of the camera system, electrons from the origin effectively arrive at the same time, and are thus well suited to determine the temporal resolution [64]. Figure 4 a shows a VMI where electrons from the XUV-ionization of N 2 were detected. It shows signal on a considerable part of the detector and, therefore, the temporal resolution obtained is representative for the whole detector. The corresponding ToF histogram is plotted in Figure 4 b. All entries were time-walk corrected as discussed above. For each particle hit in the detector, multiple pixels recorded the time; the weighted average was calculated, using the ToT values as weights since pixels with larger signals will tend to give more accurate measurements. Two peaks were observed, corresponding to the signal from the actual electrons with background (large amplitude) and secondary electrons with only background (small amplitude), respectively. The best fit of a sum of two Gaussians to this data is achieved with a common σ = 1.7 ns for both peaks.
In Figure 4 c the temporal profile for ions of the N ++ 2 peak is plotted. For the small region where N ++ 2 was detected, we also expect no significant spreading of the measured ToA due to the initial finite velocities of the ions. Here, the best fit of two Gaussians yielded a standard deviation of σ = 2 ns for the 1st peak and σ = 3.2 ns for the second peak. The first and narrower peak is attributed to the actual N ++ 2 ions whereas the second peak are contributions from unspecified residual background which cannot be separated from the ions of the target but have slightly different ToF due to the non-ideal VMI conditions. The 18 % larger width of the ion peak as compared to the electrons, is attributed to detector artifacts: The mean blob size in this region of the detector was 5.7 pixel whereas the mean blob size for electrons was 7.1 pixel. This is ascribed to the fact that the N ++ 2 peak is located in a less sensitive area of the MCP, and it resulted in a lower number of pixels that can be taken into account for the time-walk correction. The area of reduced sensitivity is clearly visible in the projected image, Figure 5 a, around and below the central bright N ++ 2 peak. On top, the less intense pixels also suffered from a larger temporal jitter due to time-walk.
Calculating the weighted average of the time-walk corrected ToA did not result in a superior resolution than the 1.56 ns clock period. Previously, a 720 ps resolution obtained after a pixel-by-pixel calibration of the time response in the case of direct irradiation with minimumionizing particles was reported in a dedicated Timepix3 setup [86]. However, due to the lack of flexibility in terms of detector tuning and differences in the sensors of our Timepix detector with respect the one previously reported, a pixel-by-pixel calibration did not result in an improved resolution.
Overall, we attribute the observed limit in temporal resolution to the relatively long phosphor screen rise time of 6.7 ns [92] in combination with the dynamics of the charge-collection and signal response of the Timepix3 sensor-chip assembly itself. However, the observed temporal resolution is still better than the 2 ns previously reported for electrons imaging using Timepix3 [64] as well as the 12.5 ns reported for PImMS [40]. On top, faster phosphors would improve the achievable temporal resolution. Rise times with a factor of 2 faster than the used P47 have been realized [92]. In addition, these scintillating materials come with a higher brightness and a much faster decay time, which will improve on the ToA and ToT determination.

Comparison of spatial and temporal resolution
To directly compare the spatial resolution with the temporal resolution, the ratio of (2) and (1) can be used: R = (C∆t)/(∆r m/q) with the temporal and spatial resolution denoted as ∆t and ∆p, respectively. The constant C = 2.33 × 10 −4 √ Joule pixel meter depends only on the geometry of the spectrometer and the specific voltages applied to the electrodes. For m/q = 14 u/e the temporal and spatial resolutions were determined to ∆t = 2 ns and ∆r = 0.09 pixel, respectively, which results in R = 34. Therefore, the spatial resolution is a factor of 34 better than the temporal resolution for m/q = 14 u/e. However, due to its inverse-square-root mass-over-charge dependency, this ratio improves in favor of the temporal velocity resolution toward larger ToA, i. e., mass-to-charge ratios. For m/q = 16 000 u/e a similar resolution in temporal and spatial velocity coordinates would be obtained for the voltage settings used here.

Velocity-map imaging of ions from N2
Figure 5 a shows the (v x , v y ) projected velocity map for ions from XUV ionization with a mass-over-charge ratio m/q = 14 u/e. The projection was carried out between v z = ±12 km/s. The central bright peak is attributed to N ++ 2 , whereas the outer structures arise from the fragmentation of N ++ 2 and N 3+ 2 into N + + rest. These features were described in detail before [22,[93][94][95] and the corresponing peak velocities and energies are labeled by the description F band and the final-state term symbols A 1 Π u , d 3 Π g , D 1 Σ + u , and 2 Π u in Figure 5 b and e. Figure 5 b shows a slice through the velocity distribution of Figure 5 a through the center of the v z distribution with a full width of ∆v z = 2 km/s. The central bright peak is again attributed to N ++ 2 . The 4 circular structures arising from N + are visible in the outer regions peaking at radial velocities given by v r = 3.9, 7.1, 8.2, and 10 km/s. The two inner rings show an angular asymmetry, whereas the outer rings are isotropic. Figure 5 c shows a slice through the velocity distribution of Figure 5 a through the center of the v y distribution with a width of ∆v y = 2 km/s. The assignment of the central peak and the rings are as in Figure 5 b. In contrast to Figure 5 b, a strong depletion of signal along v x = 0 is observed. This striking difference is ascribed to the less sensitive area of the detector visible in the center of the projected image toward negative v y velocities.
Collecting ToA-resolved data allowed to select specific arrival time windows from the complete data to obtain mass-over-charge-specific velocity maps. This is a significant advantage over traditional slicing techniques, which generally use gated detectors and thus only capture ions in a specific arrival time range [39]. Whilst this would produce the same images as seen here, it would come with the caveat that if one wishes to look at another arrival time/slice, a repetition of the experiment with different gate settings would have to be performed. Moreover, in that case, correlations between fragments differing in the mass-over-charge ratio are lost [62].
Furthermore, the recorded full 3D momentum distributions allow for arbitrarily oriented slices or subsets of the data. For instance, the data in Figure 5 c corresponds to a slice rotated around the v x axis by 90 • relative to the one in Figure 5 b. Both of these are contained in the single recorded dataset as well as the data for any other slice. Due to the axial symmetry of our experiment with respect to the v x axis one expects the same image. We attribute the observed differences in sharpness between Figure 5 b and Figure 5 c to the different resolutions obtained for the spatial and temporal coordinates, as described above. Compared to traditional gating, which is also very challenging on the sub 10 ns level, we want to stress that these data for all the different ToAs of the different masses were all recorded simultaneously, in a time that would otherwise have been needed for a single slice imaging measurement. This demonstrates the power of recording the 3D datasets for advanced analysis opportunities. Figure 5 d shows the Abel-inverted image of Figure 5 a obtained using the rBasex method [83]. Again, the inner N ++ 2 structure and the four main circular features are observed. It shows smooth angular structures in comparison to the slice images, which are expected for the polar-coordinate-based inversion method used. However, the statistical noise and systematic errors, such as the less sensitive area, lead to strong artificial radial features in the Abel-inverted image and thus fine ring-like structures that are not real. These cannot always be distinguished from the real signal easily, as compared to the sliced images, and as such this could be seen as a disadvantage of such inversion methods. On top, Abel-inversion requires for the experiment a cylindrical symmetry of the observed physical problem. Figure 5 e shows the energy distributions obtained from the projected image (blue), the (v x , v y ) slice (orange), the 3D velocity distribution (green), and the Abel-inverted image (red). The 4 circular structures are clearly visible for all distributions. The increased resolution obtained by slicing is also observed in the kinetic energy distributions in Figure 5 e. The three central circular structures are visible for the projected-image distribution, Figure 5 a. However, here, the peaks and thus energies for the specific channels are observed at too low energies due to the projection along v z .
Furthermore, all ions within the m/q = 14 u/e range were used to determine a 3D energy distribution from the three-dimensional velocity vector that, in principle, would provide the full information with the best statistics. In practice, the obtained resolution of the 3D distribution is worse compared to the one obtained by slice imaging, which is again attributed to the temporal resolution being worse than the spatial one for m/q = 14 u/e. Referencing to the Abel-inversion, the peaks of the 3D distribution are observed at slightly to high energies when compared to slice imaging. We ascribe this to their overlap in combination with an increasing volume element from the Jacobian as a function of increasing energy.
The energy distribution obtained from the Abelinverted image is similar to the one received from the slice distribution. For the relatively narrow slices used, this is expected for the four N + rings. Here, a shift of the peak energy as well as a peak broadening below the percent level with respect to the peaks obtained from Abel inversion due to the finite slice width is expected. However, the central part of the image is not well sliced. Especially for radial ion velocities below 1 km/s the momenta were effectively projected on the (v x , v y ) plane again. The distribution from slice imaging overestimates in terms of counts the real distribution in this area. Therefore, in this part of the image, the energy distribution obtained from Abel inversion is clearly favorable.

Covariance mapping of ions from N2
To further investigate the fragmentation dynamics of N 2 after XUV ionization, we employed a covariancemapping technique [96][97][98]. Figure 6 shows the timeof-flight mass-spectra covariance map obtained from the temporal component of the Timepix3 data. Diagonal structures observed between ion pairs in the covariance map are attributed to fragmentation channels involving at least two charged particles; all other structures arose due to false coincidences. The line at m 1 /q 1 = 14 u/e and m 2 /q 2 = 14 u/e corresponds to the channel N 2 + hν → N + + N + , whereas the steeper line at m 1 /q 1 = 7 u/e and m 2 /q 2 = 14 u/e is ascribed to N 2 + hν → N ++ + N + . The very week line at m 1 /q 1 = 7 u/e and m 2 /q 2 = 7 u/e corresponds to the channel N 2 + hν → N ++ + N ++ as documented before [94,95,[99][100][101]. These previous studies observed further correlation channels, which were not visible in our measurement at lower FEL intensity, resulting in ionization only to low-charge states z ≤ 3 in our case. Nevertheless, the presence of the three covariance lines shows that our method has the sensitivity to apply these techniques to the recorded dataset. Further analysis demonstrated good agreement with the experimentally determined Timpix3 detection efficiency given by 98 % obtained from the blob-size distribution.

Imaging photoelectrons from He
The VMI map for electrons from XUV ionized helium is shown in Figure 7 a. Helium was chosen for its simplicity and the clearly detected photoemission line, which for nitrogen photoelectron imaging was not visible due to the excessive background. The anisotropic He(1s) photoemission line labeled E 1 corresponding to the first ionization energy with 24.6 eV of He at a velocity of 6.6 Mm/s can clearly be observed. Electrons emitted with the energy from the second ionization energy of 54.4 eV are visible at the line with the label E 2 . The inner bright structure in the image is attributed to undefined anisotropic background signal of undefined shape, which makes it impossible to subtract it from the actual signal to improve  Figure 7 c shows the energy distributions for the projected data (blue), cut within a full opening angle of 46 • , as indicated in Figure 7 a, in order to mitigate the effects of the large background contributions in other regions of the detector. The energy distribution obtained from the Abel inverted data is also shown (orange). Both curves were normalized to the same peak intensity of the photoemission line. The spectrum was calibrated using the known photo line energy given by 123.5 eV and a discussion of the accuracy of the mapping regarding the absolute-velocities determination was thus not possible.
The energy width of the photoemission line in terms of the standard deviation obtained from the Abel-inverted image is given by σ = 4.8 eV. The width is attributed to three effects: Firstly, the 1 % root-mean-square (RMS) bandwidth and 1 % RMS jitter of the FEL gave rise to an RMS of about 2 eV at the photon energy of 148.1 eV. Secondly, the limited instrument resolution of the VMI given by dE/E = 1.5-2 %. Thirdly, the strong background signals observed for electrons which broadens the line additionally. Overall, in such typical VMI setups, the spatial resolution of the detector is not the limiting factor for precise measurements of photoemission lines.
To further demonstrate the capabilities of the Timepix3 at even higher repetition rates, photoelectrons from He were recorded for FEL pulse rates of 1 MHz. Due to limitations in the available radiofrequency window of ∼30 µs, only 30 pulses were added into the pulse train. For the short time period of ∆t = 1 µs between XUV pulses only electrons were recorded as the ToF of ions is generally much longer. Disentangling such overlapping ToFs from multiple pulse times is beyond the scope of the current work.
The results for these measurements are depicted in Figure 7 d, where the average number of electrons per shot as a function of the specific XUV pulse N burst within a pulse train recorded with the Timepix is plotted in blue. The FEL pulse energy measured with the gas monitor detector (GMD) of the beamline is shown in orange [102]. To match both data sets, the data of the GMD were scaled to the number of electrons measured with the Timepix in the first burst pulse. An overall decrease of XUV energy and mean electron number over the course of the pulse train due to the FEL performance is observed. Starting at around the twentieth pulse in the train, the Timepix electron count starts to deviate from the GMD energy due to the properties of the detection system. The principal result from these measurements is that our Timepix3 setup is fully capable of recording data at such high repetition rates in burst-mode operation.
The 30 pulses within a burst at a burst-to-burst repetition rate of 10 Hz resulted in a data rate of approximately 20 000 pixels per second per detector. This is well below the maximum bandwidth of the camera given by 80 Mpixel/s. However, the full bandwidth of the camera is likely to be reached at upcoming research facilities like LCLS-II [6]. In principle 10 ions or electrons with an average blob size of 8 pixels at the full repetition rate of 1 MHz, corresponding to 10 MHits/s, could be detected. This is still one order of magnitude lower than the state of the art FPGA DLD technology [103]. The temporal resolution in our experiment of 1.7 ns is between the 10 ps and 12.5 ns obtained for DLDs and PImMS, respectively. The Timepix3 spatial resolution of 25 µm is comparable to the ones realized with PImMS and DLDs. Important advantages of our approach with respect to DLDs are the easier incorporation of the camera into existing VMI setups, which does not even require to break vacuum, as well as the better multi-hit capability. Furthermore, for the next generation of Timepix4 with an improved temporal resolution of ∼200 ps and a 30 times higher bandwidth, the expected performance gets considerably closer to that of DLDs [104,105].

Detector dead-time and saturation
For the last pulse in the trains a deviation in the expected signal intensity of about 2 % with respect to the GMD data was observed, see Figure 7 d. This slightly decreased electron detection efficiency for late pulses in the pulse train was attributed to saturation effects and will be further investigated in future work.
To minimize saturation, an even distribution of the signal across the detector is advantageous. For the data presented in Figure 5 and Figure 7 on average 9 electrons and 7 ions per XUV pulse were recorded with an average blob size of 7 pixels for electrons and 9 pixels for ions. The dead time for a single pixel is given as a sum of the Timepix3 read-out time of 475 ns [63] and the ToT for that pixel. The average ToT for the N 2 data presented was approximately 500 ns. This results in an averaged pixel dead time of around 1 µs. However, this does not provide a good estimate for the dead time of the pixels of a whole blob: Generally, a broad distribution of ToTs is present for the pixels in a single blob, which could lead to missing pixels in a potential second blob arriving within the dead time of the highest intensity pixel. Therefore, a much better estimate for the blob dead time results from taking the ToT from only the pixels with the highest intensity in each individual blob. For our experiment, this was ToT = 950 ns, which results in an average dead time at the blob level of approximately 1.5 µs.

CONCLUSIONS
We demonstrated the implementation of two Timepix3 cameras at a high-repetition-rate x-ray facility and the ability to record the 3D momentum distribution of all ions from XUV ionization of N 2 and 2D-projected photoelectron distributions from He with the PymePix software. The data was recorded using a double-sided-VMI setup in the CAMP endstation at the free-electron laser FLASH operating with pulse-train structures with 250 kHz and 1 MHz pulse repetition rates.
The use of the Timepix3 for acquiring electron images from 30 XUV pulses evenly spaced over 30 µs showed saturation effects in the order of 2 % toward the end of the burst, allowing for single ion and electron detection for all pulses in the train. Through clustering and centroiding of the signals, we achieved a spatial resolution of ∼0.1 pixel and thus the equivalent of an 8 Mpixel camera. The arrival times of electrons were determined with a temporal resolution of σ = 1.7 ns limited by the photoemission dynamics of the phosphor screen and a complex interplay of camera internals. Here, faster phosphor screens are required for further improvements, which becomes an even more pressing matter with the developments of Timepix4 on the horizon.
To further exhibit the potential of the Timepix3 detector, a covariance analysis for the ToF-MS was performed providing fragmentation correlations that are usually lost in VMI spectrometers combined with regular cameras.
Overall, our results demonstrate the potential of the Timepix hardware platform combined with appropriate data acquisition and analysis software not only for laboratory experiments but also for highly demanding experiments at large-scale facilities operating at very high repetition rates such as FLASH, the European XFEL, or LCLS-II.

ACKNOWLEDGMENTS
We thank Daniel Ramm for preparing the experimentalsetup, Sören Grunewald for helping with IT infrastructure, Matthew Robinson for proofreading the manuscript, and Amsterdam Scientific Instruments B. V. for collaborative information sharing and discussions.

FUNDING
We acknowledge financial support by Deutsches Elektronen-Synchrotron DESY, a member of the Helmholtz Association (HGF), also for the provision of experimental facilities and for the use of the Maxwell computational resources operated at DESY. Parts of this research were carried out at FLASH.
We acknowledge the Max Planck Society for funding the development and the initial operation of the CAMP end-station within the Max Planck Advanced Study Group at CFEL and for providing this equipment for CAMP@FLASH. The installation of CAMP@FLASH was partially funded by the BMBF grants 05K10KT2, 05K13KT2, 05K16KT3, and 05K10KTB from FSP-302.
The research was further supported by the European Union's Horizon 2020 research and innovation program under the Marie Skłodowska-Curie Grant Agreement 641789 "Molecular Electron Dynamics investigated by Intense Fields and Attosecond Pulses" (MEDEA) and the Cluster of Excellence "Advanced Imaging of Matter" (AIM, EXC 2056, ID 390715994) of the Deutsche Forschungsgemeinschaft (DFG).