Real-time spatial characterization of micrometer-sized X-ray free-electron laser beams focused by bendable mirrors

: A real-time and accurate characterization of the X-ray beam size is essential to enable a large variety of different experiments at free-electron laser facilities. Typically, ablative imprints are employed to determine shape and size of µm-focused X-ray beams. The high accuracy of this state-of-the-art method comes at the expense of the time required to perform an ex-situ image analysis. In contrast, diffraction at a curved grating with suitably varying period and orientation forms a magnified image of the X-ray beam, which can be recorded by a 2D pixelated detector providing beam size and pointing jitter in real time. In this manuscript, we compare results obtained with both techniques, address their advantages and limitations, and demonstrate their excellent agreement. We present an extensive characterization of the FEL beam focused to ≈ 1 µm by two Kirkpatrick-Baez (KB) mirrors, along with optical metrology slope profiles demonstrating their exceptionally high quality. This work provides a systematic and comprehensive study of the accuracy provided by curved gratings in real-time imaging of X-ray beams at a free-electron laser facility. It is applied here to soft X-rays and can be extended to the hard X-ray range. Furthermore, curved gratings, in combination with a suitable detector, can provide spatial properties of µm-focused X-ray beams at MHz repetition rate.


Introduction
Free-electron lasers provide high peak intensity X-rays with femtosecond pulse duration and high degree of coherence. The European X-ray Free-Electron Laser (EuXFEL) has, in addition, the unique feature of providing both soft and hard X-rays up to MHz repetition rate [1]. These features enable new science opportunities in many diverse fields as physics, chemistry, material science, planetary science and biology. The Spectroscopy and Coherent Scattering (SCS) Instrument of the EuXFEL aims to explore electron, spin and lattice dynamics of complex materials by means of various techniques, e.g. X-ray absorption spectroscopy, small angle X-ray scattering, coherent X-ray diffraction imaging (CXDI) and resonant inelastic X-ray scattering (RIXS). The diversity of these experimental techniques calls for a high flexibility in setting the X-ray beam size at the sample in order to reach feasibility and optimize the experimental conditions of a given experiment. To achieve this goal the SCS Instrument is equipped with two Kirkpatrick-Baez (KB) mirrors providing independent control of horizontal and vertical X-ray beam dimension at the sample plane from approximately 1 µm to 500 µm. In particular, beam sizes ≤ 10 µm are essential to perform CXDI, RIXS and non-linear X-ray spectroscopy, while X-ray spectroscopy and X-ray scattering in the linear fluence regime benefit from larger beams of 10 − 100 µm. Therefore, a quick, accurate and reliable method to characterize µm-focused X-ray beams is crucial to enable a large variety of user experiments. This work focuses on µm-sized X-ray beams, since for larger defocused beams other techniques are available, as described below.
X-ray beam sizes at FEL sources are typically determined by the well established method of ablative imprints [2,3]. Its high accuracy, especially in the sub-10 µm range, comes at the expense of the time required for ex-situ sample inspection using a microscope and consequent image analysis. In-situ analysis of imprints has been demonstrated [4], but it is limited to few µm beam sizes. One of the easiest approaches to determine the size of an X-ray beam is by imaging the X-ray induced fluorescence in a luminescent crystal such as Ce:YAG [5]. It can be employed for relatively large beam sizes ≈ 100 µm, while it is not suitable for beam dimensions smaller than 20 µm due to saturation and quenching of the fluorescence process, which imposes stronger X-ray attenuations and more sensitive imaging setup [4]. Another standard tool for beam size characterization is a knife edge scan [6]. It can deliver a sub-µm spatial resolution, but it can provide neither single pulse nor single pulse train information since the outcome relies on the average of many pulse trains [7]. Moreover, this technique is not suited for a fast focus characterization since it requires several iterations of changing KB mirror settings and measuring knife edge scans. On the other hand, wavefront sensing based on the Hartmann sensor can be employed as a tool for online correction of optical aberrations by tuning KB settings [5,8]. However, the focal spot and its longitudinal position can be obtained only indirectly [9,10] and the experimental setup should be compatible with X-ray transmission to the Hartmann sensor located sufficiently far away from the focus.
Recently, a new technique based on transmission diffraction gratings with suitably varying period and orientation has been developed and demonstrated to be capable of beam size characterization in the soft X-ray range [11,12]. On a 2D detector, the far-field diffraction pattern of such a grating contains magnified images (in each diffraction order) of the spatial fluence distribution at the grating plane. The images can be then further analyzed to extract in real time the relevant spatial information, i.e. beam shape, width and position jitter with sub-µm resolution. In this work, we present curved grating characterization of µm-focused FEL beams and provide a systematic, in-depth comparison to ablative imprints data measured under the same conditions. The excellent agreement demonstrates the high accuracy of the curved grating technique and makes it an ideal tool for real-time spatial properties characterization of focused X-ray free-electron laser beams.

