Design, realization, and high power test of high gradient, high repetition rate brazing-free S -band photogun

rf photoguns find several types of applications as high brightness electron sources for free-electron lasers, energy recovery linacs, Compton and Thomson sources, and high-energy linear colliders. The high peak current and low transverse emittance of the generated beam are obtained with the combination of a high peak electric field ( > 100 MV = m) at the cathode surface, a proper choice of the solenoid field around, or immediately after, the gun, and special fabrication and treatments of the cathode itself. On the other hand, to increase the average electron current, a high repetition rate ( > 100 Hz) and/or a multibunch rf gun have to be developed. These types of devices are, in general, fabricated by brazing processes of copper machined parts. The brazing processes require a large vacuum furnace, are very expensive, and pose a not negligible risk of failure. A new fabrication technique for this type of structure has been recently developed and implemented at the Laboratories of Frascati of the National Institute of Nuclear Physics (INFN-LNF, Italy) and already applied to an rf gun now operating at a relatively low cathode peak field and low repetition rate [D. Alesini et al. , Phys. Rev. Accel. Beams 18 , 092001 (2015)]. It is based on the use of special rf-vacuum gaskets that allow a brazing-free realization process. The S -band gun of the Extreme Light Infrastructure-Nuclear Physics Gamma Beam System, under construction in Magurele (Bucharest, Romania), has been realized with this new technique and represents a further and fundamental step toward the consolidation of this technology for high gradient particle accelerator fabrication. It operates at 100 Hz with a 120 MV = m cathode peak field and 1 . 5 - μ s-long rf pulses to house the 32 bunches necessary to reach the target gamma flux. High gradient tests, performed at full power and a full repetition rate, have shown the extremely good performances of the structure in terms of the breakdown rate and conditioning time and definitively demonstrated the reliability and suitability of such fabrication process for high gradient structure realization. In this paper, we report and discuss the electromagnetic and thermomechanical design, the realization process, and all the experimental results at low and high power at a full repetition rate.


I. INTRODUCTION
Photocathode rf guns [1] allow reaching a very high beam brightness and can find applications as injectors for free-electron lasers, terahertz and Compton sources, and electron diffraction microscopes [2][3][4][5][6][7][8][9][10][11][12][13][14][15]. They are multicell standing wave structures in which the electron beam is generated by photoemission illuminating the cathode surface with a drive-laser pulse. The beam is then immediately accelerated by the high electric field (>100 MV=m) on the cathode itself and typically focused with a solenoid field around, or immediately after, the gun. This allows to limit the emittance degradation due to the space charge effects and to reach a very high beam brightness.
From the electromagnetic (e.m.) point of view, since the achievable beam brightness is proportional to the peak field at the cathode, in the last generation of rf guns great effort has been made to increase the field amplitude and, at the same time, to reduce the breakdown rate (BDR). This requires a proper rf design of the structures, to minimize the surface electric and magnetic peak fields [16][17][18], and appropriate realization techniques in terms of surface finishing (typically below 200 nm) and cleaning procedures. Much effort has been made also to increase the repetition rate and to reduce the realization cost. The former requires a careful cooling system design aided by thermomechanical simulations and a mechanical design of the structure that allows one to integrate cooling channels into the gun body. Concerning the second item, the common fabrication process relies on brazing. This requires large vacuum furnaces, so that it is very expensive and poses a non-negligible risk of failure. Furthermore, BDR studies carried out on X-band prototypes indicated that, by avoiding copper thermal stress release associated with brazing, it is possible to reduce the BDR probability [19]. There are also indications that the conditioning time required for hard copper structures is reduced with respect to annealed copper [20]. For all these reasons, a new brazing-free fabrication technique based on the use of special rf-vacuum gaskets has been recently developed at LNF-INFN [21] and successfully applied to the realization of a first rf gun prototype, in operation at UCLA since three years at a low repetition rate (5 Hz) and relatively low cathode peak field (<90 MV=m) [22][23][24][25].
This technique has also been adopted for the realization of the rf gun of the Extreme Light Infrastructure-Nuclear Physics Gamma Beam System (ELI-NP GBS) [26]. It operates at a relatively high repetition rate (100 Hz) and with relatively long rf pulses (1.5 μs) to allow the multibunch operation (32 bunches spaced by 16 ns) foreseen for the gamma source. It has been fabricated and tested at high power, reaching its nominal performances after about 160 h of conditioning. This test definitively demonstrates the reliability of this technology for high gradient structures and its possible extension to the fabrication of more complex radio frequency structures [27]. The results presented in this paper represent a further important step oriented to prove that the new proposed clamping technique can be applied to particle accelerators operating at a high gradient and high repetition rate. With respect to the already published paper [22], there are, in fact, several new results, implementations and calculations: (a) The ELI-NP gun has been designed and tested for the 100 Hz repetition frequency with long rf pulses and high average dissipated power to sustain the multibunch operation, and, to this purpose, also the design of the cathode has been changed with an integrated cooling system completely different to that already implemented, as example, in the Linac Coherent Light Source gun [28]; (b) the maximum reached peak cathode field has been increased and successfully tested up to 120 MV=m; (c) an improved technique to detect all breakdown phenomena based on a fast digitizer and rf pulse shape masks has also been implemented; (d) a thermomechanical design for the operation at 1 kW average dissipated power has been done; (e) calculations of beam loading effects in the multibunch operation and of the excitation of the 0-mode due to short rf pulses and its impact on the multibunch beam energy spread have been inserted; (f) an optimization procedure of the coupling coefficient for long rf pulses and multibunch operation have also been discussed.
In the first section of the paper, the electromagnetic and thermomechanical design of the gun will be reviewed. In the second section, the fabrication process will be illustrated. The low and high power test results, together with a discussion about the advantages of this technique with respect to other possible brazing-free realizations, will be presented in the third and fourth sections, respectively.

