Higher-order mode-based cavity misalignment measurements at the free-electron laser FLASH

At the Free-Electron Laser in Hamburg (FLASH) and the European X-Ray Free-Electron Laser, superconducting TeV-energy superconducting linear accelerator (TESLA)-type cavities are used for the acceleration of electron bunches, generating intense free-electron laser (FEL) beams. A long rf pulse structure allows one to accelerate long bunch trains, which considerably increases the efficiency of the machine. However, intrabunch-train variations of rf parameters and misalignments of rf structures induce significant trajectory variations that may decrease the FEL performance. The accelerating cavities are housed inside cryomodules, which restricts the ability for direct alignment measurements. In order to determine the transverse cavity position, we use a method based on beam-excited dipole modes in the cavities. We have developed an efficient measurement and signal processing routine and present its application to multiple accelerating modules at FLASH. The measured rms cavity offset agrees with the specification of the TESLA modules. For the first time, the tilt of a TESLA cavity inside a cryomodule is measured. The preliminary result agrees well with the ratio between the offset and angle dependence of the dipole mode which we calculated with eigenmode simulations.


I. INTRODUCTION
The Free-Electron Laser in Hamburg (FLASH) [1,2] and European X-Ray Free-Electron Laser (European XFEL) [3][4][5] are single pass free-electron lasers (FELs), generating high-brilliance radiation by self-amplified spontaneous emission [6]. Acceleration of the driving electron bunches is achieved by using superconducting TeV-energy superconducting linear accelerator (TESLA) [7] -type cavities. The high duty cycle and, thus, long radio frequency (rf) pulse structure allows one to provide long bunch trains adapted to the needs of the experiments, which significantly increases the efficiency of the machine. High longitudinal and transverse stability of the beam along the bunch train is essential for multibunch FEL operation. However, intrabunch-train variations of rf parameters as well as structure misalignments induce intrabunch-train trajectory variations which affect the multibunch FEL performance considerably [8]. The accelerating cavities are housed inside 12-m-long cryomodules [9], which restricts the ability for direct alignment measurements. Precise knowledge of the cavity misalignment, however, would allow for optimizing the low-level rf in order to compensate the impact on the intrabunch-train trajectory variation.
In order to determine the transverse cavity position, we chose a method based on beam-excited dipole modes in the cavities. These modes have a linear dependence on the transverse beam offset and angle with respect to the cavity axis. When the beam trajectory is varied systematically, the relative strength of the excited modes can be compared quantitatively, and the determination of the cavity axis becomes a linear regression problem. The proof of principle measurements can be found in Ref. [10]. Because of the low beam energy, and thus beam sensitivity to off-axis fields, the injector module (ACC1) has the largest impact on the intrabunch-train trajectory variation, and therefore knowledge on its cavity alignment is the first priority. Dedicated studies to derive accelerating structure misalignments from multibunch rf and beam position measurements [11] at the injector module have not been conclusive.
We have developed a measurement and signal processing routine which is able to reliably evaluate a large amount of data. Its application to multiple accelerating modules at FLASH will be presented. We will start this paper with a brief summary of the principles of dipole modes needed for the measurements. A description of the signal measurement and processing procedure follows. Because of the large size of the accelerating cavities, ambiguities arise in terms of the beam position when the beam travels obliquely with respect to the cavity axis. For the first time, we quantified this effect experimentally. We compare our results with simulations based on eigenmode calculations of a TESLA cavity. Finally, the results of cavity misalignment measurements at five accelerating modules at FLASH are presented. The measurement at the injector module was the most challenging part of the experiment.

