Design study for a compact laser-driven source for medical x-ray fluorescence imaging

Thomson scattering sources with their hard x-ray pencil beams represent a promising candidate to drive high-resolution X-ray Fluorescence Imaging (XFI). As XFI is a scanning imaging modality, it specifically requires pencil-beam geometries along with a high beam mobility. In combination with laser-wakefield acceleration (LWFA) such sources could provide the compactness needed for a future transition into clinical application. A sufficient flux within a small bandwidth could enable in-vivo high-sensitivity XFI for early cancer diagnostics and pharmacokinetic imaging. We thus report on a specific all-laser driven source design directed at increasing the photon number within the bandwidth and opening angle defined by XFI conditions. Typical parameters of driver lasers and electron bunches from LWFA are utilized and controlled within realistic parameter regions on the basis of appropriate beam optics. An active plasma lens is implemented for chromatic focal control of the bunch. Source performance limits are identified and compared to existing x-ray sources with regard to their potential to be implemented in future clinical XFI. DOI: 10.1103/PhysRevAccelBeams.23.031601


I. INTRODUCTION
Synchrotron radiation (SR) sources have the potential to deliver hard x-rays with high photon number and low bandwidth within a small divergence angle. This makes them an important research tool in many disciplines, including medical research where they could enable novel imaging modalities, such as x-ray fluorescence imaging (XFI) [1][2][3][4][5][6]. Being a scanning imaging modality, XFI explicitly requires pencil-beam geometries, as the spatial resolution is determined by the x-ray beam size. XFI is a functional imaging modality based on the fluorescence signal of gold nanoparticles employed as tracers e.g., for early cancer diagnostics and pharmacokinetic studies. Hard x-rays (90 keV) are required to excite the K α gold fluorescence and enable in-vivo imaging. Recently, human XFI imaging became feasible by overcoming its intrinsic Compton-background problem for large objects [5].
Given the novelty of this discovery, there exist no dedicated XFI x-ray sources, yet. The required brilliant pencil beams are not easily realizable by clinical x-ray tubes with their highly divergent and broad spectrum [7]. There exist proof-of-concept XFI studies on synchrotrons [5]. However, as XFI is a scanning imaging modality (not like computed tomography using wide cone beams) it requires the ability of a source to scan a hemisphere from several angles, a condition which is not provided by large-scale synchrotrons. In order to transfer SR-based basic research on XFI to future clinical application and to increase the accessibility of SR in research and applications, compact source designs are required which still possess high-brilliance x-ray beam characteristics. Therefore, both electron acceleration and x-ray generation would need to be downsized toward laboratory scale.
In LWFA, a high-power laser focused into a plasma induces accelerating fields with gradients exceeding those of conventional accelerators by orders of magnitude [43]. This allows for the acceleration of electrons to energies in the GeV range on a cm scale [44][45][46][47][48]. Thus, LWFA significantly reduces the spatial requirements in comparison to conventional-accelerator-based light sources [49,50] while providing high-energy electrons required to drive x-ray sources of sufficient energies for XFI. The short acceleration stage enables LWFA setups with a high electron-beam mobility.
As both LWFA and TS are laser-driven processes, their combination allows for an all-optical compact setup [36,37,41,[51][52][53]. Motivated by the recent and current development of high-power lasers [54][55][56], an all-laserdriven brilliant hard x-ray source, where LWFA and TS are driven by a single laser system appears feasible in the near future. A beam splitter would divide the initial laser pulse into driver laser and Thomson laser, resulting in a pumpprobe setup with intrinsic synchronization of Thomson-laser pulse and electron bunch. The size of such an LWFA-driven Thomson source is then determined predominantly by the laboratory-sized footprint of the laser system [57]. The x-ray beam inherits the high mobility of the electron beam, a characteristic required for scanning imaging such as XFI.
So far, existing compact sources generally possess a low photon production per electron. The reasons for this are manifold and will be discussed in detail in this paper. As a consequence, currently ≳nC bunch charges [26,29,31] and MHz repetition rates [27,29,31] appear necessary to reach high photon fluxes in state-of-the-art compact SR-based x-ray sources and modern CTs [7]. Current LWFA-TS sources [34][35][36][37]41] do not easily reach such parameters and are generally operated with ∼10-100 pC and at 1-10 Hz. Apart from the flux, a further point of necessary improvement is the typically broad photon spectrum produced by such sources, as TS is highly sensitive to both electron energy spread and divergence.
In this paper, we determine the performance limit of an optimized LWFA-driven TS source at reachable experimental parameters and evaluate the potential of such a dedicated source to drive XFI.
In Sec. II the challenges and design considerations of TS sources are presented and the optimization goal is defined. We examine the Thomson interaction process via simulations, the applicability of existing theory and elaborate on their differences with respect to the special case of a confined observation cone. Based on our results, we propose an optimization process for the Thomson interaction process combining theoretical calculations and simulations. This process provides the laser and electron focal parameters which lead to maximum effective photon production within a design bandwidth and divergence. We propose to employ chirped and parabolic mirrors to adjust the laser properties. Active plasma lenses (APLs) [58][59][60][61][62][63] allow for electron focusing and exerting control on the focal parameters of the bunch. The TS results of APL-focusing are compared with an unfocused bunch of finite energy spread. We show that the problem of large x-ray bandwidths from initial electron properties can be overcome due to the chromatic focusing of APLs. The dedicated optimization process allows us to define the requirements on bunch charge, repetition rate and pulse energy in Sec. III. In Sec. IV we present an overview on state-of-the-art compact sources and discuss their applicability in XFI, including this paper's results (Tables II, III). Separate from this application-centered line of argument, we provide an in-depth description of the extensive optimization procedure including the methods used in the Appendixes. This added context allows the reader to react to changes in technological capabilities or future shifts in application requirements and adapt our conclusions accordingly.

II. THOMSON SOURCE
Thomson sources are often promoted as high photon energy sources of intrinsic small divergence. These characteristics are compatible with XFI requirements given in Table I. A suitable source requires a sufficient flux within a small bandwidth, and the source should allow for scanning of the target under investigation, e.g., the patient in clinical XFI. In the following discussion, our Thomson source design shown in Fig. 1(a) is developed.