II. DESIGN OF THE GUN
The design of the rf gun followed the same criteria illustrated in Ref. [22]. The main gun parameters are given in Table I. In the table, P diss is the dissipated power in the cavity, E surf is the surface peak field on the iris, and the shunt impedance (R) has been defined as On axis a As illustrated in the next section, the rf input power has a steplike profile to have a constant accelerating field over the bunch train. The two power levels reported in the table are referred to as these two levels of power. In parentheses, there are also reported the two levels of power that are required, according to the measured quality factor and coupling coefficient.
where ω rf ¼ 2πf rf , f rf being the excitation frequency and E acc the accelerating field phasor.

A. Electromagnetic design
The e.m. design of the gun has been performed using 2D and 3D e.m. codes (Superfish [29] and Ansys Electronics [30]). Figure 1 shows the geometry of the gun with its main dimensions. The iris profile has been designed with an elliptical shape and a large aperture, to simultaneously reduce the peak surface electric field, increase the frequency separation between the two gun resonant modes, and improve the pumping efficiency on the half cell. Figure 2 shows the 2D profile of the gun with the longitudinal and surface electric field of the working mode (π mode) and of the 0 mode. The large frequency separation (>41 MHz) of the two gun resonant modes limits the excitation of the 0-mode during transients in the pulsed regime, which is particularly important if the structure is fed with short pulses [28] or if "rf gymnastic" is required to have a uniform accelerating field along the bunch train, as discussed later. Calculations on the residual excitation of the 0-mode are performed in Appendix A, showing that its impact is negligible.
The coupling window between the rectangular waveguide and the full cell has been strongly rounded to reduce the peak surface magnetic field and, as a consequence, the pulsed heating [16,22]. The magnetic field in the coupler region at a 120 MV=m cathode peak field is shown in Fig. 3. To compensate the dipole field component, induced by the presence of the coupling hole in the full cell, a symmetric port (connected to a circular pipe below the cutoff) has been included in the gun [31][32][33], and it is also used as a pumping port. The residual dipole and quadrupole field components, due to the presence of the power flux and of the two holes, have been evaluated, and the results are presented in Appendix B. Their impact on the transverse beam dynamics has been evaluated causing an ∼15% of emittance increase in one of the two planes [34]. This growth has been considered to be tolerable for machine operation. Finally, the radius of the pipe is compatible with the on-axis laser injection foreseen for the gun: the laser pulses will be injected through a dedicated chamber after the solenoid.
To have a uniform accelerating field along the whole bunch train, the input power profile has to be properly shaped to avoid bunch-by-bunch energy spread. A uniform input power profile will, in fact, produce an exponential increase of the accelerating voltage in the cavity (see Appendix C). One possibility is to shape the input power as shown in Fig. 4(a). In this case, one can play with both the injection time (t inj ) and power ratio (α) to have a uniform accelerating field along the bunch train. It is possible to demonstrate (see Appendix C) that these two quantities have to satisfy the relation where τ ¼ 2Q L =ω rf is the filling time of the gun mode and Q L ¼ Q 0 =ð1 þ βÞ is the loaded quality factor. The required peak input power αP rf and the average dissipated power into the gun (hP diss i) depend on the injection time and gun parameters, as illustrated in Fig. 5, where αP rf and hP diss i have been plotted as a function of t inj and the coupling coefficient (β). Details of the calculations are given in Appendix C. From these results, it is possible to conclude that a high coupling coefficient allows to use short rf pulses, keeping under control the required rf peak power. With such a choice, the average dissipated power results are also minimized. Moreover, short rf pulses are also preferable to reduce the BDR [18,35]. On the other hand, large coupling coefficients require large holes and can introduce a strong perturbation on the accelerating mode configuration as multipole field components in the full cell. The last quantity we have considered is the sensitivity of the head-tail train energy spread with respect to the power ratio α, that is given by (see Appendix C) The sensitivity does not depend on the injection time and increases if the coupling coefficient increases, as given in Fig. 6.
In conclusion, a good compromise between all different quantities has been found with β ¼ 3 and t inj ¼ 1 μs.
So far, beam loading effects [36] have not been considered. The passage of electron bunches through accelerating structures excites electromagnetic wakefield. This field can have longitudinal and transverse components and, interacting with subsequent bunches, can affect the longitudinal and the transverse beam dynamics. Those related to the excitation of the fundamental accelerating mode are referred to as beam loading effects and can give a modulation of the beam energy along the train. The main effect of the beam loading is the reduction of the accelerating field gradient in the structure, since the effective field can be assumed as a superposition of the rf field and induced wakefield. It can be easily demonstrated [26] that these effects are, nevertheless, completely negligible in our case, as discussed also in Appendix D. As an example, the voltage induced in the gun by the beam itself is shown in Fig. 7 and, if compared with the nominal accelerating voltage of about 5.7 MV, gives a residual energy spread along the train below 0.1%. As discussed in Appendix D, this residual spread can also be compensated by a slight correction of the input power P rf and α parameter.