Optical layout of the spectroscopy and coherent scattering instrument
The optical layout of SASE3 tunnel and SCS instrument operating in monochromatic mode is sketched in Fig. 1 [13]. The two horizontal offset mirrors M1 and M2 have the purpose to remove spontaneous radiation and suppress higher harmonics of FEL radiation by tuning the angle of incidence from 6 to 20 mrad depending on the photon energy. In particular, M2 is an adaptive mirror which provides an intermediate focus at the horizontal slits (HS) in order to limit the horizontal beam size along the SASE3 beamline and at the SCS hutch. The pre-mirror M3 has elliptic cylindrical shape with fixed radius and focuses the beam at the exit slits (ES) in the vertical direction. There are two pre-mirrors available: one for low photon energies (< 1.5 keV) and angle of incidence 20 mrad (displayed in Fig. 1); a second one for high photon energies (> 1.5 keV) and angle of incidence 9 mrad, located 1 m upstream. The dispersive element of the monochromator is a variable line spacing grating with either 50 lines/mm or 150 lines/mm. The former was employed in this work. The distribution mirror M5, with an incidence angle of 9 mrad, steers the beam horizontally to the SCS hutch, with entrance located 19 m downstream of the ES. Before reaching the sample, the beam impinges on three additional mirrors. The horizontal (HFM) and vertical (VFM) focusing mirrors, forming a KB mirror system, can shape independently horizontal and vertical beam dimensions from ≈ 1 µm to 500 µm depending on the requirements of each experiment. To maintain the beam horizontal after the KB mirrors, a flat vertical deflecting mirror (VDM) is introduced between HFM and VFM. All X-ray optics described above are coated at Helmholtz-Zentrum Geesthacht with (nominally) 50 nm boron carbide (B 4 C) to protect the single crystalline silicon mirrors from possible damage caused by high X-ray power densities, and to ensure large reflectivity (> 90%) over the whole energy range from 250 eV to 3000 eV. In general, the ideal point-to-point focusing can be achieved with a mirror surface of elliptical shape [14]. The ideal mirror shape can be obtained by applying unequal torques (moments of force) to the two ends of a mirror of variable width or thickness [15,16]. The present HFM and VFM substrates have a constant thickness of 35 mm and variable widths, as reported in Table  S1 of Supplement 1. The ideal ellipses of HFM and VFM which focus the beam at the first interaction point (IP1) are characterized respectively by object distances p (52.65 m and 28 m), image distances q (3.35 m and 2 m), and incidence angle of 9 mrad (Table S1 of Supplement 1). The Si substrates of KB mirrors were polished to the predetermined ellipses by the company JTEC. Each focusing mirror was clamped to a bending system based on a leaf spring mechanism and two independent stepper motors to enable the application of different moments of force at the two ends of the mirror. Therefore, the figure of each KB mirror can be tuned to obtain the desired beam shape and in particular to obtain the two nominally ideal ellipses. The bending system is mounted on a motorized support providing pitch, tilt and yaw degrees of freedom. The vacuum chamber and all the mechanical infrastructure were provided by FMB Oxford.
Each bender motor has an absolute rotary encoder providing a value proportional to the corresponding applied torque, hence to the actual shape of the mirror. In addition, since rotary encoders cannot monitor or compensate the backlash of motors (Section 5 of Supplement 1), the bending state of each KB mirror is measured by means of three capacitive displacement sensors. The latter are located at the center and near the two extremities of the mirror back surface, with a distance L between two extreme sensors of 656 mm and 418 mm for HFM and VFM, respectively. Each pair, consisting of sensor and substrate back surface, acts as a parallel-plate capacitor, where a distance variation, due to mirror bending, translates into a variation of capacitance. The measurement range can be set to ±50 µm with nominal resolution 1 nm (HFM) or ±125 µm with nominal resolution 2.5 nm (VFM). The calculation of the mirror bending degree based on capacitive sensor measurements is detailed in Section 3 of Supplement 1.

Curved grating
The curved grating experimental setup consists of a zone-plate-derived grating and a 2D pixelated detector (see Fig. 2). Our curved grating was fabricated at the Max Born Institute in Berlin and consists of a Ta grating on a Si 3 N 4 membrane of lateral size 200 µm x 200 µm and thickness 200 nm. One side of the membrane is coated with 10 nm Ta which is then milled by focused ion beam (FIB) to obtain the desired grating structure with a total size of 20 µm x 20 µm and groove depths of 2 − 5 nm. The half-pitch structures are approximately 60 nm wide, therefore enabling accurate mapping of sub-µm X-ray beams [12].  The choice of Ta as grating material is motivated by radiation hardness and two additional major considerations. First, in the photon energy range from 500 eV to 1000 eV, Ta has no absorption resonances which ensures that there are no sudden jumps in the grating efficiency (estimated to be ≈ 3.4 × 10 −4 ) as a function of photon energy. Second, the fabrication by focused ion beam milling, the smoothness of the initial layer and the absence of grains with a size distribution similar to the grating period are crucial for the final grating quality. Sputter-deposited as well as thermally evaporated Ta forms very smooth layers, free from hard nm-sized grains. In contrast, sputtered or evaporated films of other materials, e.g. Au, despite the larger estimated grating efficiency (≈ 4.7 × 10 −4 ), contain grains of a few 10 nm size which are resistant to focused ion beam milling, due to ion channeling effects at grain boundaries. As a result, these grains remain as undesired scattering centers, degrading the quality of the grating.
In general, the grating efficiency is determined by the aspect ratio of the grating structures and the resulting absorption contrast in the grating material. For direct milling with focused ion beam of Ga + -ion, the aspect ratio is limited by the size of the focused ion beam, proximity effect and material re-deposition. Higher aspect ratio, hence higher grating efficiency, can be obtained by other manufacturing process, e.g. by using He or Ne FIB, or, at the cost of significantly increased processing effort, by electron-beam lithography-based approaches as are typically used for Fresnel zone plate production.
We turn now to the discussion of possible sources of image aberrations. A curved grating produces two real images (positive and negative diffraction order) of the illumination function at the close-by object plane located at f = z det /(2m) behind and in front of the grating. The distance between grating and detector is indicated by z det , while m refers to the magnification factor. To ensure a faithful imaging of the illumination function close-by the grating position, f must be smaller than the Rayleigh range z R , hence the following condition must be fulfilled [12]: valid for a Gaussian beam with waist radius w 0 . For a given z det , m should be sufficiently large to satisfy Eq. (1). This implies having grating periods sufficiently smaller than the beam footprint to ensure a proper grating illumination. If Eq. (1) is not fulfilled, images of positive and negative diffraction order will deviate from each other and from the illumination function at the grating position, and aberrations will occur. In our case, the most stringent requirement is set by the vertical dimension of the beam with z R = 1.44 mm (Section 4.1), and the maximum z det = 2mz R = 864 mm (with m = 300). The horizontal dimension of the beam has larger Rayleigh range (Fig. 3), hence it does not add any further constraint. Our z det = 808 mm satisfies Eq. (1), and with f = z det /(2m) = 1.35 mm smaller than z R , we can conclude that aberrations in the measured images can be neglected. Furthermore, a valid mapping of the illumination function at the grating occurs only if the detector is sufficiently far away from the sample to be in the Fraunhofer regime [12], i.e. z det >2w 2 0 /λ. On the way to the Fraunhofer regime, diffraction patterns present distortions and cannot be used as faithful maps of the illumination function at the grating. In the particular case of hyperbolic gratings, the evolution to the final far-field diffraction pattern is accompanied by a 90 • rotation. The completion of this rotation indicates that the Fraunhofer regime is reached and the diffraction pattern is free from aberrations. For the vertical beam direction, the rotation was fully completed, while the horizontal beam direction shows a residual 3 • tilt, however with no sign of image distortion. Therefore, to extract horizontal beam dimensions, the image was additionally rotated by 3 • before the image processing described in Section 1 of Supplement 1.
The X-ray beam image was monitored 808 mm behind the grating on the FastCCD detector [17,18], a Si-based charge-coupled device with 1920 x 960 pixels and 30 µm x 30 µm pixel size. At this distance and with photon energy 775 eV, the grating design used yields an approximately 300-fold magnified image of the X-ray spot on the grating plane. A single image pixel corresponds to a distance of 110 nm on the grating, as obtained by the pixel calibration reported in Section 2 of Supplement 1. The FastCCD detector operates at 10 Hz, hence the pulses of an FEL train coming at MHz repetition rate cannot be resolved and are integrated providing one image per pulse train. At the same time, the low diffraction efficiency of the curved grating imposes a large number of strongly attenuated pulses per train in order to have sufficient counts without damaging the grating. This enables the analysis of individual images for beam width and position determination on a train-by-train basis (see Section 1 of Supplement 1).
Curved grating experiments were performed with the monochromator in first diffraction order at photon energy 775 eV (λ = 1.6 nm) and offset mirrors (M1 and M2) at 13 mrad. Horizontal slits and exit slits gaps were set respectively to 516 µm and 21 µm, with few exceptions specified in the text. EuXFEL delivered 120 pulses per train at 1.1 MHz of pulse energy ≲ 4 mJ. The transmission T of the monochromator in first-order diffraction with exit slits closed to 10 µm (T = 3 × 10 −5 ) and the nitrogen-filled gas attenuator (GATT) (T ≤ 1 × 10 −3 ) resulted in X-ray fluence at the grating always less than 1 mJ cm −2 .

