Online single-shot pulse reconstruction for optimizing a seeded X-ray free-electron laser

X-ray free-electron lasers (FELs) hold promising prospects for opening up opportuni-ties for ultra-fast sciences at the atomic and molecular system. A precise knowledge of temporal information of FEL pulses is the central issue for experiments. Here we proposed and demonstrated an online diagnostic method to determine the FEL temporal proﬁles at the Shanghai Soft X-ray FEL facility. This robust method, designed for seeded FELs, allows researchers to acquire real-time longitudinal proﬁles of FEL pulses with a resolution better than 3 fs. Based on this method, for the ﬁrst time, we can directly measure various properties of FEL pulses from two stages and correlations between them online. This helps us to further understand the physics and realize the lasing of a stable, nearly fully coherent soft X-ray FEL through a two-stage harmonic up-shift conﬁguration. This method also provides an intuitive way for precise detection and control of the relative timing between electron beams and external optical lasers.


Introduction
various subjects such as femtochemistry, ultrahigh-resolution imaging, and the investi-8 gation of the dynamics in atomic and biological systems [7,8,9]. Of particular interest 9 is the experiment performed at seeded X-ray FELs, which have the major advantage 10 of full coherence, precisely arrival time control, uniform longitudinal profile and so on.

11
For most of FEL experiments, a precise knowledge of the characteristics of FEL pulses diation power is relatively weak. Sometimes even negative power profile occurs due to 48 shot-to-shot fluctuations of the electron beam longitudinal phase space and instability 49 of the RF phase of the deflecting cavity, et cetera. 50 In this paper, we proposed an online method to retrieve FEL pulses shot-by-shot 51 at the Shanghai Soft X-ray FEL facility (SXFEL). This method designed for seeded 52 FEL is an extension of what was discussed in Ref. [24]. Instead of building a set of 53 "lasing-off" shots, the initial electron beam centroid energy and energy spread at the 54 interaction point between seed laser pulses and electron bunches are evaluated by the 55 locally weighted polynomial regression since the seed laser pulses are much shorter than 56 the electron bunches. This avoids the erroneous measurement inherent to the original 57 algorithm and makes it reliable to characterize the properties of the FEL pulses shotby-shot during the machine tuning. Based on this method, we have directly observed 59 the evolution of FEL pulse profiles during the FEL amplification and analyzed the 60 correlation of the FEL properties in real time, which helped us to realize the lasing and 61 parameters optimization of the SXFEL. Our experiments also indicate the feasibility 62 to construct a timing diagnostic and feedback system for the electron beam and an 63 external laser source with a resolution better than 3 fs. This has been proved to be very 64 useful to stabilize the seeded FEL output and paves a new way for interpretation of 65 user experiment data in the future.  As the first X-ray FEL facility in China, the SXFEL is a seeded FEL aiming at 69 generating soft X-ray radiation from a 266 nm conventional seed laser through two   With these interest points and the preset pulse lengths (P L set1 , P L set2 ), the roughly 127 estimated energy spread curves for each stage can be defined as σ E,on (t P 1 ± P L set1 /2) 128 and σ E,on (t P 2 ± P L set2 /2). The second order polynomial fittings of these curves are    To quantify the difference between measurements and reconstructions, we introduce 205 the relative root mean square error (RRMSE) defined as: where P E mea mean is the mean of the measured FEL pulse energies. In this case, the 207 RRMSE is about 0.15 which means the reconstructions and measurements fit very well. ified level is reached (in this experiment we set at 5% of the currents' maximum value).

230
The distance between these two lines, denoted ∆T L−E , quantifies the relative timing 231 between the external laser and the electron beam. The yellow areas in Fig.4(a,b) are 232 the "golden" regions of electron bunches. Compared with other parts, this "golden" 233 region has much more homogeneous and suitable distributions, such as the sufficient 234 beam current, the good-quality longitudinal and transverse phase space and so on.

235
With the proposed method, the FEL power profiles for the first stage and second 236 stage can be reconstructed simultaneously. The pulse energies, pulse lengths as well as 237 the relative timings are shown in Fig.4(c-h). These strong correlations indicate that the 238 relative timing between electron bunches and seed laser pulses plays an essential role 239 in cascaded FEL process. As ∆T L−E decreases (from Fig.4(a) to Fig.4(b)), a part of and second stages are negatively correlated as shown in Fig.4(g,h). These measurement 246 results give an important guidance on tuning of the machine. The result of two-stage correlation analysis confirms that the relative timing between 249 the seed laser pulses and the electron bunches needs to be stabilized in order to perform 250 reliable seeding for external seeded FELs. One approach is to install several bunch The most challenging problems are the synchronization of several clock domains and 255 online calibration. Those difficulties make it an extremely complicated system.

256
The method proposed above provides a much more straightforward approach to 257 establish a laser-electron relative timing feedback system. ∆T L−E , which is defined 258 in Fig.4(a,b), is served as the objective of the proposed feedback system. Figure.5(a) 259 shows the continuous acquisitions of relative timing between electron bunches and seed 260 laser pulses before and after feedback at SXFEL. More convincingly, the effects of this 261 feedback system on the second-stage FEL pulse energies are shown in Fig.5(b). The [13] Engel R, Düsterer S, Brenner G, et al. Quasi-real-time photon pulse duration measurement by analysis of FEL radiation spectra. J. Synchrotron Radiat. 23,