Cooling system design: Goal and constraints
The operation at 100 Hz with 1.5 μs rf pulses, required for the multibunch operation, results in an average dissipated power into the gun body larger than 1 kW. For this reason, a careful design of the cooling system has been performed to avoid detuning of the gun during operation, due to not uniform deformations. The gun cooling system integrates six cooling channels with different diameters (as given in Fig. 8): three for the full cell, one for the iris, one for the half cell, and one for the cathode. In each channel, a continuous flow of demineralized water was foreseen with a total flow of 30 l= min.

Implemented methods
The 3D model of the gun, including cooling channels, has been implemented in the Ansys Workbench (WB) [30] environment. With this code, the fully coupled thermal, structural, and electromagnetic analysis has been performed. The heat load obtained by the electromagnetic analysis has been imported in the thermal analysis module. This analysis, in particular, was integrated by a specifically developed Ansys Parametric Design Language script, following the same criteria illustrated in Ref. [37][38][39]. This customized code was needed to modify the model generated by default in Ansys Workbench, introducing the most appropriate elements for the convective heat exchange simulation and the temperature distribution calculation on both the copper part and the coolant water. Afterwards, the results of the thermal analysis have been linked to the input of the structural analysis in order to import the thermal stress on the gun body and to calculate the related material deformation. Subsequently, in the last step, this last result has been linked back to the electromagnetic module (closing the loop) in order to perform again the e.m. simulation with the deformed structure, calculating the detuning of the rf gun and deformed field map.

Results: Temperature distributions, calculated deformations, and electromagnetic field perturbation
The final temperature distribution is given in Fig. 8; the corresponding deformation, reaching at maximum a few microns, is depicted instead in Fig. 9. The constraints imposed in the mechanical model reproduce the real setup of the gun, as given in pictures in Figs. 10 and 20. From the e.m. point of view, the corresponding frequency detuning of the gun in operation is lower than 100 kHz, and the field flatness is not affected at all. Such frequency detuning can be compensated by changing the water inlet temperature of about 2°C.

