Electro-optic time profile monitors for femtosecond electron bunches at the soft x-ray free-electron laser FLASH

B. Steffen, V. Arsov, G. Berden,* W.A. Gillespie, S. P. Jamison, A.M. MacLeod, A. F.G. van der Meer, P. J. Phillips, H. Schlarb, B. Schmidt, and P. Schmüser Deutsches Elektronen-Synchrotron DESY, Hamburg, Germany Paul Scherrer Institut, Villigen, Switzerland FOM Institute for Plasma Physics ‘‘Rijnhuizen’’, Nieuwegein, The Netherlands University of Dundee, Dundee, United Kingdom Accelerator Science and Technology Centre, STFC Daresbury Laboratory, Warrington, United Kingdom School of Computing and Advanced Technologies, University of Abertay Dundee, Dundee, United Kingdom (Received 14 January 2009; published 17 March 2009)


I. INTRODUCTION
Intense relativistic electron bunches with a duration of 100 femtoseconds or less are essential for free-electron lasers (FELs) based on the principle of self-amplified spontaneous emission (SASE), such as the soft x-ray free-electron laser at Hamburg (FLASH) [1], and future x-ray FELs like the Linac Coherent Light Source [2] at SLAC and the European XFEL [3]. Precise measurements of the temporal profile of extremely short electron bunches are indispensable for a detailed understanding of the bunch compression and lasing mechanisms in a SASE FEL. Single-shot electro-optic (EO) detection techniques are ideally suited for this purpose since they are nondestructive and can be carried out concurrently during regular operation of the free-electron laser for user experiments. An important aspect is that they permit correlation studies between the measured time profile of electron bunches and the properties of FEL pulses produced by the same bunches.
A bunch of relativistic electrons passing through a long undulator magnet will only generate FEL radiation if stringent requirements on the electron beam quality are satisfied, such as very low transverse emittance, high peak current, low energy spread, and a precisely aligned beam orbit in the undulator. At FLASH the peak current must be of the order of several 1000 A. This high local beam current is achieved by longitudinal bunch compression. In the magnets of the bunch compression system collective effects play a significant role that is difficult to model with sufficient accuracy: space charge forces and coherent synchrotron radiation may seriously distort the temporal shape and the internal energy distribution of the compressed bunches. Precise measurements of the temporal profile of the compressed bunches are therefore of utmost importance for a deeper understanding of the bunch-shaping procedure. Owing to bunch-to-bunch pulse shape variations and arrival time jitter, caused by fluctuations in the accelerator, such measurements are only meaningful if they are done on single bunches.
Single-shot EO measurements of picosecond electron bunches were first demonstrated in 2002 [4]. Several variants of EO bunch diagnostics have been applied [4][5][6], all sharing the underlying principle of utilizing the fieldinduced birefringence in an electro-optic crystal to convert the time profile of a bunch into a temporal, spectral, or spatial intensity modulation of a probe laser pulse.
The EO techniques have the advantage of being nondestructive, thereby permitting correlation studies of EO measurements on selected bunches with the FEL radiation pulses produced by the same bunches. Their drawback is that one has to rely on nonlinear optical processes for converting the electric field profile of a bunch into an optical signal; confidence in the understanding of these processes for very short bunches is crucial to the interpre-tation of the data. In a recent paper [7], we reported on a benchmark study where ultrashort electron bunches of FLASH were simultaneously characterized with a transverse-deflecting structure (TDS) and an electro-optic detection system. In the present paper the high-resolution electro-optic experiments carried out at FLASH are described in detail. After a thorough discussion of the experimental procedures and the infrastructure, we present data showing the capabilities of electro-optic techniques for longitudinal electron bunch profile measurements.

II. THE FREE-ELECTRON LASER FACILITY FLASH
The ultraviolet and soft x-ray free-electron laser facility FLASH at DESY is shown schematically in Fig. 1. The electron bunches are generated by illuminating a Cs 2 Te photocathode with ultraviolet laser pulses. The cathode is mounted at the backplane of a 1 1 2 -cell 1.3 GHz copper cavity which accelerates the particles to 4-5 MeV. The bunches leaving the gun have a charge of 0.5 to 1 nC, a peak current of 50-100 A, and an rms length of about 4 ps. They come in pulse trains (repetition rate 5 Hz), where each train consists of 1-800 bunches with a spacing of 1 s. A linear accelerator (linac) increases the electron energy to values between 440 to 770 MeV. The linac is composed of five acceleration modules (ACC1-ACC5), each containing eight 1.3 GHz superconducting cavities [8].
At intermediate energies of typically 125 and 370 MeV, the bunches are longitudinally compressed in order to raise the peak current to more than 1000 A as required for the high-gain FEL process. Bunch compression is achieved by imprinting an energy slope on the bunch by off-crest acceleration in the first three modules, and passing the particles through two magnetic chicanes. The curvature of the rf wave adds a nonlinear term to the position-energy relationship inside the bunch, hence the compressed bunches do not possess the ideal narrow profile but consist of a leading spike with a width of less than 100 fs and a 10 ps long tail. The spike contains 10%-20% of the total bunch charge and reaches a peak current in excess of 1000 A while the local current in the tail is too small to produce significant FEL gain.
Coherent synchrotron radiation and space charge forces have a considerable influence on the shape of the leading spike, and high-resolution longitudinal phase space analysis is essential for the understanding and optimization of the bunch compression mechanism. In the straight section between the linac and the undulator, three devices have been installed for this purpose: a transverse-deflecting radio-frequency structure (TDS) [9], the electro-optic (EO) experiment described in this paper, and a broadband beam line for coherent transition radiation (CTR) spectroscopy [10]. The first two experiments allow for highresolution, single-shot, direct visualization of longitudinal electron bunch profiles. Since the TDS and EO experiment are located within a few meters from each other, simultaneous measurements can be performed to benchmark the two techniques. The principle of EO detection, and its implementation at FLASH, are described fully later.
The TDS converts the temporal profile of the electron bunch charge density into a transverse streak on a view screen by a rapidly varying electromagnetic field. It was built at SLAC and installed and commissioned in FLASH at DESY in collaboration with SLAC [11,12]. The TDS is a 3.6 m long traveling wave structure in which a transverse electromagnetic field exerts a time-dependent transverse force on the electrons. The bunches pass through the TDS near zero crossing of the rf field and receive no net deflection, however they are streaked in the vertical direction. The TDS frequency of 2.856 GHz is tuned to exactly 11=5 of the 1.3 GHz linac rf, thereby permitting a precise synchronization. Since the fill time of the TDS is less than a microsecond, a single bunch out of a train can be streaked. With a fast kicker magnet, this bunch is deflected horizontally towards an optical transition radiation (OTR) screen viewed by a CCD camera. The other bunches in the train are not affected. The time resolution is of the order of 25 fs (rms) with the beam optics tuned for FEL operation. The TDS is inherently destructive prohibiting the characterization of bunches that are needed further downstream. Owing to space constraints, the EO experiment had to be mounted downstream of the TDS so that it was not possible to observe the same electron bunch with both detection schemes. The comparative EO and TDS measurements reported here used the EO signals from the penultimate bunch and the TDS signals from the last bunch in the same train.