II. MEASUREMENT PRINCIPLES
When a bunch of electrons traverse a cavity, wakefields covering a wide range in frequency domains are excited. These fields can be classified into different modes according to the field distribution [12]. The modes with higher frequencies than the fundamental mode used for acceleration are referred to as higher-order modes (HOMs). These modes can damage the beam quality, and therefore they are damped. For this reason, each TESLA cavity is equipped with two HOM couplers [13]. It has been shown experimentally [10] that a beam-excited dipole mode, extracted by HOM couplers, can be used to study the misalignment of the cavities in an installed cryomodule. In this paper, we restrict the description to the basics of dipole modes and the properties needed for the HOM-based cavity misalignment measurement and its data analysis.
In cylindrically symmetric cavities, HOMs can be characterized by their azimuthal dependence as monopole, dipole, quadrupole, etc., modes [12]. According to the nine-cell geometry of the TESLA cavity, nine modes form a band. In this paper, we focus on the sixth transverse electric dipole mode, TE 111 -6.
The main reason for using this mode is that the electronics installed at the first five cryomodules in FLASH filter this mode. This is one of the strongest dipole modes, quantified by an (R=Q) of 5.5 Ω=cm 2 [13]. One can argue that mode TE 111 -7 may give better accuracy due to its higher (R=Q) of 7.7 Ω=cm 2 . However, there are other factors that contribute to the final result, e.g., the amount of the mode energy that is extracted through the HOM coupler. Also, looking at the longitudinal electrical field distribution, the middle cell seems to contribute more to the sixth than to the seventh mode, but this remains to be shown.
Dipole modes can be excited by a traversing beam in three different scenarios, which are illustrated in Fig. 1: The trajectory may have an offset x with respect to the cavity axis (top) and a tilt angle α (center). Additionally, the bunch itself might be tilted by an angle Θ (bottom). It has been shown [14] that the corresponding amplitude of the beam-excited dipole mode is proportional to the bunch charge Q and V α ðtÞ ∝ −α · e −ðt=2τÞ cosðωtÞ; ð2Þ with the frequency ω and decay time τ of the considered dipole mode. The signal excited by the tilt of the bunch, V Θ ðtÞ, is furthermore proportional to the square of the bunch length. At FLASH and European XFEL, the bunch lengths are on the order of 100 fs. V Θ ðtÞ is therefore vanishing small and can be neglected [10]. It is worth noting that, due to field disturbances caused by structure imperfections and couplers, the geometrical axis of the cavity can deviate slightly from the electrical axis of the considered dipole mode. This effect is hardly quantifiable, and eventually beam offsets from the electrical axis of the strongest HOMs affect the beam much more than from the axis defined by the geometry. The following analysis will therefore not distinguish between these two axes and refer to them as "cavity axis".
Dipole modes occur in orthogonally polarized doublets, following from the two transverse degrees of freedom in an axially symmetric cavity. Note that their polarization axes may not be coincident with the horizontal and vertical planes of the cavity. Furthermore, due to asymmetries and imperfections of the cavity, their frequencies are usually split, and the angle between their polarization axes can deviate from 90°. The TESLA cavities at FLASH are equipped with a HOM coupler at both ends which span an angle of about 115°. An illustration can be found in Figs. 2 and 3. Hence, depending on the particular imperfections of one cavity, the two couplers are expected to have a dissimilar sensitivity to the dipole doublet.