III. GUN FABRICATION
The mechanical drawings of the gun are shown in Figs. 10 and 11. The body of the gun has been fabricated from a single piece of OFHC copper using diamond tools. The rounded coupler geometry and the overall gun body have been realized with a five-axis milling machine. The full cell has then been sealed by clamping the body with the pipe by means of the special copper gasket [21,40], that simultaneously guarantees the vacuum seal and the rf contact, avoiding sharp edges and gaps. The geometry of the gasket and the mechanism of gasket compression are illustrated in Figs. 11 and 12. The gasket has not been annealed and has been compressed by a few hundred microns. This assures that it works in the elastic regime without damaging the surfaces of the gun body. All gasket properties are well illustrated in Ref. [21]. In order to test the reliability of the system, before the realization of the whole gun, a prototype cell has been fabricated [Figs. 13(a) and 13(b)]. It reproduces the rf and vacuum connection between the full gun cell and the beam pipe tube. The cell has been clamped, vacuum tested, and then undergone several baking thermal cycles from room temperature up to 200°C for several hours. The setup is shown in Fig. 13(c). Leak tests have been successfully performed during all these thermal cycles. We have also substituted the gasket with a new one and performed similar tests, and no leaks have been detected. Because of the elastic compression of the gasket and because of the hardness of the copper cell body, after the gasket removal, we noticed that the surfaces were not damaged.
The waveguide has then been realized separately, and its connection to the gun body has been done using a similar type of gasket. In this case, the special copper gasket works between the stainless steel flange and the copper gun body.
The rf gun has been fabricated by a private company [41] with a precision on the internal dimensions of AE10 μm and a roughness smaller than 150 nm. The detail of the gun assembly procedure is given in Figs. 11 and 14. The cathode has been realized from a single piece of copper and has been clamped to the structure. The rf contact between the cathode and the gun body is guaranteed by pressure, while the vacuum seal by a special aluminum gasket not exposed to rf, as given in Fig. 15, where a detail of the cathode assembly is reported. The cathode dissipates around 200 W and has to be cooled independently. Before the final clamping, the gun has been cleaned with a detergent (ALMECO-19), a mixture of organic (citric) acid and distilled water, in an ultrasound bath.

IV. LOW AND HIGH POWER RF TESTS
A low power rf test and tuning of the gun have been performed, after its assembly, with the bead pull technique [42], measuring the reflection coefficient with a network analyzer (Rhode & Schwarz ZVB 20). The picture of the structure under test is given in Fig. 16. The accelerating field profile is shown in Fig. 17, while the reflection coefficient at the input port after tuning and the transmission coefficient between the waveguide and the gun probe 1 are shown in Fig. 18. The tuning has been done by deformation tuners in the full cell. These tuners have been realized with a technique similar to that already described in Ref. [43]. 2 The resulting measured coupling coefficient was β ¼ 2.5 in fair agreement with the design value, while all other parameters were in perfect agreement with the simulated ones, as listed in Table I. The measured quality factor was even larger than the simulated one and consistent with the lower measured coupling coefficient. A lower β, in fact, is related to a slightly smaller coupling hole dimension and, then, to smaller values of the surface magnetic field and associated losses, as can be verified by electromagnetic simulations.
High power rf tests have been performed at the Bonn University in collaboration with a private company [44].
Pictures of the structure under test and details of the test stand are given in Figs. 19 and 20 with the schematic of the setup given in Fig. 19(b). The power source was the ELI-NP Scandinova rf unit based on solid state modulator K2-3 and 60 MW S-band Toshiba klystron. Two directional couplers (DCs) have been inserted in the waveguide line to detect the forward and reflected power signals right after the klystron and before the gun. Four ion pumps have been connected following the same configuration of the final ELI-NP injector. An isolator in SF6 has also been installed, to protect the klystron from the reflected power.
The aim of the test was to achieve 120 MV=m at the cathode (corresponding to 14 MW input power) at the nominal repetition rate of 100 Hz with a 1.5 μs rf pulse duration. In this test, it was not possible to make the steplike input pulse that will be implemented in the real machine to avoid energy spread along the bunch train. The power signals from DCs were measured using rf peak detectors (Schottky diodes) read out with a digital oscilloscope. Samples of the detected signals are given in Fig. 21. The klystron power, repetition rate, and pulse length were progressively increased, while breakdown phenomena were detected by looking at the ion pump current and rf signals from pickups. The conditioning procedure was semiautomatic, and the power has been increased acting on modulator high voltage (HV). In particular, the modulator HV was switched off by (a) ion pump current absorption exceeding a threshold corresponding to a pressure of 5 × 10 −8 mbar; (b) high reflected power to the klystron; and (c) distortions of the reflected signal due   1 The gun probe is a small antenna inserted into the stainless steel tube connected to the vacuum pump and coupled with the rf field of the full cell. 2 The full cell wall has two points with a reduced wall thickness (∼1 mm) allowing a plastic deformation of the wall itself. Such a deformation can be obtained in both directions: The surface can be pushed into the cell by hitting the tuner or can be pulled out with a screw and a dedicated tool.
to breakdown phenomena. This last control method has been implemented using a fast PCI (Peripheral Component Interconnection) eXtensions for Instrumentation system and is thoroughly illustrated in Ref. [45]. The waveform at each pulse was acquired and automatically compared with the previous one within a mask of tolerance [ Fig. 22(a)], and, in the case of pulse distortions due to a discharge, the modulator HV was switched off immediately. This method allows a very fast and sensitive control of the breakdown events with respect to the control based on vacuum pressure only. As an example, the detection of a breakdown by means of the reflected signal mask is given in Fig. 22(b).
The rf conditioning lasted about 160 h, and the gun reached the nominal parameters with a breakdown rate of a few 10 −5 bpp. Considering the limited test-stand time availability and the schedule constraints of the ELI-NP project, we concluded that the test was successful, because the BDR continued decreasing after reaching the nominal parameters. Figure 23 shows the conditioning history in terms of the power, repetition rate, and pulse length. During the conditioning, we basically kept constant the repetition rate at 100 Hz, and we progressively increased the pulse length up to the nominal parameter. For each pulse length step (below 1 μs), we increased the power level up to about 18-20 MW. Above 1 μs and up to the nominal value of 1.5 μs, we increased the power level to about 14 MW corresponding to the cathode peak field of 120 MV=m. The level of input power has been measured by both peak detectors and power meters through the directional couplers and also from the gun probe, which has been calibrated during the low power rf tests. The klystron output power versus the high voltage has also been measured and calibrated with a direct connection of the klystron to an rf load.
The vacuum pressure was constantly measured by the ion pump current during the whole process. Its baseline at full power was of the order of 1 × 10 −8 mbar and always maintained a decreasing trend. At the end of conditioning and without power, the vacuum pressure in the gun was lower than 5 × 10 −10 mbar. Figure 24 shows the measured pressure during the gun conditioning.
The number of cumulated breakdowns is given in Fig. 25  (upper plot), while the calculated breakdown rate in the last 10 h of conditioning is given in Fig. 25 (bottom plot).