III. PRINCIPLE OF ELECTRO-OPTIC DETECTION
When a relativistic picosecond duration bunch passes within a few millimeters of an electro-optic crystal, its transient electric field is equivalent to a half-cycle THz pulse impinging on the crystal. The temporal profile of this equivalent half-cycle THz pulse provides a faithful image of the longitudinal charge distribution inside the electron bunch if the electrons are highly relativistic. The transient electric field induces birefringence in the electro-optic crystal. As the electric field propagates through the crystal, the birefringent properties of the crystal also propagate. This birefringence can be probed by a copropagating optical laser pulse. The experiments described in this paper have been performed with a gallium-phosphide (GaP) electro-optic crystal and probe pulses from a titaniumsapphire (Ti:Sa) laser at a wavelength around 800 nm. In the following section we present a short summary of the electro-optic effect in gallium-phosphide (GaP) and refer to [13,14] for a detailed description. Similar considerations hold for zinc telluride (ZnTe) which has also been used for electron bunch measurements [4,5,14].
A. Electro-optic sampling using gallium-phosphide The cubic gallium-phosphide (GaP) crystal is optically isotropic at vanishing electric field with an index of refraction n 0 ¼ 3:57 at the titanium-sapphire (Ti:Sa) laser wavelength of 800 nm. Exposed to an electric field GaP acquires a birefringence. The crystal is cut in the (110) plane [see Fig. 2(a)]. The THz pulse impinges perpendicular to this plane and is linearly polarized parallel to the crystallo-graphic ½À1; 1; 0 axis. In this specific case, the polarization ellipse in the (110) plane is shown in Fig. 2(b). The principal refractive indices are n 1 ¼ n 0 þ n 3 0 r 41 E=2; n 2 ¼ n 0 À n 3 0 r 41 E=2; (1) where E the strength of the THz field and r 41 the electrooptic coefficient. The probe laser pulse is also linearly polarized along the ½À1; 1; 0 axis and propagates collinearly with the THz pulse. Because of the different refractive indices, the two components of the laser field vector along the principal axes of the refractive index ellipse receive a relative phase shift given by where 0 is the wavelength of the laser light in vacuum and d the thickness of the crystal, and the electric field is assumed to be quasistatic. The quantity À is called the phase retardation parameter. For ultrashort electron bunches more effort is needed to compute À, and we need to consider the propagation of the THz field and probe laser through the crystal. The physical processes are more easily described for a short duration probe pulse, which can be shown to sample an effective THz field. In this description, the Coulomb ''THz'' pulse EðtÞ is decomposed into its Fourier components which propagate through the EO crystal with their respective phase velocities v ph ð!Þ ¼ c=nð!Þ, where nð!Þ is the real part of the refractive index in the THz range. Usually there will be a mismatch between the THz phase velocity and the optical group velocity v g of the laser pulse. A quantitative measure of the velocity mismatch is the geometric response function where ð!Þ is the imaginary part of the refractive index in the THz range. The response function depends on the thickness d of the EO crystal and is close to unity if the velocities are well matched. The integral in Eq. (4) can be calculated analytically. The geometric response function of GaP for three crystal thicknesses used in the present experiment is shown in Fig. 3(a). We note that the response function of a 175 m thick GaP crystal becomes very small at frequencies between 5 and 6 THz. For a somewhat larger thickness of 230 m, the response function would even vanish near 5.5 THz. The explanation is that the phase factor appearing in the integral (4) carries out a full 360 rotation in the complex plane when z grows from zero to 230 m, and hence the integral over this phase factor tends to zero. For a 65 m thick GaP crystal the response function drops to zero above 9 THz. In addition to velocity mismatch, the strong frequency dependence of the EO coefficient, depicted in Fig. 3(b), plays an essential role if the THz pulse contains significant Fourier components above 7 THz. Also the frequency dependence of the amplitude transmission coefficient for the Coulomb field from vacuum into the EO crystal must be taken into consideration: Including the above factors, the phase retardation can be computed from the response function by an inverse Fourier transformation: In this equation is an arbitrary time delay between THz pulse and laser pulse. In an electro-optic scanning experiment, would be varied in small steps. Although electrooptic scanning is not a single-shot method, it can be used for real-time monitoring of the electron bunch shape [15]. Single-shot electro-optic detection can be performed with probe pulses that are longer than the electron bunch (Sec. III C). In that case, the Coulomb electric field cannot be considered quasistatic during the laser pulse. In a first approximation, the probe pulse can be considered as a collection of temporally delayed slices. Then, Eq. (6) is used to calculate the retardation ÀðÞ, where specifies the delay of a specific slice of the probe laser.
We note that for the theoretical analysis of electrooptical measurements an alternative description of the EO effect is available, which is based on the sum and difference frequency mixing between the probe laser spectrum and the spectrum of the electric field pulse [16,17]. While currently less widely used, this approach lends itself more simply to describing arbitrarily chirped pulses and the effects of group velocity dispersion in the optical pulse, and is also capable of describing effects at high strength of the bunch electric field.

