rf traveling-wave electron gun for photoinjectors

The design of a photoinjector, in particular that of the electron source, is of central importance for free electron laser (FEL) machines where a high beam brightness is required. In comparison to standard designs, an rf traveling-wave photocathode gun can provide a more rigid beam with a higher brightness and a shorter pulse. This is illustrated by applying a specific optimization procedure to the SwissFEL photoinjector, for which a brightness improvement up to a factor 3 could be achieved together with a double gun output energy compared to the reference setup foreseeing a state-of-the-art S-band rf standing-wave gun. The higher brightness is mainly given by a (at least) double peak current at the exit of the gun which brings benefits for both the beam dynamics in the linac and the efficiency of the FEL process. The gun design foresees an innovative coaxial rf coupling at both ends of the structure which allows a solenoid with integrated bucking coil to be placed around the cathode in order to provide the necessary focusing right after emission.


I. INTRODUCTION
The electron beam quality in free electron laser (FEL) machines is mainly determined during the initial acceleration, before space-charge effects are suppressed by relativistic effects. For this reason, the design of the injector, in particular that of the electron gun, is of central importance for any FEL machine in order to provide bunches with the highest possible brightness [1][2][3]. For machines based on normal conducting radio-frequency (rf) technology aiming at the generation of x rays, rf standing-wave photocathode guns are those which have demonstrated the best performances together with a good reliability [4][5][6][7]. Advanced designs in S-band [8][9][10] and also in X-band [11] are being developed in different laboratories with promising performance predicted by simulations.
The standing-wave nature of such cavities limits the maximum number of cells, which cannot be too large in order to ensure a minimal mode separation between the desired accelerating mode and those adjacent to it. This is particularly true for higher frequencies [11,12] for which the higher reachable accelerating gradient is not enough to compensate the shorter cell length when aiming at a comparable output energy with an unchanged number of cells. Therefore, for standing-wave guns, the output energy is limited by the presence of adjacent modes, consequently limiting the possibility of generating more rigid beams with higher brightness. In addition, an increased brightness is directly related to a larger electron density n which enters the plasma frequency definition as ω p ∝ ffiffiffiffiffiffiffiffiffi ffi n=γ 3 p , where γ is the relativistic gamma factor [13]. This simple scaling shows that a higher electron density eventually restricts the first plasma oscillation, on which the invariant envelope matching is based [14,15], within a too short distance from the cathode. Again, a limited output energy γ does not allow to compensate the larger electron density.
Previously proposed hybrid designs [16,17] partially solve the issue of the adjacent modes by restricting the standing-wave part of the hybrid gun to one and a half cells. They also eliminate the need for a high power circulator by strongly reducing the reflected power. Due to the topology of the rf input coupling lying at the center of the device between the standing-wave and the traveling-wave part, they require a complex system of multiple focusing solenoids (and bucking coil) to provide a suitable focusing. In addition, such hybrid photocathode guns were proposed for applications with completely different parameters than FEL photoinjectors [18].
Only few pioneering works which involve the idea of a pure rf traveling-wave gun are found in the literature. Shintake [19] addresses the analytical computation of the rf-induced emittance accounting for all of the space harmonics present in an ideal cavity. This study indicates that traveling-wave fields provide a smaller contribution to the rf-induced emittance as compared to standing-wave fields. The rf-induced emittance for an ideal cavity is also studied by Gao [20] with an approach analogous to that of the well-known theory developed by Kim [21]. The validity of this approach seems however to be very limited when applied to a real case [22]. In both mentioned studies, space-charge effects are neglected. A preliminary rf (and corresponding beam dynamics) simulation of a simplified traveling-wave gun is found in Ref. [23]. A thermionic cathode and a different application are considered, making the results not relevant for the present study.
In this paper, a complete design of a pure rf travelingwave gun is proposed for the first time. The existence of undesired resonant modes near the operating frequency is naturally removed and the proposed solution has the potential to increase the output energy above the common values just by increasing the number of cells. Furthermore, there is the technological advantage that a high power rf circulator is not required to operate the gun. The selected gun frequency in the C-band (5.712 GHz) is motivated, on one hand, to reach a short filling time while keeping a suitable power efficiency at the same time. Due to the wellestablished dependence of the achievable gradients on the duration of the rf pulse, shorter filling times enable higher accelerating gradients [24,25]. On the other hand, the choice is supported from the experience gained on this technology with the development of the main linac of the SwissFEL facility [26], currently being built at Paul Scherrer Institut (PSI).
In Sec. II, after defining an appropriate figure of merit which can be condensed into a scalar penalty function, an optimization scheme is proposed which partially integrates into the same loop parameters related to both the rf design and the beam line setup. In particular, the length of input, regular and output cells of the traveling-wave gun are optimized by stretching the gun field map based on the beam dynamics performance and are then adopted in the rf design. This method is applied to the SwissFEL injector in Sec. III, where the benefits of a traveling-wave gun on the performance of the FEL machine are demonstrated, fulfilling all of the constraints. Section IV presents the detailed rf design of the traveling-wave gun, together with practical feeding schemes. An innovative coaxial rf coupling on both the cathode and the output side allows a solenoid with integrated bucking coil to be placed around the main body of the gun, partially surrounding also the cathode, in order to provide the necessary focusing right after emission. The cylindrical symmetry characterizing the gun in the beam region strongly simplifies its manufacturing and avoids additional emittance contributions.