V. DISCUSSION ON DIFFERENT BRAZING-FREE TECHNIQUES
Brazing is usually used for making the rf contact and the vacuum sealing at the same time. Comparing to it, the proposed technology for the rf structure fabrication is based on the use of special gaskets that allows one to guarantee, at the same time, rf and vacuum contacts, without the brazing process. There are, in principle, other possibilities of the realization of structures without brazing, with the use of gaskets (or welding vacuum seal joints). They are schematically represented in Fig. 26.
The first alternative solution [ Fig. 26(b)] includes the use of an rf contact that can be realized, as example, with a tooth scratched between the two copper parts to be joined, while the vacuum seal is on the outer diameter. In our opinion, this mechanism has a couple of disadvantages. First of all, it is not trivial to reopen and then close the structure simply substituting the gasket, because the realization of the rf contact by the scratch of the tooth makes the two copper parts not reusable for other clamping. Second, there is a region between the rf contact and the vacuum seal  Extremely good rf contact with good performances at a very high gradient Not possible to reopen the structure Undefined vacuum region between the rf contact and the vacuum tight Cooling channels have to be placed outside the vacuum seal (or have to cross the vacuum region, which is not recommendable), and therefore they could be too far from the region to be cooled.
Choke mode Possibility to implement HOM damping system for multibunch operation Cooling channels could be too far from the region to be cooled Lower quality factor, shunt impedance, and higher BDR due to the choke mode that has a not well-defined "vacuum condition" and has to be evacuated with a dedicated pumping system or with a hydraulic connection with the internal vacuum. Moreover, the cooling channels have to be placed outside the vacuum seal (or have to cross the vacuum region, which is not recommendable), and therefore they should be far from the region to be cooled. This will be a limitation for high duty cycle structures. On the other hand, the advantage of this technique is the fact that the rf contact is guaranteed by the tooth and by a strong penetration between two copper parts. In this case, the small tooth can be plastically deformed, and it "conpenetrated" the surface of the other part, guaranteeing an extremely good rf contact. This can give advantages in the case of a very high gradient test with respect to the rf and vacuum gasket solution, in which the rf contact is guaranteed by pressure only, with a relatively small deformation or penetration between the copper surfaces. A high power test performed on hard copper cavities fabricated with this technique has demonstrated low breakdown rates at a very high gradient [46][47][48].
The second alternative solution is sketched in Fig. 26(c). The choke mode filter proposed and implemented in the Spring 8 C-band structures [49][50][51] allows to avoid the rf contact. In this case, the vacuum seal does not "see" any rf field. In our opinion, the main disadvantage of this solution is related to the use of choke mode cavities instead of pillbox cavities, that have, a lower quality factor and shunt impedance. Second, the cooling pipes have to be placed outside the vacuum seal, and they should be far from the region to be cooled. Also, this will be a limitation for high duty cycle structures. From the breakdown rate point of view, choke mode cavities seems to have a BDR higher than pillboxlike cavities due to the presence of the gap in the choke mode filter [52][53][54]. On the other hand, the main advantage of this solution is the possibility to implement a high order mode (HOM) damping mechanism that is necessary for multibunch operation [39,55]. All these different features have been summarized in Table II.