B. Detection schemes and signal linearity
In the refractive index formalism, the net result of the EO effect within the EO material, acting on a short laser pulse, is a retardation between the orthogonal electric field components of the probe laser. An analyzing polarizer converts this temporally localized retardation into a temporally localized intensity change. In the simplest situation, the analyzing polarizer is arranged in the ''crossedpolarizer'' configuration, with no light transmitted through the analyzer in the absence of an EO induced phase retardation. In this configuration it can be shown that the signal in the photodetector (for example a CCD camera) is given by (see e.g. [18]) S X ðÞ / sin 2 ÀðÞ 2 % 1 4 À 2 ðÞ / E 2 ðÞ; where EðÞ is the time profile of the bunch electric field. Note that the last relation is only true for sufficiently long electron bunches, while for shorter bunches distortions according to Eq. (6) have to be considered. In this crossed-polarizer configuration the advantages of a zerobackground signal are partially offset by the quadratic dependence on the electric field strength and the associated small signal size for weak fields. When this configuration is used for the detection of nonunipolar electric fields, such as in coherent transition or synchrotron radiation measurements, it is also subject to an ambiguity in the sign of the electric field. The linearity of the signal with respect to the effective electric field can be regained in a ''balanced detection'' configuration. To this end, a quarter-wave plate is placed before the analyzing polarizer so as to produce circular polarized light in the absence of EO induced retardation. The signal is taken as the difference in intensity between orthogonal polarization components, as separated by the analyzing polarizer, and can be shown to be [18] S bal ðÞ I s ðÞ À I p ðÞ / sin½ÀðÞ / EðÞ: In case of small signals the balanced detection suffers from the presence of a significantly larger background. Noise in this background, or digitization limits in the camera detection, can degrade or swamp the EO signal. It is also possible to configure the detection so that it is approximately linear in the bunch field, and with a modest background. The quarter-wave plate is set to minimize the transmitted light through the analyzing polarizer. Then, a half-wave plate is inserted before the analyzing polarizer. Defining the orientation angle of the half-wave plate such that ¼ 0 corresponds to a crossed-polarizer configuration, it can be shown that the intensity is given by [14] S near X ðÞ / 1 À cos½ÀðÞ þ 4 % 1 2 ½À 2 ðÞ þ 8ÀðÞ þ 16 2 / EðÞ þ offset; (9) where in the last steps it is assumed that À and are small. In Fig. 4 the detector signal is plotted as a function of À for two angles of the half-wave plate. For ¼ 0 we are in the crossed-polarizer regime with a detector signal that is quadratic in the electric field. Rotating the half-wave plate by a few degrees leads to a larger signal that is almost linear in the retardation À, and hence in the bunch electric field. However, this signal has to be separated from a background which is also present in the absence of electron bunch.

C. Single-shot EO detection methods
The basic idea in single-shot EO detection is to probe the induced birefringence in such a way that the complete longitudinal electric field profile of an individual electron bunch can be recorded with a single optical pulse. Several techniques have been developed, converting the time profile of the electron bunch either into a spectral [4], a temporal [5], or a spatial [6] intensity modulation of the probe laser pulse. This paper describes the implementation of the first two techniques for electron bunch characterization at FLASH.
In the first method [see Fig. 5(a)] which we call electrooptic spectral decoding (EOSD) [4], a short laser pulse ( < 30 fs FWHM) is dispersively stretched to a length which is longer than the electron bunch. This probe pulse is linearly chirped, which means that the instantaneous wavelength depends linearly on the longitudinal position inside the pulse. The probe pulse is guided through a polarizer P to ensure its horizontal polarization (the horizontal axis is chosen parallel to the ½À1; 1; 0 axis of the electro-optic GaP crystal). It is then injected into the accelerator beam pipe and passes through the GaP crystal placed at a distance of 4-5 mm from the electron beam. In this way, the electron bunch profile is electro-optically encoded onto the probe pulse: the probe pulse contains a time-dependent elliptical polarization that reflects the electron bunch shape. After exiting the beam pipe, the timedependent elliptical polarization of the probe pulse is converted into an intensity modulation with an analyzing polarizer A that is orthogonal to the polarizer P. The residual birefringence of the electro-optic crystal is removed by a quarter-wave plate (by minimizing the transmitted light through the analyzer in the absence of an electron bunch). The half-wave plate shown in Fig. 5 can be used to obtain an intensity modulation that is either linear or quadratic in the bunch electric field (see Sec. III B). Owing to the linear chirp, the time dependency of the intensity modulation is translated into a wavelength dependency, and can thus easily be measured by a grating spectrometer equipped with a CCD camera.  Electro-optic spectral decoding EOSD is comparatively easy to implement but its temporal resolution is limited as a result of frequency mixing of the Fourier components of the THz field with frequency components of the optical probe pulse, as described and experimentally demonstrated in Refs. [5,19].
The problem of frequency mixing is avoided in the electro-optic temporal decoding (EOTD) technique in which the temporal profile of the intensity-modulated probe pulse is converted into a spatial profile [5,19]. As shown in Fig. 5(b), the temporal profile can be retrieved single shot by cross correlating the probe pulse with a short gate pulse, whereby the temporal intensity profile of the probe pulse is mapped into a spatial intensity profile. By overlapping the two pulses in a noncollinear geometry, a position-dependent time delay is introduced between probe and gate pulse at a frequency doubling crystal -barium borate (BBO) crystal. The frequency doubled (400 nm) light emerging from the BBO crystal is imaged by an intensified CCD camera. The temporal profile of the electron bunch is deduced from the light intensity as a function of horizontal position in the crystal (a detailed description of EOTD is presented in Sec. IV F).
The EOTD method yields a better intrinsic time resolution than EOSD, but the setup is more complicated, higher laser power is needed, and the repetition rate drops to about 1 kHz (see Sec. IVA). Therefore, it depends on the actual application which technique is the better choice.