II. FIGURE OF MERIT AND OPTIMIZATION
The general purpose of this section is the improvement of the optimization procedure of a photoinjector, meant as photocathode gun and following booster structures, for FEL machines. It is therefore of central importance to first identify the most adequate figure of merit which can be condensed into a penalty function to be minimized by an automatic routine. The proposed optimization scheme combines the tuning of common beam line parameters, like field strengths and element positions, with parameters directly entering into the rf design, like the cavity cell lengths.

A. Brightness and FEL parameter
The normalized beam brightness B n;inj at the end of the injector is defined as [13] B n;inj ≡ I inj ε x;n ε y;n ; ð1Þ where I inj is the bunch peak current before the first bunch compressor, while ε x;n and ε y;n are the horizontal and vertical normalized emittances, respectively. Subdividing the electron bunch in N s transverse slices allows one to define a mean slice emittanceε i;n ≡ mean s ε i;n;s (i ∈ x; y) over the emittance values ε i;n;s of the individual slices s (of which a small number k s at the head and tail of the bunch is sometimes neglected). A mean normalized slice brightness can also be defined asB n;inj ≡ I inj =ε x;nεy;n . For this work, which focuses on an electron beam for FEL, these mean slice values are more relevant than the projected ones, since the FEL amplification process independently takes place within the individual slices. For the purpose of evaluating the slice emittance (and the mismatch parameter, defined below) at the end of a photoinjector, N s ¼ 20 and k s ∈ f0; 1; 2; 3g are typical values. Furthermore, the subdivision is performed such that all of the slices contain the same charge and therefore every particle has the same importance in the averaged values. A fundamental quantity for the optimization of an FEL photoinjector is the FEL (or Pierce) parameter ρ, whose maximization provides a double advantage: a proportional increase of the saturation power and an inversely proportional decrease of the gain length [27]. The relation between the FEL parameter and the brightness at the entrance of the undulator is where the first proportionality, involving the peak current I und at the entrance of the undulator, the transverse beam sizes σ i and the relativistic gamma factor γ, is just following from the definition of ρ. In the second proportionality, the common relation σ i ¼ ffiffiffiffiffiffiffi ffi β i ε i p between beam size, betatron function β i and geometric emittance ε i is inserted together with the relation between geometric and normalized emittance ε i;n ¼ βγε i (setting β ¼ 1 for the fully relativistic electrons). As for the third proportionality, the discussion is more subtle. From the second proportionality one would tend to minimize the betatron function in order to maximize the FEL parameter. However, the transverse velocity spread which contributes to the effective energy spread in the undulator starts to harm the FEL process below a certain value of the betatron function. This means that an optimal compromise for the betatron function exists. From the study of the undulator dynamics in 3D, it turns out that this is achieved when β i ∝ ε i [28], from which follows the third proportionality in Eq. (2).
It is true that the brightness as it is defined in Eq. (1) is not a conserved quantity along the linac. In fact, B n;und in Eq. (2) refers to the brightness at the entrance of the undulator, which is of course higher than that at the exit of the gun B n;inj as a consequence of the compression stages along the linac which increase the peak current. The achievable overall compression factor I und =I inj along a linac is limited by space-charge and coherent synchrotron radiation effects [2]. Therefore, the beam brilliance B ≡ Q=ε x;n ε y;n ε z;n , where also the energy spread is taken into account within the normalized longitudinal emittance ε z;n , is not necessarily the best figure of merit for an FEL injector even if it is a conserved quantity along the whole beam line. This is also reinforced by the fact that a laser heater is usually employed to increase the initial energy spread above a certain threshold in order to avoid microbunching instabilities [29]. Neglecting the energy spread in the figure of merit is therefore reasonable and therefore also the use of brightness as the figure of merit for a photoinjector.
The mentioned limitations of the achievable overall compression factor mean that a higher peak current at the end of the injector does not only correspond to a higher brightness, but also relaxes the compression factor required to reach the nominal current at the entrance of the undulators. This mitigates the risks of transverse emittance dilution due to the compression stages.

B. Mismatch parameter and FEL pulse energy
Based on the same averaging procedure as that adopted for the slice emittance, a mean slice mismatchζ can be defined based on the common definition of mismatch parameter ζ s [30]: where α, β, γ are the well-known Twiss parameters and the subscripts 0 and s indicate either the bunch as a whole or the specific slice s. The level of matching (ζ ¼ 1 for a perfectly matched bunch andζ > 1 otherwise) has an important influence on the achievable pulse energy of the FEL radiation. For the specific case of SwissFEL, a sensitivity study revealed that the maximum tolerable beta mismatch is β x =β x;0 ¼ 2.3 (where β x;0 is the design value) [31]. This corresponds to a maximum tolerable mismatch parameter ofζ ¼ 1.36, assuming a uniform focusing channel and matched projected Twiss parameters.

