FemtoMAX – an X-ray beamline for structural dynamics at the short-pulse facility of MAX IV

The FemtoMAX beamline facilitates studies of the structural dynamics of materials on the femtosecond timescale. The first commissioning results are presented.


Introduction
Investigating structural dynamics in molecular systems on timescales that are pertinent to revealing short-lived transient states is an evolving scientific field. The first major results were obtained on the 100 ps timescale at the ID09 beamline at the European Synchrotron Radiation Facility (ESRF), where dynamics of myoglobin were studied (Srajer et al., 1996). Following that, short-pulse, laser-based and accelerator-based sources were developed (Rischel et al., 1997;Rose-Petruck et al., 1999;Chin et al., 1999). Some of the research highlights using these sources were studies of acoustic phonons in semiconductors (Lindenberg et al., 2000), non-thermal melting of InSb (Sokolowski-Tinten et al., 2001;Rousse et al., 2001) and optical phonons in Bi (Sokolowski-Tinten et al., 2003). Up until 2003 there was no X-ray source that could combine the short pulses available from the laser-based sources with the low divergence generally achieved at the accelerator-based sources. However, focusing optics for laser-based sources were improved (Nicoul et al., 2005) and the temporal resolution at accelerator-based sources could be improved using streak cameras (Larsson et al., 1998) and slicing techniques (Schoenlein et al., 2000;Ingold et al., 2008).
In 2003 a major step forward for ultrafast X-ray science was achieved when the sub-picosecond photon source (SPPS) was launched at SLAC. It provided a wealth of scientific results during about ten campaigns of 2-3 week periods (Lindenberg et al., 2005(Lindenberg et al., , 2008Gaffney et al., 2005;Cavalieri et al., 2005). The SPPS was terminated in 2006 when the space was needed for the construction of the LINAC Coherent Light Source (LCLS). During the construction of LCLS, the femto-slicing beamline at the Swiss Light Source (SLS) was the leading source for time-resolved X-ray measurements in spite of the limited flux Harb et al., 2011;Mariager et al., 2012;. In 2010 the completion of the X-ray pump-probe (XPP) instrument at LCLS enabled hard X-ray pump-probe studies using a free-electron laser (FEL). In the first years, XPP provided insights into the dynamics of ferroelectrics (Daranciang et al., 2012), the dynamics of basic chemical processes (Haldrup et al., 2016) and provided basic knowledge of structural dynamics in various materials (Trigo et al., 2013). A recent overview of the XPP instrument describes the instrumentation in detail (Chollet et al., 2015). FemtoMAX is an incoherent source with significantly lower flux than LCLS, but with the aim of being able to carry out a large portion of the solid-state and chemical physics science programmes that today rely on over-subscribed hard X-ray FELs.

Overview of SPF and FemtoMAX beamline
The short-pulse facility (SPF) is driven by the linear accelerator (LINAC) at MAX IV. The design of the LINAC and SPF allows for electron bunches shorter than 100 fs in duration. We will, in the next section, briefly discuss the LINAC and in particular the properties enabling FemtoMAX. The scope of the paper is to describe the FemtoMAX beamline which, so far, is the only SPF beamline. We will give a detailed description of the FemtoMAX beamline including specifications and present status of the components shown in Fig. 1.
The FemtoMAX beamline is equipped with a 666-period undulator with 10 m active length. When the short electron pulses are sent through this insertion device they emit femtosecond X-ray pulses with photon energy from 1.8 keV and higher. The first element of the front-end is a dipole magnet that bends the electrons onto an electron dump. The X-ray beam is defined by an adjustable slit positioned 10 m after the exit of the undulator. The position and flux of the beam can be measured using an X-ray beam-position monitor (X-BPM) based on a thin Ce:YAG screen and an absolute calibrated Si diode. The front-end also contains a user shutter which can reduce the pulse-repetition rate of the X-rays and the safety shutters. Two sets of focusing optics are available. A toroidal mirror in the beamline hutch images the source with a (de)magnification of 0.4 at the end-stations. Cylindrical Be lenses can be used to vertically obtain a (de)magnification of 0.1 at the end-station. One double-crystal monochromator and one double multi-layer mirror monochromator are available. An overview of the beamline can be seen in Fig. 1. An ultrafast laser system provides femtosecond optical pulses for optical pump-X-ray probe experiments. The laser system is located in a laser laboratory directly above the beamline. The laser oscillator is synchronized to the 3 GHz radiofrequency (RF) signal originating from the master oscillator. The synchronization between laser and electrons is monitored by an optical cross-correlator and an RF filter-based jitter monitor. The direct timing between laser and X-rays can be measured by a UV-sensitive, X-ray streak camera. End-stations for scattering and spectroscopy are built to be interchangeable, whereas a chamber for atomic and molecular physics is placed behind the scattering and spectroscopy end-station. Single-photon-sensitive two-dimensional detectors including a Pilatus3 1.2M and a direct detection detector built in CMOS technology are available.

SPF electron bunch structure
The SPF is an accelerator facility allowing for use of longitudinally compressed electron bunches for generation of X-ray radiation (Werin et al., 2009). The MAX IV LINAC (Thorin et al., 2014) is operated at 3 GeV. The electron pulses are generated in a field which is shaped to give a linear The FemtoMAX hard X-ray beamline at the MAX IV short-pulse facility.
longitudinal energy spread (chirp) during initial acceleration. A longitudinally extended bunch reduces the Coulomb repulsion during acceleration. The electron bunches are longitudinally compressed to 100 fs in two bunch compressors (BC1, BC2) (Thorin et al., 2010). The SPF is designed to have optimally compressed pulses for a bunch charge of 100 pC. However, it has also been operated at charges above 200 pC, at the expense of pulse duration and emittance. The MAX IV LINAC is a stable electron source, as the pulse charge varies less than 10%, and the fluctuations of position and angle of the beam fall within 10% of the beam size and divergence. The design and measured values are given in Table 1. The design of the beamline optics is dependent on the emittance and beta function of the electron source. We have used a conservative value of 10 mm mrad for the normalized emittance of the electron beam. This gives a non-normalized root mean square (RMS) value of 1.6 nm rad. The target value for the normalized emittance is 1 mm mrad and a value of 0.5 mm mrad has been measured near the photoelectron gun. A lattice which allows the beta function (describing the electron beam focus) to vary between 10 m and 15 m horizontally and vertically through the 12 m-long undulator section has been chosen. A beta function of 15 m and an emittance of 1.6 nm rad gives an electron source size of S ¼ ½15 Â ð1:6 Â 10 À9 Þ 1=2 = 150 mm. The divergence is given as ¼ ð1:6 Â 10 À9 =15Þ 1=2 = 10 mrad.
Work to measure and minimize the bunch duration is still ongoing. With full compression in BC1, a full width at halfmaximum (FWHM) bunch length of 160 fs was recorded using a screen in a dispersive section of BC2 as diagnostics. Lacking a transverse deflecting cavity, measurements of longitudinal phase space have been made using a version of the zerocrossing method. A streak of the beam was made in a dispersive section of BC2, when accelerating the beam 20 off crest in the whole main LINAC. This makes the profile along the horizontal axis on the screen proportional to the longitudinal profile of the beam..

Insertion devices
The beamline design contains insertion devices which fit in the 15 m-long straight section of this SPF beamline. As a compromise between budget and performance, we choose a 10 m-long short-period in-vacuum undulator covering the energy range 1.85-20 keV with a continuous tuning range. The undulator is divided into two 5 m-long sections with a phase-shifter in between sections. In order to obtain the fundamental energy operating at 1.8 keV for the 3 GeV source, we choose an undulator period of 15 mm. The K value can be tuned between 0.5 and 2.2 which provides a complete spectral coverage without gaps. A magnetic design requiring a 2 mm undulator gap has been chosen. The undulators have been delivered by Hitachi/Neomax. A temporary long-period undulator, designed for generating soft X-rays (Denecke et al., 1999), is presently installed in a third 5 m section. This is the device labelled 'Soft X-ray Undulator' in Fig. 1. It is a 49period undulator with a 52 mm period and gap that is adjustable down to 22 mm (limited by SPF vacuum tube). The results presented here are obtained by this undulator as the invacuum undulator is not yet installed. Calculations for the undulator flux have been carried out using SPECTRA v10 (Tanaka & Kitamura, 2001). The source flux incident on the X-ray optics is given in Table 2.

X-ray optics
The divergence of the undulator radiation is limited by the electron beam divergence and 1/, where is the relativistic gamma factor, and is expected to be less than 20 mrad. The unfocused beam will be less than 1 mm at the user endstations. Because of the low average power, the X-ray optics design is simpler at the SPF than at the 3 GeV ring. The average LINAC current will be below 1 Â 10 À7 A and there is   3.5 Â 10 5 at K = 1.7 6 Â 10 7 at K = 1.9 4 Â 10 5 4 keV 1.2 Â 10 5 at K = 1.7 4 Â 10 7 at K = 0.9 1 Â 10 5 6 keV 5.7 Â 10 4 at K = 2.7 2.1 Â 10 7 at K = 1.9 5 Â 10 4 8 keV 4.0 Â 10 4 at K = 2.7 1.3 Â 10 7 at K = 1.5 3 Â 10 4 10 keV 2.5 Â 10 4 at K = 2.7 1.1 Â 10 7 at K = 1.2 2 Â 10 4 15 keV 6 Â 10 6 at K = 2.0 20 keV 4 Â 10 6 at K = 2.1 no need for cooling. Even though the very short duration of the X-ray pulses leads to a high peak power, it is still well below the thresholds for damage of optical components. The high peak energy leads to a fast temperature increase at the surface of the illuminated area. There is however a finite electron-phonon coupling time, typically a few picoseconds, meaning that no significant heat is transferred to the lattice during the 100 fs X-ray pulse. Before the next pulse arrives 10 ms later, the heat has dissipated.

Harmonic rejection
The radiation produced by an undulator contains both the fundamental energy and several harmonics. A monochromator can be used to remove energies lower than the set energy. Higher energies may however still be transmitted. These have to be removed by an additional device, such as harmonic rejection mirrors. This works by the principle that the critical angle for specular reflection normally is smaller for higher photon energies.
By positioning a mirror so that the desired energy is reflected close to the critical angle, the harmonics with higher energy can be rejected. For harmonics with photon energies lower than 10 keV, harmonic suppression can be carried out using harmonic rejection mirrors. To keep the outgoing beam parallel to the incoming, a set of two carbon-coated mirrors is used in a configuration similar to a double-crystal monochromator. The main parameters for the harmonic rejection mirrors are given in Table 3. The harmonic rejection mirrors have been implemented as stripes on the multi-layer mirror monochromator substrates.
At higher energies, the harmonic separation prism will be used since it provides better throughput. The harmonic separation prism uses the dispersion of Be in order to select a single undulator harmonic using a downstream slit. The principle has been described by Burza et al. (2015). The prism is positioned close to the undulator after the first beamdefining slit. The dispersion results in harmonics being separated in the horizontal plane. By using a second slit, a given harmonic can be chosen and the rejection ratio can be tradedoff against flux by varying the slit sizes. The energy separation for undulator harmonics is larger for a higher fundamental energy which is manifested as a larger horizontal separation and a larger useful energy range. As an example, for a third harmonic beam at 12 keV, incident on the prism at an angle of 89.5 relative to the surface normal, about 50% of the light is transmitted. The separations for the third harmonic at the plane of the mirror, 10 m downstream, is 1.2 mm from the fourth harmonic at 16 keV and 2.5 mm from the second harmonic. In this case the limiting factor that will set the rejection ratio is the scattering from inclusions and imperfections at the prism surface. The useful spectral ranges where a 0.5 mm separation can be reached together with a < 50% absorption in the prism are given in Table 4 3.

Monochromators
For monochromatization, several alternatives are needed. The double-crystal monochromator (DCM) houses two sets of crystals which can be interchanged by moving a translation stage. As can be seen in Table 5, InSb (111) extends to softer X-rays and provides a wider bandwidth compared with Si (111). A multi-layer monochromator (MLM) is required to obtain the highest possible flux for wide-angle X-ray scattering (WAXS) experiments on liquids while at the same time suppressing the low-energy tail in the undulator spectrum. Three different multi-layer mirror pairs have been coated onto the same substrates together with the harmonic rejection stripe in order to conveniently optimize the performance for different wavelength ranges. The characteristics of the monochromators are shown in Table 5. A monochromator scan using the MLM and the temporary soft X-ray undulator is shown in Fig. 2. The flux from the undulator and throughput of the monochromator is within specifications for the given range.

Focusing optics
A cylindrical Rh-coated Si mirror with an incidence angle of 0.14-0.18 which can be bent to a toroid has been commissioned. It has been designed to focus the radiation from both the soft X-ray undulator and the in-vacuum undulator. The focusing mirror parameters can be seen in Table 6. The invacuum undulator source point is 15 m before the mirror, and the focus can be positioned at all end-station locations. For the soft X-ray undulator radiation, the source distance is 30 m and the image distance is 7 m. For this case we have observed a spot size of 80 mm in the horizontal direction and 160 mm in the vertical direction at the scattering end-station. This corresponds to a (electron) source size of 0.3 mm Â 0.6 mm. The measured X-ray focal spot from the soft X-ray undulator is shown in Fig. 3. The beam profile was recorded in air directly after a helium-flushed tube.
For many experiments a smaller spot, than what can be achieved with the mirror system, is needed. This can be  Mirror pair contribution to rejection ratio for fundamental versus third harmonic 10 2 for third-harmonic photon energy 5.5-9 keV (calculated) achieved with Be lenses at the expense of the throughput. The beryllium compound refractive lenses for micro-focusing are useful for the radiation from the permanent short-period undulator. The distance from the source point at the end of the undulator to the sample holder in the goniometer is 24.85 m. A set of vertically focusing lens stacks can be inserted 2.2 m before the sample holder. A binary insertion system is used to facilitate focusing of a wide range of photon energies. The bender for the toroidal mirror is then set to flat, so that the mirror only provides horizontal focusing. This setup gives a demagnification of the source by a factor of 11. The beam size at the output of the undulator is designed to be 150 mm and the resulting X-ray spot on the sample will have a vertical size of <15 mm. Fine-tuning of the focal position can be achieved by slightly bending the focusing mirror. The range over which a throughput larger than 50% can be achieved is 2.5-20 keV for a one-dimensional focus suitable for grazing-incidence diffraction.
4. X-ray diagnostics 4.1. X-ray beam-position monitors The five X-BPMs are based on 20 mm-thick Ce-doped YAG crystals Ce:YAG. Each crystal is imaged onto an Andor ZYLA sCMOS camera. Each X-BPM is placed directly after a fourblade slit which is used for maintaining a reference position for the X-ray beam. For energies above 10 keV, the trans-mission is >70% and one BPM can remain in place. For softer X-rays the X-BPM can be retracted. The beam from the soft X-ray undulator on the first X-BPM after the focusing mirror is shown in Fig. 4. The beam is cut horizontally by a 5 mm-wide filter and vertically by the mirror. The 400 mm-long mirror has a vertical aperture of about 1.2 mm at an incidence angle of 0.2 . The X-BPMs are mounted on the same translation stage as calibrated large-area Si diodes (10 mm Â 10 mm), so that a photon flux can be obtained at each X-BPM.     (111) 1.72-20 keV < 4 Â 10 À4 Mo-B 4 C 44 Å 1.8-2.5 keV < 2 Â 10 À2 Ni-B 4 C 39.5 Å 2.5-8 keV < 2 Â 10 À2 Mo-B 4 C 24 Å 8-20 keV < 2 Â 10 À2

Figure 2
Monochromator scan using the MLM with the Ni-B 4 C stripes. The harmonic numbers are given. The beam has passed through a Parylene C filter so that the chlorine edge at 2824 eV is visible. The filter transmission (right axis) is given as a dashed line. The photon numbers correspond to the detected number of phonons after the calibration filter and the multilayer mirror pair, which has a transmission ranging between 30% and 50% in this photon energy range.

Figure 4
X-BPM image of the beam just after the focusing mirror. The approximately 8 mm free aperture round Ce:YAG disc can be seen.

X-ray intensity monitors
Monitoring the X-ray intensity can be done with a high degree of accuracy. The inline intensity monitors for X-ray energies up to 8 keV consist of three interchangeable Alcoated diamond wedges which allows for setting the diamond thickness between 10 mm and 200 mm. For the energy range 8-20 keV, two Si diodes of 100 mm and 300 mm thickness are used. The diamonds are biased and a pulsed photo-current is obtained from each X-ray pulse. The integrated charge is measured by a trans-impedance amplifier and a digital oscilloscope. In order to obtain absolute photon numbers from the diamond wedges, it is possible to calibrate them against the calibrated silicon diodes placed behind the wedges. At FemtoMAX which has a low flux compared with an FEL or a storage ring beamline, we have designed detectors to be limited by Poissonian photon statistics. This means that a reference measurement for compensation of intensity fluctuations should be set up to have the same number of detected photons as the signal. Thus, the optimal reference signal (I 0 ) is equally as strong as the signal in the experiment. At 1.85 keV, the thinnest diamond wedge transmits 25% of the radiation, and for a 300 mm silicon diode the transmission of 20 keV radiation is 75%. If a reference signal that uses 25-75% of the incident flux is considered acceptable, intensity monitoring is available for the full range of the beamline. For weak scattering signals it would be preferable not to lose too much of the incident flux, as the signal-to-noise level then would be primarily determined by the signal. This is a limitation for tender X-rays. The lowest photon energy where less than 10% of the flux is required for the monitor is 4.4 keV.

Synchronized lasers
The FemtoMAX beamline is equipped with commercially available laser systems. The main laser is a cryo-cooled kHz Ti:sapphire amplifier (KM Laboratories Red Wyvern). It can run at a repetition rate up to 1 kHz and delivers pulses with a duration of 50 fs and pulse energy of 11 mJ at a centre wavelength of 800 nm. The reason for choosing a 1 kHz laser is amplitude stability due to the fact that CW pumped, Qswitched lasers can be used to pump the amplifiers. This is important for non-linear conversion schemes. The laser system also includes an optical parametric amplifier (OPA) (TOPAS HE from Light Conversion) with mixing stages to cover a wavelength range of 0.2-10 mm. Out of the available 800 nm laser power, 10% is split off and used for diagnostics whereas the remaining 10 W either pumps the OPA or can be used for the experiment.

Timing and synchronization
Timing needs to be considered on three different timescales. On the millisecond timescale, each pulse has an identity and signals from all detectors and diagnostics are time-stamped. On faster timescales, timing pertains to the relative arrival time of the laser and X-rays (or another event from the electrons). On the 100 ps timescale the same trigger derived from the 3 GHz facility master oscillator is distributed via a commercial fibre system to the gun laser and to FemtoMAX. This signal provides triggers at the repetition rate of the LINAC pulses which are used for non-critical laser components, detectors and auxiliary equipment. On the femtosecond timescale, the laser oscillator is synchronized to the LINAC RF. The LINAC cavities, the gun laser and the FemtoMAX laser all get their RF from the main facility 3 GHz oscillator which is distributed on phase-stabilized rigid lines. So far the locking accuracy to the RF has been measured to be < 30 fs RMS by measuring the beat note between the RF and the 39th harmonic of the laser oscillator pulse train. Locking the oscillator to the RF is necessary but not sufficient in order to obtain a low jitter in the experiments. A more direct measurement of the jitter has been carried out using nonthermal melting on InSb in a crossed-beam measurement where the complete time history is recorded in a single X-ray pulse (Lindenberg et al., 2005). This method has previously been used to verify electro-optical sampling as a reliable timing tool (Cavalieri et al., 2005). We found that the jitter depends strongly on the alignment of the electron beam through the bunch compressor. In the best data, 90% of the pulses appear in a 1 ps time window, but on other occasions only 25% of the pulses appeared in a 5 ps window.
One of the planned three permanently installed online jitter monitors has been developed and tested. This device measures the relative timing jitter between electrons arriving at the dump magnet and laser pulses arriving at the X-ray hutch. The first measurement was carried out by sending light from the locked laser and visible light from the bending magnet in the front-end onto fast photodiodes and subsequently filtering the diode signals into 3 GHz bandpass filters. This provides oscillating signals and their relative phase can be measured using a mixer and a fast oscilloscope. The accuracy of this scheme has been shown to be better than 200 fs when using two laser beams. However, the first measurement gave a jitter of 5 ps (RMS) while a lower jitter was measured by the direct non-thermal melting experiment, indicating that further work on this device is needed. In particular, since the visible light was weak, an avalanche photodiode (APD) was used as a detector. We believe that the randomness of the amplification process makes APDs unsuitable for this application. In the next version we will use an electron BPM signal to excite the 3 GHz bandpass filter rather than visible light from the LINAC. The second and more direct measurement of the relative timing between X-ray and laser pulses is an in-housedeveloped streak camera. This device will measure the relative timing for each shot which will allow for post-synchronization below the jitter level. It will also be able to compensate for the change in X-ray pulse delay during monochromator scans. The X-rays pass through the photo-cathode of the streak camera and generate photo-electrons while >90% of the X-ray flux is transmitted to the sample. UV pulses from the laser impinge on the same cathode and the delay is measured. The streak camera is placed in the hutch near the experiment. A proto-beamlines type streak camera has been built and the ability to measure relative delays with an accuracy of 280 fs has been demonstrated (Enquist et al., 2010). The timing streak camera will have a smaller anode slit than the prototype and is anticipated to provide a resolution of 150 fs throughout the spectral range and a time window of 10 ps when the fastest sweep speed is used. A third diagnostic which can measure the arrival time as well as the electron pulse duration is under development. The pulse shape of the X-rays will follow that of the electron bunch. Visible radiation from the bending magnet in the frontend will also follow the electron bunch shape. These dependencies enable pulse duration measurements as well as jitter measurements by means of optical cross-correlation using visible radiation from the bending magnet and 800 nm radiation from the laser (Tenishev et al., 2004).
The pulse duration has not yet been measured, but an indication of the pulse duration has been obtained by an experiment where InSb was non-thermally melted by an ultrashort laser pulse. The lattice loses its crystalline structure within a few hundreds femtoseconds, which manifests in a decrease of the X-ray diffraction efficiency. The experiment was carried out in a crossed-beam experiment where the temporal evolution can be captured in a single shot and the time resolution is unaffected by jitter. The data represented as black squares in Fig. 5 are compared with the simple Gaussian model that reproduced the data by Lindenberg et al. (2005). The blue curve represents the model response with no consideration taken of finite duration of the probing X-ray pulse, whereas the red dashed curve shows the same model response convoluted with a 400 fs pulse shape. As can be seen, the model without convolution fits best, indicating a pulse duration below 400 fs. This impression is verified by the fact that the best fit between the data and the model, in a least-squares analysis, is obtained when the model is left without convolution. When data are convoluted with a pulse, the sum of squares increases monotonically as the pulse duration is increased. Convoluting the model with a pulse of 400 fs in duration results in an increase of the sum of squares by 20%.

End-stations and sample environments
The scope of the beamline is to provide a facility where structurally sensitive techniques can be used to measure evolving atomic structure on a femtosecond timescale. A synchronized laser will initiate a photo-induced process and subsequently the structure is measured using the pump-probe technique. Both scattering (diffraction) and X-ray spectroscopy methods will be available.
The user needs are diverse and thus a single sample environment is insufficient to cover a broad user base. A setup which could handle vacuum, liquids, atomic and molecular physics, liquid-helium temperatures etc. would be extremely complex and not user friendly. These requirements have been addressed by designing several user stations. The end-station for scattering and X-ray spectroscopy is intended to be mounted on a common base which has three lateral and three angular motions. This base is a precision system from Huber Diffraktionstechnik and can carry up to 600 kg if the load is centred.
For scattering in air we are providing a sample stack intended mainly for grazing-incidence measurements as well as a Kappa diffractometer. Furthermore, in-vacuum scattering environments have been developed and a low-vacuum/Hepurged environment for X-ray spectroscopy is in progress. Because of the very limited amount of beam time and the high demand for accommodating many different experimental possibilities at the existing FEL facilities such as FLASH in Hamburg and LCLS in Stanford, the group of Professor Joachim Ullrich from the Max Planck Institut fü r Kernphysik in Heidelberg developed a highly versatile, multi-purpose user station called CAMP (Strü der et al., 2010). For this station many different user groups have already developed different kinds of detection systems, like, for example, electron and ion time-of-flight spectrometers, and target sample systems, like, for example, supersonic gas beams and liquid jets, which make this chamber more and more a standard within the community working with high-peak-intensity X-ray science. In order to benefit from this development, we have built a copy of the CAMP chamber not including the PN-CCD part.

Detectors and data acquisition
All detectors are designed to operate in vacuum, but can also be equipped with protective windows and operated in air. For in-air operation, all detectors can be mounted on a robot detector arm. The industrial robot from ABB can carry a load of 120 kg and has a position accuracy better than 80 mm. With a smaller load we have measured the reproducibility to be better than 40 mm using a laser tracker. Different detectors The pulse duration was estimated to be below 400 fs from a non-thermal melting experiment in crossed-beam geometry. The time axis shows delay of the probing X-ray pulse with respect to the laser pulse. The black squares are the experimental data whereas the blue curve is the model from Lindenberg et al. (2005). The red dashed line is the same model but convoluted with a 400 fs Gaussian curve. The noise in the experimental data is due to photon statistics. The data have been smoothed to a fivepoint weighted average. have been commissioned, including X-ray diodes and X-ray avalanche photodiodes as well as a 4 Mpixel Andor IKON CCD camera with a chip size of 25 mm.
We intend to include two types of two-dimensional detectors. One of them will be based on scientific CMOS technology which can be used in the range 2-7 keV although primarily designed for visible radiation. They offer high resolution <13 mm, sizes up to 50 mm while maintaining a full-frame readout speed of >50 Hz. Photon-counting detectors for tender and hard X-rays can be found at almost every scattering beamline. However, at a low-repetition-rate, shortpulse beamline, the requirements are slightly different. FemtoMAX will be equipped with a custom-built 1.2M PILATUS3 detector with the ability to count more than one photon per pixel per pulse. It is based on the instant retrigger technology which was introduced in the PILATUS3 ASIC to cope with the high photon fluxes at third-generation synchrotrons (Loeliger et al., 2012). Additionally, it enables the determination of the deposited charge in each pixel by converting the current to voltage and measuring the duration for which the voltage stays over a predefined threshold. The technology has been given the name Time over Threshold (ToT). As proof of principle, a PILATUS3X 300K-W detector has been tested in this operating mode using both fluorescence targets and FemtoMAX as sources. The 300K detector features 172 mm Â 172 mm pixels in a 1475 Â 195 matrix. The ASIC pixels are bump-bonded to a 1 mm Si sensor. Initial simulations were carried out to determine optimal detector settings for the best possible energy resolution in ToT mode. Subsequently, the ToT of each pixel was calibrated as a function of photon energy by a large number of events in order to reduce statistical uncertainties. In the first studies a commercially available GE Titan-E X-ray tube was used. This tube was used to irradiate 13 different fluorescence targets in order to excite the K lines from these targets, thus obtaining photon energies ranging from 5 to 25 keV. Each X-ray photon which is absorbed in the detector generates a cloud of electrons. The cloud may be confined in a single pixel or be spread over a number of adjacent pixels. Since only single-pixel events can be used for the calibration, the flux was kept low to achieve an average pixel occupancy of about 1% per frame. Because of the high flux of the source the exposure times could be kept in the ms range. The calibration profits from the 500 Hz frame rate of the detector since between 10000 and 100000 images were acquired for each individual target.
Application testing was performed at FemtoMAX with 2.8 keV and 4.9 keV photons, focused on a single pixel. Different Al foils were used to attenuate the beam and create femtosecond photon pulses with known integrated photon energies between 500 keV (corresponding to 100 Â 5 keV photons) and 5 MeV (corresponding to 1000 Â 5 keV photons). Fig. 6 shows the spatial distribution of a 5.3 MeV pulse. Analysing the test results, each PILATUS3 ASIC pixel can provide the photon count for up to 300 keV in ToT mode with an error of <10%. Since charge sharing helps to spread the incoming charge across multiple ASIC pixels, the detector can give photon numbers up to 2.5 MeV in a single focused pulse with an error of < 10%. The accuracy was evaluated by repeating the measurement a large number of times for the same number of photons per pulse. At 2.5 MeV cluster energy the spread in evaluated energy was around 200 keV FWHM, which means that the number of photons in the cluster could be calculated with an accuracy better than 90%. This development is most important to diffraction where the detected intensity is concentrated to spots. The study shows that it is possible to capture 200 Â 10 keV photons for a single pulse  incident on a single pixel. The maximum number of photons for any other photon energy is found from the total maximum energy which is 2 MeV incident on a single pixel.

Present status and outlook
The FemtoMAX beamline has been built and much of the performance has been verified. Beamline diagnostics, slits, focusing optics, monochromators, harmonic rejection mirrors and the sample camera have been commissioned. The laser system performs to specification and the synchronization between the laser and the RF is better than 30 fs RMS. Installing the new short-period undulators will increase the flux significantly. The required magnetic performance has been verified at the MAX IV laboratory and installation is planned for November 2017. The parameters that have been achieved are compared with the design values in Table 7. The remaining challenges mainly include optimization of the LINAC as a driver for FemtoMAX. The repetition rate is presently limited by the existing photo-electron gun which was developed for 10 Hz. A new photo-gun which can be operated at the maximum LINAC repetition rate of 100 Hz is being manufactured. The jitter between the RF and the electron bunches can be as good as 1 ps, which is within specifications but above the 100 fs (RMS) target. Table 7 Key parameters for the FemtoMAX beamline.