III. EIGENMODE SIMULATIONS
The scaling factor between the dipole mode amplitude excited by the bunch trajectory offset and the amplitude from the trajectory tilt angle depends on the mode phase change per cell and the geometry of the cavity. Previous estimations for a single cell imply that the amount of amplitude induced by an offset of 100 μm is equivalent to an amplitude excited by a tilt angle of 1 mrad [15]. In order to determine the proper ratio for the TESLA cavity, eigenmode calculations are performed [16].
The electric and magnetic field in a cavity, E and H, respectively, can be expanded in terms of orthogonal eigenfunctions e ðmÞ and h ðmÞ : with the time-dependent eigenmode amplitudes q ðmÞ and p ðmÞ of mode m. The eigenfunctions e ðmÞ and h ðmÞ are the eigenmode field distribution normalized by the energy stored in the mode. By inserting Eqs. (4) and (5) into the Maxwell equations in a vacuum, the second-order differential equation for the amplitude of the electric field can be obtained as by using the relation ∇ × h ðmÞ ¼ ω m =ce ðmÞ . Here J is the current source, ω m is the angular frequency of mode m, c is the speed of light, ϵ 0 is the permittivity of free space, and the integration is performed over the cavity volume. Note that so far there is no restriction on the trajectory and the distribution of the current source J. Assuming a pointlike charge Q to move on a trajectory xðtÞ, Eq. (6) can be rewritten as withxðtÞ being the unit vector in the direction of the trajectory. The field distribution e ðTE 111 -6Þ is obtained via CST® [17], and Eq. (7) is solved numerically for different beam trajectories xðtÞ. In the first scenario, an ultrarelativistic (j _ xj ¼ c) paraxial passing beam with different offsets x is considered. In the second case, the beam traverses the cavity with different tilt angles x 0 through the longitudinal center of the cavity, as illustrated in Fig. 1. The maximum value of the amplitude q ðTE 111 -6Þ ðtÞ is calculated for different beam trajectories. Results are shown in Fig. 4 for different trajectory offsets (left) and angles (right). A linear fit reveals that an amplitude excited by a tilt angle of x 0 0 ¼ 1 mrad corresponds to an amplitude excited by a trajectory offset of x 0 0 ¼ 214 μm. The discrepancy with the estimations made in Ref. [15] is reasonable, since the considered geometry differs. Measuring this ratio is one of the purposes of this paper. Figure 5 shows a schematic drawing of the experimental setup used for the HOM-based cavity misalignment measurements. The trajectory of the beam is varied with two pairs of steerers. The beam transverse position is measured by two beam position monitors (BPMs), upstream and downstream of the considered module, respectively. For each trajectory, the dipole mode signal is measured. The basic principle of the involved electronics [18] is shown in the lower part of In the left graph, paraxial trajectories with different offsets x are evaluated; the right graph shows the amplitude as calculated for different trajectory tilt angles x 0 through the longitudinal center of the cavity. modes vary for each cavity but are typically on the order of microseconds.