VI. CONCLUSIONS
The S-band gun of the ELI-NP GBS has been fabricated with a new technique based on the use of special rf-vacuum gaskets, recently developed and implemented at the INFN-LNF. This allows brazing-free production processes, thus reducing the cost, the production time, and the risk of failure. The ELI-NP gun has been designed, realized, and successfully tested at low and high power reaching in a remarkably short time (160 h) the nominal parameters (120 MV=m cathode peak field at 100 Hz and 1.5 μs rf pulse length). The tests definitively demonstrate the reliability and suitability of such fabrication technology for high gradient structures and opens the possibility for its implementation to any cavities including linac multicell structures.

ACKNOWLEDGMENTS
We thank R. Di Raddo and P. Chimenti for the technical support and L. Serafini and the COMEB company for the helpful scientific and technical suggestions and discussions.

APPENDIX A: CALCULATION OF THE AMPLITUDE OF THE 0-MODE IN TRANSIENT REGIME
To calculate the excitation of the so-called 0-mode during transient, it is convenient to refer to the equivalent circuit of a resonant mode into a cavity coupled to an external generator, as given in Fig. 27. The mode parameters are related to the circuit components with the wellknown relations that we report here for completeness: where ω 0 ¼ 2πf 0 (f 0 is the resonant frequency of the 0-mode) and Q 0 , β 0 , and R 0 are the unloaded quality factor, the coupling coefficient, and the shunt impedance where Z 0 is the characteristic impedance of the waveguide line itself.
To obtain the cavity voltage V cav 0 during the transient regime, it is useful to refer to the analysis of the circuit in the Laplace domain [56]. In this domain, the relation between the generator voltage and the cavity voltage is given byṼ where where H is the Heaviside function. From previous expressions, we obtaiñ This function has a well-known time-domain expression: The approximated expressions are valid in the case of loaded quality factors larger than a few hundred, like in our case.
We can consider two different cases: the case of a mode excited at the resonant frequency (ω rf ¼ ω 0 ) and the case of a mode excited a few bandwidths out of resonance (jω rf − ω 0 j ≫ ω 0 =2Q L 0 , f BW 0 ¼ f 0 =Q L 0 being the 3 dB bandwidth of the mode). In the first case, we obtain That is the well-known expression of the cavity voltage amplitude when the cavity is excited on resonance.
In the second case, we have that where Δf ¼ f 0 − f rf is the difference between the resonant frequency of the cavity (f 0 ) and the excitation frequency (f rf ). In Eq. (A9), the sign of the phases is positive (negative) if the resonant frequency of the cavity is larger (smaller) than the excitation frequency. In the final expression of Eq. (A9), we have considered the following approximations: The previous equations work also for the cathode peak field by simply substituting the square root of the shunt impedance ( ffiffiffiffiffi ffi R 0 p ) with the normalization factor E cath 0 = ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2P diss 0 p . In conclusion, during the transient regime we have an exponential decay of the transient component of the 0-mode at the resonant frequency f 0 with a time constant 2Q L 0 =ω 0 .
In our case, at the injection time of the first bunch, there is another step on the input power (as represented in Fig. 4) that causes another transient regime of the 0-mode. In this case, it is straightforward to recognize that the total voltage related to the 0-mode excitation (for t > t inj ) is then given by The effects of such a mode on the beam dynamics are multiple. The transient component at f 0 causes a perturbation of the cathode peak field and of the total accelerating field that varies along the bunch train, while the steady state component at f rf causes a perturbation of the accelerating field (that does not change along the bunch train). The first effect is of more concern, since it can perturb the dynamics along the train, while the second one can (slightly) perturb the beam dynamics in the gun. However, in our case, the first term, the contribution of the 0-mode, is very small, because the demagnification factor f BW 0 =Δf is as small as 0.01.
The total accelerating voltage (and cathode peak field) are given, at the end, by the superposition of the π-mode accelerating field [see Eq. (C6)] and of the 0-mode of Eq. (A9). As an example, in Fig. 28 we show the peak voltage and cathode E field (for t > t inj ) normalized to the average one along the bunch train. In the same plot, we also show the voltage (and cathode field) sampled by bunches. In the calculation, we considered the following parameters for the 0 mode (Ansys Electronics results [30]): β ¼ 1.41, Q 0 ¼ 14000, MV=ðmMW 0.5 Þ, and the parameters of Table I for the working mode.
From previous expressions and figures, it is quite easy to observe that t inj and the injection bucket of the first bunch can be (slightly) optimized in order to minimize the energy spread along the bunch train due to the transient of the 0-mode. In particular, in the case shown in Fig. 28, the full bunch train energy spread is less than 0.1%, and also the cathode field variation is less than 0.3%.

