# Analysis Strategies for MHz XPCS at the European XFEL
## 2 Materials and Methods
In Figure 3b, the comparison between the intensity profiles from this experiment and the one obtained from a measurement performed at beamline P10 of PETRA III is shown, resulting in a sample-detector distance of 7.46 m. The shallow minima in the \(I(q)\) from the XFEL data is a consequence of the lower resolution due to the comparably large pixel-size of the AGIPD. Figure 2: Stack of images acquired by the AGIPD. For sake of the visual representation, we limit the figure to six images. In principle, 352 images per train can be acquired with the AGIPD. The data are stored in individual memory cells for each X-ray pulse that arrives at the detector. \(t\) is the delay time between successive pulses. In the sketch, the first six memory cells of one pixel are shown. The intensity is measured as analogue to digital units (ADUs) and then converted to the number of photons (photonization, see Figure 3a). A measurement--at XFEL also denoted a _run_--is gathering data over a certain time \(t_{\text{m}}\). During this time, trains of highly intense X-ray pulses arrive at the detector with a separation of 99.4 ms. A train contains currently up to 200 individual X-ray pulses at MID. The delay time between the X-ray pulses within a train can be adjusted in steps of 222 ns which defines the fastest time scale of the correlation function (see Equation (2)). Each AGIPD module is a separate entity which works independently from the others. To compose an entire scattering pattern, data from the 16 modules need to be grouped. Each module may record a different number of trains which requires a synchronization step to ensure that the final image contains X-rays that arrived at the same time at the detector. This synchronization can be implemented using the train identification number associated with each recorded pattern [25] or using the software _EXtra-data_ developed by XFEL [26]. Strictly speaking, Equation (1) only holds for stationary dynamics, i.e., when the dynamics only depend on the delay time but not on the absolute time during the measurement. To measure time-dependent sample dynamics and catch time dependent detector artifacts, we will calculate two-time correlation functions (TTCs) [27; 28; 29; 30; 5]:  
\[C(q,t_{1},t_{1}+t)=\frac{\langle\delta I(q,t_{1})\delta I(q,t_{1}+t)\rangle_{ sp}}{\langle I(q,t_{1})\rangle_{sp}\langle I(q,t_{1}+t)\rangle_{sp}}\,, \tag{4}\]  
where \(\langle\dots\rangle_{sp}\) denotes the ensemble average over speckles in the same \(q\)-ROI and \(\delta I(q,t_{1})=I(q,t_{1})-\langle I(q,t_{1})\rangle_{sp}\). By the properties of the speckle patterns [31], it is possible to link the two-time correlation matrix to the (square) modulus of the intermediate scattering function, providing information on the density fluctuations and hence internal dynamics of the system that generated the speckle pattern. If the sample is at equilibrium and the dynamics are stationary--within the time-scale of a train--the two-time correlation matrix can be averaged over time \(t_{1}\) yielding \  
The average over pixels in Equation (4) usually is enough to cancel out any purely random noise sources [28; 30], but, in case of the AGIPD (and similar FEL detectors), there are many possible sources of spurious correlations which can generate additional, sometimes time-dependent, terms in the correlation function. The magnitude of these effects can reach comparable or even higher levels with respect to the system's correlation especially at low count rates.