IV. EXPERIMENTAL SETUP
In order to relate the measured signal from a HOM coupler with the beam position in that cavity, the beam trajectory has to be known. For a high initial beam energy of several hundred MeV, the transfer matrices of the cavities can be estimated from the rf parameters, and the difference between the actual trajectory and that of a drift space is small. For the first module, however, the difference is significant, and its particular value depends strongly on the beam input parameters. Furthermore, the beam trajectory within one cavity differs significantly from a straight line. A precise knowledge of the beam position and angle in each cavity therefore requires the rf to be switched off. In addition, all quadrupole magnets between the BPMs are cycled to zero field to avoid kicks.
If a drift space can be modeled between the upstream and downstream BPMs, the beam position and angle at the center of each cavity can be interpolated from the BPM readings. The reference axis is defined by these two BPMs. It is worth noting that the downstream BPM is located inside the accelerating module. As a consequence, the measurable offset of the downstream cavities may be underestimated, as will be reviewed later in Sec. VI. The resolution of the involved BPMs is measured before each HOM measurement and is found between 5 and 60 μm.
As illustrated in Fig. 5, for each transverse plane two steerers are required in order to change the trajectory offset and angle at each cavity to cover a sufficient range for later analysis while obeying machine constraints. The phase space coverage of typical beam trajectories is shown exemplarily for the first cavity of the second accelerating module (ACC2) in Fig. 6. An example of a HOM spectrum from a spare TESLA cavity recorded with a network analyzer is shown in the left part in Fig. 7. Several bands are noticeable, e.g., between 1600 and 1800 MHz (TE 111 modes), between 1800 and 1900 MHz (TM 110 modes), and above 2400 MHz (TM 011 modes). The TE 111 -6 mode around 1680 MHz is highlighted and magnified in the right plot. One notices that the two polarizations from the same TE 111 -6 mode have different frequencies mainly due to the influence of the couplers. The discrepancy normally is of the order of 500 kHz.
The left-hand side of Fig. 8 shows an example of a digitized beam-excited raw signal from cavity eight at ACC1 in the time domain. Before the signal can be analyzed quantitatively, the following digital filtering is applied. The sinusoidal calibration signal of the electronics has to be removed. This can be done in the time domain by fitting a sinusoidal function to the signal prior to the time at which the beam has entered the cavity. The transient of the beam itself also induces a signal which is removed by cutting the signal at the corresponding position. Another distorting effect can be the saturation of the digitizer, which FIG. 5. Schematic drawing of the experimental setup used for the HOM-based cavity misalignment measurement. Eight cavities are located inside one accelerating module, followed by a BPM. The rf is switched off, assuring a drift space between the upstream and downstream BPMs. The beam position and angle at each cavity are calculated from the BPM readings. For each dimension, two steerers are needed in order to get any combination of beam offset and angle at a cavity. Each cavity is equipped with an upstream and a downstream HOM coupler. At each coupler, the signals are filtered, down-converted, and digitized.
FIG. 6. Beam position and angle as calculated for the first cavity of ACC2 at FLASH during a HOM-based cavity misalignment measurement. The x-y plane (left) and the x-x 0 plane (right) for 3300 trajectories are plotted. For each plane, two steerers are driven randomly within a defined range, giving, e.g., in the x-x 0 -plane a tilted rectangular shape. Its inhomogeneous filling is due to beam losses.
FIG. 7. Normalized beam-excited spectrum as recorded from a HOM coupler at ACC4 at FLASH. The left plot covers a wide frequency range including several monopole and dipole bands. The highlighted peak in the left plot and its magnification in the right one shows the TE 111 -6 dipole mode used for the diagnostic. Note its double-peak character, indicating a frequency deviation between the two parts of the orthogonally polarized doublet. occurs in case of a strong signal amplitude. In order to quantitatively compare dipole modes excited by different beam trajectories, one has to ensure that the saturated part of the signal is removed in all data samples consistently. The resulting processed signal is plotted in the right graph of Fig. 8. Finally, the signal has to be normalized with the bunch charge. Its measurement, however, is not possible at each cavity but only at the cavity-type BPM at the end of the module. Steering the beam in a wide range can cause partial beam losses which may occur between the cavities. Normalization to the measured charge can therefore overestimate the signal in the first cavities at certain beam positions. Care has therefore been taken so that beam losses were limited. For further analysis, it is convenient to normalize the signal for each coupler; in that way, the different trajectories of one set of data correspond to dipole mode amplitudes between zero and one.