C. Penalty function
The quantities defined in Eqs. (1) and (3) can be combined to form a scalar penalty function f p ðB n ;ζÞ which represents a synthesis of the performance in terms of pure beam dynamics. This value f p will be minimized during the optimization process.
It is important that both involved quantities are evaluated at a bunch energy E kin ≳ 100 MeV for two reasons. First, a significant value of the transverse emittance is better obtained at energies where space-charge forces are already considerably suppressed by relativistic effects and, second, the mismatch parameter is strongly dependent on the achievable invariant envelope matching between gun and first booster structure [14,15].
A simple but efficient choice of the penalty function as a linear combination of brightness and mismatch is where C 1 ; C 2 ≥ 0 are the weighting coefficients, C 3 is a normalization constant,B n;0 is a reference brightness and ζ off is the value below which the mismatch is considered to be ideal. Figure 1 shows the dependence of the penalty function f p ðB n ;ζÞ on its two variables by means of a contour plot as it is later used for the optimization of the SwissFEL photoinjector. In the rangeζ >ζ off the dependence is on both parameters, while it is reduced on just the brightness (C 2 ¼ 0) in the range 1 ≤ζ ≤ζ off . The ideal mismatch was set toζ off ¼ 1.05 (gray dashed line in the plot). The fundamental choice is that regarding the ratio between C 1 and C 2 which determines how much weight is given to the brightness and to the mismatch, respectively. This was chosen such that a degradation of the mismatch parameter fromζ ¼ 1.05 toζ ¼ 1.2 is tolerated against an improvement of a factor 3 of the SwissFEL reference brightnessB n;0 ¼ 965 TA=m 2 (see first column of Table I). FIG. 1. Contour plot of the penalty function f p ðB n;inj ;ζÞ in the typical optimization range of brightnessB n;inj and mean mismatch parameterζ for the SwissFEL injector.
Finally, the penalty function can be normalized as desired with C 3 , e.g. requiring that f p ðB n;0 ;ζ off Þ ≡ −1. This normalization has no effect on the optimization because it does not change the gradient of the penalty function which is uniquely defined by the ratio between C 1 and C 2 .