APPENDIX B: ANALYSIS OF THE DIPOLE AND QUADRUPOLE FIELD COMPONENTS DUE TO THE COUPLING HOLE
The coupling hole in the full cell breaks the rotational symmetry of the cavity, generating dipole and quadrupole field components. The dipole component has been compensated with a symmetric hole connected to a circular pipe below the cutoff. Nevertheless, a residual component of the dipole field, due to the asymmetry between the waveguide and the circular pipe below the cutoff and to the power flux from the waveguide to the accelerating cells (Poynting vector), is still present.
Let us consider the rf gun sketched in Fig. 29. The transverse magnetic field calculated along line 1 is given in   Fig. 31. The fields have real and imaginary components that can be integrated along the axis, taking into account the field variation with time and particle velocity (that has been assumed for simplicity equal to c). The results are given in Fig. 32, where we show the transverse voltages integrated along the gun as a function of the launching phase (we have represented the magnetic and electric field contributions and their sum). In the same plot, we also show the accelerating voltage calculated on the same rf phase. In conclusion, the transverse field for a perfect on-crest particle is almost zero, and, in any case, the maximum head-tail transverse voltage for a 10 ps beam (typical bunch length in the gun for the different working points of the ELI-NP machine) is below AE200 V, giving a relatively small transverse net effect if compared with typical beam divergences. The quadrupolar field components can be treated in a similar way. It is quite easy to verify, by means of simulations, that the quadrupole field in the coupler is completely dominated by the magnetic field asymmetry, while the radial electric field is unperturbed. Following the same approach developed in Refs. [39,57], we report in Fig. 33, as an example, the phasor of the azimuthal magnetic field (that is purely imaginary if we assume the accelerating field real) calculated in the center of the full cell for three different circle radii (r 0 ) and for one-half of the structure (θ ¼ π=2 is below the coupling hole). Because of the presence of the two symmetric holes, the phasor of the magnetic field component has an even periodicity with respect to the azimuthal angle, and it can be expressed to first order as follows: where the A 2n components are complex functions and depend on the longitudinal coordinate z. The quadrupolar one is the component associated to the term with n ¼ 1, and its gradient is exactly the term A 2 .
In principle, it is possible to calculate all multipolar components at different longitudinal coordinates by calculating the Fourier series components on different arcs. A first-order estimation of the quadrupole gradient along the structure is given by Figure 34(a) shows the phasor of the azimuthal magnetic field calculated for θ ¼ 0 and π=2 as a function of z for r 0 ¼ 2 mm. In the same plot, we also show, for completeness, the phasor of the transverse electric field (E r ) that, as is clearly visible, does not show any quadrupolar component (it is easy to verify that B is imaginary and E is real). The corresponding quadrupole gradient is given in Fig. 34(b). In Fig. 35, we finally report the integrated quadrupole gradient in the gun as a function of the launching phase (in the same plot, we also show the accelerating voltage). The plot clearly shows that the integrated quadrupole gradient is perfectly in quadrature with respect to the accelerating field and that an on-crest beam of 10 ps experiences a head-tail quadrupole integrated field of less than AE2 mT.

