longitudinal compression. However, this procedure generates an additional negative curvature of the temporal energy profile. In order to linearize the longitudinal electron-beam phase space during the compression (generally necessary to have a relative constant current profile), an X-band, 4th high-harmonic RF cavity [@Xband] positioned just upstream of the chicane is run close to negative crest to provide a positive contribution to the $\chi_{2}$ coefficient and compensate the aforementioned negative curvature. Following compression, strong longitudinal wakefields [@longwake] in the downstream linac act upon the much higher current electron beam bunch: they induce a chirp that contains both a linear, negative term and a positive curvature component. While the linear $\chi_{1}$ coefficient can be eliminated by slightly dephasing off crest the last couple RF linac sections (at a price of a small reduction in final beam energy), there is no simple way to reduce the quadratic $\chi_{2}$ coefficient and therefore in general the electron beam enters the FEL with a quadratic energy chirp.

At FERMI@Elettra, we characterize the electron beam longitudinal phase space at the end of the linac via a diagnostic section composed of an RF deflecting cavity [@HERFD] followed by an energy spectrometer. The cavity stretches the beam in the 