V. ANGULAR DEPENDENCE OF DIPOLE MODES
As described in Sec. II, the field amplitude of the excited dipole mode can be described as a sum of contributions from the beam offset and angle. Restoring each part of the signal individually is hardly possible. If a sufficient number of data points is available, theoretically the linear correlation between each of the beam coordinates ½x; x 0 ; y; y 0 and the signal amplitude at each cavity can be resolved. However, as described in the following, this requires a high resolution of the involved devices and is experimentally difficult to achieve. Based on the simulations presented in Sec. III, the scaling factor between the dipole mode amplitude excited by the bunch trajectory offset and the amplitude from the trajectory tilt angle is 214 μm∶1 mrad. In order to verify this ratio experimentally for a TESLA cavity, a comprehensive measurement procedure was applied at the second cavity of ACC2.
Ideally, the 4D transverse phase space should be filled in order to achieve minimum excitation of the undesired fields from trajectory offsets. However, this requires the coordinated use of four steerers, which is experimentally challenging due to calibration uncertainties. It turned out that subsequent data filtering is more efficient. Therefore, the offset dependence of the two dipole modes is measured in both planes on a sufficient grid of beam trajectories. After postprocessing the raw signal as explained in the previous section, the two amplitudes of the dipole doublet are calculated using a Fourier transformation of the processed signal and a peak-finding algorithm. The polarization axes are found with a fitting routine as illustrated in Fig. 9. A coordinate system transformationx ¼ x cos ϕ þ y sin ϕ andỹ ¼ y cos ϕ − x sin ϕ with the polarization angle ϕ ensures that data evaluation is performed on the polarization axes and orthogonal to it, respectively.
The trajectory which minimized the dipole mode was identified through an online optimization routine [19] using upstream steerers and set as a reference trajectory for the further procedure. The ratio between the strength of the two steerers used for each plane in our measurement, as illustrated in Fig. 5, was fixed in order to allow the variation of the trajectory tilt angle without changing the offset in the second cavity of ACC2 substantially.
Multiple data sets taken in different measurement shifts are evaluated. Preliminary results for both polarizations are shown in Figs. 10 and 11, respectively. A total of 23 000 data points and, thus, beam trajectories are evaluated. Every tenth data point is plotted in each graph to reduce the file size. The upper left plot in Fig. 10 shows the amplitude of the second dipole mode (cf. right plot in Fig. 9) measured at the downstream coupler as a function of the transformed horizontal offsetx with a polarization angle of ϕ 2 ¼ 86. 5°. The upper right plot shows the same data as a function of transformed horizontal tiltx 0 . The lower two plots show the amplitude as a function of the transformed vertical coordinatesỹ andỹ 0 , respectively. As expected, the mode amplitude is clearly sensitive only to the transformed vertical plane ½ỹ;ỹ 0 . Note that each evaluated data point, and thus beam-excited dipole mode amplitude, is plotted in every graph, thus revealing a complete 4D scan.
It is reasonable to assume that the lowest amplitudes at eachỹ 0 correspond to a signal purely excited by the beam trajectory tilt with respect to the cavity axis. The overall minimum is reached atỹ 0 min ¼ 214 μrad with respect to the axis defined by the two BPMs. The linear increase of the lowest amplitudes withỹ 0 reveals the dipole mode dependence on the trajectory tilt angle and is found to be 3.2=mrad in arbitrary units. Based on the previously mentioned simulations, this corresponds to an offset dependence of 16=mm for the normalized amplitude.
In the lower left graph in Fig. 10, this slope is plotted. The dashed lines indicate a AE20% error. The same analysis was applied for the first dipole mode (cf. left plot in Fig. 9) as measured at the upstream HOM coupler. The result is shown in Fig. 11 in the transformed coordinate system with ϕ 1 ¼ −6.5°. The minimum amplitude is found atx 0 min ¼ −3 μrad.
No well-defined linear correlation between the dipole mode amplitude and the trajectory offset is observed. For example, the linear correlation should result in a welldefined minimum, which is not the case. Systematic errors at the involved BPMs are supposed to be the dominant source of error. Because of the large amount of required data, and thus beam time, the plotted data were measured during three individual shifts, while a precise BPM calibration was performed once. Numerical studies have shown that BPM calibration errors of AE10% can affect the calculated trajectory offset in this particular experimental setup by about AE20% while hardly changing the calculated trajectory tilt. Long-term drifts in the involved readout electronics cannot be excluded and could therefore induce a pseudocorrelation, for example, between x and x 0 . The offset dependence of the dipole mode amplitude of different data sets is slightly different. This supports the assumption that variable BPM calibration errors are affecting the measurement. Furthermore, cavity movement between the measurements cannot be excluded. Future studies may focus on this issue. However, we interpret these preliminary results as a clear indication that the simulated ratio between the offset and angle dependence of the dipole mode in a TESLA cavity of about 1 mm:5 mrad is appropriate.