APPENDIX C: BUNCH TRAIN ENERGY SPREAD DUE TO A STEPLIKE RF INPUT PULSE
If we assume a simple excitation of the gun with a constant rf input pulse, we have that the amplitude of the accelerating voltage in the cavity is where P rf is the incident input power in the gun, β is the coupling coefficient, and τ ¼ 2Q L =ω rf is the filling time of the π mode of the cavity. The accelerating voltage sampled by each bunch of the train is then given by  33. Phasor of the azimuthal magnetic field (that is purely imaginary) calculated in the center of the full cell for three different circle radii (r 0 ) and for one-half of the structure (θ ¼ π=2 is below the coupling hole).
where t inj corresponds to the injection time of the first bunch, ΔT is the bunch distance (supposed to be an integer number of rf periods), and ϕ is the injection phase. In Fig. 36(a), we report, as an example, the multibunch energy spread in the bunch train for different injection times, assuming the gun parameters of Table I and ϕ ¼ π=2. Similarly, Fig. 36(b) shows the full multibunch energy spread in the train. In the figures, we have defined the bunch energy spread and the head-tail energy spread, respectively, as where hV acc i is the average accelerating voltage over the train and N b ð¼ 32Þ is the number of bunches. From the previous plots, it is easy to verify that, in order to limit the energy spread along the bunch train below the acceptable threshold of 0.1% [26], one has to increase the rf pulse length (i.e., t inj ) and/or the coupling coefficient. However, an increase of the pulse length gives an increase of the average dissipated power into the gun and can also increase the BDR [18]. A large coupling coefficient, on the other hand, requires large holes in the structure and can introduce a strong perturbation on the accelerating mode configuration, such as multipole field components in the full cell.
To reduce the required rf pulse length and the required coupling coefficient, the input power profile can be shaped with a steplike input pulse, as shown in Fig. 4(a). In this case, the peak of the accelerating cavity voltage is given bŷ where the parameter α is defined as the ratio between the initial and final input power. In order to have a uniform accelerating voltage along the bunch train, the following relation between α and t inj has to be satisfied: In this case, the peak of the accelerating voltage of Eq. (C4) becomes and is uniform along the bunch train (t inj < t < t end ).
where the equalities are valid if α satisfies Eq. (C5).
Equations (C4) and (C6) can be extended also to the cathode peak field, simply by changing the square root of the shunt impedance ( ffiffiffi ffi R p ) with the normalization factor E cath = ffiffiffiffiffiffiffiffiffiffiffi ffi 2P diss p that can be calculated by simulations and is given in Table I. As an example, with the gun parameters of Table I, and with t inj ¼ 1 μs, α is equal to 1.2, and the input power profile and cathode peak field are given in Fig. 4(b).
From the previous formula, it is also possible to calculate the peak input power (P peak ¼ αP rf ) to reach E cath ¼ 120 MV=m and the average dissipated power into the gun hP diss i as a function of t inj , for different coupling coefficients β. The results are given in Fig. 5.
The last important quantity that can be calculated is the sensitivity of the full multibunch energy spread (ΔE head-tail =hEi) to the power ratio α. From previous equations, we have where Δt train ¼ t end − t inj , as given in Fig. 4. We have then that corresponds to Eq. (3).

APPENDIX D: BEAM LOADING EFFECTS
The main effect of the beam loading [36] is the decrease of the accelerating field gradient in the structure, since the effective field can be assumed as a superposition of the rf field and induced wakefield. If V acc is the rf accelerating voltage in the structure and V bl is the induced voltage by the longitudinal wakefield, the total accelerating voltage is Also, other longitudinal HOMs can be excited in the structure and can contribute to the beam energy perturbation. Nevertheless, we will focus our attention on the contribution given by the fundamental mode, that is, the dominant one.
When a Gaussian bunch of total charge q passes through the gun, the beam-induced voltage on the fundamental mode is given by where the R=Q factor is the ratio between the shunt impedance and the unloaded quality factor, σ τ is the bunch length, and τ is the filling time. According to the beam loading theorem, the beam voltage induced on the bunch itself is given by If we consider a train of identical bunches spaced in time by ΔT, the total beam loading voltage experienced by the nth bunch is simply given by The beam-induced voltage assuming the ELI-NP beam parameters (q ¼ 250 pC, 32 bunches, and ΔT ¼ 16 ns) and the gun parameters of Table I is given in Fig. 7. Since the nominal accelerating voltage for an on-crest accelerated beam is ∼5.8 MV, the induced energy spread along the bunch train due to the beam loading effect is below 0.1% and can be, in principle, neglected. In case one wants to also compensate this effect, it is possible to play with the input power and α parameter defined in the previous paragraph. The total voltage as a function of time seen by subsequent bunches is, in fact, given by In order to have the desired accelerating voltage (V TOT nom ) and a uniform voltage profile over the bunch train, the two following relations have to be satisfied: > > > > > : From these equations, it can be easily verified that the correction on both P rf and α to compensate also the beam loading effects is less than 1%.