Ablative imprints
Besides curved grating measurements, the method of ablative imprints [2,19] was employed to find the optimum bending of KB mirrors, which provides the focus at the first interaction point IP1, and to characterize the size of the focus. The used imprinting targets consisted of a ≈ 20 nm layer of lead iodide (PbI 2 ) thermionically coated either on chemical vapor deposition (CVD) diamond (thickness: 500 µm, dimensions: 10 mm x 10 mm) or silicon (thickness: 520 µm, dimensions: 20 mm x 10 mm) substrates. Samples were mounted on an in-vacuum translation stage allowing a linear motion in the plane normal to the beam direction. In order to find the optimum KB bending and characterize the focus, two different imprinting techniques were employed: the method of longitudinal z-scan [2] and transverse fluence scan (f-scan) [19]. Since the PbI 2 /CVD target has considerably larger dynamic range than PbI 2 /Si, it was used preferably for the in-focus f-scan measurements. Ablative imprints were analysed with the use of the high-resolution Keyence VHX-6000 microscope employing a VH-Z500R/W/T zoom lens.
Usually, when z-scanning the beam, the target is longitudinally translated step-by-step through the focus and a single-shot ablative imprint is created at each z position. To account for intrinsic pulse energy fluctuations, several single-shot imprints are created. After each shot the sample is moved transversally to a fresh unexposed position. The spacing between the positions is chosen large enough to prevent an overlap of neighbouring imprints even at the out-of-focus positions, typically 100 -200 µm. The z-scan can be repeated at several beam attenuation levels starting from full power down to the ablation threshold at the focus. The method of z-scan can be used to find the optimum KB mirror bending corresponding to the focused beam at the sample plane. Here, the z-translation of the sample was replaced by bending one of the mirrors in discrete steps while keeping the other partially unbent and the sample at fixed longitudinal z-position. This approach makes it easier to identify the degree of bending leading to the best focusing at the target plane. Imprint data were analysed using methods reported in [2] and detailed in Section 9 of Supplement 1.
Once the optimum bending of both KB mirrors is found and the focus is properly set to the target plane, the method of the fluence scan can be used to measure the focused beam spot size in terms of the effective area. The principle of the f-scan method resides in the fact that laser-induced ablation occurs above a sharply-defined ablation threshold fluence F th . Hence, the area S of the single-shot ablative imprint corresponds to the part of the beam profile exceeding F th and the ablation contour follows the beam iso-fluence contour right at the threshold fluence. Provided that the beam shape is sufficiently stable on the shot-to-shot basis, we can recover these iso-fluence contours for a broad range of threshold-to-peak fluence ratios (normalized fluence) f = F th /F 0 by varying the pulse energy E of the beam and thus the peak fluence F 0 . While keeping the KB mirrors at the focus position, the beam fluence was tuned by changing the transmission of GATT. From an ensemble of threshold-to-peak fluence ratios f = F th /F 0 and contour areas S, the so called normalized fluence scan curve f (S) can be constructed [19]. The area below the curve represents the effective area A eff of the beam which directly and uniquely relates the peak fluence F 0 and pulse energy E via the relation F 0 = E/A eff . This allows to express the normalized fluence as f = F th /F 0 = E th /E, where E th = F th A eff is the threshold pulse energy. In practice, E th is extracted from Liu's plot, as explained in Section 10 of Supplement 1, and the pulse energy E was monitored on a shot-to-shot basis using the X-ray gas monitor (XGM) detector [20]. The f-scan curve is an universal beam quantity which can be recovered also by other means, for example, from curved grating measurements. This allows the results of both approaches to be directly compared, as shown in Section 5.2.

Nanometre optical metrology
To verify the quality of optical polishing, and subsequent coating with B 4 C, both substrates were characterized in the Optics Metrology Lab (OML) at Diamond Light Source (Diamond) before and after coating. The OML cleanroom contains a suite of metrology instruments capable of characterizing state-of-the-art X-ray optics for synchrotron or free-electron laser sources [21].
Each unmounted substrate, resting on kinematic supports at Bessel points, was measured by the slope profiler at Diamond [22]. The Diamond-NOM (nanometre optical metrology) utilizes a high-grade pentaprism and computer-controlled air bearing stages to scan an electronic autocollimator beam along the surface under test to measure angular deviations. An environmental enclosure around the apparatus passively stabilises air temperature to <10 mK over several days and helps reduce excessive air flows and background light levels. With such precautions, the Diamond-NOM is capable of measuring slope errors with a repeatability of <50 nrad rms. Results obtained on HFM and VFM are presented in Section 6.