VI. CAVITY MISALIGNMENT MEASUREMENT
Considering the large amount of required data, and thus beam time, it was not possible to apply the previously described measurement procedure to other cavities. Typical ranges for the trajectories during a HOM-based cavity misalignment measurement are u max ≈ AE10 mm and u 0 max ≈ AE1 mrad, where u stands for x and y. Based on the previous considerations, it is expected that the maximum signal amplitude related to trajectory offsets exceeds the maximum signal related to tilts by a factor of 50. We will show in the following that during ordinary cavity misalignment measurements the dipole mode excitation due to trajectory tilts can be neglected. Figure 12 illustrates an example of the normalized dipole mode amplitude versus beam offset. In the left plot, the amplitude is color coded, showing qualitatively the dependency. The right graph shows the amplitude of the highlighted points as a function of transformed vertical offsetỹ, including a linear fit. The corresponding polarization angle is found as ϕ ¼ 78.5°. In this example, the offset dependency of the normalized amplitude of the excited mode is about 15%/mm. The phase space coverage is y max ≈ AE12 mm and y 0 max ≈ AE1.2 mrad. This leads to a maximum amount of less than 2% of the signal amplitude excited by the trajectory angle. Figure 13 shows the residuals of the linear fit shown previously. On the left-hand side, the absolute difference between the normalized amplitude and the linear fit is plotted as a function of the transformed vertical trajectory offsetỹ. The right plot shows the same residuals as a function of the transformed vertical trajectory angleỹ 0 , indicating that there is no distinct systematic identifiable in either graph.
It is nontrivial to obtain the angular dependence from this data set. Based on the previous discussion in Sec. V, it is expected that the angular dipole mode is weakly excited in comparison to the excitation due to trajectory offsets. Thus, during usual cavity misalignment measurements it was not possible to resolve the angular dependency of the dipole mode. As a result, the cavity tilt cannot be determined. In the following discussion, the beam trajectory angle is neglected and serves as a source of uncertainty for the cavity misalignment measurement. However, the phase difference as indicated by Eqs. (1) and (2) might be exploited by the system now under development for the European XFEL. Regarding offset measurements, the experimentally challenging phase space coverage as shown in Fig. 6 is of minor importance. Especially for the injector module, this is a fortunate situation. Machine restrictions such as few available steerers with a limited range and the small aperture thus far prevented a relatively uncorrelated phase space coverage.
As discussed before, the two HOM couplers have different sensitivities to the two polarizations of the same dipole mode. The intersection of the transverse axes where each of these polarizations have minimum amplitude defines the cavity center, actually the center of this particular mode. By identifying the beam position ½x 0 ; y 0 with a minimum dipole power, the electrical center of the mode can be determined.
As illustrated in Fig. 12, the beam phase space can be binned into narrow slices, and a linear function can be fit to the amplitude, providing the center for each slice. These centers provide the axis of each polarization as shown in Fig. 9. However, it turned out that this method was rather difficult to automize. In order to deal with large amounts of experimental data with unequal offset limits for different couplers, a reliable fit algorithm was established. A parabolic fit to the signal power is equivalent to a linear fit to its amplitude. The implemented algorithm fits a 2D parabola of the form to the total power of the signal of each coupler. The rotational transformatioñ x ¼ x cos ϕ þ y sin ϕ; the two polarization axes are assumed to span an angle of 90°. Although this might induce additional error, it turned out that this uncertainty is small compared to the benefit of reduced fit parameters and, thus, robustness of the algorithm. Figure 14 shows a qualitative illustration of the power of the measured dipole mode signal for each coupler at the injector module at FLASH. The missing points at cavity three are caused by momentary problems of the readout electronics. The fitted cavity centers are highlighted as red dots. Note the unequal axes limits for the first four and the last four cavities. It was not possible to fill the ½x; y phase space at the first cavities in a wider range. The rising edge of the dipole mode in the positive vertical direction could not be reached in the first cavities. In addition, it was not possible to switch off the third horizontal gun steerer and still get sufficient transmission through the module. These points hint to a significant horizontal misalignment of the injector module with respect to the gun section.
As mentioned before, the used reference axis is defined by the zero readings of the BPMs. Because of experimental constraints, the required downstream BPM available for HOM-based misalignment measurements is located behind the last cavity, still inside the accelerating module. Figure 15 illustrates the thereby arising difficulties. Illustrated are different alignment scenarios of the injector module (left) and corresponding measurement results for the cavity misalignments (right) with respect to the reference axis.
Even if both the offset and angle of each cavity would be measurable, it would still not be possible to distinguish, for example, between a perfectly aligned module and a module which is rotated around the upstream BPM. As the lower two examples point out, the same is true for any setup rotated around the upstream BPM. Moreover, the measurable offset of cavity n with respect to the design axis of the machine will decrease linearly with n. Despite these uncertainties, a quantitative analysis of the cavity misalignment measurement follows. Figure 16 shows the transverse electrical cavity centers obtained with our method at the injector module at FLASH as obtained from two data sets, separated by about three months of machine operation. The fit results (cf. Fig. 14) in the reference frame as discussed above are plotted in the upper row. It is reasonable to define the module axis by the individual cavity centers. A linear fit therefore reveals the module axis with respect to the reference frame. The lower row shows the cavity misalignment with respect to the module axis. The agreement between the two individual measurements is satisfactory, considering the described experimental challenges and physical movement of the cavities. Combining both measurements, the fitted module axis can be described to have an offset and tilt with respect to the gun section of ½Δx mod ; Δy mod ¼ ½ð−0.65 AE 0.21Þ mm; ð0.03 AE 0.2Þ mm; ½Δx 0 mod ; Δy 0 mod ¼ ½ð22 AE 12Þ μrad; ð−229 AE 6Þ μrad: However, the quantitative interpretation of these values is rather difficult. Results shown in Fig. 14 must be taken into account as well as the above-mentioned problems of transmission through the module, when operating gun steerers below their maximum value. The fact that all horizontal steerers had to be set near their maximum value suggests that the relatively small fitted values ½Δx mod ; Δx 0 mod are underestimating the actual misalignment (see, for example, the second row in Fig. 15). Furthermore, recall the insensitivity of the measurable offset of downstream cavities caused by the used reference axis. The fitted values of vertical offsets do not reflect that prediction. A likely explanation is that the involved downstream BPM shows a significant error. In order to undeniably determine the actual misalignment of the injector module with respect to the gun section, additional measurement efforts have to be made.
The principle of the above-described procedure for the measurement and data analysis was applied also to the next four accelerating modules (ACC2-5) at FLASH, which are equipped with HOM readout electronics. Because of the higher beam energy at downstream modules, and thus smaller beam size and lower sensitivity to space charge effects, we were able to implement an efficient measurement procedure while obeying the experimental constraints.
In contrast to the injector module, the ½x; y phase space could be filled reasonably well. A total of 32 000 beam trajectories are evaluated. A histogram of the residual cavity offsets as obtained from the corresponding fitted module axes is shown in Fig. 17, combining both transverse planes. A Gaussian distribution reveals a standard deviation of σ cav ¼ 342 μm. The measurement result agrees decently with the specification of the maximum cavity offset of Δu cav ¼ AE500 μm in TESLA modules [7]. The exact values of previous measurements of the cavity offsets in ACC4 and ACC5 made in 2006 [10] were not reproduced. However, this is expected, since the modules have been heated up between the measurements, which in turn changes the cavity alignment significantly [20].

VII. SUMMARY
Beam-excited dipole modes which are extracted by HOM couplers can be used to study the transverse position of the accelerating cavities inside an installed cryomodule.
We have developed and applied an efficient measurement and data evaluation procedure on five accelerating modules at FLASH, which are equipped with HOM readout electronics. The rms value of the measured offset of the cavities in the first five accelerating modules of 342 μm agrees with the specification of maximum cavity offset of 500 μm in TESLA modules.
We performed eigenmode simulations of the TESLA cavity showing that the ratio between the offset and angle dependence of the dipole mode is about 1 mm:5 mrad. For the first time, we measured the dipole mode excitation due to trajectory tilt angles. The preliminary results agree with the simulated values.