IV. DESCRIPTION OF THE ELECTRO-OPTIC EXPERIMENT
The electro-optic experiment at FLASH consists of a laser laboratory outside the accelerator tunnel, a laser transfer line to the tunnel, and an optical table inside the tunnel (Fig. 6). The laser laboratory is temperature stabilized to 20 AE 1 C and holds the optical table with the laser systems (cf. IVA) and diagnostic equipment. Furthermore, the laboratory houses electronics and computers to control the synchronization of the lasers, the motorized optics, the accelerator settings, and the data acquisition devices. From the optical table in the laboratory, the laser beam is sent into the accelerator tunnel. There a second optical table holds the optics for the detection setup and a special ultrahigh-vacuum chamber which is part of the electron beam pipe and contains the electro-optic crystals.

A. Laser systems
The laser used for EOSD is a FemtoSource Compact20 titanium-sapphire (Ti:Sa) oscillator from Femtolasers GmbH. The oscillator delivers 15-20 fs (FWHM) long pulses of up to 4 nJ pulse energy at a repetition frequency of 81.25 MHz. The second laser system, used for the EOTD experiment, is an 81.25 MHz Ti:Sa seed oscillator (FemtoSource Pro HP, Femtolasers GmbH) and amplifier (Omega Pro, Femtolasers GmbH). The amplifier delivers 30 fs (FWHM) long pulses of 0.8 mJ pulse energy [20] at a repetition frequency of 1 kHz. The emitted bandwidth is 30 nm (FWHM) with a center wavelength of 795 nm.

B. Synchronization of the lasers to the linac rf
All EO detection techniques require a precise synchronization between the laser oscillator and the accelerator radio frequency. The accuracy of the synchronization sets a limit on the resolution of the electron bunch arrival time measurements.
The 81.25 MHz repetition frequencies of both Ti:Sa oscillators are locked to the 1.3 GHz master frequency of the accelerator using a phase-locked loop. A beam splitter directs a part of laser pulses to a 10 GHz photodiode. The 16th harmonic of the narrow photodiode signals is selected by an eighth-order bandpass filter, amplified and fed to one port of a 1.3 GHz mixer, the other port is connected to the 1.3 GHz signal from the master oscillator of the accelerator. The dc output of the mixer yields an error signal which is fed back to the piezocontrolled end mirror of the laser resonator. A variable phase shift of the laser pulses with respect to the linac rf is accomplished by a vector modulator shifting the phase of the 1.3 GHz rf in programmable steps before entering the mixer. From the measured noise of the error signal in a bandwidth from 1 Hz up to the Nyquist frequency of 40.6 MHz, the rms time jitter of the laser-rf synchronization system is determined to be 65 fs. The relative jitter between the electron bunches and the linac rf is not included here.
A more detailed description of the synchronization scheme and its accuracy can be found in [21].

C. Optical transfer line
The laser laboratory is connected to the accelerator tunnel by a 16.7 m long evacuated beam pipe to transport the laser beam into the tunnel (Fig. 6). The optics in the transfer line consists of two remotely controlled mirrors and two identical lenses with focal lengths of f ¼ 4 m. An approximate f À 2f À f imaging setup is realized to im- age the exit of the optical table in the laser laboratory to the entrance of the optical table in the accelerator tunnel. This way the effect of vibrations and movement of the laser optical table on the beam stability at the EO setup in the tunnel are minimized. The laser transfer line and the imaging system has proven highly stable, neither short-term nor long-term motions of the laser spot position on the electrooptic crystal are observed. The two vacuum windows and the two lenses contained in the transfer line add up to 12 mm of borosilicate glass (Kodial glass and BK7). This introduces additional dispersion to the laser pulse, which, in the case of EOTD, has to be compensated by adjusting the compressor length in the Ti:Sa amplifier. For the EOSD setup the additionally introduced chirp does not need to be compensated.

D. Optical setup in the accelerator tunnel
A special electron beam vacuum chamber (Fig. 7) has been designed, comprising the 65 mm diameter electron beam pipe, the input and output windows for the laser beam, and a port for mounting the movable holder for two EO crystals mounted on top of each other. The laser beam can be steered vertically, allowing measurements with two different crystals without opening the vacuum chamber. A spherical mirror (f ¼ 1:5 m) focuses the laser beam onto the selected EO crystal. The laser beam is injected into the vacuum chamber at an angle of 6 relative to the electron beam. Thereby, a mirror upstream of the EO crystal is avoided which would disturb the Coulomb field of the passing electron bunch. A mirror behind the crystal reflects the laser beam to the detector optics outside the vacuum chamber.
A useful feature of the setup is the possibility to determine the temporal overlap between laser pulse and electron bunch without the need of an electro-optic signal. For this purpose, a metalized optical transition radiation (OTR) screen is moved into the electron beam. The OTR pulse generated by the electron bunch and the reflected laser pulse are simultaneously detected by a fast photomultiplier, allowing one to determine their relative timing to better than 500 ps. This narrow time window is then scanned in small steps to search for the EO signal and to establish the temporal overlap of the two pulses on a 100 fs time scale.
A two-level optical table is installed inside the linac tunnel, which holds on the lower level the vacuum chamber and on the upper level the optical components needed for retrieving the electron bunch profile from the electrooptically encoded laser pulse (see Fig. 8). For the EOSD experiments [ Fig. 5(a)], the pulse from the Ti:Sa oscillator is stretched by SF11 glass blocks or by an SF11 prism stretcher resulting in a linearly chirped pulse of several picoseconds length. The laser pulse is guided through the transfer line and through a polarizer for restoring the horizontal polarization, and is then directed towards the EO crystal in the vacuum chamber. After the vacuum chamber the pulse passes through a quarter-wave, a half-wave plate, and an analyzer, and is then coupled into a multimode fiber leading to a spectrometer in the laser laboratory. The image of the spectrum is recorded with a gated intensified camera. The camera is fully integrated in the accelerator control and data acquisition (DAQ) system, and single-shot data from one bunch per train can be taken and stored with the full 5 Hz repetition rate of the accelerator. The integration in the DAQ system also makes it possible to synchronize and compare the EO data to other bunch diagnostic and accelerator data. The spectrometer was calibrated using the argon and mercury spectral lines of a low pressure mercury arc lamp. The resolution was found to be better than ¼ 0:3 nm ðrmsÞ.