HFM and VFM bender scan
To determine FEL horizontal and vertical focus at IP1, HFM and VFM were bent while measuring the beam profile using the curved grating setup (see Section 3.1). All images recorded at the same mirror bending were individually analyzed and the fitted beam widths w were averaged as detailed in Section 1 of Supplement 1. In the following, beam width refers to the full width at half maximum (FWHM), unless specified otherwise. The resulting horizontal and vertical beam widths w hor and w ver are displayed in Fig. 3(a) and (b) as a function of q − q IP1 , i.e. the distance from the focus at IP1 derived from capacitive sensors measurements (see Section 3 of Supplement 1).
The data reported in Fig. 3 refer to four different scans of bender motors of each mirror: two scans moving the focus downstream, and two upstream. The same moment of force was applied at either side of each KB mirror, hence performing symmetric bender scan. It is important to note that, despite bender scans were performed along both opposite directions, no hysteresis was observed when data are plotted as a function of q − q IP1 , derived from capacitive sensor data. The latter can therefore be used to accurately reproduce a given desired beam width, regardless of the bender previous movements. In contrast, bender motor positions do not reflect accurately the bending status of the mirror leading to hysteresis as shown in Section 5 of Supplement 1. Figure 3(a) and (b) show a clear minimum corresponding to the horizontal and vertical foci, respectively equal to 2.48 ± 0.07µm and 1.21 ± 0.03µm. Camera images at the horizontal and vertical foci are shown in Fig. 2(b) and (c), with the respective projections and Gaussian fits in Fig. 2(d) and (e). The error bars of horizontal and vertical beam widths range from 3% near the focus to 10% away from the focus. The small error bars at the focus reflect the small FEL train-to-train deviations of the beam width. In contrast, away from the focus, train-to-train positional jitter leads to differently diffracted beam at the edges of the curved grating, eventually resulting into larger deviation in beam width determination. resulting into larger deviation in beam width determination. In general, the optimum mirror ellipse may be obtained by applying different moments of force at the two mirror ends, thereby performing asymmetric bender scans. In particular, this is more relevant for longer optics which have a predetermined polished ellipse and upon symmetric bending deviate more from the ideal ellipse as compared to shorter optics. In fact, asymmetric bender scans of the shorter (401 mm) VFM provided negligible change to the focal size. On the other hand, for the longer (638 mm) HFM, asymmetric bending provided a smaller horizontal beam width of (2.25 ± 0.11) µm (see Section 7 of Supplement 1). Note that bending the KB mirrors, with a real-time feedback from curved grating measurements, is an effective way of finding the smallest beam size or a specific beam size near the focus at any given sample position.
Although bender motors were scanned symmetrically, the beam width profiles in Figure 3 display an asymmetry. This is not a characteristic of the focusing optic, but an artifact introduced by the limited size of the diffraction grating. In particular, during the VFM bender scan, the beam position moved from the grating center (at q − q IP1 = −17 mm) towards the grating edge when the focus was shifted downstream of the grating. For larger beam sizes, only part of the beam profile was imaged by the grating and intensity ringing occurred perpendicular to the illuminated edge due to diffraction at the abrupt transmission change (see Figure 6c of Supplement 1 for an example). Fitting such altered beam profile with a Gaussian function underestimates the beam width, resulting in the asymmetry visible in Figure 3b for q − q IP1 > 0. In contrast, the vertical beam widths at q − q IP1 < 0 are not affected by edge diffraction and are well described by the Gaussian beam function: where 0 is the beam waist radius at the focus and = 2 0 / is the Rayleigh range. The beam waist radius 0 is defined as the point where the beam intensity falls to 1/ 2 of the axial value. The fit provides a vertical beam waist radius 0 = 0.85 µm, with Rayleigh range = 1.44 mm and beam divergence = /( 0 ) = 0.6 mrad. A similar analysis could not be performed on the horizontal beam width data. Because of the larger horizontal positional jitter (Section 4.4) and the larger beam pointing drift, as benders are scanned away from the focus (Section 6 of In general, the optimum mirror ellipse may be obtained by applying different moments of force at the two mirror ends, thereby performing asymmetric bender scans. In particular, this is more relevant for longer optics which have a predetermined polished ellipse and upon symmetric bending deviate more from the ideal ellipse as compared to shorter optics. In fact, asymmetric bender scans of the shorter (401 mm) VFM provided negligible change to the focal size. On the other hand, for the longer (638 mm) HFM, asymmetric bending provided a smaller horizontal beam width of 2.25 ± 0.11µm (see Section 7 of Supplement 1). Note that bending the KB mirrors, with a real-time feedback from curved grating measurements, is an effective way of finding the smallest beam size or a specific beam size near the focus at any given sample position.
Although bender motors were scanned symmetrically, the beam width profiles in Fig. 3 display an asymmetry. This is not a characteristic of the focusing optic, but an artifact introduced by the limited size of the diffraction grating. In particular, during the VFM bender scan, the beam position moved from the grating center (at q − q IP1 = -17 mm) towards the grating edge when the focus was shifted downstream of the grating. For larger beam sizes, only part of the beam profile was imaged by the grating and intensity ringing occurred perpendicular to the illuminated edge due to diffraction at the abrupt transmission change (see Fig. 6(c) of Supplement 1 for an example). Fitting such altered beam profile with a Gaussian function underestimates the beam width, resulting in the asymmetry visible in Fig. 3(b) for q − q IP1 >0. In contrast, the vertical beam widths at q − q IP1 <0 are not affected by edge diffraction and are well described by the Gaussian beam function: where w 0 is the beam waist radius at the focus and z R = πw 2 0 /λ is the Rayleigh range. The beam waist radius w 0 is defined as the point where the beam intensity falls to 1/e 2 of the axial value. The fit provides a vertical beam waist radius w 0 = 0.85 µm, with Rayleigh range z R = 1.44 mm and beam divergence θ = λ/(πw 0 ) = 0.6 mrad. A similar analysis could not be performed on the horizontal beam width data. Because of the larger horizontal positional jitter (Section 4.4) and the larger beam pointing drift, as benders are scanned away from the focus (Section 6 of Supplement 1), the imaged horizontal beam profiles are affected by diffraction at the grating edges to a larger extent as compared to the vertical ones. A possible solution is employing larger curved grating. Alternatively, beam positional drifts with changing degree of bending could be compensated by an equal grating movement in the grating plane.

Exit Slit gap scan
When the SCS Instrument is operated in monochromatic mode, the vertical beam size at the sample is determined by the size of the exit slit gap. The gap size corresponding to the best energy resolution is given by the monochromator resolving power. In these experiments the monochromator grating (Section 2.) in first diffraction order delivers a resolving power of 3000, hence an energy resolution of 258 meV at 775 eV. Given a dispersion of 2.18 eV/mm at the exit slit plane, for ES gaps smaller than 120 µm, the energy resolution is not further improved. Nevertheless, the vertical beam size can be further decreased at expense of the beam intensity at the sample as presented below.
The ES gap was varied between approximately 120 µm and 20 µm, while VFM was set to have the vertical beam profile near the focus at the grating position (coincident with IP1). At each ES gap, 2500 images of the FEL beam were measured. The resulting average widths w ver (displayed in Fig. 4(a)) were determined with high accuracy as it results from the small error bars with average standard deviation of (0.09 ± 0.04µm). The FEL width has a clear linear dependence from the ES gap with slope 0.05. A vertical beam width of 1.2 µm was achieved with ES gap of 21 µm. Finally, it is important to note that these measurements can be used for an accurate calibration of exit slit gap size. a b

Exit Slit gap scan
When the SCS Instrument is operated in monochromatic mode, the vertical beam size at the sample is determined by the size of the exit slit gap. The gap size corresponding to the best energy resolution is given by the monochromator resolving power. In these experiments the monochromator grating (Section 2) in first diffraction order delivers a resolving power of 3000, hence an energy resolution of 258 meV at 775 eV. Given a dispersion of 2.18 eV/mm at the exit slit plane, for ES gaps smaller than 120 µm, the energy resolution is not further improved. Nevertheless the vertical beam size can be further decreased at expense of the beam intensity at the sample as presented below. The ES gap was varied between approximately 120 µm and 20 µm, while VFM was set to have the vertical beam profile near the focus at the grating position (coincident with IP1). At each ES gap, 2500 images of the FEL beam were measured. The resulting average widths ver (displayed in Figure 4a) were determined with high accuracy as it results from the small error bars with average standard deviation of (0.09 ± 0.04) µm. The FEL width has a clear linear dependence Besides the beam width, image analysis provides the beam position as well (see Section 1 of Supplement 1). Figure 4(b) shows the standard deviation of the beam position σ µ ver measured at each ES gap. At gap size of 116 µm, σ µ ver = 0.19 µm. In contrast, for gap sizes below 70 µm, σ µ ver is approximately constant and equal to (0.145 ± 0.005µm). This observation suggests that for smaller ES gap sizes the jitter in beam position comes from instrumentation downstream of the exit slit and is close to the ultimate resolution limit (110 nm) given by the pixel size (Section 3.1). Possible sources of beam position instabilities may be vibrations of KB mirrors, sample, and detector. The additional slightly larger jitter for larger ES gap may come from the source position and/or from optical components upstream affecting the vertical position, i.e. M3 and monochromator grating. In general, pointing instabilities in the vertical direction are about one order of magnitude smaller than the beam size (Section 4.4), therefore do not represent a limitation even for experiments requiring high spatial pointing accuracy.
The standard deviation of the beam width σ w ver shows the same qualitative behavior as σ µ ver and in particular a factor of 3 increase in going from ES gap < 70 µm to ES gap = 116 µm. Nevertheless, with an absolute value of σ µ ver = 0.15 µm, the standard deviation of the beam width is still more than one order of magnitude smaller than the corresponding beam width. The high stability of beam spatial properties at the sample along the vertical direction primarily results from the fact that the ES defines the source of VFM by selecting a small portion of the energy-dispersed FEL beam. This makes beam width and position at the sample plane less sensitive to FEL pointing jitter.

Horizontal slit gap scan
The minimum horizontal beam width (averaged over the pulse train) of 2.5 µm (Section 4.1) can be further reduced by decreasing the gap of the horizontal slit, which represents the source object of HFM mirror. While the HFM was set to have the focus at IP1, the HS gap was varied from approximately 520 µm to 80 µm, and images of the FEL beam were recorded at each gap size. The resulting beam widths are displayed in Fig. 5(a). For HS gap >125 µm, a constant average beam width of (2.5 ± 0.4µm) was measured, in agreement with the minimum w hor at HS gap = 500 µm reported in Section 4.1. For HS gap <125 µm, a linear decrease in w hor with slope 0.02 was recorded. A smaller horizontal beam size at the sample could therefore be obtained by reducing the HS slit gap at the expense of the FEL intensity at the sample. a b limitation even for experiments requiring high spatial pointing accuracy. The standard deviation of the beam width ver shows the same qualitative behavior as ver and in particular a factor of 3 increase in going from ES gap < 70 µm to ES gap = 116 µm. Nevertheless, with an absolute value of ver = 0.15 µm, the standard deviation of the beam width is still more than one order of magnitude smaller than the corresponding beam width. The high stability of beam spatial properties at the sample along the vertical direction primarily results from the fact that the ES defines the source of VFM by selecting a small portion of the energy-dispersed FEL beam. This makes beam width and position at the sample plane less sensitive to FEL pointing jitter.

Horizontal slit gap scan
The minimum horizontal beam width (averaged over the pulse train) of 2.5 µm (Section 4.1) can be further reduced by decreasing the gap of the horizontal slit, which represent the source object of HFM mirror. While the HFM was set to have the focus at IP1, the HS gap was varied from approximately 520 µm to 80 µm, and images of the FEL beam were recorded at each gap size. The resulting beam widths are displayed in Figure 5a. For HS gap >125 µm, a constant average beam width of (2.5 ± 0.4) µm was measured, in agreement with the minimum hor at HS gap = 500 µm reported in Section 4.1. For HS gap <125 µm, a linear decrease in hor with slope 0.02 was recorded. A smaller horizontal beam size at the sample could therefore be obtained by reducing the HS slit gap at the expense of the FEL intensity at the sample. The analysis of the standard deviation of the beam width w hor and position µ hor for different HS gap is reported in Fig. 5(b). For HS gap >125 µm, the average σ µ hor is (0.61 ± 0.09µm), equal to 25% of the beam size. On the other hand, for HS gap sizes <125 µm, σ µ hor decreases and reaches 0.3 µm at HS gap ≈ 80 µm. This behavior is consistent with a reduction of the horizontal positional jitter measured at the curved grating, as a result of a more confined intermediate source point defined by a smaller HS gap. A similar trend is observed for σ w hor , with a constant value of (0.41 ± 0.03µm) at HS gap >125 µm, while at HS gap <125 µm, σ w hor decreases and reaches 0.12 µm at HS gap ≈ 80 µm. Because each image is the average over a pulse train, the resulting beam width depends on the intra-train beam jitter. Therefore, at large HS gaps, due to inter-train and intra-train positional jitter, a larger deviation of beam width is expected. In contrast, at small HS gaps the reduced positional jitter leads to smaller width deviations and effectively smaller horizontal beam widths. Based on the arguments above, the minimum horizontal beam width measured by a trainresolved detector is limited by the intra-train positional jitter. Therefore, the result is an upper limit of the horizontal beam width. At HS gap of 76.5 µm, the detrimental effects mentioned above are significantly reduced and the measured beam width is (1.5 ± 0.1) µm. This corresponds to a horizontal beam size 15% larger than prediction based on ray tracing simulations [23]. To explain this observation we consider two mutually exclusive sources of jitter. Assuming the jitter comes entirely from the source, given HFM and M2 demagnification factor respectively of 15.7 and 3.15 (Table S1 of Supplement 1 and Figure 1), the width at the intermediate horizontal focus is 24 µm and the source width is 74 µm. Under our measurement conditions, bunch charge of 250 pC and photon energy of 775 eV, the expected beam size (FWHM) of each FEL pulse is ≈50 µm [24]. Therefore, a FWHM of 74 µm averaged over the pulse train can be explained by an intra-train pulse-to-pulse positional jitter following a Gaussian distribution with sigma equal to 23 µm. On the other hand, assuming a 50 µm jitter-free source, the expected width at the HS is 15.9 µm, as opposed to the 24 µm derived above. In this second case, the increased width could be explained by angular vibrations of the first three horizontal mirrors M1, M2, M5 of 10 nrad rms. These vibrations are likely to be present at frequencies ≤ 10 Hz and contribute to the train-to-train beam pointing jitter. However, within a pulse train, at frequencies ≥ 100 kHz, angular vibrations are more than 16 orders of magnitude smaller, therefore do not contribute to beam pointing jitter within the pulse train [25]. As a result, the larger horizontal beam width is assigned to a larger source size and/or intra-train pulse-to-pulse positional jitter of the source.

Positional jitter
Dedicated studies of horizontal and vertical positional jitter were performed by measuring XFEL images at fixed beamline settings. In particular, ≈ 13200 XFEL trains were recorded in different runs with 166 µm < HS < 516 µm and HFM set to provide the horizontal focus at the sample position. Similarly, ≈ 3200 XFEL trains were recorded in different runs with 26 µm < ES < 66 µm and VFM set to provide the vertical focus at the sample position. The histograms of the horizontal and vertical beam positions are reported in Figure 6a and b, respectively. Both distributions follow a Gaussian statistics with FWHM approximately one order of magnitude larger in the horizontal direction as compared to the vertical one. The larger horizontal positional jitter is assigned to the jitter of the source and/or to mirror vibrations as discussed in Section 4.3. In general, the positional jitter along the vertical direction is expected to be smaller than in the horizontal because of the following reason. At the ES the beam is energy-dispersed along the Based on the arguments above, the minimum horizontal beam width measured by a trainresolved detector is limited by the intra-train positional jitter. Therefore, the result is an upper limit of the horizontal beam width. At HS gap of 76.5 µm, the detrimental effects mentioned above are significantly reduced and the measured beam width is (1.5 ± 0.1µm). This corresponds to a horizontal beam size 15% larger than prediction based on ray tracing simulations [23]. To explain this observation we consider two mutually exclusive sources of jitter. Assuming the jitter comes entirely from the source, given HFM and M2 demagnification factor respectively of 15.7 and 3.15 (Table S1 of Supplement 1 and Fig. 1), the width at the intermediate horizontal focus is 24 µm and the source width is 74 µm. Under our measurement conditions, bunch charge of 250 pC and photon energy of 775 eV, the expected beam size (FWHM) of each FEL pulse is ≈ 50 µm [24]. Therefore, a FWHM of 74 µm averaged over the pulse train can be explained by an intra-train pulse-to-pulse positional jitter following a Gaussian distribution with sigma equal to 23 µm. On the other hand, assuming a 50 µm jitter-free source, the expected width at the HS is 15.9 µm, as opposed to the 24 µm derived above. In this second case, the increased width could be explained by angular vibrations of the first three horizontal mirrors M1, M2, M5 of 10 nrad rms. These vibrations are likely to be present at frequencies ≤ 10 Hz and contribute to the train-to-train beam pointing jitter. However, within a pulse train, at frequencies ≥ 100kHz, angular vibrations are more than 16 orders of magnitude smaller, therefore do not contribute to beam pointing jitter within the pulse train [25]. As a result, the larger horizontal beam width is assigned to a larger source size and/or intra-train pulse-to-pulse positional jitter of the source.

Positional jitter
Dedicated studies of horizontal and vertical positional jitter were performed by measuring XFEL images at fixed beamline settings. In particular, ≈ 13200 XFEL trains were recorded in different runs with 166 µm < HS < 516 µm and HFM set to provide the horizontal focus at the sample position. Similarly, ≈ 3200 XFEL trains were recorded in different runs with 26 µm < ES < 66 µm and VFM set to provide the vertical focus at the sample position. The histograms of the horizontal and vertical beam positions are reported in Fig. 6(a) and (b), respectively. Both distributions follow a Gaussian statistics with FWHM approximately one order of magnitude larger in the horizontal direction as compared to the vertical one. The larger horizontal positional jitter is assigned to the jitter of the source and/or to mirror vibrations as discussed in Section 4.3. In general, the positional jitter along the vertical direction is expected to be smaller than in the horizontal because of the following reason. At the ES the beam is energy-dispersed along the vertical direction, therefore pointing instabilities of the beam upstream will translate mostly into intensity rather than positional jitter, and will lead to worse energy resolution.
Note that σ µ ver reported in Fig. 4(b) are in good agreement with jitter data in Fig. 6(b). In contrast, in Fig. 5(b) σ µ hor ≈ 0.7 µm for HS >125 µm, hence approximately a factor 2 smaller then data reported in Fig. 6(a). The latter sets of data were measured in different days. This suggests that a significant contribution to the horizontal jitter may depend on the source properties, hence on specific machine settings which may change from day to day. Therefore, these measurements could be used to feedback machine tuning with the goal to minimize the source jitter, in particular for experiments sensitive to the FEL beam position.

HFM and VFM bender scan
KB benders were scanned around the pre-estimated optimum bending in fine steps to find the best focusing while always keeping one of the mirrors partially unbent and fixed. Scanning was performed at full power and 10% attenuation level. For each KB setting 20 single-shot ablative imprints were created on PbI 2 /Si sample. Horizontal and vertical diameters were measured from acquired micrographs for both the HFM and VFM bender scans, respectively. Figure 7 depicts averaged imprint diameters and corresponding standard deviations as a function of the bender motor position for both the horizontal (black circles) and vertical (red squares) mirrors.  Clearly, both curves exhibit sharp minima corresponding to optimum bending bringing the focus to the sample plane. It follows from the fit of the Gaussian model (Section 9 in Supplement 1) that bender motor positions corresponding to horizontal and vertical foci are z H,c = 27.0 ± 0.3 and z V,c = 25.1 ± 0.3, respectively. This result is in a good agreement with curved grating results (Section 5 in Supplement 1) within the bender motor position hysteresis which can be up to several arbitrary units of bender motor position.

Fluence scan at the focus
The characterization of the beam size at focus was performed using the fluence scan method which requires an ensemble of ablative imprints created by the focused beam at various pulse energies. Figure 8 shows a selection of ablative imprints in PbI 2 /CVD obtained at different attenuation levels as indicated by the transmission values of the GATT. The top-left imprint corresponds to close-to-threshold fluence while the bottom-right imprint was created by full power (unattenuated) beam. In total 12 attenuation levels were scanned and, in order to achieve a good statistics, 160 imprints per level were created. Figure 9(a) (red circles) shows the measured fluence scan curve, i.e. the normalized fluence f = F th /F 0 (threshold-to-peak fluence ratio), as a function of the measured ablation (iso-fluence) contour area S (see Section 3.2). 0.14 µm × 0.16 µm. Clearly, there is a very good agreement between ablative imprint and curved grating datasets in Figure 9a. The smaller dynamic range of the curved grating measurement limits the f-scan curve at the level f ≈ 0.02, corresponding to the contour area of approximately 28 µm 2 . Consequently, the effective area A eff = 4.5 µm 2 , evaluated as a numerical integral below the black curve, is slightly underestimated, but still well within the error bar of the effective area resulting from Monte Carlo calculations. Furthermore, the comparison of the beam cross-section in Figure 9b at level f ≈ 0.02 (with S ≈ 28 µm 2 ) and the ablative imprint in Figure 8 at T = 4% (with S = 33.9 µm 2 ) reveals a good qualitative agreement. Interestingly, the shape of the grating-resolved profile resembles also the imprint in the CVD substrate (black part) shown in Figure 8 at T = 100%. This can be observed only at the highest fluence due to the larger ablation threshold of diamond compared to PbI 2 . To overcome the relatively large noise, especially at low pulse energies, a statistical treatment of the data is introduced. Red circles in Fig. 9(a) depict the raw data, whereas blue circles represent the raw data rebinned into equal bins of the size ∆S = 1 µm 2 . This allows to calculate average pulse energy and standard deviation in each bin and apply the following Monte Carlo approach. A (log)normal random number generator was employed to generate 50000 realizations of the dataset with the calculated average pulse energy and standard deviation in each bin. This approach allows not only to extrapolate the threshold pulse energy and evaluate the effective area, but also to quantify the respective uncertainties. As a result, we obtain E th = 1.4 ± 0.7 nJ and A eff = 5.8 ± 2.3 µm 2 . The procedure and outputs of the Monte Carlo method are described in detail in Section 10 of Supplement 1.
To enable a consistent comparison between ablative imprints and curved grating results, a fluence scan curve was retrieved from the beam profile at the focus as measured by the curved grating. Figure 9(b) displays an averaged intensity profile obtained from 905 grating-resolved images. Due to beam pointing instabilities, images needed to be aligned before being averaged. However, the low signal-to-noise ratio of individual images prevented the numerical evaluation of the beam centroid required for alignment. Therefore, an iterative algorithm based on the maximization of the correlation among images was developed to align them prior to averaging. The reliability of the algorithm is demonstrated by an excellent visibility of diffraction side lobes in Fig. 9(b).
By normalizing the maximum of the resultant intensity profile to unity and calculating the beam cross-section at different levels, we obtain the normalized f-scan curve marked by the black solid curve in Fig. 9(a). The minimum increment in area corresponds to the pixel area, equal to 0.14 × 0.16 µm. Clearly, there is a very good agreement between ablative imprint and curved grating datasets in Fig. 9(a). The smaller dynamic range of the curved grating measurement limits the f-scan curve at the level f ≈ 0.02, corresponding to the contour area of approximately 28 µm 2 . Consequently, the effective area A eff = 4.5 µm 2 , evaluated as a numerical integral below the black curve, is slightly underestimated, but still well within the error bar of the effective area resulting from Monte Carlo calculations.
Furthermore, the comparison of the beam cross-section in Fig. 9(b) at level f ≈ 0.02 (with S ≈ 28 µm 2 ) and the ablative imprint in Fig. 8 at T = 4% (with S = 33.9 µm 2 ) reveals a good qualitative agreement. Interestingly, the shape of the grating-resolved profile resembles also the imprint in the CVD substrate (black part) shown in Fig. 8 at T = 100%. This can be observed only at the highest fluence due to the larger ablation threshold of diamond compared to PbI 2 .

Metrology results
The Diamond-NOM introduced in Section 3.3 was employed to measure the slope profile of both KB mirrors after optical polishing (a), after subsequent coating with B 4 C (b), and finally after clamping to the mechanical bender system (c). Before and after coating, the best fit ellipse to the measured curvature of the mirror was found by fixing p = 52.65 m and fitting both q and θ. The resulting fitting parameters are: (a) q = 3.31 m, θ = 8.86 mrad and (b) q = 3.30 m, θ = 8.83 mrad. A negligible change of only 0.3% for the ellipse parameters was measured, confirming that the coating process did not significantly change the low-spatial frequency errors (curvature) of the mirror. In fact, such minor change could also be caused by a small difference in how the optic was supported in the two measurements.
The quality of X-ray mirrors is typically judged by the slope error, that is the deviation of the actual mirror curvature from the best fit ellipse. Figure 10 shows excellent agreement in the midand high-frequency components of the slope error of the HFM before and after B 4 C coating. The slope error relative to the best fit ellipse is respectively 40 nrad and 53 nrad root mean squared (rms). This represents exceptional quality for X-ray optics, especially for elliptically curved mirrors of this length, and further confirms that the coating process did not degrade the surface quality. Comparable results were obtained for the VFM.
Clamping the KB mirrors into the respective mechanical bender systems caused optical distortion and twist that were iteratively minimised using metrology feedback from the Diamond-NOM. Figure 10 shows that clamping added a small 3 rd order slope distortion to the mirror, and the slope error rms increased to 102 nrad (red curve). As expected, distortions occurred towards the ends of the mirror, close to the clamping points. After commissioning of the bender motor actuators, the range, stability, and repeatability of bending were measured for each clamped mirror using the Diamond-NOM. Metrology feedback guided the search to find the optimum motor settings to bend each mirror to the specified ellipses which focus the FEL beam to the first interaction point of the SCS Instrument at q = 3.35 m. The Diamond-NOM data was complemented by simultaneously monitoring the optical surface with three capacitive displacement sensors. Note that each capacitive sensor is offset vertically from the optical surface by an unknown distance. This means that it is not possible to use the capacitive sensors to obtain an absolute measurement of the mirror's surface profile. However, since capacitive sensors are decoupled from the mirror bending mechanism, they can provide accurate information about the relative change in height during bending. This is also true if the sensors accidentally are shifted vertically relative to each other during transit or installation at the beamline. The relative changes in height measured by the capacitive sensors provide valuable help to guide and speed-up the commissioning of KB mirrors with the FEL beam.
By spatially integrating the slope profile of a mirror, the corresponding height profile is obtained. The solid curves in Fig. 11 show the change in the height profile of HFM mirror between its unbent state (q = 3.2 m), and different mirrors bending up to q = 5.7 m. The corresponding change in height measured by the capacitive sensors are shown as a series of data markers. To make the comparison possible, for each bend profile, the outer two capacitive sensors are shifted vertically to match the Diamond-NOM height data. Assuming the nominal position of the capacitive sensors (Section 2), a good agreement between the two bending measurements methods is obtained, with a maximum deviation of 0.8 µm at q = 5.7 m. This deviation vanishes, leading to an excellent agreement, if the distance between the two extreme capacitive sensors is ≈ 1% larger than the nominal separation (664 mm instead of 656 mm as shown in Fig. 11).

Discussion
The data presented in this manuscript show that the curved grating approach provides an accurate determination of mirror settings corresponding to a focused X-ray beam at a given sample plane. This is particularly important for bendable mirrors (HFM and VFM), as well as for a systematic characterization of other beamline components, such as horizontal and exit slits, and their influence on the beam properties at the sample position. Imaging the beam profile impinging on a curved grating provides direct access to the X-ray beam size and position at and near the focus. Importantly, this information can be obtained in real time, by means of online processing tools, and offers the opportunity of quickly changing beamline settings to reach the desired beam properties. Misleading diffraction artifacts occur when the grating edges are illuminated due to beam misalignment or the beam size exceeding the grating area. This effect can be avoided by careful alignment of the X-ray beam at the center of the curved grating, while alignment constraints can be relaxed using gratings of larger dimensions. The smallest horizontal and vertical foci at the first interaction point of the SCS Instrument are respectively 2.48 ± 0.07µm and 1.21 ± 0.03µm, obtained with HS = 516 µm (i.e. open) and ES = 21 µm. These very small focal sizes accompanied by structureless and Gaussian-like beam profiles result from the high quality of the KB mirrors with rms slope errors ≈ 100 nrad (Section 6). It is interesting to compare our experimental results with ray tracing calculations obtained at the same beamline conditions [23], which provide 1.4 µm and 1.7 µm respectively for horizontal and vertical beam focus. The measured smaller vertical focal size may result from the actual smaller VFM slope errors as compared to the rms slope error of 250 nrad assumed in the calculations. In contrast, the measured larger horizontal beam size at focus is attributed to a broadening due to intra-train FEL positional jitter. In order to verify this hypothesis, curved grating measurements need to be performed with a pulse-resolved detector, e.g. DSSC [26], to determine beam properties of each FEL pulse arriving at MHz repetition rate in the train. In this study, limited to 10 Hz detection rate, we present train-to-train positional jitter along horizontal and vertical direction equal to 3.38 µm and 0.35 µm (FWHM). Moreover, we propose an approach to mitigate the horizontal position jitter based on a better definition of the horizontal source point by closing the horizontal slits. This leads to a smaller beam size at expense of the total number of photons reaching the sample.
In order to validate the accuracy of the results obtained by the curved grating, a comparison with ablative imprints was performed. A qualitative agreement can already be concluded from the beam profile of imprints at 4% transmission (Fig. 8) and the average grating image at focus ( Fig. 9(b)). The measurement of horizontal and vertical beam cross sections by the curved grating (Section 4.1) provides an indication of the beam size but no information on the actual beam shape and its effective area A eff , a quantity directly derived from imprint fluence scans (Section 5.2). Therefore, to obtain consistent and comparable quantities, curved grating images of the focused FEL beam have been analyzed as an imprint fluence scan. The resulting effective area of 4.5 µm 2 is well within the outcome of Monte Carlo calculations based on imprint data 5.8 ± 2.3 µm 2 . We have therefore demonstrated a quantitative agreement between curved grating and ablative imprint techniques. The small underestimation of curved grating effective area follows from the fact that contour areas larger than 28 µm 2 could not be measured due to the smaller dynamic range compared to imprints. The limited dynamic range of the focused beam as measured by the curved grating is due to the following reason. To avoid damage of the grating, the transmission of the FEL beam at focus was 2 orders of magnitude lower compared to the one used for bender scans, where the beam was defocused along one direction. At the same time, in general, a larger diffraction efficiency would also be beneficial since it would lead to a stronger diffracted signal at the detector for the same incident X-ray fluence at the grating, hence to larger dynamic range.
Having demonstrated the accuracy of the curved grating approach in comparison with the stateof-the-art ablative imprints, another equally important property of a KB system is reproducibility. We have shown that a given bending degree of the mirror, corresponding to a certain beam dimension at the sample plane, can be reproduced and unambiguously determined by three capacitive sensors. This conclusion follows from the performance of multiple scans of the bender motors in opposite directions (hence potentially affected by motor hysteresis), and the excellent agreement of KB bending resulting from capacitive sensors measurements and slope profiler. These observations corroborate the importance of having capacitive sensors installed at bendable mirrors, which otherwise would lack of a quick, accurate and reproducible procedure to obtain a desired beam dimension.

Conclusions
In this work we present a systematic characterization of FEL spatial properties as a function of KB mirror bending, as well as other beamline optical elements, at the SCS Instrument. In particular, we investigate widths and positions of the FEL beam at and near the focus using a curved grating and ablative imprints. With the beamline operating in monochromatic mode, at photon energy 775 eV with ES = 21 µm, the focused X-ray beam has ≈ 1 µm beam size in both horizontal and vertical direction and Gaussian-like beam profile. These results follow from the high quality mirrors with exceptionally small slope errors ≈ 100 nrad rms, as measured by optical metrology.
We demonstrate that results obtained with the relatively novel technique of curved grating are in good qualitative and quantitative agreement with the state-of-the-art method of ablative imprints. For a consistent comparison, a fluence scan analysis of curved grating images of the focused FEL beam was carried out. Moreover, a new analysis procedure based on Monte Carlo calculations was introduced in order to assign a confidence range to the effective area measured by imprints. The good agreement of these two independent approaches confirms the accuracy of the beam properties based on curved gratings. Besides the analysis of beam dimensions, the curved grating technique was employed to assess train-to-train deviations of FEL beam properties (width and position) and therefore conclude on the beam stability at focus. The investigation of beam properties as a function of exit slits and horizontal slits indicates possible strategies to reduce positional jitter and improve stability. Importantly, curved grating images of the beam can be analyzed and results can be displayed in real time. This quick feedback is used to timely modify beam properties as required by the experiment. Finally, with a pulse-resolved detector (e.g. DSSC) capable of recording images of individual FEL pulses arriving at MHz repetition rate in the train, pulse-to-pulse positional jitter and deviations of beam size, obtained by curved gratings, could be measured and used as feedback to the machine to optimize beam properties at the sample position.