A. General radiation characteristics and design considerations
In the electromagnetic field of a laser, a relativistic electron oscillates due to the Lorentz force and emits radiation upon this acceleration [ Fig. 1(c)]. A measure for the laser's intensity I 0 is the laser strength parameter a 0 . It is defined as the normalized electric field amplitude [9,64] where e and m e are the electron charge and mass, respectively, E 0 is the electric field amplitude of the laser, ω the laser frequency and c the speed of light. The photon energy radiated by an electron of velocity β and Lorentz factor γ is given by [65,66]:  [5].
E γ 90 keV ΔE γ =E γ ≤15% FWHM θ AE0.5 mrad N γ;eff =ðs mrad 2 Þ 10 9 ph=ðs mrad 2 Þ with E L ¼ hc=λ the laser photon energy, a 0 the laser strength parameter [Eq. (1)], α the interaction angle between laser and electrons and θ obs the scattering angle of the photon with respect to the electron propagation direction. In our paper, we will focus on the so-called head-on geometry where α ¼ π [ Fig. 1(b)]. In its mean rest frame, the oscillating electron may be regarded as a Hertzian dipole and the emission angle in forward direction is Lorentz contracted. This is the synchrotron angle θ S ∼ 1=γ which lies in the sub-mrad divergence regime for electron energies of γ > 1000 [17]. In the ideal case, i.e., an electron bunch of vanishing divergence in a continuous laser field (transversely and longitudinally), the photon production μ id , i.e., the number of photons per electron emitted into the full solid angle, is [16,[66][67][68] with the number of emitted photons N γ , the number of electrons N e , the fine structure constant α f , the number of oscillations, i.e., laser periods N 0 , and the laser strength a 0 . The photon production μ=2 is the emission into the synchrotron angle θ S , and while in general a low divergence, i.e., an intrinsic pencil-beam geometry, could be obtained from sufficient electron energies, the use of the full synchrotron angle is not an option for applicationoriented sources, both in terms of photon energy, as well as x-ray bandwidth. The XFI design divergence of 1 mrad would require γ ∼ 1000. First, this electron energy is an order of magnitude higher than required for a photon energy of 90 keV, according to Eq. (2), leading to MeV photon energies for typical λ ∼ 1 μm lasers. Second, as 1=γ ¼ 1 mrad is the opening angle with respect to a single electron, the bunch divergence would have to be of the order of 1 mrad, as well, or even below, to maintain this source divergence. And third, even in the aforementioned ideal case, the Thomson spectrum possesses a bandwidth of ∼50% within the full forward opening angle θ S [see Eq.
The intrinsic energy-angle and intensity-angle relation of the Thomson radiation of a single electron is an important aspect in designing an application-oriented source. Both, the photon energy and photon number are maximum on axis and decrease with increasing observation angle θ obs . The number of photons emitted into a confined angle AEθ is given as [66] with the percentage of photons radiated into AEθ and the bandwidth κ associated with that collimation angle θ. Regarding single-electron emission, the bandwidth contribution κ ≡ ΔE γ =E γ from the collimation angle AEθ is given by [66]: Employing an on-axis pin hole for collimation makes use of the energy-intensity-angle relation [Eqs.
(2), (5)] to reduce the bandwidth and is thus the first design aspect included in our setup [ Fig. 1(a)]. Only the high intensities and energies of the x-ray spectrum are emitted into the pin hole, while lower intensities and energies are cut [69][70][71]. Consequently, reduction of the spectral bandwidth and of the source divergence is obtained in a single step, so that potentially lossy spectral x-ray filters may be avoided altogether. The intensity and energy range emitted into the pin hole depend on the collimation angle θ and the synchrotron angle θ S . A first approximation of the percentage of photons radiated into the design divergence of AE0.5 mrad can be achieved assuming a uniform photon number distribution within θ S : According to Eq. (2), electrons of γ ∼ 120 in a laser of λ ¼ 800 nm are required to obtain a peak x-ray energy of E γ ¼ 90 keV (assuming the linear regime, where a 0 ≪ 1). With A S ≈ πθ 2 S ¼ π rad 2 =γ 2 being the solid angle given by the synchrotron angle and A θ ≈ π × ð0.5 mradÞ 2 being the solid angle confined by the pin hole, only A θ =A S ¼ ð0.5 mradÞ 2 · γ 2 ∼ 0.4% of the photons emitted in forward direction are radiated into the pin-hole area.
The Thomson process has been extensively studied [8][9][10]13,65,66,[72][73][74][75] and means to maximize the total photon yield N γ and to reduce the bandwidth have been proposed [74,76]. These are evaluated with respect to our special case of a confined radiation cone and compared to simulation results in Sec. II C and in the Appendix A. Basic characteristics of a TS source and following design requirements with respect to low bandwidth and high photon production can already be derived from Eqs. (2), (3).
A large photon production μ requires long interaction durations, thus long laser pulse duration τ and Rayleigh length Z R ¼ πw 2 0 =λ, with the laser focal waist w 0 and wavelength λ, during which the overlap of electron bunch and laser beam has to be maintained. Therefore, the head-on geometry is favorable in terms of longitudinal overlap. Methods to overcome the laser's Rayleigh limit such as traveling-wave Thomson scattering (TWTS) [72,77,78] and plasma channels to guide the laser [66,79,80] may provide larger photon numbers in case of sufficient laser pulse energies. However, in the pumpprobe setup proposed here, where a single laser system drives both LWFA and TS, the pulse energy available for TS is limited to several 100 mJ to 1 J in current medium to high repetition-rate systems [37,41]. It is thus not the Rayleigh length, but the number of available laser photons that limit the photon production. Attempted compensation via scattering at large a 0 approaching the nonlinear regime, defined as a 0 ≥ 1, typically results in two issues. On the one hand, more photons are emitted into higher harmonics (nE γ ), multiples of the required XFI photon energy. On the other hand, due to the pulsed nature of the laser and the longitudinal and transverse intensity profile, broadening of the x-ray spectrum increases [66,71,75,[81][82][83][84][85][86] as can be seen in nonlinear TS experiments [24,34,[39][40][41]. In a hypothetical laser of constant field amplitude, all electrons would experience the same amplitude during the interaction and thus emit the same photon energy, according to Eq. (2). However, in pulsed lasers, a transverse and longitudinal field gradient is present. Depending on its position x, y, z relative to the laser, as well as on the time of interaction t, an electron will experience the laser strength a 0 ðx; y; z; tÞ ≤ a 0 whereâ 0 is defined as the maximum laser strength parameter. The radiated photon energy is then given by [75] E γ ∝ 1 1 þ a 0 ðx; y; z; tÞ 2 =2 : ð7Þ With increasing peakâ 0 , the available range of values Δa 0 ¼â 0 increases. Consequently, a moderateâ 0 is required for the bandwidth, resulting in moderate μ. For fixed pulse energies, increasing the laser intensity via strong laser focusing reduces the Rayleigh length and thus does not increase the photon number production. So far, means to reduce the bandwidth were linked to a reduction of μ, as well. This often imposes high demands on the bunch charge Q bunch ∝ N e and the repetition rate to reach the required fluxes for an application.
However, the resulting x-ray photon number and bandwidth depend on the a 0 distribution that is actually experienced by the single electrons of a bunch during the interaction. We refer to it as the effective laser-strength distribution, i.e., the distribution which contributes to the Thomson spectrum. Photon production and bandwidth contribution depend on the mean and the width of this distribution, i.e.,ā 0;eff and Δa 0;eff , respectively. As the distribution depends on the laser profile and the overlap of bunch and laser so do μðā 0;eff Þ and ΔE γ ðΔa 0;eff Þ [71,75]. As a consequence, the design requires focal control to optimize laser and electron parameters. For LWFA-driven TS sources, the Thomson laser requirements differ significantly from those of the LWFA-driver laser, in terms of intensity, duration and focal waist. While nonlinear LWFA, e.g., requires short laser pulses (∼50 fs, depending on the plasma wavelength) at high intensity, a moderate intensity and long pulse durations (∼ps) are beneficial for TS sources, as stated above. Thus, separate beam optics are required to manipulate duration and focusing individually, e.g., via chirped and parabolic mirrors [37]. A discharge-capillary active plasma lens (APL) [59][60][61][62][63] allows for single-element symmetric electron bunch focusing at short focal length [60,63] while preserving the beam emittance [62].
The proposed all-laser-driven setup including laser and electron optics and the pinhole is shown schematically in Fig. 1.

B. Optimization goal: Effective photon production μ eff
For sources dedicated to a specific application, such as XFI, the brilliance of a source, typically employed to quantify its performance, is no good measure for its suitability. The brilliance is defined as the photon flux per mrad 2 and mm 2 within a 0.1% bandwidth. By that, it is a mathematically determined value that provides no information on the spectrum actually reaching the target and thus, e.g., whether further spectral filtering is required. In TS, the bandwidth in a single observation direction might be small while the full-opening angle has a large bandwidth [66,70]. Thus, the obtained brilliance would neither account for applicability nor for photon number efficiency.
In order to find a good measure, we need to determine the goal of the optimization. Typically, this can either be the minimum bandwidth, the maximum photon number, or both. In our case, the bandwidth is the more crucial parameter. A too large bandwidth of the incident photon spectrum leads to a reduced sensitivity [5]. A lower photon number can theoretically be compensated with a larger number of shots per second. In other words, the design bandwidth needs to be achieved in each shot, not so the photon number.
To relax the demands to realistic parameters for a LWFA-TS x-ray source, we aim at optimizing the interaction itself, in that we strive at maximizing the effective photon production μ eff . It is defined as the number of photons emitted per electron into the cone of AE0.5 mrad and the bandwidth of 15% FWHM. This quantity also enables the comparison of different types of electron-based x-ray sources. A normalization with respect to the laser pulse energy or laser strength parameter would be more representative for the efficiency of a TS source, but limits the comparison to laserdriven sources. A simple approach assuming a uniform spectrum yields the effective photon production: with μ θ the photon production within the confined cone of opening angle AEθ which typically needs to be determined numerically. The ideal effective photon production μ eff;id is calculated according to Eq. (3). It refers to the ideal case, i.e., a single electron propagating head-on through a laser field of constant field amplitude a 0 ðx; y; z; tÞ ¼â 0 transversely and longitudinally. As in this case, the effective field amplitude is independent of the electron position with respect to the laser coordinates, μ eff;id marks the maximum achievable amount for a given laser parameter set, as a 0;eff ¼â 0 . Consequently, the optimization of a nonideal interaction can be quantified by the ratio of the achieved and the ideal photon production μ eff =μ eff;id . This value would approach unity for ideal overlap. However, it should be noted that an electron traveling on axis will always experience the effective longitudinal intensity range Δa 0;eff;long .

C. Bandwidth and photon yield theories
In order to determine the performance limit of our design, and therefore find the optimum parameter configuration, we review existing theory on Thomson bandwidth and photon production with respect to XFI requirements.
The bandwidth theory of a Thomson source has to distinguish between the so-called on-axis bandwidth BW onaxis , often employed to quantify synchrotron sources and the bandwidth within a confined opening angle, as relevant for XFI. In this paper, two bandwidth theories are compared to the simulation results (see Appendix A). Reference [66] gives FWHM bandwidth calculations for the on-axis bandwidth, as well as for a confined opening angle. Apart from the collimation angle θ in Eq. (6), the bandwidth of the Thomson source is increased by several electron, laser and geometrical parameters. A finite energy spread Δγ=γ of the electron bunch leads to spectral broadening because electrons of different energies emit different photon energies. Due to the quadratic dependence in Eq. (2), the according bandwidth contribution BW onaxis ¼ 2Δγ=γ can quickly become dominant with increasing energy spread. The divergence of an electron bunch increases the on-axis bandwidth, due to the angular shift of the single-electron emissions. Electrons, traveling at an angle Δα with respect to the mean propagation direction, will emit lower-energetic photons into an on-axis pin hole. In Eq. (2) this corresponds to Δα ¼ −θ obs ≠ 0 and BW onaxis ¼ ðγΔθÞ 2 =4 [66,68] with Δθ denoting the FWHM electron divergence angle. The contribution from the laser bandwidth is BW onaxis ¼ Δλ=λ. Broadening from the intensity profile of the laser is assumed to scale asâ 2 0 =2. The on-axis x-ray bandwidth is obtained by quadratic addition of the single on-axis contributions [66,87]: A first estimate of the bandwidth within a confined cone combining Eq. (9) and the cone angle contribution κðθÞ from Eq. (6) reads [66]: This approach assumes that the confined cone cuts equivalent parts of the single-electron spectra. With increasing bunch divergence, this is no longer valid. Also, it neglects that an increasing opening angle broadens only the lowenergy side of the spectrum. Under the assumption that all contributions to the bandwidth are of Gaussian shape, the resulting x-ray spectrum is as well. For a Gaussian function, the ratio of the RMS and FWHM is constant, allowing to retrieve both values from the formulas in [66]. Several bandwidth contributions, however, are asymmetric. Thomson spectra from different bunch and laser parameters are thus of different shapes and rarely approximated by a Gaussian distribution. Consequently, the broadening from the bunch divergence is overestimated since it neglects its asymmetric nature, as the divergence only increases the low-energy contributions. Moreover, assigning a constant bandwidth to a laser beam of peakâ 0 and divergence Δθ neglects overlap effects and the resulting effective distributions a 0;eff and σ θ;eff whose widths determine the x-ray bandwidth. In Ref. [75] a bandwidth theory is introduced which is independent of the spectral shape. Overlap-dependent effective a 0;eff and effective bunch divergence σ θ;eff are taken into account which are not found in Ref. [66]. The RMS bandwidth with respect to the mean photon energy [75]: may be calculated with the RMS bandwidth contributions from the effective laser intensity with an overlap-dependent factor C: and from the effective bunch divergence As a consequence, a largeâ 0 does not necessarily result in bandwidth broadening. However, as this theory determines the emitted and not the detected spectrum, the effect of the confined cone is not taken into account. For bunch divergences on the order of or larger than the aperture angle, the bandwidth contribution exceeds the simulation results. Furthermore, this theory neither assumes a spectral shape nor provides this information. None of the bandwidth theories provides reliable information on the spectral shape for crucial parameter regions, such as high laser intensities and divergences and are not designed for the special case of an aperture. As a consequence they cannot replace numerical simulations in our case where this information is important for the XFI application. For the calculation of the expected photon number from an electron bunch in a Gaussian laser, we closely follow Ref. [66]. It takes into account both the effect of the overlap and the radiation into the confined cone, and thus allows to evaluate the laser and electron focal parameters.
For a head-on collision geometry without relative longitudinal, transverse and temporal displacements, the total yield can be calculated on the basis of the Thomson cross section σ T ¼ ð8π=3Þr 2 e with the classical electron radius r e ¼ e 2 =ð4πε 0 mc 2 Þ, the number of electrons and laser photons in the interaction N e and N L , respectively, as well as the longitudinal beam sizes σ l;e and σ l;L , the transverse beam sizes in the focus (σ e and σ L ¼ w 0 =2) and their β functions (β Ã e ¼ σ 2 e =ε and β Ã L ¼ Z R ) [66,88]: where and The photon number within a confined cone can then be determined numerically, taking into account the bunch divergence σ θ [66,88]: with the total yield N γ , the modified Bessel function of the first kind I 0 , the observation angle θ obs , the energy of the emitted photon normalized to the maximum energy of the fundamental y ¼ E γ =E γ;max andθ ¼ ð1 − yÞ=ðγ 2 yÞ. This approach was developed for linear Thomson scattering. It is valid if no photons are emitted into higher harmonics. As this is already the case in the weakly nonlinear regime, deviations from the numerical simulations are obtained, in the sense that the full photon yield is overestimated. However, the general efficiency of the Thomson interaction in terms of overlap and emission into the cone is well represented, so that qualitatively, this approach still allows retrieving the laser and electron parameters for a givenâ 0 (see Appendix Fig. 4) which provide the highest cone photon number.

D. Laser and electron bunch optimization
Common theoretical optimization processes of TS, e.g., in Ref. [66], aim at photon production maximization, independent of the photons' emission direction. By assuming σ e ≪ σ L , transverse overlap effects are neglected and optimization only relies on confining the available laser photons longitudinally to the interaction region. For that, the laser pulse length cτ, must lie within the Rayleigh range 2z R of the laser: with the laser's Rayleigh length z R ¼ πw 2 0 =λ and the speed of light c. In a Gaussian laser, the laser strength parameter a 0 depends on the pulse energy E p , the duration τ, the wavelength λ and the focal waist w 0 as follows [71]: with the electron charge e and mass m e and the vacuum permittivity ε 0 . From this one obtains the recipe for laser optimization, yielding the optimum focusing w 0 and duration τ at a given laser strength parameterâ 0 and laser pulse energy E p : Stretching the laser via imprinting a longitudinal chirp is a means to reduce the broadening effect on the x-ray spectrum [71,74,76,89,90] as it can result in a reduced effective laser bandwidth Δλ eff < Δλ, depending on the electron-laser overlap [71]. While laser optimization has been thoroughly studied, overlap-dependent bandwidth theory was only recently introduced [75]. The influence of electron-bunch optimization, as well as of angular confinement of the detector is investigated in detail, in the Appendix A. Both simulations and calculations show that there exists an optimum electron divergence and waist for a given laser parameter set, where the configuration for maximum photon production μ θ matches that of the lowest bandwidth ( Fig. 4 in the Appendix). The reason is the optimized overlap. We find that by transversely confining the electrons to the laser center the effective laser strength parameter as experienced by the electrons increases, while the experienced range Δa 0;eff decreases. Due to the confined opening angle, the bunch divergence for a pencil-beam optimization needs to be smaller than required from overlap considerations alone. The developed optimization process is given in this paper's Appendix A 2 and employs Eqs. (15)- (18) to find the parameters for highest cone photon production μ θ for a given laser strength parameter. Thereupon, trajectory-based classical radiation simulations determine the spectral broadening.
The results show that two of the main reasons for broad spectral widths from Thomson sources, namely from (weakly) nonlinear a 0 and from bunch divergence, are significantly reduced while the photon production is increased. This further enables the use of higher laser intensities to achieve an even higher photon production. Moreover, higher-harmonics generation is no major concern due to the confined opening angle, as the second harmonic is not emitted on-axis and harmonics generation of even higher order is negligible in the regarded regime of a 0 ≲ 1 [91]. Nonlinear spectral broadening of the fundamental, though reduced, is still a limiting factor with regard to the bandwidth of the spectrum emitted from a monochromatic electron bunch. The dominant effect on the bandwidth, however, remains the electron energy spread which is the reason for broad x-ray spectra in most existing sources.

III. DESIGN RESULTS
Our design aims at optimizing the Thomson scattering spectrum from a given laser and LWFA system with respect to a specific application, in our case XFI. In order to determine the performance limit of a realistic LWFA-TS setup, we have chosen the following parameters: As model for realistic driver-laser parameters, we have chosen the 200 TW laser system ANGUS at LUX [57]. Of the initial 5 J pulse energy, ∼90% are required for the LWFA process to achieve sufficient laser intensities in the plasma. For all simulations, the pulse energy in the Thomson laser pulse is fixed at E p ¼ 0.5 J, unless stated otherwise. The Thomson laser has a longitudinal and transverse Gaussian shape. Its duration, wavelength, bandwidth and repetition rate are inherited from the driver laser ANGUS τ ¼ 25 fs, λ ¼ 800 nm, Δλ ¼ 40 nm FWHM, f ¼ 5 Hz. For the preservation of low normalized bunch emittance values as regarded here (ε n ¼ 0.2 mm mrad) [92], space-charge effects arising from large bunch charges [93] should be avoided. To circumvent this effect, a sufficiently low bunch charge of Q ¼ 10 pC was chosen for the simulations, an amount easily achievable by today's laser-plasma accelerators [94][95][96].
As described above, source optimization requires control of the laser and electron parameters which is achieved by chirped and parabolic mirrors for laser focusing, and an APL for electron bunch focusing. Typically, the electron energy spread is the main source of spectral broadening of TS sources. With an XFI bandwidth limit of ≤15%, the allowed electron energy spread is Δγ=γ ≤ 7.5% not taking into account other broadening effects. Chromatic focusing has proven to be a means for effective-energyspread reduction [97] and further motivates the implementation of an APL. Applying our optimization process (Appendix A 2) to the given setup yields the parameters given in Table II. The APL is tuned in such a way that the design parameters in the focus are reached for the targeted electron energy which gives 90 keV photons according to Eq. (2). This is not the same as the total focus of the full bunch with non-zero energy spread. The bunch focusing is shown schematically in Fig. 2. The chromatic focusing effect (inset) allows probing part of the electron spectrum and thus reducing the effective electron energy spread. The detailed analysis of the setup via simulations, including tolerance and arbitrary collision angle studies, is presented in Appendix B.
The comparison of the TS interaction at the plasma exit with the implementation of an APL in Fig. 3 and Table III demonstrate the advantage of the latter. The maximum effective photon production for TS with an APL-optimized bunch focus is μ eff ¼ 7.2 × 10 −3 ph=el into the design divergence and bandwidth. A similarly high effective photon production for the TS with an unfocused bunch ðμ eff ¼ 6.7 × 10 −3 ph=elÞ is only reached for optimum conditions. On the one hand, this implies optimum initial bunch parameters so that after a small drift length of 0.8 mm, the bunch parameters within the interaction region are similar to the found optimum. On the other hand, low electron energy spreads are required. In a realistic setup, both might be difficult to realize. A distance of 3 mm already leads to a μ eff decrease by a factor of ∼1=3. And for electron energy spreads of more than 2.5% RMS, the x-ray source bandwidth exceeds the XFI limit of 15% FWHM. The APL setup allows for larger distances between plasma exit and APL. Chromatic focusing leading to the observed APL-focusing setup. The transverse RMS bunch size σ x is plotted as a function of the propagation distance after the plasma target at z ¼ 0. Free drift is shown as green, the APL as red shaded area. The inset displays the single electron trajectories in the focal region for an electron bunch of 10%RMS energy spread. Electrons at target energy are colored green, lower (higher) energies in blue (red).
The simulation results of the Thomson spectra are shown in terms of the bandwidth BW θ (a) and effective photon production μ eff (b) for interaction at the plasma exit for different distances (blue, dashed blue and cyan) and after APL focusing in the target and total focus (red and orange). (c) x-ray spectra obtained from a 10% RMS energy spread bunch without (blue) and with APL focusing (red, orange).
bandwidth saturation sets no limit to bunch energy spreads. Moreover, the photon production and bandwidth are very resistant in lieu of realistic pointing and offset deviations of the driver laser. The proposed setup can deliver 90 keV pencil beam x-rays with the design bandwidth. With a bunch charge of Q ¼ 10 pC, μ eff ¼ 7.2 × 10 −3 ph=el results in 4.5 × 10 5 photons per shot. For a repetition rate of f rep ¼ 5 Hz (cp . Table V), we obtain a photon intensity of 2.25 × 10 6 ph=ðs mm 2 Þ within the design bandwidth and divergence. The design photon number of 10 9 photons=mm 2 for a single line scan would be reached after 7 min, exceeding realizable scanning times for the clinical implementation. There are three ways to reduce the scanning time of our x-ray source: Increase (1) the number of shots per second, i.e., the source repetition rate, (2) the number of electrons per shot, i.e., the effective bunch charge, and (3) the number of photons emitted per electron, i.e., the effective photon production. Higher repetition rates are the most favorable option, as the photon production per second grows linearly with f rep . With a repetition rate of e.g., 1 kHz and a slightly increased bunch charge the scanning time would be reduced to 1 sec per line scan. As it is the effective bunch charge which determines the photon number per shot, the full bunch charge required depends on the bunch energy spread and spectral shape. Note that the bandwidth saturation in Fig. 3(a) indicates that the bunch charge within an energy band of 5% RMS determines the effective bunch charge. For Gaussian energy spreads as investigated here, a bunch charge of 27 pC is required in case of a 1% RMS energy spread bunch, 42 pC for 5% RMS and 70 pC for 10% RMS. At these values of the bunch charge, the transverse expansion is emittance-dominated for realistic bunch durations of ∼10 fs and space-charge effects can be neglected [93]. A constant repetition rate of 5 Hz is currently not an option, as the required bunch charges of ∼5 nC=MeV exceed demonstrated charge densities in LWFA experiments [98] by three orders of magnitude.
An increase of μ eff is possible via the pulse energy E p . For larger E p higher focal intensitiesâ 0 are obtained for weaker laser focusing at longer interaction duration. Optimum transverse overlap is obtained for weaker electron bunch focusing. However, as the interaction is already optimized with respect to a 0 -related broadening, the intensityâ 0 ¼ 0.55 should not be exceeded, in order to avoid further increase of the x-ray bandwidth, due to the longitudinal Δa 0;eff ∝â 0 . The Rayleigh length is fully filled. Hence, the pulse energy gain will be used to increase the interaction duration and thereby the photon production [cp. Eq. (3)] at constantâ 0 . A simple approximation is employed to estimate the gain in μ: The interaction duration is given by the laser pulse duration and the Rayleigh length, so that both τ and w 0 have to be increased. From Eq. (19) follows and from Eq. (20) so that with Eq. (3), the following relation between photon production and pulse energy is obtained for further increase of E p ≥ 0.5 J: Thus, a four-fold pulse energy is required to double the photon production and equivalently, μ eff .

IV. COMPARISON TO STATE-OF-THE-ART COMPACT SOURCE PROJECTS
So far, we have shown that the effective photon production can be significantly improved by proper optimization of laser and bunch parameters. The advantage of such optimized setups is a flux increase which is important for systems of limited repetition rate. The proposed setup including chirped mirrors for laser tuning and the chromatic bunch focusing via an APL allows reaching these parameters in the interaction region with an experimental design of small footprint. To put our results into context, the development of compact x-ray sources, either in proof-ofprinciple or dedicated experiments is discussed in the following. Table IV presents an overview of different projects, as well as this paper's result (see also Tables II  and III). The table compares the source type, energy E γ and opening angle θ, as well as the bandwidth BW θ and flux within θ. The laser strength parameterâ 0 and laser pulse energy E p are provided for laser-based x-ray sources, as well. The bunch charge Q and the repetition rate f rep are given to comprehend the calculated photon intensity. For each project, the effective photon production μ eff gives the number of photons per electron within a 15% FWHM bandwidth around the respective source energy E γ and AE0.5 mrad divergence. If possible, information on source dimensions and scanning mobility are included. Parameters given within a confined opening angle θ are marked accordingly. An asterisk symbolizes the requirement of further energy filtering, i.e., spectra with a bandwidth exceeding the design limit of 15% FWHM.
A comparison of the sources and an evaluation of their potential applicability in XFI is attempted, bearing in mind the different envisaged applications of the projects. A good example is the ELBE/PHOENIX project [24,75]. It is not built as a light source but as diagnostics for electron bunch properties. Thus, regarding our design goal of an XFI source, PHOENIX as well as other projects with their respective applications, might not or only partly appear suitable. The according evaluation and comparison, however, can serve as a measure for the general potential of the projects with respect to a broader application range. And it gives an overview on the current performance levels of compact x-ray sources.
Concerning their applicability in XFI, the different projects exhibit different challenges and limitations.  (3) and (8), assuming BW θ ≤ 15%: and with γ ¼ 120 and σ½κðθ ¼ 0.5 mradÞ from Eq. (4)-(6) μ eff;id;ThomX ¼ 1.2 × 10 −6 ph=el: The lowâ 0 of the Thomson laser is the main reason for a small effective photon production. The deviation by one order of magnitude of μ eff;ThomX ¼ 10 −7 from μ eff;id;ThomX shows the potential for laser and bunch optimization. For comparison, in case of our design result, the ratio is 40%. The x-ray beam parameters, as well as the small footprint (100 m 2 ) would make ThomX a suitable source for XFI. Dedicated optimization would further increase the source flux and decrease treatment time. However, this setup may lack the required scanning mobility. In principle, the highest mobility and photon fluxes at lowest footprint are reached by modern CT tubes [7]. In the cw mode, currents of ∼1 A produce a high flux of 2 × 10 16 photons per second into the hemisphere above the focal point. This current can be maintained for a duration of ∼4 s, so that average flux values are significantly lower. Derived from the brilliance at 90 keV which amounts to B ∼ 2 × 10 6 ph=ðs mrad 2 mm 2 0.1% bandwidthÞ [7], the effective photon production within the design values for divergence (AE0.5 mrad), area (AE0.5 mm) and bandwidth (15% FWHM ¼ 150 × 0.1% FWHM) amounts to: As the x-ray generation is based on bremsstrahlung, the radiation is highly divergent with a broad spectrum. This is the reason for the low effective photon production μ eff . Moreover, further energy filters are required. A small footprint, mobility and a sufficiently high x-ray photon energy can be obtained from LWFA-driven TS sources. Their flux, however, is generally lower than synchrotron-and linac-driven sources. This is due to lower bunch charges and repetition rates of LWFA-driven TS. Table IV provides a chronological overview on the development of such sources. While the bandwidth has slightly decreased over time, due to reduced electron bunch energy spreads, the effective photon production does not show improvement. Lowâ 0 values, e.g., for UNL(III) are partly responsible, but even at large laser strength parameter at UNL (I) and the LMU þ MPI project, the effective photon production is three orders of magnitude below our result. Firstly, this is due to the short interaction length. For example in case of UNL (I) with τ ¼ 90 fs, one obtains μ id;UNLðIÞ ¼ 1=14 μ id;design . Second, no bunch focusing or any optimization process is used in these projects. Moreover, the large bandwidth requires further filtering with probable further photon number efficiency decrease. Generally, a high photon flux (ph/s) is mostly obtained from a high repetition rate, while the Thomson interaction itself is not optimized.
In summary, we observe the following main causes for the differences in μ eff with respect to our design study: First, a lowerā 0;eff =â 0 and the opportunity to use largerâ 0 at reduced transverse spectral broadening is neglected. The utilized low Thomson laser intensities which are not mitigated by long interaction lengths lead to small photon productions μ in the first place [Eq. (3)] and subsequently to low values of μ eff . If the nonlinear regime is approached to increase μ, the result is a broadband x-ray source, i.e., low photon number per bandwidth. Second, nonoptimized Thomson interaction leads to losses in μ eff . E.g., with electron-bunch divergences exceeding the collimation angle, the cone effect can reduce μ eff significantly with respect to a possibly high μ. Third, a broad electron bunch spectrum leads to large x-ray bandwidths, as no energy spread filtering is implemented. Even in cases where the theoretical effective photon production is comparable to our design result, further filtering is required. This leads to photon number losses and consequently, lower μ eff can be expected in these cases.
Compared to existing sources, our source design combining laser-wakefield acceleration, chromatic focusing and Thomson scattering, delivers unprecedented effective photon production values at a low enough bandwidth, so that no further filters are required. In order to arrive at realistic treatment times the average photon intensity should be of the order of 10 9 photons per second per mrad 2 . The low flux obtained from parameters in Table V could most efficiently be moderated by higher repetition rates and slightly higher bunch charges. With a requirement of, e.g., 1 kHz repetition rate and a bunch charge of 30 pC this design photon intensity would be achieved, while both quantities (f rep , Q bunch ) are much lower than those theoretically required by most state-of-the-art sources presented in Table III. Finally, our all-optical setup is quite compact. Changing the electron bunch propagation direction via the driver laser pointing allows for coarse steering. Mounting the accelerating and TS stage on a movable arm would thus provide the mobility of the x-ray beam in 4π. Fine scanning is realized via a small-angle tilt of the APL (mrad).

V. CONCLUSION AND OUTLOOK
In this paper, we present a compact hard x-ray source design based on LWFA and TS with a photon number efficiency exceeding previously published results. For application scenarios requiring narrow-bandwidth pencil beams from such sources, we propose an optimization process exploiting existing theory [66,75] and combining it with simulations. As reference application we dedicate the design study to x-ray fluorescence imaging (XFI) [5]. Our results show that electron-bunch optimization proves to be highly beneficial for TS design, both, to increase the photon production, i.e., the number of photons per electron μ θ emitted into the design divergence and to decrease the bandwidth BW θ at a given driver-laser configuration. We thus demonstrate an effective photon production several orders of magnitude larger than that of the reviewed stateof-the-art compact x-ray sources, due to control of laser and electron bunch focal parameters. This control is achieved via optical chirped mirrors which provide the required laser pulse duration by imposing a longitudinal linear chirp. We propose the implementation of an active plasma lens for electron bunch focusing which is of twofold advantage. Achieving the design electron focus with respect to the laser focal parameters reduces the spectral broadening from the transverse laser-pulse intensity profile while at the same time increasing the photon production. This relaxes the limitations on laser intensity. Moreover, the APL serves as an effective energy filter on the electron spectrum. This overcomes the problem of large x-ray bandwidths due to broad electron spectra potentially present in existing source designs. Consequently, our design is not limited by the bunch energy spread and does not require any spectral x-ray filters (besides the pin hole). The setup is relatively tolerant in the presence of pointing (∼mrad) and offset (∼μm) instabilities in an experimental setup.
For the clinical implementation of full-body in-vivo XFI, a scanning time of 1 s per scanning direction is targeted, i.e., a photon intensity of 10 9 photons= sec within AE0.5 mrad and 15% FWHM bandwidth. With the repetition rates currently provided by high peak-power lasers, the resulting photon flux as obtained from the proposed setup would be too low as scanning times would be too long. The high effective photon production of 7 × 10 −3 ph=e at E p ¼ 0.5 J is unprecedented compared to existing sources and to TS sources with sub-Joule-level pulse energies. It significantly relaxes the demands on repetition rates from MHz down to 1 kHz, as well as on bunch charge (Q eff ∼ 30 pC=1% RMS energy spread) and laser pulse energy (E p ¼ 0.5 J) in comparison to those of high-flux state-of-the-art sources presented in this paper. This results in a photon yield of 1.3 × 10 6 ph=shot and > 10 9 ph=s. Thus, with these parameters the design photon intensity is reached. Future improvements in high-power laser technology with an increase in the repetition rate toward kHz [56,101] hold promise to fulfill the envisaged clinical application.
Another possible future concept for TS is travelingwave Thomson scattering (TWTS). It was proposed [72,73,77,78] as a means to increase the interaction duration without being limited by the Rayleigh length. There, the laser pulse front is tilted to match the bunch path. This is of interest for high-E p Thomson lasers in future laser systems and for arbitrary collision angles. The underlying physics and consequences for the applicationoriented optimization presented in this paper does not change for TWTS. However, overlap and bunch optimization for this method are still to be investigated.
Regarding the experimental realization, the requirements and geometry of the setup pose several challenges. Our design study is based on experimentally feasible, but challenging qualities of the electron bunches and the driver laser. The Thomson laser inherits a duration of 25-30 fs from the driver laser and has to be stretched by a factor of ≳50 to 1.7 ps, while also imprinting a linear longitudinal chirp. This requires several chirped mirrors or gratings and thus a long enough delay line for the LWFA laser in order to achieve temporal synchronization of electrons with the Thomson laser at the interaction point. We show that the electron bunch requires a low divergence and small focal waist, i.e., a low emittance, to obtain a high effective photon production. The distance of the APL from the plasma target exit, even at low electron divergences, has to be rather small (∼cm), to ensure no electrons are clipped and lost for interaction. The driver laser would have to either travel through the APL or be diverted before the capillary. Another challenge of the proposed setup is the head-on collision geometry. The colliding laser would have to be focused with an off-axis parabola and an on-axis mirror with a hole in the center, large enough to avoid electron or x-ray photon collision. Furthermore, the setup should prevent the colliding laser from entering the driverlaser beam path and damaging the laser system.
We believe that our optimization process may serve as a guideline for future experiments aiming at maximizing the efficiency of a TS source. Our results show that LWFAbased TS in combination with APL focusing is a good candidate for future small-scale high-quality x-ray sources as it provides bandwidth and photon energy control, as well as the required scanning mobility. discussions. T. B. acknowledges the support of the Gleichstellungsfonds der Universität Hamburg 2016.

APPENDIX A: SIMULATION-BASED OPTIMIZATION OF ELECTRON-BUNCH AND LASER OVERLAP AND CONE-EMISSION
The initial parameters are motivated in Sec. III of the main manuscript and summarized here, in Table V. For all simulations, the pulse energy in the Thomson laser pulse is fixed at E p ¼ 0.5 J, unless stated otherwise. Upon these parameters, the duration τ, focal waist w 0 and laser strength parameterâ 0 are varied. When split from the LWFA-driver laser, the duration of the laser pulse is typically on the order of several 10 fs, depending on the plasma parameters utilized for the plasma acceleration. TS, however, is likely to require elongation of the pulse duration. This is achieved by chirped mirrors, thus obtaining a longer pulse duration by imposing a chirp on the laser pulse. Though not matched to the longitudinal intensity profile I(z) to obtain a flat a 0 ðzÞ distribution, as proposed for bandwidth reduction [74,76,90], a chirp reduces the contribution of highest and lowest wavelengths in the laser profile and thereby the effective laser bandwidth, as well. This effect is due to the higher photon emission close to the laser focus where a 0 is largest [cp. Eq. (3)]. The longitudinal chirp reduces the range of wavelengths effectively contributing to the x-ray spectrum [71]. The magnitude of this effect depends on the parameters of the Thomson laser and the electron bunch and their overlap.
Here, we present the effect of electron bunch focal parameters on the Thomson spectrum within a pin hole of AE0.5 mrad. In the following discussion, the subscript θ denotes variables defined within this confined cone angle. For the simulations we employ the general particle tracer (GPT) [102] to calculate the electron-trajectories in the free drift and during the interaction with the fields of an APL and a colliding laser. Using these trajectories, the emitted radiation is simulated with the CLARA2 code [103,104]. Based on the purely classically Liénard-Wiechert potentials and assuming incoherent radiation, this code is capable of quantifying the directionally resolved radiation spectra [105] during nonlinear Thomson scattering. Up to 10 4 macroparticles were tracked at time steps of λ L =80=c and evaluated with an energy resolution < 50 eV and an angular resolution of <10 μrad.
The target electron energy γ t is defined as the kinetic energy providing E γ ¼ 90 keV photons according to Eq. (2). The kinetic bunch energy γ AE σ γ should be set to γ t or include γ t in its spectrum, preferably at peak dQ=dγ.
The goal is to maximize the contribution of electrons at the target energy to the Thomson spectrum. Consequently, we set the energy spread of the bunch to zero for the optimization process. In Sec. IV where bunch propagation is included, finite energy spreads are included, as well.

Head-on collision
For a head-on Thomson scattering geometry, we elaborate on the effect of bunch optimization and evaluate the applicability of Thomson yield and bandwidth theories, the optimization processes for collimated sources and limits to the laser strength parameter.
For different laser configurations, the electron bunch focal waist σ e and thus the divergence σ θ are varied, according to [106] Consequently, a smaller focal waist increases the bunch divergence. The Courant-Snyder parameters [106] of a bunch with zero energy spread are calculated at a distance of ≳1.5cτ before the focus. This distance assures good separation of electron position and laser fields. The bunch is then propagated in a head-on geometry through the laser focus. The different configurations are listed in Table VI. As a starting point, we chose the linear case ofâ 0 ¼ 0.15, where only ∼5% of the energy is lost to higher harmonics [73]. The theoretical laser optimization according to Eq. (21) yields a laser focal waist of w 0 ¼ 12.3 μm and duration of τ ¼ 4.2 ps (Config I). Config II-IV vary the pulse duration,â 0 and the bunch emittance, respectively. The results of the electron bunch focus variation for all configurations are displayed in Fig. 4. The theoretical results for the photon production μ in the full forward opening angle (a) and the cone photon production μ θ within the 1 mrad cone (b) are obtained from Eqs. [(15), (18)]. Bandwidth calculations for both, the FWHM [66] (c) and the RMS theory [75] (d), are compared to the simulation results. The dependence on the focal waist ratio of laser and electron bunch σ e =σ L (left) and on the bunch divergence σ θ (right) is displayed. In (a), only theoretical results are shown. The results for the theoretically optimized laser configuration forâ 0 ¼ 0.15 are displayed in blue. Variations from this configurations are a larger bunch emittance (cyan), a longer laser duration (green) and a larger laser strength parameterâ 0 ¼ 0.5 (red).
The photon production μ in Fig. 4(a) is the number of photons per electron emitted into the full solid angle [Eq. (15)]. It therefore accounts for the interaction itself, i.e., the overlap of electron bunch and laser. For better visualization, it is normalized by the laser strength parameterâ 0 . For all configurations, μ=â 0 drops quickly, if either the bunch waist is too small, i.e., for large divergence, or if the bunch waist increases, i.e., at low divergences. This demonstrates that the electron bunch focus must not be neglected in source design to optimize the laser-bunch overlap. A strongly focused bunch leads to an increased hourglass effect, i.e., a large bunch size at beginning and end of the Thomson interaction. For weakly focused bunches the divergence becomes negligibly small and the bunch size stays constant during interaction. Maximum photon emission is thus obtained, when the mean bunch size is small compared to the laser waist. In a Gaussian transverse laser profile the electrons are then confined to the largest a 0 values. This increases the effectiveā 0;eff and thus the total photon production in compliance with Eq. (3). Consequently, there exists an optimum bunch focus, defined as the point of maximum μ.  . 4. Photon production μ, cone photon production μ θ and collimated bandwidth dependence on electron-laser waist ratio σ e =σ L and electron bunch divergence σ θ . Bunch waist and divergence are related via Eq. (A1). For various laser parameters (legend), the photon production μ in the full synchrotron angle (a) and μ θ within the collimation angle θ ¼ AE0.5 mrad (b) are displayed. The collimated bandwidth BW θ for the FWHM theory along Ref. [66] and the RMS theory along Ref. [75] are shown in (c) and (d), respectively. Theoretical results are represented by lines, simulations as markers. The parameters for the different configurations are found in Table VI.  Fig. 4. In configurations I, III, and IV the laser waist w 0 and duration τ are set according to the theoretical optimum Eq. (21 This optimum is not identical for the different configurations. The interaction length depends on the laser duration and the laser waist determines the spatial distribution of a 0 . Hence, the optimum bunch waist is dependent on the laser configuration. A large bunch emittance increases the hourglass effect, shifting the optimum to larger waist ratio and aggravating the degradation of μ at large divergence. Highest photon production is obtained for configuration II (green) where the laser focal waist is smaller and the pulse duration is longer, than the theoretical optimum according to Eqs. (19) and (21) of configuration I (blue). Obviously, in the presence of bunch optimization, the assumptions the theoretical optimization is based upon no longer hold: Transverse overlap is adjustable via the bunch focus. While pulse durations exceeding the Rayleigh range will slightly decreaseā 0;eff , this is mitigated by a larger number of oscillations N 0 . Consequently, the term N 0ā 2 0;eff in Eq. (3) increases.
In our case, we do not only rely on overlap improvement, but the effect of collimation is important. This is investigated in Fig. 4(b) where the results of the photon production within AE0.5 mrad, μ θ , are displayed for both, theory (lines) and simulations (markers), again normalized byâ 0 . First of all, we observe that numerical calculations and simulations of the cone photon production agree well for lowâ 0 . For Config. III (red), μ θ appears to be overestimated. Nevertheless, for all configurations, we find that the bunch focus parameters yielding maximum μ θ coincide for simulation and theory. Consequently, the theory along Eqs. (15)- (17) can be employed to determine the optimum bunch focal parameters for a given configuration. This allows avoiding costly parameter scan simulations.
Comparing μ θ (b) to μ (a) reveals the difference of optimization with respect to the emission into a confined opening angle. The bunch divergence has a stronger impact on μ θ than on μ. As electrons emit the maximum intensity in their propagation direction, with increasing divergence, more photons are radiated into directions outside of the confined cone. Consequently, electron bunch optimization in the special case of a confined cone differs from total yield maximization, as both the overlap and this cone effect have to be taken into account. The optimum bunch configuration is shifted to larger bunch waists and lower divergence values. Small deviations from this optimum lead to significant photon yield loss. Again, maximum μ θ and optimum bunch focus depend on the chosen configuration. Highest μ θ at lowâ 0 is again obtained for longest pulse duration (green). The lowest value is reached for highest bunch emittance (Config IV, cyan). The highest photon yield is obtained for the laser configuration of largestâ 0 ¼ 0.5 (red). It thus underlines that a largeâ 0 , which is associated with spectral broadening, ultimately appears to be the most effective way to increase the photon production.
The collimated bandwidth displayed in Figs. 4(c,d), however, show deviations between simulations and theory. The FWHM theory [66] is in good agreement with the simulations for configurations I and II at low divergence σ θ ≲ 2 mrad. The theoretical bandwidth BW theo is larger than obtained from simulations BW sim for largeâ 0 on the one hand and for large divergence values, on the other hand. In both cases, we claim that the theory overestimates the bandwidth for the following reasons.
First, a bandwidth increase proportional to σ 2 θ does not take into account the underlying characteristic of divergence-related bandwidth broadening. As shown in (a), the overlap effect of a large divergence can be neglected within the regarded parameters σ θ < 7 mrad. Singleelectron emissions can be assumed to be similar in terms of photon number and bandwidth. The nature of the divergence effect is then solely angular, in that the relative angular shift of the single electron emissions increases the bandwidth within the confined cone. However, with increasing propagation angles, electrons emit radiation of lower intensity into the collimation angle. This is illustrated in Fig. 5. A mono-energetic electron bunch (left) emits highest energy E γ and highest number of photons (color scale) on axis θ ¼ 0. The result is a banana-shaped angular spectrum where collimation cuts low-energy photons and reduces the x-ray bandwidth. In a bunch of 2.5 mrad divergence (right), the single electrons have different propagation angles with respect to the axis. They will emit low-energy photons at θ ¼ 0, but also fewer photons, the further their emission direction is displaced from the axis. Further increase in bunch divergence has no impact on the on-axis spectrum due to vanishing x-ray intensity and thus the bandwidth should even saturate.
Second, the optimization of the electron bunch focus has an effect on the bandwidth, as well, which is neglected in current theoretical models. The transverse confinement of electrons to the highest laser fields, which is a measure to increase μ θ viaā 0;eff maximization, has a reducing effect on the spectral bandwidth. The effectiveā 0;eff is increased because fewer electrons interact with low a 0 values. In other words, the width of the effective a 0;eff distribution is also reduced. With Eq. (2) we immediately realize that this results in a lower bandwidth, as well. Optimized bunch focusing can thus be viewed as the transverse equivalent to the bandwidth reduction via longitudinal laser chirp, as both measures reduce Δa 0;eff . As a consequence, we observe lowest bandwidth at maximum μ θ . But moreover, we receive lower x-ray bandwidths even at high peakâ 0 . Both are vital findings for our optimization process. The FWHM bandwidth theory neglects the overlap dependent Δa 0;eff and assumes a constant contribution ofâ 2 0 =2 which for Config. III would amount to 12.5% FWHM on axis. The RMS bandwidth theory in (d) is calculated via Eqs. (11)- (14). Configurations I & II (blue, green) show reasonable agreement between simulation and theory. For all configurations and predominantly configurations III & IV (red, cyan), however, the simulation results exceed the theory. This is valid until the simulation bandwidth saturates with increasing divergence. The RMS theory as presented in [75] was developed as means to validate the measurements at PHOENIX/ELBE. It allows to calculate the effectiveā 0;eff and divergenceσ θ;eff values which are based on the emission, hence the overlap of laser and electron bunch. They are thus weighted by the emitted intensity and not by the detected intensity. Hence, large emittance and divergences of the order of the cone angle or higher are not represented by this approach. Therefore, the saturation at large divergences is not included. Due to the special optimization goal arising from the application, the theory cannot replace simulations in the optimization process. The optimization of maximizing the number of photons within the design divergence and 15% of the peak x-ray energy of 90 keV requires obtaining information on the spectral shape (E γ;peak ≠ E γ;max ≠Ē γ and ΔE γ ). Thus, we need both the peak of the a 0;eff distribution and Δa 0;eff but not the meanā 0;eff , as defined in the RMS theory.
Due to the good qualitative agreement of both bandwidth theories with the simulations in the range around the bunch focus optimum, they may serve as means to provide starting values for the optimization process and later as a validation method for the simulation results.

Optimization process
The optimization process aims at finding the best compromise between the overlap and the cone optimization and hence between a small waist and a low divergence. As the positions of maximum cone photon production μ θ and bandwidth BW θ coincide, the optimum laser and bunch configuration can be determined with Eqs. (15)- (18). We also found that increasingâ 0 to increase μ θ is possible without dramatic increase of the bandwidth. However, a limit toâ 0 in terms of spectral bandwidth cannot be established analytically, but requires simulations.
We thus apply the following process: First, the pulse energy E p and electron bunch emittance ε n are fixed. Thereupon, different values ofâ 0 are chosen within a reasonable range. For eachâ 0 , the laser configuration w 0 and τ and the bunch focus σ e with energy γðâ 0 Þ are varied. We employ Eqs. (15)- (18) to determine the number of photons emitted into the confined cone (θ) for each parameter set. The evaluation limits of the normalized photon energy dy in Eq. (18) are adjusted according to the desired photon energy band. The best laser and bunch configuration is defined via the maximum μ θ ðâ 0 Þ.
Thereupon, we perform simulations for eachâ 0 and Δγ ¼ 0 with these configurations to establish the bandwidth and the effective photon production. In order to determine the optimum, the (effective) bunch energy spread has to be taken into account. This reduces the maximum allowed x-ray bandwidth from the simulations: Finally, the configuration with the highest effective photon production μ eff within the allowed bandwidth limit is chosen as the optimum.
In order to retrieve the best configuration for our x-ray source, this process is now applied to our parameter set (Table V). Figure 6 displays the optimum pulse waist (a) and duration (b), the cone bandwidth (c) and the photon productions (d) μ θ (blue) and μ eff (red) with respect to the peakâ 0 of the Thomson laser. The theoretical results (black lines) are again included to demonstrate the difference in optimum laser configurations, as well as to show the overestimated bandwidth and photon production with increasing laser strength parameter. The XFI bandwidth limit of 15% FWHM (green line) marks theâ 0 limit above which the cone photon production μ θ and the effective photon production μ eff differ, as lower photon energies are emitted into the design bandwidth. The maximum of μ eff then marks the optimum parameter set associated with the accordingâ 0 . As predicted, bunch optimization reduces Δa 0;eff . It thus allows for largerâ 0 values, hence higher values of μ eff , than theoretically obtained from imposing the XFI bandwidth limit to Eqs. (9), (10). In case of a monoenergetic electron bunch, the optimum laser strength parameter isâ 0 ¼ 0.67. As BW θ increases with a nonzero energy spread, the XFI limit of the monoenergetic-bunch simulation decreases, according to Eq. (A2). This is shown in Fig. 7 (green). With that, theâ 0 limit declines. Limiting the bandwidth from the monoenergetic electron bunch to 10% results inâ 0 ∼ 0.55.
Then, the ratio of ideal and simulated effective photon production amounts to μ eff;sim =μ eff;id ¼ 0.4. The according parameters are given in Table II and are utilized for simulations in the following sections.

Arbitrary collision angles
In case of experimental collision angles smaller than the preferable 180 degrees, different overlap-effects have to be taken into account. Equation (15) and hence the abovementioned optimization process is not applicable for such geometries. The presented optimization relies solely on simulations.
The results are displayed in Fig. 8. Depending on the laser waist and duration, as well as on the collision angle, the electron bunch might not travel through the whole longitudinal extent of the laser. Thus, with increasing Δα,   the optimum pulse duration (a) decreases. The electrons will, however, propagate through the full transverse laser profile. Hence, as means to elongate the interaction duration, an increase in w 0 is preferable (a). As a consequence, the overlap effect of small mean bunch size as promoted for head-on collisions will prove less effective in bandwidth reduction and photon production increase via the effective transverse a 0 distribution. The optimum bunch focal waist σ e;opt (a) is still much smaller than w 0 , in order to probe the central high-a 0 part of the laser, now both transversely and longitudinally. As the overlap of the laser and electron beams is quickly lost in nonhead-on geometries, the photon yield decreases rapidly with increasing interaction angles (b). The bandwidth (b) decreases, however slightly, as well.

APPENDIX B: ELECTRON BUNCH PROPAGATION AND ENERGY SPREAD
Now that we established the optimum configurations for the target electron energy, realistic electron bunches with a nonzero energy spread are simulated. In order to include an energy spread, the bunch propagation has to be defined. Here, both is included in the simulations. As shown in Fig. 2, an electron bunch exits the LWFA plasma at z ¼ 0 and is later focused by an active plasma lens (red). The Thomson interaction with an unfocused bunch behind the plasma target is compared to that with an APL-focused bunch. For both scenarios, the impact of the bunch energy spread and the spatial and temporal variation of electron and laser focus are investigated.
For the shape of the energy spread we chose a Gaussian distribution around the target electron energy γ t with varying width, due to the energy-dependence of the electron contribution to the collimated x-ray spectrum which depends on the ratio of the collimation and the synchrotron angle 1=γ. As we keep the x-ray collimation angle fixed (AE0.5 mrad), electrons at γ > γ t will emit more photons into the cone, also with a larger bandwidth contribution [Eq. (6)]. The opposite holds for γ < γ t . As a consequence, an unfocused electron bunch will only lead to a peaked x-ray spectrum, if the electron spectrum is peaked (at γ t ), as well.

Interaction at the plasma exit
Electron-bunch optimization shows that a small mean size and a small divergence is beneficial for both, the photon production, as well as the bandwidth of the Thomson source. LWFA-accelerated electron bunches are promoted with small emittances [92,107] and theoretical means have been published aiming at a divergence reduction and suppressed emittance growth at the transition from plasma to vacuum [108,109]. The photon production and bandwidth are determined by the mean electron bunch size, so that bunch focusing is not generally necessary.
This motivates the analysis of Thomson spectra from unfocused electron bunches where the interaction takes place close to the plasma exit, marked with an arrow in Fig. 2. Mind, however, that without focusing optics, the predetermined optimum parameters (Table II) for the bunch are not reached for arbitrary initial parameters. Again, an emittance of ε n ¼ 0.2 mm mrad [92] is assumed. The electron bunch exits the plasma in its focus with a focal waist of σ e;0 ¼ 1 μm (Table V), slightly lower than the determined optimum bunch waist (Table II). The laser has a pulse energy of 0.5 J, a duration of τ ¼ 1.7 ps and a focal waist of w 0 ¼ 5.2 μm, resulting in a laser strength parameter of a 0 ¼ 0.55 (Table II). As the bunch size grows according to the bunch divergence, the distance of the interaction point from the plasma exit in z direction is an important parameter and its impact on the Thomson spectrum is investigated. Moreover, as the Thomson bandwidth is limited by the XFI application, the electron bunch energy spread is a crucial factor in the applicability of this setup.
The lowest distance from the plasma exit is given by the laser pulse duration. In order to assure a good separation of electrons exiting the plasma from the laser field, the low limit is again set to 1.5cτ ∼ 0.75 mm. The distance from the target Δz is increased to 1.5 mm and 3 mm. The energy spread of the bunch is varied from zero to 10% RMS.
In a symmetric electron energy spread distribution as, e.g., the simulated Gaussian, the energy spread has no significant effect on the photon yield. Photon yield loss within the confined cone due to smaller electron energies, i.e., larger synchrotron angles, is balanced out by the increased yield contribution of electrons of larger energies. Note that this is an idealized approximation of the spectral shape and does not hold for electron spectra with an asymmetric energy distribution. Figure 3 shows the x-ray bandwidth (a) and the effective photon production (b) for the different energy spreads. The results of the interaction without APL-focusing are displayed for Δz ¼ 0.8 mm (blue), Δz ¼ 1.5 mm (blue dashed), and Δz ¼ 3 mm (cyan dashed). At large values of energy spreads Δγ=γ, this contribution is dominating. The bandwidth is then given by ΔE γ =E γ ¼ 2Δγ=γ. Large bandwidths thus lead to a decrease in the effective photon production for BW θ > 15% FWHM. Due to the growth of the electron bunch size and the consequent decrease ofā 0;eff , the μ eff decreases with increasing distance Δz. At a distance of 3 mm, wherē σ e ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ε n =ðγσ e;0 Þ 2 Δz 2 þ σ 2 e;0 q ¼ 4.8 μm, already 60% are lost. The distance Δz has a small impact on the spectral bandwidth. Assuming that electrons of smaller energy γ obtain a larger divergence according to Eq. (A1), theirā 0;eff will be lower. This decreases their contribution to the spectrum even more. The result is a slightly smaller x-ray bandwidth.
For bunches fulfilling the energy spread condition σ γ =γ ≲ 2.5% RMS and experimental setups allowing for an interaction at a distance where the bunch parameters are comparable to the optimum bunch parameters, here <1 mm, an effective photon production of μ eff ∼ 6 × 10 −3 is obtained. In this case, solely Thomson laser optimization is sufficient and electron bunch focusing is not required. However, experimental feasibility of small Δz might be the limiting factor, as the Thomson laser has to be prohibited from entering the driver laser beam path. Also, vacuum chamber placements and diagnostics optics might limit the available space. Moreover, small emittance and divergence at the plasma exit are the premises for this setup.

Active plasma lens focusing
A discharge-capillary active plasma lens (APL) is a gasfilled cylindrical tube with electrodes at either side [60]. A charge is applied between the electrodes, so that, at breakdown, a current flows axially through the tube. The resulting magnetic field is radially symmetric and possesses a high field gradient ∂B ϕ =∂r ¼ μ 0 I 0 =ð2πr 2 0 Þ. By that, electron bunches can be focused symmetrically by a single element to short focal lengths and thus small focal waists. Here, we assume a linear radial magnetic field gradient in the capillary without temperature-related effects [61,62]. Also, fringe fields at the capillary edges play no role [63].
Due to the energy dependence of the focusing strength k ¼ eð∂B ϕ =∂rÞ=ðm 0 γcÞ, i.e., the chromaticity of the APL, electrons of higher (lower) energy obtain a longer (shorter) focal length and larger (smaller) focal waists. For the required photon energy of the Thomson source, an optimum electron energy was identified. In the following discussion, this energy will be referred to as the target energy γ t ¼ 129. An APL-focused electron bunch of nonzero energy spread obtains a smeared out asymmetric focus, as shown for σ γ =γ ¼ 10% in Fig. 2 (inset), owed to the chromaticity effect of the lens. The total bunch's focal point, defined as the point of smallest transverse bunch size, is shifted toward smaller values in comparison to the target focal point. This is referred to as the total focus. Each electron's kinetic energy determines its contribution to the Thomson spectrum. In Ref. [97], chromatic focusing via a quadrupole doublet reduces the effective energy spread of an electron bunch in a magnetic undulator. Electrons of target energy are focused onto a small on-axis detector behind the undulator, while electrons of different energy obtain different divergences. Target-electron contribution to the spectrum is thus increased because of the emission of highest intensity into the electron propagation direction. This procedure cannot be adapted here, as both, the cone effect, as well as the overlap have to be taken into account.

a. Head-on collision
The lens parameters were adjusted to obtain the design parameters of the electron bunch in the target focus.
The transformation of the Courant-Snyder parameters [106] can be calculated via the matrix formalism for beam transport in the free drift: 0 and within the APL: with C ¼ cos ϕ, S ¼ sin ϕ and ϕ ¼ L ffiffi ffi k p . Different sets of lens parameters result in the same focus parameters for the target energy γ t electrons. When choosing the lens parameters, it should be ensured that the whole bunch enters the capillary, i.e., that the transverse bunch size at the APL position z 0 is smaller than the radius r 0 of the capillary (preferably σ e < r 0 =2, in order to remain in the region of linear field gradients [60]). The length of the plasma lens affects the strength of the chromaticity effect, i.e., the longitudinal separation of the energydependent focal points. The lens configuration utilized in our simulations yields the design parameters (Table II) and is given in Table VII. The results for the APL-TS bandwidth BW θ and effective photon production μ eff are included in Fig. 3 (a,b, respectively). The results for the interaction center coinciding with the target focus (red) and the total focus (orange) show a decrease for μ eff with increasing energy spread. It is comparable to that of the unfocused bunch at lowest distance from target (blue). At zero energy spread, it is slightly larger, as the design parameters are reached for all electrons in the APL case. The collimated bandwidth increase, however, is not proportional to the energy spread. Even more so, it appears to saturate at large energy spreads, at ≈17% FWHM. The reason is the chromatic focusing effect, leading to an effective energy spectrum of narrower spread than the initial bunch spectrum. The contribution of electrons deviating from the target energy is reduced, resulting in a smaller effective bunch charge and thus a smaller effective photon production, as well.
Here, the reasons for energy-dependent contribution differ from those in Ref. [97]. On the one hand, this is due to the intrinsic relation between electron energy and the opening angle of the emission θ S . Due to the fixed collimation angle, electrons of smaller energy and thus larger emission angle will emit less photons into the confined cone at a smaller cone bandwidth. On the other hand, the chromatic focusing has two effects on the singleelectron contributions, which are a characteristic feature of TS and not present in magnetic undulators. First, the different divergence and focal waist values for different energies lead to less contribution from electrons with parameters deviating from the previously determined optimum. Second, the longitudinal smearing of the single energy-slice foci in the bunch in combination with the limited interaction region given by the laser length limits the number of electrons at reasonable transverse size within the interaction region. Adjusting the lens parameters and the interaction region to the electrons at the target energy thus increases their contribution. The contribution of electrons at different energies is lessened. This is also the reason for the bandwidth saturation, where electrons too far from the target energy have no impact on the spectrum, anymore.
Note that assuming the same bunch charge for bunches of different energy spread translates to decreasing charge per percent energy spread at increasing total energy spread. This was chosen to demonstrate that x-ray bandwidth reduction through chromatic focusing is a result of effective electron energy-spread reduction by reducing the number of interacting/contributing electrons to those near the target energy. As a consequence the effective photon production-which is normalized by the full bunch charge-decreases with increasing energy spread. Regarding the number of photons emitted per electron in a specific energy range, this quantity would increase and saturate analogous to the bandwidth. The decrease of μ eff ðσ γ =γÞ in Fig. 3(b) should thus not be mistaken for a decrease in quality or efficiency.

b. Tolerance
Several geometrical parameters have an impact on the resulting spectrum. Here, a short overview is provided. The results are presented in Table III. First, a precise adjustment of laser and target electron focus is required to obtain the design x-ray energy. Second, the experimental feasibility of a head-on collision might be difficult. Consequently, an evaluation of deviations from this angle is required. Third, the laser and electron bunch are subject to angular and positional jitters, changing the interaction geometry.
Due to the chromatic focusing of the APL, the x-ray source energy is sensitive to the position of the interaction. Depending on the interaction plane the laser focus coincides with the foci of electrons of different energies (Fig. 2 inset). The effect on the x-ray spectrum is illustrated in Fig. 3(c) where the green area marks the XFI design bandwidth. Here, all spectra for the largest simulated energy spread σ γ =γ ¼ 10% RMS are shown. If no APL is employed (blue), the width of the x-ray spectrum is given by twice the bunch energy spread. As mentioned before, this spectrum is peaked due to the peaked electron spectrum. APL focusing allows enhancing the contribution of electrons at specific parts of the energy spectrum to the emitted radiation while decreasing that of other energies, thereby probing only parts of the available electron spectrum and hence of the blue x-ray spectrum. Adjusting the focal plane to the focus of γ t yields a distribution highest at the design energy of 90 keV (red). A shift of the interaction plane to the focus of γ < γ t , e.g., to the total focus, leads to an x-ray spectrum around 80 keV, i.e., an x-ray energy shift of > 10%. As a consequence, the photon production within the energy band around 90 keV is reduced by a factor of 3.6 at σ γ =γ ¼ 1% RMS compared to the target focus interaction result.
The driver laser of the plasma acceleration is subject to nonideal effects, such as angular (pointing) and spatial (offset) deviations from the ideal propagation axis. The accelerated electrons are assumed to inherit pointing and positional jitter from the driver laser. Typically reached positional jitters are as low as 1 μm. As a reference for the pointing jitter, experimental data from Ref. [110] is consulted to assume 0.3 mrad RMS. Here, we examine offsets up to 3 μm and pointing up to 2 mrad [94]. For the simulations, an electron bunch with either an offset or pointing angle at the plasma exit is propagated through the setup in Fig. 2. An APL maps the initial focus onto the focal plane. As the design focus of 1.25 μm is of approximately the same order as the initial focus at the plasma exit (1 μm), offset and pointing at the interaction plane are only slightly lower as at the plasma exit. For a finite initial offset, the electron bunch in the focal plane is transversely shifted with respect to the Thomson laser. This reduces the effectivē a 0;eff and leads to a decreased μ eff . In our case, the overlap has been optimized, so that the focal bunch waist is smaller than the laser waist. For offsets of the order of σ e ∼ 1 μm, the decrease in μ eff is therefore only ∼5%. With an offset larger than σ e , e.g., of 3 μm, the effect becomes more significant, leading to a loss of >40%. An initial pointing angle is basically a collision angle deviation of few mrad. However, the pin hole is adjusted to the on-axis propagation direction of the bunch, so that for finite pointing angles, x-ray photons of lower energy and intensity are radiated into the cone. Still, at pointing angles smaller than the bunch divergence, the effect is negligible. With a divergence of the order of 1 mrad (Table II), a pointing angle of 0.5 mrad results in a 1.4% reduction of μ eff , while the bandwidth stays constant at 11.5%. At large initial jitter values, it might be beneficial to use the APL as a stabilizing element by increasing the focal length and waist. This leads to lower jitters in the interaction plane.