## 4 Start-to-End Beam Physics  
Using the optimized electron bunches at multiple cathode accelerating gradients in the injector, start-to-end beam physics studies of the accelerators are performed. As shown in Figure 1a, the bunches are tracked from the injector (I1) all the way through the linac (L1/L2/L3) up to the entrance of the undulators (SA1). The particle tracking is done in the open-source code OCELOT [51] using the charged particle beam dynamics (CPBD) module. A full machine lattice setup of the European XFEL is available online [20]. Design optics are used. The beam matching follows a so-called artificial matching approach developed in OCELOT and the optics are not explicitly optimized for individual simulation cases in this paper. Collective effects such as 3D space-charge, 3D wakes and 1D CSR are taken into account, as described in [52]. In this study, an energy profile along the accelerator beamline is fixed as 130 MeV, 700 MeV and 2400 MeV at three bunch compression stages, which is the same as in the present XFEL. For simplicity, a possible modification in this energy profile for the future CW mode is not considered in these simulations. The final beam energy scaling is done by adjusting the energy gain of the main linac, which results in 14 GeV and 17.5 GeV for the pulsed mode and 7.3 GeV for the CW mode. Under these conditions, the electron beam qualities in front of the undulators are investigated. Specifically, a primary goal of start-to-end simulations is to find a suitable working point, allowing bunch compression to the target peak current while maintaining as well as possible the bunch qualities obtained from the injectors. Essentially the working point refers to a set of longitudinal beam dynamics parameters such as the R56s and beam energies at the bunch compressors, and also a set of RF parameters, including amplitudes and phases of the acceleration modules, namely A1, AH1, L1 and L2 as shown in Figure 1a. In the following, we employ a parameter set of \(-44\) mm, \(-50\) mm and \(-30\) mm as the R56s at the bunch compressors BC0, BC1 and BC2 as shown in Figure 1a, respectively. The mapping between the RF parameters and the longitudinal beam dynamics parameters is described in [52]. It can be noted that dedicated high-resolution simulations are performed in IMPACTZ [53] with a real number of electrons to numerically resolve the micro-bunching effect by the so-called brute-force technique. This allows a determination of the ratio between the peak current and the energy spread at the end of the accelerator beam line with respect to an optimal laser heater working point [54,55]. The optimized ratio is then set as a goal for further optimization of the RF parameters as well as the mapping between the RF parameters and the longitudinal beam dynamics parameters in OCELOT [51]. More details about this approach will be published elsewhere, for example, in [33]. Figure 7 shows the current profiles (left) and the slice emittance (right) along the three optimized electron bunches in front of the SA1 undulators [see Figure 1a]. As shown, the working points are found for all three cases, such that the peak currents close to 4 kA can be reached after the compression with a peak energy spread of about 2 MeV. The final slice emittance are obtained tracking the bunches generated with different accelerating gradients at the cathode through the whole accelerator beam line. The 56 MV/m case  
Figure 6: Evaluation of sliced gain parameters accounting for slice current and slice emittance along the optimized bunches which is of more relevance to the FEL performance. shows the lowest horizontal emittance. When reducing the cathode gradient down to 40 MV/m, a degradation in emittance can be seen. A stronger emittance growth in the vertical direction is observed. This may attribute to the impacts of the optics on CSR-related emittance growth in the bunch compressors [56; 57]. The optics are not explicitly optimized in this study.