D. Simultaneous optimization of rf and beam dynamics
Assuming that rf accelerating structures and focusing solenoids are given, many parameters are still available to optimize the beam dynamics of a photoinjector. The most important are the transverse spot size, pulse duration and injection phase of the laser at the cathode, the gun solenoid position and field strength, and the position, phase and gradient of the first booster structure. It is therefore evident that the use of an optimization algorithm is of central importance to solve the task. An implementation of this approach was already published in Ref. [32], and the concept is extended in this work.
The current problem, in fact, is more general, since a new design of the rf gun and of the focusing solenoid is investigated in order to improve the photoinjector performance. Therefore, additional degrees of freedom related to a new electromagnetic field distribution of the electron source are available and should be integrated into the optimization loop. For an rf standing-wave gun, in particular, the length of the first half cell is an important factor for the achievable beam quality. This fact is not new, as demonstrated by previous studies which already addressed this topic [11,[33][34][35]. For an rf traveling-wave gun, it turned out that the phase at which the electron bunch enters the last (the output coupling) cell has a fundamental influence on the final performance. This phase can be tuned by adjusting the length of the first (the input coupling) cell and that of the regular cells. The length of the last cell showed to have a minor influence.

General scheme
The central point of the optimization strategy, summarized by the flow diagram of Fig. 2, is the stretching of the field maps to avoid an optimization of the beam dynamics based on several rf designs with a different combination of cell lengths, i.e. on a discrete set of values. This would in fact be very inefficient, at least for a first, rough investigation of the parameter space. The first step of the proposed approach consists in computing the rf fields for a specific gun geometry, for example with ANSYS® HFSS [36] (see Sec. IVA) or POISSON SUPERFISH [37]. The obtained on-axis field map of the longitudinal electric fieldẼ z ðsÞ, which is an input required for beam dynamics simulations with ASTRA [38], is then used as a reference. In the optimization procedure, taking place within a MATLAB interface, the different cell lengths can be defined to be free parameters, in which case the reference field map is stretched according to the new value at every iteration. Once the chosen optimization algorithm (usually LN_NELDERMEAD or GN_DIRECT_L from the NL-OPT library [39]) has converged, a final check is performed by recomputing the rf fields in HFSS with the gun geometry corresponding to the new optimal cell lengths. The beam dynamics simulation is then performed with these final, unstretched field maps revealing the real performance of the optimized solution. The same option was implemented for the length of the solenoid, for which the reference and final electromagnetic simulations are performed with POISSON SUPERFISH [37].
The described procedure is a way of integrating the rf (and/or magnet) design into the optimization loop of beam dynamics. It is worth emphasizing here that starting from a reference electromagnetic simulation of a practicable design is of crucial importance in order to obtain feasible, optimized solutions. The rf design can in fact be as challenging as the optimization of the beam dynamics in the photoinjector.

Field map stretching
The gun field maps are stretched within the MATLAB interface by scaling the s axis of the cell in the range ½0; l c by a factor F s ¼ 1 þ Δl c =l c , where l c is the length of the reference cell, F s l c is the length of the new cell and Δl c their difference. A half period of a cosine function is used to weight the scaling within this range such that the deformation of the field map at both ends of the cell (s ¼ 0 and s ¼ l c ) tends to zero. The stretching from the referencẽ E z ðsÞ to the newẼ z ðs str Þ complex field map is computed according to In this way, the first derivative dẼ z ðs str Þ=ds str , representing the dominant term of the field expansion performed by ASTRA, remains unaffected at the edges and its continuity is ensured also at the related joining points. Typically, the stretching factor of input and output coupling cells is limited to about F s ¼ 1 AE 0.25. As for the regular cells, the maximum required stretching is determined by the requirement of scanning all possible phases at the entrance of the last cell. This can also be expressed by the relation where N c is the total number of cells and Δφ c their phase advance. The resulting maximum stretching with e.g. N c ¼ 10 and Δφ c ¼ 120 deg is then Figure 3 shows an example of stretching of the input coupling cell of the traveling-wave gun design presented in Sec. IV. From the l c ¼ 8 mm of a field map computed with HFSS (solid red) the cell is stretched to a final length of F s l c ¼ 9 mm (dash-dotted blue). The corresponding field map computed in HFSS (solid blue) is obtained by only setting the new axis length and adapting the cell radius in order to obtain the desired resonance frequency. The other geometrical parameters like e.g. iris aperture, iris thickness, rounding radii, etc. are all kept constant. Comparing the blue lines shows that the main difference is found in the field amplitude, revealing a decreased rf coupling between input coupling cell and first regular cell which is due to the slightly different geometry between the two cases. This element has not been modeled yet in the simple stretching procedure. Along the whole gun it corresponds to an overall offset of the accelerating gradient of about 7 MV=m while, inside every individual cell, it manifests itself as a 7 MV=m peak-to-peak oscillation of the relative difference (green, right scale). As for the complex phase of the electric field argðẼ z Þ, the difference between stretched case and HFSS simulation remains below 2 deg along the whole gun. This is a tolerable error for a first scan of the parameter space. Regarding the rf phase advance in the input coupling cell, the adopted procedure turns out to be very accurate. Considering the example of Fig. 3 (bottom, right scale), the error in phase advance at the first iris between the stretched field map and the field map recomputed in HFSS amounts to only 0.3 deg.

III. HIGHER BRIGHTNESS FOR THE SwissFEL INJECTOR
In this section, new configurations with the potential of further improving the performance of the SwissFEL injector are explored by applying the scheme discussed in Sec. II. Since the method is applied to a preexisting facility, the idea is that of only upgrading the rf gun (and relative solenoid), whose baseline is represented by the standingwave S-band SwissFEL Gun 1 built at PSI [40,41]. This gun has already demonstrated excellent results in the SwissFEL Injector Test Facility [42] providing measured normalized slice emittances in the order of 0.2 μm at 200 pC [43], very similar to those obtained with the previously employed CTF2 Gun 5 built at CERN [6].

A. Injector beam dynamics
Preliminary studies on standing-wave [12] as well as on traveling-wave [44] C-band guns for the SwissFEL injector have already demonstrated that there is margin for sensible improvements. In both cases, doubling the frequency from S-band to C-band allowed one to generate shorter bunches without spoiling the transverse emittance and the mismatch parameter in comparison to the SwissFEL baseline design. For the case of the traveling-wave gun with a phase advance per cell of 60 deg, the mean slice emittance was even lower than for the standing-wave options. An additional advantage of an injector with an rf gun operating at 5.712 GHz ¼ 40f b (American C-band) and the booster structures operating at 2.9988 GHz ¼ 21f b (a slightly modified European S-band) is the potential reduction of the dark current transported after the gun due to the fact that the two frequencies are perfectly synchronized only every 21 periods of the common base frequency Among the several proposed configurations summarized in Table I, the one providing the highest brightnessB n;inj ¼ 2940 TA=m 2 at a maximum accelerating gradient of 135 MV=m foresees a traveling-wave C-band gun with 60 deg phase advance per cell and a laser pulse length of 4.5 ps. This solution is taken as an illustrative example in Fig. 4, where the ASTRA simulation setup is sketched together with the resulting common projected parameters along the photoinjector. The gun has an electrical length of about 0.2 m with a maximum on-axis gradient of 135 MV=m. This is still considered to be a conservative value, as supported by recent experimental results in S-band [45], C-band [46] and X-band [25,47,48] and considering the very short filling time of the cavity below 100 ns (see Table II). The longitudinal electric field of this traveling-wave cavity is input into ASTRA based on the decomposition of a traveling wave into two standing waves, following the instructions of the manual. Basically, the real and imaginary part of the complex electric field computed by HFSS are superimposed with a relative phase offset of 90 deg. This is not necessary for the two following identical booster structures which can be input according to the more standard and simple method available for periodic traveling-wave structures. For the gun solenoid and the four identical solenoids surrounding each booster structure, the on-axis longitudinal magnetic field must be provided. Transverse fields are then computed based on the first order expansion of the input field map. The tracking is performed assuming 2D rotational symmetry and taking into account space-charge interactions with 10000 macroparticles, resulting in a run time for a single simulation of approximately 4 min on eight cores.
The output kinetic energy of 12 MeV almost doubles that of the baseline S-band SwissFEL Gun 1 and is the result of a compromise. On one hand, a higher energy is desirable to compensate the higher electron density due to the shorter bunches which tends to increase the frequency of the plasma oscillation. A too high plasma frequency would shift the matching point of the first booster structure [15] too close to the cathode, not providing enough space for the desired diagnostic at the exit of the gun. Furthermore, a higher energy also corresponds to a more rigid beam in the drift section between gun and first booster structure which reduces the undesired emittance contribution from nonlinear space-charge effects before the beam energy is further boosted. On the other hand, an even higher output energy would push the required peak magnetic field of the focusing solenoid towards higher values (in the order of 0.75-0.85 T for 15-20 MeV) with related technological problems, raising doubts about the feasibility of the simple design presented in Sec. IV D.
An important point to underline is the tendency of the optimization algorithm to decrease the accelerating gradient in the first booster structure since this improves the matching. For all traveling-wave cases of Table I, the gradient is always about 40% of that predicted by the theory, given by E bs1 ≈ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi I inj =2I 0 γσ 2 x q (I 0 ≈ 17 kA being the Alfvén current). This is understood by considering the magnetic focusing of the solenoids around the booster structures which provide an additional contribution to the rf focusing, whose gradient is therefore reduced to fulfill the matching conditions [15]. The phase of the booster structures always corresponds to the on-crest situation, so that the maximum available accelerating gradient is used in order to reach an energy in the range of 120-160 MeV after the second booster structure. This is necessary to be within the tunable energy range of the SwissFEL laser heater [49]. Figure 5 shows the slice parameters of the electron bunch evaluated after two booster structures at s ¼ 12.6 m (i.e. at the end point of Fig. 4) where the energy E kin ¼ 139 MeV is large enough to have a reliable evaluation of the penalty function f p defined in Eq. (4).

B. Layouts compared
The optimization procedure described in Sec. II D was employed starting from two reference rf designs of traveling-wave guns with 60 and 120 deg phase advance per cell. The first choice was initially motivated by previous studies showing that the smaller the phase advance per cell, the smaller the rf-induced emittance in the gun (neglecting space-charge effects) [19]. The value of 60 deg was considered to be the lower limit in C-band, since a cell length considerably shorter than 8 mm would raise huge technological challenges. The second, more standard phase advance per cell of 120 deg was studied in view of experimental indications that traveling-wave structures with a short phase advance of 60 deg might suffer of a reduced performance in terms of breakdown [50].
For both cases, the optimization process revealed different interesting solutions. These are collected in Table I, where the layout parameters and simulated beam quality after two S-band booster structures (E kin ∼ 140 MeV) of the SwissFEL injector are compared. As reference for the comparison, the first two columns of Table I report two setups foreseeing an rf standing-wave gun. The baseline setup of SwissFEL is taken as the absolute reference (penalty function f p ¼ −1) for improvements, while the setup with the C-band gun presented in Ref. [12] is indicated to compare standing-wave versus traveling-wave at the same rf frequency.

Nominal designs
For the traveling-wave gun setups, optimizations were performed with different laser pulse lengths and nominal maximum gradient of 135 MV=m. The normalized (to the laser spot size) intrinsic emittance set in the simulations was 0.550 μm=mm, according to the most recent experimental results at the SwissFEL injector test facility on copper and cesium-telluride cathodes [43,51]. The solution with 60 deg phase advance per cell and laser pulse of 4.5 ps results in a very low mean slice emittance of 0.128 μm and a high peak current of 47.9 A corresponding to a brightness increase of a factor 3 compared to the reference design. The price to pay for the very small slice emittance is a slightly higher mean mismatch parameter of 1.13, which is nevertheless well within the tolerable range. An almost ideal mean mismatch parameter of 1.07 is provided for example by the solution with a shorter laser pulse of 3 ps, at the expenses of a larger mean slice emittance of 0.168 μm.
Somehow between these two cases one finds the solution with the gun with 120 deg phase advance per cell and a 4.5 ps laser pulse length, resulting in a mean slice emittance of 0.149 μm and a good mean mismatch parameter of 1.09. The peak current of 40.8 A is smaller than that provided by the previous examples. This is in line with the observation that the ideal injection phase for the gun with 60 deg phase advance per cell, characterized by a shorter first cell, usually provides some ballistic bunching in the drift space after the gun, as it can be observed in Fig. 4 (middle plot).
Therefore, in view of the comparable performance provided by the two designs and the indications of eventually enhanced discharge problems with a shorter phase advance per cell, the gun with 120 deg phase advance per cell would represent the more conservative choice for a first prototype.

Margin for further improvements
In order to assess if the traveling-wave gun has further margins of improvement, additional simulations were performed with more progressive values of some parameters for the case of 120 deg phase advance per cell.
First, a very optimistic maximum gradient of 200 MV=m at the cathode was assumed. This had a very important impact on the achievable brightness which increased by a factor of 2.1, due to both a reduction of the mean slice emittance by 19% and an increase of the peak current by 38%. Note that the field map for this simulation was reoptimized (modified number of cells and cell lengths) to get the best performance and to contain the required magnetic peak field to reasonable values. The result is a traveling-wave gun with only six regular cells and a 1.2 mm shorter first cell in comparison to the case with the nominal gradient of 135 MV=m.
A 50% initial reduction of the intrinsic emittance (0.225 μm=mm) only shows a benefit of 15% on the mean slice emittance after two booster structures. At such low values, the intrinsic emittance does not represent the main contribution to the mean slice emittance after two booster structures anymore, as it is still the case with the measured value of 0.550 μm=mm. As expected, no effect on the peak current is observed.

IV. TRAVELING-WAVE ELECTRON GUN DESIGN
Based on the results presented here above, the rf design of the C-band traveling-wave gun is based on a rotationally symmetric central body, connected through an input and output coupling cell to a coaxial section. It is the waveguide-to-coaxial transition, far from the beam axis, which introduces the first asymmetry with a dual feed at both ends. Due to the rotational symmetry of the coaxial coupling which does not introduce quadrupole components, no racetrack geometry of the coupling cell is required. Based on this topology, two designs with a phase advance per cell of 60 and 120 deg are proposed and their rf parameters are summarized in Table II. Only the dimensions of input, regular and output cells differ, while those of the waveguide-to-coaxial transitions are exactly the same in the two cases. In order to provide a comparable output energy in the order of 10 MeV at the nominal on-axis maximum gradient of 135 MV=m, the design with 60 deg phase advance per cell counts 21 identical regular cells, while that with 120 deg phase advance has only ten. This can be seen in Fig. 6 where the magnitude of the complex electric field jẼ z ðx; sÞj in the cavity is displayed for both designs (top), with particular interest on the on-axis field jẼ z ðsÞj (middle). One can observe the decay of the magnitude of the fields along the axis which characterizes all rf accelerating structures with a constant impedance design.
The amplitude variation within a single cell is less pronounced in the case of 60 deg phase advance per cell (1.13 peak-to-valley, against 2.51 for 120 deg), meaning that the electron bunch experiences a more homogeneous acceleration along the gun. Previous works based on an analytical, idealized description not including space-charge effects indicate that the dynamics inside a traveling-wave gun might differ significantly from that of a common standing-wave gun [19,20]. The actual effects of the more homogeneous acceleration e.g. on the transverse emittance for a concrete design are studied in this work by means of numerical simulations. An example of the typical accelerating field E z ðsÞ experienced by the bunch centroid along the gun is presented in Fig. 6 (bottom). For both traveling-wave cases, the extraction gradient is around 100 MV=m, while the maximum gradient around 120 MV=m is experienced in the middle of the first cell. The nominal maximum gradient of 135 MV=m is therefore never seen by the particles, differently than in standingwave guns where the field balance between all cells in the gun allows to almost reach it in the middle of every full cell. Also in the standing-wave case the extraction gradient of the electrons at the cathode is as low as 77 MV=m and only 127 MV=m are reached in the middle of the first half cell. These values indicate that, to reach a high brightness, the suitable range of the rf phase at extraction is limited and does not necessarily coincide with the range where the electron bunch would experience the maximum available electric field.
In the following two sections, the characteristics of the rf design are explained in more detail for the beam section, the region interesting the beam dynamics displayed in Fig. 6, and for the transitions from rectangular waveguide to coaxial section, where the rf is coupled in from the external source and out to the load.

A. Beam section
The importance of the length of input, regular and output cells for the beam dynamics performance has already been emphasized in the previous sections, as well as the procedure adopted to determine the optimal values. There are however several additional parameters related to the cell geometry which can still be used to optimize the rf design. This is done by means of HFSS simulations where, thanks to the rotational symmetry, a longitudinal sector of 2 deg aperture with applied perfect magnetic boundary conditions is enough to compute the on-axis field map (compare Fig. 6). The small volume is meshed with curvilinear elements with a maximum aspect ratio of 3, which approximate the surface geometry with an accuracy below 1 μm. Second order basis functions are used for the computation of the fields.

Regular cell
The definition of the regular cell represents the starting point for the rf design and it is simulated with the eigenmode solver of HFSS by setting periodic boundary conditions on the 2 deg longitudinal sector. The velocity β ∼ 0.9 of the electrons at the exit of the input coupling cell is almost fully relativistic, as it can be seen in Fig. 7. For this reason, it was chosen to adopt identical regular cells for the central part of the gun.
On one hand, the maximum surface electric field (found in the lower part of the iris) should be small enough compared to the maximum on-axis field. Their ratio amounts to 1.44 and 1.26 for the 60 and 120 deg phase advance design, respectively. With these values, when the regular cells are combined with the input coupling cell, the maximum surface electric field in the gun is that at the cathode and the limiting surface electric field corresponds to the maximum on-axis gradient. On the other hand, a sufficiently large group velocity near to 0.01c, providing a cavity filling time in the order of 100 ns or below, is desired to potentially increase the achievable maximum gradient. The first goal can be achieved by either an increased iris thickness or a reduced iris aperture, both of which however reduce the group velocity. The chosen values, a consequence of a compromise to fulfill both requirements, are reported in Table II. To help reduce the maximum surface electric field, an elliptical shape of the iris is adopted.
An interesting outcome of the beam dynamics optimization is the regular cell length corresponding to β ¼ 0.9531 for the case with 60 deg phase advance per cell. The effect of the corresponding 2.8 deg phase slippage per cell can be observed in Fig. 6, where the decrease of the experienced electric field along the gun (bottom) is clearly more pronounced than the damping of the electric field due to rf losses (middle). In the case of 120 deg phase advance per cell this element is not present since the cell length corresponds to β ¼ 1.

Input and output coupling cells
Once the regular cell, i.e. the impedance of the central part of the gun, is defined, the impedance matching with the coaxial section must be reached at both ends (input and output). The most important free parameters available for the impedance matching are the radius of the coupling cells, the height of the coupling irises, the cathode penetration (at the input) and the coaxial inner conductor (at the output) penetration into the coupling cells.
An additional iris was introduced in the central part of the input coaxial section, forming a sort of virtual cell, in order to avoid a too small gap of only few hundreds of microns between the regular coupling iris and the cathode edge. With this solution, the gap could be increased to 2 mm in the current design.
Regarding the fields in the cathode region, it must be mentioned that both presented designs show an off-axis field enhancement [44] of about 10%. This is the minimal value which could be reached with the present topology by optimizing the coupling cell length and cathode penetration, always keeping the optimal distance between cathode surface and first iris, which determines the input coupling cell length. To further reduce the field enhancement, the radius of curvature of the cathode edge was maximized. The latter is mainly limited by the inner radius of the coaxial section, which cannot be enlarged indefinitely with respect to the outer radius to still allow a suitable design of the waveguide-to-coaxial transition. The outer radius of the coaxial section, in fact, should not be larger than the cell radius, so that the minimum inner radius of the focusing solenoid surrounding the gun (see Sec. IV D) is not further limited. In the present design, the cathode surface is perfectly flat within a radius of 1 mm (5 times larger than the laser transverse sigma, see Table I) from the beam axis. Trials with a curved cathode surface extending until the beam axis showed that it would be possible to have the maximum electric field on-axis. However, the effect of the resulting defocusing electric field on the beam dynamics should be investigated in detail.
Regarding the fields in the output coupling region, no particular issues have been encountered during the impedance matching process.

B. Waveguide-to-coaxial transitions
Starting from the idea of an rf coupling from the cathode side, already presented in Ref. [12] for a C-band standingwave gun, a novel design was developed to allow the FIG. 7. Relativistic β factor of the electron bunch (solid) along the initial part of the C-band guns. The first three iris positions of the TW guns are indicated, as well as the first two of the SW gun (dashed). transition from the rectangular waveguide to the coaxial section. Both input and output transitions are visible in Fig. 8 for the design with 120 deg phase advance per cell. The magnitude of the complex electric jẼj and magnetic jHj field are displayed on the final geometry simulated with the driven modal solver of HFSS. At this point, a section of 90 deg with applied perfect magnetic boundary conditions must be simulated due to the broken symmetry from the dual feed at both input and output (note that only one waveguide at each side is visible in Fig. 8). The frequency bandwidth from the simulation of the full geometry of Fig. 8 is plotted in Fig. 9.
The main advantage provided by such a coaxial coupling is the availability of space between the input and output waveguides for a focusing solenoid (and bucking coil combined in a simple magnet design, see Sec. IV D). In addition, the gun geometry is fully rotationally symmetric around the beam axis, with the first asymmetry being introduced far from it by the dual feed. The corresponding quadrupole component propagating until the beam region was checked to be below the numerical noise of the simulation.
As it can be seen from Fig. 8, input and output transitions are based on the same principle: A filtering cell was inserted in the coaxial section behind the waveguide to have vanishing rf fields at the closing surfaces. The color scales indicate that almost neither electric (<50 kV=m) nor magnetic (<3 kA=m) field, i.e. no surface currents, are present at these locations, allowing the insertion of a short. A simple copper surface can therefore be used as a closing short of the coaxial tube without the need for an rf contact.
This considerably simplifies the mechanical design, in particular for the cathode region where an exchangeable cathode is desired. In order to again take advantage from locations with vanishing fields, a choke was inserted in the output coaxial section. At one of its ends a flange without rf contacts can be easily designed in order to separate the main body of the gun from the output transition. This is necessary for the mounting of the solenoid which, at some moment, must be slid around the gun to fit between the two waveguides.
The aperture with a radius of 6 mm at the exit of the gun around s ¼ 400 mm provides enough space for the coupling into the cavity of the UV laser with a standard angle in the order of 0.5 deg. The 12 mm × 12 mm optical mirror can be placed for example at a distance of 2 m so that the separation between its edge and the beam axis is 15 mm.
Finally, an interesting option which should also be considered, is the insertion in the output coaxial section of an absorbing material which would act as an integrated load and removes the need of the transition and of the choke.

C. Feeding schemes for very short filling time
A closer look to the required input power for the nominal gradient of 135 MV=m (see Table II) reveals that the structure with 120 deg phase advance per cell can be directly fed with a standard klystron amplifier as that employed in the main linac of SwissFEL, which can provide a maximum of 40 MW at the gun input (50 MW at the klystron output minus 20% losses in the waveguide system). In this case, the average dissipated power in the gun at the SwissFEL nominal repetition rate of 100 Hz amounts to only 100 W, around 1 order of magnitude below the typical value of S-band standingwave guns [40]. This simple solution is at the limit of the amplifier capabilities and the feeding schemes proposed below, necessary for the gun with 60 deg phase advance per cell, have also the potential to bring benefits for this 120 deg case in terms of rf source lifetime.
In the 60 deg case, a direct connection of the gun to the klystron is not possible, since the required input power to reach the nominal gradient of 135 MV=m is 57.9 MW. In order to reach the mentioned nominal power, it is possible to take advantage from the very short cavity filling time of 73 ns in comparison to the maximal klystron pulse length of 3 μs. Based on this fact, two different feeding schemes are proposed below by assuming a maximum klystron output power of 40 MW (20% lower than the nominal maximum power to improve the lifetime of the device) and 20% waveguide losses which reduce to 32 MW the available power at the gun input. Figure 9 displays the relatively narrow bandwidth of the two gun designs, which nevertheless does not constitute an issue in terms of reflected power. By means of a frequency domain analysis, it was checked that the peak reflected power to the klystron remains below 0.2 MW and that the reflected to incident energy ratio is in the order of 10 −3 . Therefore, as it is the case for common traveling-wave cavities, also the traveling-wave gun can be operated without a high power circulator protecting the klystron amplifier.

Pulse compression with BOC
For the standard C-band module of the SwissFEL main linac, the necessary peak power is reached by a compression of the rf pulse with a barrel open cavity (BOC) [52]. As the following computations based on Ref. [53] demonstrate, it would be straightforward to use the same device also for the proposed traveling-wave gun. Figure 10 (top) shows the input pulse which can be provided at the gun input (solid lines) starting from a 3 μs long 14.1 MW pulse from the klystron. Since 20% losses between klystron output and gun input have already been accounted for, the net gain factor in terms of maximal power in the BOC is 5.1. This could be even higher without the phase modulation of the klystron output voltage (dashed lines) which was introduced to limit within 4 deg the peak-topeak phase variation at the gun input during the high power interval, which can be better visualized in the inset. The average dissipated power in the gun is computed by integrating over time the whole pulse coming from the BOC (solid blue line in Fig. 10) and amounts to 1.1 kW, again for the nominal 135 MV=m at the cathode and 100 Hz repetition rate.
The same pulse profile can be employed with the 120 deg phase advance gun, in which case 9.2 MW at the klystron output are enough to reach the nominal 37.4 MW at the gun input with a resulting dissipated power of 490 W.

Recirculation with hybrid
A second feeding possibility, which is not compatible with the idea of an integrated load at the output coaxial section of the gun, is based on the use of a four-port hybrid with 180 deg phase shift as described in Ref. [54]. The klystron is connected to one of the input ports, the gun and a load are connected at the output ports and a waveguide connects the output of the gun to the remaining input port. In this way, part of the power which has not been dissipated in the gun is recirculated into the gun itself, summing up with the constant input power from the klystron. The result is a stepwise increase of the gun input power, where the step length corresponds to the filling time of the cavity (assuming a negligible time for the wave to recirculate from the output to the input). This is shown in Fig. 10 (bottom) which plots the gun input power (solid blue) as a function of time for a power of 39.9 MW at the klystron output (dashed blue). Three recirculation steps are enough in order to reach the nominal power of 57.9 MW (gray dashed), bringing the required pulse length to 292 ns (4 times the cavity filling time). The average dissipated power was minimized down to 540 W, for the nominal operation conditions, by selecting the optimal bridge ratio n hyb ¼ 1.71 between the four ports of the hybrid device. In gray, the situation with a longer pulse length of 1.095 μs (15 filling times) is also shown. In the hypothetical case of an infinite pulse, a power of 78.3 MW corresponding to a cathode gradient of 157 MV=m could be reached, while more than 98% of this level can be reached after ten filling times.
Applying the same recirculation scheme to the 120 deg phase advance gun provides an optimal bridge ratio n hyb ¼ 1.28 which requires only one recirculation step with a klystron output power of 39.9 MW to reach the nominal accelerating gradient. In this case, the average dissipated power is as low as 200 W, i.e. double that in the case of a direct connection to the klystron.

D. Simplified solenoid with integrated bucking coil
The previously described rf coupling topology provides the necessary space to place the focusing solenoid very close to the cathode also in the case of a traveling-wave gun with input and output waveguides. This is very important in the presented setups where a transverse focusing already in the first cells is required to confine the electron bunch within the iris apertures. Trials with a common solenoid placed such that its peak field was at s ¼ 300 mm (like in the SwissFEL Gun 1 setup), showed that it is difficult to extract a usable beam from the gun. A second strong motivation for a solenoidal field raising right from the cathode comes from previous studies [8,35] which showed an important benefit to achieve a better emittance compensation. A bucking coil, driven with opposed current polarity, must be introduced in order to get a vanishing solenoidal field at the cathode (s ¼ 0), which would otherwise introduce an undesired emittance contribution after exiting the solenoid due to the initially magnetized beam [13]. Figure 11 shows the on-axis field B z and the corresponding position of a solenoid combining bucking and main coil into a single device. The 2D (rotationally symmetric) simulation was performed with POISSON SUPERFISH. The cavity volume is also displayed, around which some margins for the copper must be accounted for, demonstrating that the two devices fit well together.
The required peak magnetic field in the setups with the nominal gun gradient of 135 MV=m is about 0.5 T (see Table I) and corresponds to an initial slope of 3.6 T=m for the field map used in ASTRA simulations (solid line). The proposed solenoid design can provide a peak on-axis magnetic field up to 0.6 T, assuming a maximum current density of 5 A=mm 2 in both coils. The maximum magnetic field in the iron yoke was always checked to be below 2 T to avoid saturation.
An additional degree of freedom for the beam dynamics optimization is provided by the slope dB z =ds at the cathode, which can be varied in the range 0-6.3 T=m (dashed line), at a peak magnetic field of 0.5 T, by changing the current ratio between bucking and main coil. Note that this requires an adjustment of the longitudinal position of the solenoid in order to keep a vanishing field at s ¼ 0.
Changing from the nominal to the maximum reachable slope needs a 12 mm negative shift of the magnet. Further analysis should be performed to determine the influence of the initial slope on the beam quality at the end of the injector.
FIG. 11. Top: Upper half of the longitudinal cut of the combined solenoid incorporating main and bucking coil (blue), which are driven with opposed current polarity, around the gun cavity volume. The magnetic field lines are displayed (magenta). Bottom: Corresponding on-axis field map of the longitudinal magnetic field B z with the nominal (solid) and maximum (dashed) allowed bucking coil current. Figure 12 shows a picture of a very first mechanical concept of the traveling-wave gun with 120 deg phase advance per cell and relative solenoid. The concept is identical for the case with 60 deg phase advance per cell, where only the cell number and dimensions change. Different colors are used to distinguish between the three main mechanical pieces composing the gun. The cathode part (green) is compatible with the load-lock concept [55] since the rf design foresees an exchangeable cathode without the need of any rf contact. Again without the need of any rf contact, the inner coaxial conductor at the gun output (yellow) can be inserted after having slid the solenoid around the main body of the gun (blue).

V. CONCLUSION
Radio-frequency traveling-wave photocathode guns have the potential to provide more rigid electron beams with higher brightness. Therefore, the design of such a traveling-wave gun operating at C-band was developed and first optimized based on the beam dynamics performance. In particular, an optimization procedure was developed where the cell lengths are set as free parameters and the gun field map needed for the beam dynamics simulations can be stretched accordingly. After fixing the cell lengths, a complete rf and focusing solenoid design can be developed.
The whole procedure was applied for two different phase advances per cell: 60 and 120 deg. The brightness of the SwissFEL photoinjector could be improved in both cases at least by a factor 2 and up to a factor of 3, respecting all of the machine constraints. The higher brightness is mainly due by a (at least) doubled peak current, i.e. a shorter bunch, which relaxes the overall compression factor along the machine and also the gain curve of the microbunching instability.
With the aim of producing a prototype, the mechanical concept is currently being developed at PSI as demonstrated by Fig. 12. The next steps in the development of this device are represented by the systematic study of rf tolerances, thermomechanical effects and beam stability. These might contribute to determine which one is the best design option for the production of a first prototype.