F. Temporally resolved electro-optic detection
For EOTD the Ti:Sa amplifier, which delivers pulses of 0.8 mJ in a duration of 30 fs (FWHM), is used. The compressor of the amplifier is adjusted to obtain the shortest pulse length at the position of the BBO crystal (see IV C). To change the setup from EOSD to EOTD, the Ti:Sa pulse is intercepted by a mirror which can be inserted by remote control, and is in this way directed to the second level of the optical table [see Fig. 8(b)]. Here, the laser pulse is split into two parts of equal intensity: the probe pulse and the gate pulse. The probe pulse is sent to a grating stretcher and stretched to about 20 ps (FWHM). The stretched pulse is then transferred back to the lower level and directed into the vacuum chamber holding the electro-optic GaP crystal by a second remotely inserted mirror. A half-wave plate in front of the polarizer is used to control the energy of the probe pulse. This is important since electro-optic crystals can handle at maximum a few micro-Joules (weakly focused), before two-photon processes or even optical damage occur.
After exiting the beam pipe with the GaP crystal, the probe pulse is directed to the upper level of the optical table. Following the quarter-wave and half-wave-plates and an analyzer consisting of two ultrafast thin-plate polarizers, the transmitted horizontally polarized component is focused onto the -barium borate (BBO) crystal by means of a cylindrical lens (f ¼ 100 mm). The beam at the crystal is approximately 20 mm in width and 100 m in height.
The second part of the original laser pulse, the gate pulse, is sent to the BBO crystal via an optical delay that is adjusted such that gate pulse and probe pulse arrive simultaneously at the BBO crystal. The gate and probe beams incident on the BBO crystal are propagating noncollinearly, with an angle of incidence AE with respect to the crystal normal. The noncollinear propagation establishes a temporal to spatial mapping for the overlap of the two beams in the crystal. The time integrated secondharmonic (SH) intensity generated in the crystal at transverse position x will be proportional to [22] SðxÞ / where I gate ðtÞ and I probe ðtÞ are the gate and probe intensities as a function of time, and represents an arbitrary time delay. The mapping in time (or delay ) to spatial position x is An appropriate choice of crystal cut, the symmetry in the incident angles, and the (approximately) equal spectra of the probe and gate beams eliminate any transverse shift in the temporal-spatial mapping of the second harmonic during propagation through the nonlinear crystal. The 400 nm second-harmonic (SH) light leaves the crystal along the line bisecting the two incident beam directions. It is therefore spatially well separated from the SH light that is produced by either the gate beam alone or the probe beam alone.
In the experiments here, the angle of incidence of the gate and probe beams on the BBO crystal is ¼ 19 . The polarization of probe and gate beams are horizontal, in the plane of the two beams. The BBO crystal is 300 m thick and 15 mm wide. Its crystal orientation is described in more detail in Ref. [19]. The gate beam intensity is attenuated by a factor 2 before cylindrical focusing onto the BBO crystal (f ¼ 200 mm) to a line of about 20 mm in width and 1 mm in height. The attenuator and focal distance of the lens are chosen in such a way that secondharmonic light generated in the BBO by the overlapping gate and probe pulses can be recorded with the best signalto-noise ratio. For the measurements reported here, the gate-pulse energy incident on the BBO crystal is around 100 J.
The 400 nm second-harmonic radiation generated in the BBO crystal is imaged onto a gated intensified camera by a set of two lenses (f 1 ¼ 100 mm, f 2 ¼ 200 mm) with a magnification of 2. Since the sensitive area of the camera is 18 mm wide, only a width a ¼ 9 mm of the BBO crystal can be used. With an angle of incidence ¼ 19 , this leads to a temporal window of the measurements of Át ¼ 2a sin=c % 19 ps and a conversion factor of about 15 fs=pixel at the 1280 pixel wide camera image. For some measurements a second set of lenses was used to increase the magnification to 3.3, yielding a ¼ 5:4 mm, Át % 11:4 ps, and a conversion factor of 9 fs=pixel. The camera is equipped with a filter to block stray light at the fundamental wavelength of 800 nm.

G. Time calibration and resolution of the EOTD setup
An approximate time calibration of the EOTD setup can be derived from the known laser beam geometry in the cross correlator. We have devised an online calibration procedure of far better precision using the setup sketched in Fig. 9(a). Just before the cross correlator, the gate pulse is duplicated by remotely inserting two 50% beam splitters and a motorized delay line. As a result, the probe pulse will be cross correlated twice within several picoseconds, and the electron bunch signal will appear twice in the CCD image, separated by an unknown time T, as shown in Fig. 10. Changing the variable delay by a precisely known amount ÁT provides a time calibration with fs accuracy which is totally insensitive to arrival time jitter of the electron bunches. Note that the straightforward time calibration by varying the delay between electron bunch and laser pulse is rather inaccurate since there is a substantial jitter in the arrival time of the electron bunches, as can be seen in Fig. 10. Figure 10 shows that the second bunch signal decreases when the separation between the two gate pulses is reduced. This is caused by an imperfect alignment of the gate-pulse duplication setup and has no influence on the accuracy of the time calibration.
The overall resolution of the cross-correlator setup is estimated to be cc % 30 fs ðrmsÞ, based on the known length of the gate laser pulse, the phase matching properties and thickness of the BBO crystal, and the optical resolution of the imaging system, which was measured in the laboratory using 400 nm light and a test pattern mask.
An experimental determination of the time resolution of the cross-correlator setup (including contributions from the laser pulse length, the cross-correlator itself, the BBO crystal, the imaging system, and the CCD chip) has been carried out by splitting the gate pulse into two pulses [ Fig. 9(b)]. One pulse travels along the original gate beam path, including the delay line. The other pulse is redirected to travel along the probe pulse path (the original probe pulse is blocked during this measurement). The cross correlator now acts as a single-shot autocorrelator for the gate pulse. Time calibration of this single-shot autocorrelator is obtained by changing the variable delay by a known amount. The autocorrelation signal, shown in Fig. 11, has a  FWHM of 77 fs. The actual length of the gate pulse at the cross correlator is not known (by adjusting the compressor length of the Ti:Sa amplifier the pulse duration at the BBO crystal was minimized). Assuming a length of 40 fs FWHM (17 fs rms) at the BBO crystal, the cross correlator will have a resolution of 22 fs rms. Including the effect of the gate pulse, the instrumental resolution of the cross correlator will be 28 fs rms, which is agreement with the estimated value.

