# Analysis Strategies for MHz XPCS at the European XFEL
## 1 Introduction  
Free-electron laser facilities in the hard X-ray regime (XFELs) bear the potential for studying molecular dynamics utilizing time-domain methods such as X-ray photon correlation spectroscopy (XPCS) and the related technique X-ray speckle visibility spectroscopy (XSVS). Both techniques are based on coherent X-rays and enable probing dynamics between femtoseconds and several hours. These techniques have been developed at synchrotron radiation sources since the 1990s [1; 2; 3; 4]. Applications cover a broad range of materials and scientific questions, such as diffusion dynamics in soft matter, glass transition, and gelation, as well as domain-wall dynamics; see [5] for a recent overview. In XPCS experiments, the sample dynamics are studied by acquiring a series of coherent diffraction patterns, so-called speckle patterns. The intensity fluctuations of the speckles reflect the change of the spatial arrangement of the sample where the length scale is selected by choosing a particular momentum transfer \(q\equiv|\mathbf{q}|=\frac{4\pi}{\lambda}\sin(\theta/2)\), with wavelength \(\lambda\) and scattering angle \(\theta\). The intensities \(I(q,\tau)\) and \(I(q,\tau+t)\) at two different times with a lag time of \(t\) are recorded to calculate intensity-intensity correlation functions\[g_{2}(q,t)=\frac{\langle I(q,\tau)I(q,\tau+t)\rangle}{\langle I(q,\tau)\rangle^{2}}\,. \tag{1}\]  
The average denoted by \(\langle\dots\rangle\) is performed over both detector pixels with equivalent \(q\)-values and all times \(\tau\). The correlation function, \(g_{2}\), can be expressed by the intermediate scattering function, \(f(q,t)\), that describes the temporal evolution of the spatial arrangement of the sample. Via the _Siegert-relation_, Equation (1) can be written as  
\[g_{2}(q,t)=1+\beta|f(q,t)|^{2}\,, \tag{2}\]  
with the speckle contrast \(\beta\) that is determined by the coherence properties of the beamline [5]. While XPCS at storage-ring sources typically covers dynamics in the range between hours down to (sub-)millisecond time scales, its main application at XFEL facilities are fast time scales in the femto- to nanosecond domain [6; 7; 8], using either double-pulse approaches via split-and-delay devices or modification of the X-ray pulse length between a few to about 100 fs. The apparent gap of time scales between nano- and milliseconds originates from the limitations of the time resolution of two-dimensional detectors. Modern photon-counting detectors used for XPCS at storage-ring facilities reach kHz repetition rates [5] and thus define the experimental limit. Recently, this limit has been reduced to microsecond dynamics using new detector generations [9; 10]. However, these experiments are nowadays mainly limited to model sample systems and small-angle scattering geometries, where the scattered intensity is high enough to obtain a decent statistical accuracy. In contrast, the high intensities obtained from single FEL pulses demand the use of integrating detectors. Therefore, different detectors have been developed at FEL sources, such as the CSPAD and ePix at LCLS [11; 12; 13] and the MPCCD [14] at SACLA. These detectors match the repetition rate of the FEL in the range of 30 Hz to 120 Hz. The special pulse scheme of the European XFEL, where X-ray pulses are generated every 0.1 s in trains consisting of up to 2700 pulses at repetition rates up to 4.5 MHz, require a more demanding detector development. One of the detectors developed for the European XFEL is the Adaptive Gain Integrating Pixel Detector (AGIPD) [15]. With its pixel size of 200 um and a repetition rate up to 6.5 MHz, it promises to perform routinely XPCS experiments on (sub-)microsecond time scale. Due to the high intensity of each pulse, experiments on molecular length scales are also in reach. AGIPD is designed to be used by very different scientific communities. Each detector pixel has three gain stages (high, medium, low gain) that are switched automatically depending on the detected intensity.