H. The electro-optic crystals used in the experiments
A number of gallium-phosphide (GaP) crystals with different thicknesses were used for the measurements. Some of the crystals are wedge shaped to permit measurements at different thicknesses. They are mounted with the thin edge pointing towards the electron beam. All crystals are cut in the (110) plane and the ½À110-axis points to the center of the electron beam pipe. No degradation of crystal quality (and electro-optic response) has been observed for crystals mounted in the accelerator beam pipe at FLASH. At the FELIX infrared FEL (Nieuwegein, The Netherlands), a zinc telluride (ZnTe) crystal was used for four years without degradation after which it was damaged by accidentally steering the electron beam into the crystal.
In general, thinner crystals offer better time resolution at the cost of signal strength. Furthermore, GaP is superior to ZnTe because of its higher transverse optical lattice vibration frequency; see Ref.
[13] for a detailed discussion on electro-optic crystals for electron bunch diagnostics.
The measurements reported in this paper have been obtained with a plane parallel 175 m GaP crystal or a wedged GaP crystal (Moltech, Berlin) where the interaction points as determined by the delay of the doublereflected THz pulse are at a thickness of 65 m or 100 m.

V. EXPERIMENTAL RESULTS
Single-shot electro-optic electron bunch measurements have been performed parasitically during FEL user operation and at dedicated shifts. In the first case, the accelerator is tuned for optimum and stable SASE conditions. The electro-optic detection techniques are nonintrusive and nondestructive: the measurements have no effect on the energy or stability of the x-ray pulses produced in the undulator. The dedicated beam time was used to benchmark the electro-optic techniques with the transverse deflection technique. Furthermore, measurements were made at accelerator conditions that are not optimal for SASE operation, providing data that illustrate the capabilities and applications of electro-optic detection techniques.
This section is organized as follows. First, the procedure for converting EOTD cross-correlator and EOSD spectral images into electron bunch profiles is described. This procedure is illustrated with EOTD measurements. Following this, ultrahigh resolution measurements are re-ported and compared to simultaneously obtained transverse deflection measurements. This comparison provides a detailed insight into the current limitations of the electrooptic techniques. By slightly detuning the bunch compression system, longer bunches with a double-peak structure are obtained, and measurements of these are reported in Sec. V C. These results show that small changes in bunch profile can easily be resolved. This allows the performance of the bunch compression feedback system to be monitored (Sec. V D).
For applications that do not need very high temporal resolution, the electro-optic spectral decoding (EOSD) technique can be used. A typical electron bunch profile measurement is discussed in Sec. V E. Applications of EOSD are reported in the final sections: the dependence of the EO signal on the electron beam orbit, and electron bunch arrival time measurements.

A. Image analysis and background subtraction
Two typical single-shot EOTD measurements are shown in Fig. 12. The time axis has been calibrated using the procedure described in Sec. IV G. The leading edge of the bunch is at the left side. The data are consistent with the expectation that the compressed bunches in FLASH consist of a short leading spike followed by a long tail. The first EOTD measurement was performed near to crossed polarization (orientation angle of the half-wave plate ¼ 1 ), the second one at crossed polarization ( ¼ 0). The quarter-wave plate was set to remove residual birefringence in the EO crystal. The electro-optic signal recorded at ¼ 1 depends almost linearly on the electric field of the bunch EðtÞ, while the signal at ¼ 0 is proportional to the square of the field.
For a reconstruction of the bunch profile three different background traces are needed, which are all recorded without electron beam: (i) camera background C: the ''dark counts'' of the CCD camera are measured without laser beam and the resulting pattern is subtracted from all other traces including the following background measurements; (ii) background B measured at the desired angle of the half-wave plate with incident laser pulses; (iii) normalization trace N. For the ''near crossedpolarizer'' geometry, where Þ 0, the normalization trace is equal to the background trace, i.e. N ¼ B. For the ''crossed-polarizer'' geometry, where ¼ 0, the halfwave plate is rotated to a value of typically ¼ 2 in order to have some light on the CCD camera (thus N Þ B).
All background traces were taken with the same laser and CCD camera settings that were used for the EO measurements, and an averaging over 10 to several 100 traces was made in order to avoid additional noise introduced by background subtraction. For each single-shot measurement, the normalized electro-optic signal S N can be calculated from the measured signal S by applying the following equation: S N ¼ ðS À CÞ À ðB À CÞ ðN À CÞ : (12) Note that this image analysis procedure is also valid for electro-optic spectral decoding measurements (see Sec. V E). Furthermore, for Þ 0, it is possible to derive the value of the phase retardation parameter À by applying Eq. (9) to both the signal S and normalization N traces. The second-harmonic (SH) background light observed at crossed polarization is caused mainly by stray SH light that is produced in the BBO crystal by the Ti:Sa gate beam alone. Beam pointing instabilities of the laser amplifier and mechanical instabilities of the setup lead to fluctuations in the overlap of gate pulse and the probe pulse at the BBO crystal and cause intensity fluctuations of up to 50%. For EOTD data obtained at > 0 these fluctuations can be corrected for by scaling the signal trace with an intensity factor determined from the section of the signal trace in front of the EO peak. In this part of the trace the intensity is equal to the average laser-induced background. Figure 13 shows an EOTD signal after background subtraction and normalization. In this case the EO signal depends linearly on the electric field of the electron bunch. The main peak has a sigma value of 73 fs rms.

B. High-Resolution EOTD measurements and comparison with the TDS
The FLASH linear accelerator offers the unique possibility to perform simultaneous measurements with two independent diagnostic devices of excellent time resolution. The only restriction is that, because of the location of the TDS, the same bunch cannot be measured by both devices. Adjacent bunches in the train, however, can be compared. A single-shot EOTD measurement during FEL operation, performed at 1 away from orthogonal polarization, is compared in Fig. 14(a) with the TDS measurements on the next bunch in the same bunch train. The EOTD and TDS signals agree in their main features but the superior time resolution of the TDS technique is evident. The TDS signal exhibits a structure consisting of a narrow peak (rms width < 30 fs) and a shoulder, while the electric field pulse EðtÞ as measured by EOTD shows only a single peak with an rms width of 60 fs. The full time window of the measurements is 2 ps for the TDS and thus much narrower than the 12 ps window of the EOTD setup. The electro-optic GaP crystal is wedge shaped, and the thickness at the point scanned by the laser is 65 m (as determined from the 1.4 ps delay of the secondary signal that is caused by internal reflection). For a quantitative comparison we have simulated the response of a 65 m GaP crystal to ultrashort electron bunches as characterized by the TDS. From the measured TDS signal, the shape of the equivalent THz pulse at the position of the GaP crystal is calculated. This ''THz pulse'' is then taken as input for a numerical simulation of the EO process in GaP using the known material properties, as described in Sec. III A. The predicted EO signal shape is shown as the lowest trace in Fig. 14(a). It has an rms width of % 55 fs. This widening is entirely due to high-frequency cutoff in GaP near the transverse optical lattice resonance. For the 65 m GaP crystal the cutoff arising from the frequency dependence of the EO coefficient r 41 is in fact even lower than that from phase matching, and limits the usable frequency range to f < 8 THz. Figure 14 shows that the shape of the measured EOTD signals agrees very well with the predicted ones except for a slight increase in width (60 fs), due to the resolution of the optical cross correlator (28 fs rms), and a higher intensity in the tail of the bunch. The tail is enhanced by wakefields generated upstream of the EO crystal. Such wakefields are invisible in the TDS measurement because the TDS streaks the electric charge of the bunch and is totally insensitive to electromagnetic fields traveling down the beam pipe. The almost perfect agreement in the width of the leading spike between measurement and prediction means that we have basically reached the resolution limit for EO bunch shape reconstruction with GaP. This is also illustrated in Fig. 14(b). Here, the bunch compression parameters are slightly different, leading to a doublepeak structure which is only resolved in the TDS measurement. Electron bunches with an rms length of 30 fs or less appear thus stretched to about 55 fs. Note, however, that longer electron bunches ( ! 90 fs) will be faithfully reconstructed by EOTD because these pulses contain negligible Fourier components in the resonance region of GaP. This will be studied in the next section.

C. Bunches with a double-peak structure
To demonstrate the good reconstruction of longer bunches, the rf phase in the bunch compression system was detuned on purpose from its optimal value, yielding longer bunches with a double-peak structure. For these bunches the agreement of the TDS and the EOTD measurement is indeed very good as shown in Fig. 15(a). Also the simulated EO signal agrees well with the measured one except in the tail, where again wakefields enhance the intensity of the measured EO signal. Note that, as explained in the previous section, the full time window of the EOTD measurement is 12 ps while the time window of the high-resolution TDS measurement is only 2 ps. Figure 16 shows two series of five subsequent singleshot measurements. Here, the rf phase of the first accelerating module was chosen to be slightly higher (approximately 0.2 ) than needed for optimum compression. This leads to a slight overcompression but with strongly fluctuating bunch shapes as displayed in Fig. 16. For clarity, the measurements are displayed on two time scales, with time windows of 6 ps and 1.5 ps. The EO signals show either a single peak or two peaks separated by up to 500 fs. The smallest distance between two peaks which could still be clearly discriminated was 130 fs.  Only 600 fs of each measurement is shown. The full time window is 2 ps for the TDS measurement and 12 ps for the EOTD measurement. The simulated EO signal (green) has been calculated from the TDS signal.

D. Monitoring the performance of the bunch compression feedback system
At the FLASH accelerator a feedback system is used to stabilize the bunch compression system. Coherent diffraction radiation (CDR) depends critically on the bunch shape and can thus be utilized to provide a control signal. A CDR monitor mounted behind the first bunch compressor chicane is utilized to control the rf phase 1 of the first accelerating module ACC1. In order to monitor the performance of the bunch compression feedback system, hundreds of single-shot electron bunch profiles have been recorded using the EOTD technique. Figure 17(a) shows the FWHM of the measured bunch profiles while the feedback system was working. The width of the EO signal was 158 AE 15 fs (FWHM). Ten minutes after the feedback had been switched off, the rf phase of the first accelerating module drifted away, resulting in longer electron bunches and increased fluctuations in the electron bunch shape [see Fig. 17(b)]. The width without feedback was 181 AE 34 fs. Note that the EOTD measurements were recorded in crossed-polarizer geometry, which means that the actual widths of the electron bunch shapes are larger.

E. Electro-optic spectral decoding
Electro-optic spectral decoding (EOSD) has an intrinsic lower temporal resolution compared to electro-optic temporal decoding (EOTD). Nevertheless, the EOSD technique can be quite useful for applications where ultrahigh temporal resolution is not needed. Examples are provided in the next two sections. As a result of the somewhat lower time resolution, thicker electro-optic crystals can be used. The lower panel of Fig. 15(b) shows an EOSD measurement of a fully compressed electron bunch using a 175 m thick GaP crystal. The upper panel shows the corresponding transverse-deflecting structure measurement. Superimposed on the experimental EOSD trace, a simulation is shown which has been calculated from the TDS trace (using the formalisms described in Refs. [13,16]). Note that the broadening of the EOSD is a result of two effects: the electro-optic response of the GaP crystal and the mixing of the Fourier components of the electric field of the electron bunch with frequency components of the optical probe pulse [5,19]. In principle, it is possible to design a EOSD setup where the frequency mixing limit approaches the temporal resolution of the EOTD experiment shown in Fig. 14, however at the cost of a rather limited time window. With an amplified laser system it is possible to generate a supercontinuum with a bandwidth corresponding to a Fourier transform-limited probe pulse of less than 5 fs, which linearly chirped to 700 fs could provide a temporal resolution comparable to that of present EOTD experiments [23]. However, the large spectral bandwidth of the probe laser pulse will introduce additional complications in the electro-optic crystal due to group velocity dispersion, thus limiting the temporal resolution. Furthermore, the time window will be only 700 fs, while the EOTD measurements shown here have a time window of more than 10 ps, which allow the observation of the long bunch tail as shown in Fig. 13.

F. Dependence of the EO signal on the electron beam orbit
The amplitude and direction of the bunch electric field E at the EO crystal depend on the horizontal and vertical distance x and y between the electron beam orbit and the laser spot on the EO crystal (Fig. 18). The electric field amplitude at a distance r ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi x 2 þ y 2 p between the electron beam and the laser spot is given by EðrÞ / 1=r. The phase retardation depends on the angle ¼ arccosðx=rÞ between the (horizontal) ½À1; 1; 0 axis of the EO crystal and the electric field vector according to [13] ÀðÞ / EðrÞ This leads to an orbit dependence of the phase retardation given by Àðx; yÞ / 1 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi x 2 þ y 2 p ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1 þ 3 x 2 x 2 þ y 2 s : A high-resolution beam position monitor mounted close to the EO setup offers the possibility of checking this relation. Since high temporal resolution is not needed, measurements have been performed using the simpler EOSD technique. Figure 18(b) shows the measured phase retardation parameter while the electron beam was steered horizontally and vertically by AE1 mm. The beam position was measured by the beam position monitor mounted 0.5 m downstream of the EO setup [see Fig. 18(a)]. The bunch charge was 1 AE 0:03 nC. The phase retardation calculated from the measured orbit and bunch charge agrees well with the measured phase retardation. The EO signals can, in principle, be corrected for orbit fluctuations using Eq. (14). For a large vertical offset as shown in Fig. 18, the resulting phase retardation and thus the EO signal is 50% smaller than the phase retardation at zero vertical offset. During regular FEL operation the orbit fluctuations in the FLASH linac are usually quite small and have a negligible impact on the size of the EO signal.

G. Arrival time measurements
Apart from information on the bunch shape, the singleshot EO measurements can also deliver the arrival time of the electron bunch. The observed arrival time fluctuations can be attributed to three sources. The first one can be attributed to the variation in the electron bunch shape, and is related to the definition of the arrival time. The estimated arrival time jitter due to shape fluctuations is about 25 fs for the spectrally resolved measurements and 15 fs for the temporally resolved measurements and thus of minor importance. The second source is the time jitter of the probing laser pulse with respect to the 1.3 GHz linac master oscillator. The synchronization jitter of the lasers described in this paper are at best approximately 65 fs (rms) as discussed in Sec. IV B. The third source is the actual arrival time jitter of the bunches at the electro-optic crystal, which is caused by fluctuations of the accelerator parameters, especially phase and amplitude variations of the rf in the first acceleration module ACC1. The arrival time jitter of the electron bunches at the EO crystal can be estimated from simulations and indirect measurements to be approximately 150 fs (rms). Energy fluctuations of the bunches entering the first bunch compressor are a known source of arrival time jitter. Because of the energy dependence of the path length in the magnetic chicane, an energy jitter translates into a time jitter of the bunches after the bunch compressor. The energy fluctuations can be measured in the dispersive section of the bunch compressor, and the resulting time jitter can be calculated using the known longitudinal dispersion of the bunch compressor. The energy jitter of 0.026% (rms) measured in the first bunch compressor results in an arrival time jitter of 155 fs (rms) and is the dominating source of time jitter. Other sources are the time jitter of the photoinjector laser at the electron gun (which however is reduced by the bunch compression ratio) and fluctuations of the linac rf master oscillator.
Arrival time measurements reported in this paper have been performed with the EOSD setup since its laser system has a better synchronization (65 fs rms). The bunch arrival time depends linearly on small changes of the rf phase 1 of the first accelerator module. For a measurement of this dependence 1 was changed by AE1 around its value for optimum compression, and the results are shown in Fig. 19(a). A linear fit leads to a correlation constant of 1.79 ps arrival time change per degree change of 1 . Arrival time measurements without changes in 1 resulted in an arrival time jitter of 182 fs (rms). During these measurements, the jitter of 1 was 0.07 (rms, including the measurement error), which corresponds to an energy jitter of 0.017% and an arrival time jitter of 127 fs. Figure 19(b) shows a 2 h arrival time measurement during SASE tuning of FLASH. Not surprisingly, tuning accelerator settings can lead to large changes in the arrival time and in the arrival time fluctuations and occasionally the arrival time of the electron bunches are not within the time window of the ''arrival time monitor.''

VI. SUMMARY AND OUTLOOK
In summary, nondestructive, single-shot, longitudinal electron bunch profile and arrival time detectors based on electro-optic detection with femtosecond lasers have been successfully implemented and calibrated at a soft x-ray FEL. The time resolution is the best ever achieved in the electro-optic analysis of ultrashort electron bunches and is currently limited by the response of the electro-optic material GaP [7].
Simultaneous electron bunch measurements using electro-optic techniques and a transverse-deflecting structure (TDS) allow for a benchmark study. Although the EO technique is inferior to the TDS in terms of time resolution, it has the considerable advantage of being nondestructive. Moreover, the EO setup covers a larger time window, yields valuable information on wakefield effects, and requires much less space in the linac than the TDS. Examples for applications of EO measurement in accelerator diagnostics were provided for the measurement of the bunch shape as well as of the bunch arrival time.
As a further step to make electro-optic detection a routine tool in accelerator diagnostics, an EO electron bunch profile and arrival time detector based on a Ybdoped fiber [24] laser is currently under development. These lasers operate at 1030 nm and are less complex, cheaper, and more reliable than a titanium-sapphire laser. They should permit continuous operation of the EO detection system with little maintenance.

ACKNOWLEDGMENTS
We are grateful to the FLASH team for the support in operating the accelerator. This work was partially sup-