A low energy ion beamline for TwinEBIS

A low energy beamline has been designed for the TwinEBIS setup. The beamline will be used to transport ions extracted from the electron beam ion source into an accelerating radio frequency quadrupole or into secondary devices, like a time of flight-mass spectrometer, attached to the beamline via a fast three way 20̂ ion switchyard. Optional injection of ions from an external source into the electron beam ion source is foreseen. In this article the general layout of the beamline is presented and supported with simulations of the ion-optical matching. Furthermore, the switchyard and gridded electrostatic lenses, chosen as the main focusing elements, have been simulated to assess their impact on the beam quality and the dynamics of secondary electrons emitted by the gridded lenses. In addition, the beamline includes general diagnostic devices, including a bidirectional pepperpot beam profiler. An overview of the diagnostic elements is given.


Introduction
The TwinEBIS setup [1] at CERN serves as a test stand for the research and development of Electron Beam Ion Source (EBIS) [2,3] technologies. Currently, it features a novel high-compression electron gun of the Brillouin type, called MEDeGUN, which combines electrostatic and magnetostatic compression to provide a high current density electron beam for efficient charge breeding [4]. The goal of this project is to demonstrate a high-rate production of fully stripped carbon ions for applications in next generation linac-based hadron therapy facilities [5][6][7]. The carbon beams are expected to reach peak currents of 3 mA and have a normalised RMS emittance of about 0.02 mm mrad at a specific kinetic energy of 15 keV/u. In order to extend the capabilities of TwinEBIS, a low energy ion injection and extraction beamline is going to be installed at the test stand. The primary purpose of the beamline is to establish the properties of the carbon ion bunches extracted from the highly compressed electron beam and to test the injection of these ions into a 750 MHz accelerating Radio Frequency Quadrupole (RFQ) [8]. A set of electrostatic focusing elements and deflectors will be available to optimise the beam transmission and the injection of ions into the RFQ. Additional devices, e.g. an external ion source, can be attached to the beamline via a pulsed three way switchyard. To enable a full characterisation of the beam and the evaluation of the EBIS charge breeding efficiency, the beamline will feature a number of diagnostic devices.
-1 -Combining the optical requirements of the beamline with the implementation of a large number of diagnostic devices is a design challenge. Both the EBIS with the highly compressed electron beam and the RFQ have a small transverse acceptance. Therefore, providing an ion optical system with low aberrations is crucial to prevent an emittance blow-up of the transported beam. To minimise the effect of space charge blow-up, the beam line between EBIS and RFQ is kept as short as possible and offers large apertures, such that the beam can be transported with a large radius. To reduce the length and also the cost of the beam line, short (50 mm) and strongly focusing gridded electrostatic lenses are used as the main optical elements.
This article presents the design of the beamline and summarises the beamline simulation results. First, the layout of the beamline is presented and the ion optical matching of the beam for both ion injection into and extraction from TwinEBIS is discussed. Thereafter, some key components are presented in more detail. This includes a discussion of the ion beam switchyard and its impact on the beam quality, and a presentation of the electrode profile of the correcting deflectors, which have been optimised for a large aperture. Furthermore, the gridded electrostatic lenses were simulated in detail to assess the impact of the micro-lensing effect at the wire grid, and to understand the dynamics of secondary electrons generated in beam-wire interactions. Finally, we give an overview over the diagnostic equipment with emphasis on a novel bidirectional pepperpot emittance meter.

Beamline structure
The Low Energy Beam Transport (LEBT) system has been designed with a primary extraction beam line in the straight forward direction, and two secondary branches which are accessible through a ±20°electrostatic switchyard. The structure of this beamline is illustrated in figure 1. While the primary beamline is devoted to providing a small aberration beam transport and robust optical matching from the EBIS into the accelerating RFQ, the additional branches provide a high flexibility and modularity of the setup, at the cost of a slightly reduced beam quality in these sections. The secondary branches offer room for the installation of a Time-of-Flight (ToF) mass spectrometer and an external ion injection line.
For the purpose of reducing the expansion of the ion beam by space charge forces, an early acceleration of the ions upon leaving the electron beam inside the EBIS is important. Therefore, an acceleration gap is located close to the ion extraction electrode of the EBIS and used to accelerate and focus the ion beam. During conventional operation, the TwinEBIS platform is biased at 30 kV with respect to the beamline at ground potential. The acceleration tube features an internal voltage divider consisting of 9 conducting rings to create a uniform axial field and to reduce the probability of stray particles impinging on and charging up the ceramic insulator. Since the voltages of the ion extraction electrode and the voltage divider are generally fixed, an additional ring electrode (adaptor electrode) is installed in between these elements, to facilitate the regulation of the potential gradient and hence the electrostatic focusing strength of this section.
To accommodate a large beam and compensate for the defocusing space charge forces, the beamline is equipped with a set of large-aperture ion-optical elements. The two main focusing elements are gridded electrostatic lenses (cf. section 4), located shortly after the acceleration gap and just before the RFQ. The switchyard and the diagnostic chamber, housing the pepperpot beam profiler and a Faraday cup, add considerable length to the setup. Therefore, an Einzel lens is used   (2), followed by the adaptor electrode (3) and the acceleration gap (4). Two gridded lenses (5) and an Einzel lens (6) provide the focusing. A set of small angle deflectors (7) and the strong switchyard deflector (8) are available as steering elements. The RFQ will be located in the forward location at port (I); the side ports (II) provide space for additional devices. Additionally, there are two Faraday cups (A) and a pepperpot beam profiler (B).
in this long gap to reinforce the focusing of the gridded lenses. In addition, there are two sets of horizontal and vertical deflectors for trajectory corrections. The large horizontal deflector also acts as the kicker for the switchyard and allows for fast switching between the different ports. The main use for the fast switching is to combine external ion injection with the extraction of the charge bred ion beam into one of the other ports. The beam line was designed with an optimal radial acceptance of 20 mm, meaning that the aberrations for a beam with a total radius smaller than this value are tolerable. The minimum physical transverse aperture is located at the entrance of the switchyard deflector with a gap of 50 mm.

Ion extraction and transport into the RFQ
One of the challenges for the TwinEBIS beamline is the extraction of high current carbon bunches and their injection into an RFQ. The ion bunches have a length of < 10 µs and an anticipated -3 -

JINST 13 P08012
Drift tube e − supressor e − collector Ion extractor I II III IV peak current of up to 3 mA, at an energy of q · 30 kV. The starting conditions for the ion beam are determined by the interaction of the ions with the electron beam inside the EBIS and by the separation of the ions from the electron beam in the electron collector. After separation from the electron beam, the ion beam dynamics are governed by the optical elements in the LEBT and ion space charge. The simulations for the extraction from the EBIS and the transport in the LEBT have been performed separately.

EBIS extraction
It is expected that, in the process of charge breeding, the space charge of the EBIS electron beam will be nearly fully neutralized by ions. Hence, the ion space charge inside the EBIS cannot be neglected and the ions and electrons need to be seen as equally important contributors to the extraction dynamics once the magnetic field approaches zero and no longer dominates the electron beam. The starting plane of the mixed beam simulations is located in the last drift tube of the EBIS, cf. figure 2, at a magnetic flux density of 180 mT. The initial conditions for the electron beam in the last drift tube were calculated with the Herrmann formula and assuming a Brillouin flow [9]. The initial ion beam parameters are translated from an ion distribution in the central trap using conservation of the normalised transverse emittance, i.e.
Here, , R, and T denote the emittance, radius, and transverse energy of the ion distribution respectively. The subindices TC and LD describe the trap centre and the last drift tube of the EBIS. Further, it is assumed that the transverse energy relates to the potential well within the electron beam ∆U as Except for the Brillouin electron beam, this is comparable to the approach presented by Dickerson et al. [10]. Here, the ion beam radius R T C ≈ 150 µm has been assumed to be 1.5 times larger than the electron beam at a current of 1 A at 10 keV in a magnetic field of 2 T. The transverse ion energy spread is assumed to correspond to the potential well ∆U T C of the non-neutralised electron beam in the trap. Based on these quantities, R LD is chosen in such a way that, combined with the resulting total potential well inside the ion beam in the last drift tube ∆U LD , equation (3.1) is fulfilled.

Parameter Value
Twiss α x,y 0.3 Twiss β x,y 0.01 mm/mrad Normalised full acceptance 0.17 mm mrad Specific kinetic energy 15 keV/u Using TRAK [11] the electron and ion beams were traced out of the magnetic field and their space charge fields calculated iteratively in a 2D simulation, until a self-consistent solution is found. While the electrons are stopped in the collector, the ion beam was tracked all the way out of the EBIS. Right after separation from the electron beam, inside the extraction electrode of the EBIS, the ion beam has a normalised RMS emittance of about 0.02 mm mrad.

LEBT matching
Since the mixed beam TRAK-simulations in the magnetic field of the EBIS are computationally very demanding, the LEBT studies have been performed separately, using conventional LEBT simulation tools. The field maps of the relevant optical elements were generated with Superfish [12] and subsequently loaded into Travel [13] for particle tracking simulations including space charge effects. The voltages applied to the different elements of the beamline were tuned with the aim of maximising the fraction of the beam in the RFQ acceptance, whose relevant parameters are listed in table 1.
The ion beam has a waist in the field free region of the extraction electrode, which was chosen as the handover point from the extraction simulations to the LEBT simulations, cf. figure 2. The test beam consisted of 20 000 particles and had a Gaussian distribution in both real and phase space, with an initial normalised RMS emittance of 0.02 mm mrad, a 95 % beam radius of 2.5 mm, and Twiss α x,y = 0. The maximum expected peak current of 3 mA was used for the tracking and matching studies. The matching of the LEBT was performed by adjusting the voltages of the four elements that have an optical effect on the beam parameters; these are the adaptor electrode, the two gridded lenses and the Einzel lens. The voltage of the ion extractor and the divider in the acceleration gap are used to control the dynamic in the extraction and, therefore, were not used as matching parameters.
A two-step procedure has been chosen to perform the matching. In order to find an initial working set of operational voltages, a telescopic matching was established first. This means that the first gridded lens is used to parallelise the divergent beam coming from the EBIS, the Einzel lens serves to compensate space charge defocusing, and the second gridded lens focuses the beam into the RFQ acceptance ellipse. The voltage of the adaptor electrode was optimised by minimising the emittance growth between the extraction electrode and the first gridded lens. The voltages determined by this approach are given in the first column of table 2. In this configuration only 55 % of the beam current fits in the RFQ acceptance (4D, horizontal and vertical phase space combined).
In the second step of the procedure, a range of voltages around each value determined for the -5 - Adaptor = 23 kV, Gridded lens 1 = −9 kV telescopic matching was selected (cf. table 2). All possible combinations of these values were then simulated in order to find the best matching into the RFQ. The results of these scans were summarised in a catalogue of injection efficiency maps. Figure 3 shows the map featuring the highest transmission. The optimisation increased the matching efficiency to 88 %. A follow-up higher resolution scan of the second gridded lens voltage has confirmed this value. The optimised values are given in the last column of table 2. Figure 4 illustrates how the different matching settings (telescopic and optimised) are reflected in phase space. The improved overlap between the beam and the RFQ acceptance for the optimised matching is clearly visible. The tails in the phase space plots are assumed to be the result of a combination of space charge defocussing and spherical aberrations in the ion extractor and adaptor electrode, before the particles are accelerated. The RFQ has not been manufactured yet and studies of the preliminary design have demonstrated that the acceptance ellipse can be adjusted within a certain margin without affecting the general performance. Therefore, it will to a certain extent be possible to adapt the acceptance to the measured parameters of the real beam once the beamline has been set up. The improved injection efficiency of the optimised matching setup is also reflected in the evolution of the emittance along the beamline. Figure 5 (bottom) shows the emittance for the telescopic and optimised matching cases. In both cases, a quick growth of the emittance is observed in the extractor, most likely due to strong space charge forces in the tightly focused, low energy ion beam. The largest improvement in terms of emittance for the optimised matching is seen following the Einzel lens, which is the optical element where the voltages for both optical setups differ the most (cf. table 2). The irregularities in the emittance evolution around the lenses are interpreted to be the result of higher order distortions of the phase space distribution, which are not accounted for in a second order moment description. The normalised RMS emittances in the RFQ entrance plane are 0.034 mm mrad and 0.03 mm mrad for the telescopic and optimised matching respectively.
Another important observation concerns the envelope of the matched beam in the LEBT. Figure 5 (top) shows that the beam size for currents up to 3 mA stays below 25 mm at all times, and only exceeds 20 mm around the first gridded lens. Smaller beam sizes are expected for lower beam currents. The beam occupies only ≤ 50 % of the available bore of the lenses, therefore avoiding the area where aberrations are more severe. The bottleneck of the line is represented by the switchyard deflector where the ratio of beam size to bore is 80 %. Thus, there are no losses at this location in an error-free setup.

Ion injection
While a highly compressed electron beam like that of MEDeGUN promises a very efficient charge breeding due to the high current density, external ion injection into the electron beam is challenging due to its small radius. If ions are not injected into the core of the electron beam, they will partly be orbiting around the beam which decreases the chance of impact ionisation. The ions will only -7 - move deeper into the electron beam once their charge state increases. This initial ionisation delay can significantly increase the total charge breeding time and broaden the charge state distribution.
To ensure that an efficient injection is feasible, 2D simulations of the electron and ion beam were performed using TRAK. The simulation domain reached from the diagnostic chamber of the LEBT, through the electron collector up into the last drift tube of the EBIS. For the simulation, the electron beam distribution in the last drift tube was modelled in the same manner as described in section 3.1.1 and was simulated to find a self-consistent solution for the ion-free electron beam. Due to the single charge state of the injected ions and the low injection current, space charge compensation effects can be neglected. Then, a beam of 12 C + ions was launched in the centre of the diagnostic chamber with a kinetic energy of 30 keV and tracked into the precomputed electron beam. To count as accepted by the EBIS, the ions had to fall within a phase space that would correspond to their injection into the electron beam in the trap centre. This was determined by translating the ion phase space in a fashion comparable to that used for the extraction simulations, cf. equation (3.1) and [10].
It was found that for ion injection into the radius of the electron beam, the normalised RMS emittance of the injected beam should be no larger than 0.012 mm mrad. In order to provide such a small emittance beam, the future ion source line will include a set of apertures to tailor the beam emittance. Such apertures also limit the diameter of the beam, which turns out to be an important factor for the transport of the injected beam through the switchyard, as explained in section 3.3.
As an alternative to the external injection, TwinEBIS has recently also been equipped with a gas feed line. A stainless steel tube is used to deliver small amounts of gas right to the central trapping region of the EBIS. As gas molecules drift through the electron beam, they will be ionised and trapped in the beam. This offers a very robust way of filling the EBIS without relying on  (2) to reduce the field distortion due to the surrounding structure. Field terminations (3) at the front and back limit the field leakage into the beamline. the potentially difficult external ion injection. Carbon can easily be provided in the form of CH 4 (methane). The heavier carbon ions will fill the space charge well of the electron beam while protons are less strongly bound and will eventually boil off due to energy exchange with carbon ions.

Switchyard
The electrostatic switchyard uses a single pair of horizontally deflecting electrodes that connect the beamline in front of the EBIS with one of three beamlines on the far side of the switchyard, as shown in figure 6. Since the injected and the extracted beam need to take different paths, the switchyard will have to be pulsed with up to 400 Hz, the highest expected charge breeding cycle frequency for TwinEBIS. The large bending angles of 20°for the side beamlines would ideally be covered by a combination of two deflecting elements in a kicker / bender configuration, with the purpose of reducing optical aberrations and the voltage requirements of a pulsed power supply. Due to the need for large apertures in all directions, however, this would require a significantly longer beamline and larger vacuum chamber, which renders this solution impractical. Different designs for the deflector were assessed with the help of particle tracking simulations in CST Particle Studio [14].
A symmetrical deflector consisting of two cylindrical plates, as shown in figure 6, was chosen for the switchyard as a compromise between beam quality conservation and the demands on the required electrical potentials. The cylindrical shape of the deflector plates helps to reduce the required steering voltage, because the distance between the plates and the steered beam is reduced. For ions with a kinetic energy of q · 30 kV, the necessary voltage is less than ±5 kV per plate. Grounded terminations enclose the deflector to reduce stray fields, and narrow rim extensions at the top and bottom and of the deflector plates minimise vertical aberrations.
A problem with large aperture deflectors is that the ground potential of the vacuum chamber will deform the dipole field between the deflector electrodes and induce beam aberrations. To In the switchyard, the emittance growth in the horizontal plane (H) (bending plane) depends significantly on the initial emittance (cf. legend) and the beam size of the incoming beam. For small beams there is no significant emittance growth, while for large beams the emittance of the outgoing beam is almost independent of the incoming beam due to relatively strong horizontal aberrations in the deflector. In the vertical plane (V), the emittance is essentially unaffected. alleviate this effect, the inner diameter of the vacuum chamber around the switchyard deflector was increased to 200 mm to provide space for larger electrodes and to increase the distance between the beam and the chamber walls. Alternative deflector designs, like a diagonally bisected hollow cylinder [10,15] or a parallel plate deflector with additional field-shaping electrodes [16], naturally mitigate field deformation effects and provide a low aberration deflection. But they suffer from a higher necessary steering voltage and more complex electric circuitry, respectively.
Aiming to assess the impact of the switchyard on the beam quality, the emittance growth was determined for typical injection and extraction scenarios. For the external ion injection simulations a 12 C + Gaussian beam was tracked through the deflector at a kinetic energy of 30 keV. The normalised RMS emittance and the 90 % beam radius in the deflector were 0.004 mm mrad and 4 mm, respectively. Such a small emittance beam falls well within the acceptance of the EBIS (0.012 mm mrad). It was found that the emittance growth for such a beam is well below 5 %, even if it enters the switchyard with vertical and horizontal offsets of up to ±10 mm. This broad operation range will be helpful in the setup phase.
The emittance and the size of the extracted beam in the switchyard depend strongly on the space charge and on the electrostatic fields in the extraction region of the EBIS. Therefore, the emittance growth for the deflection of a 12 C 6+ beam at 180 keV was investigated for a range of beam sizes and emittances, as seen in figure 7. While small beams pass the switchyard essentially unaffected, beams with a large radius suffer from aberrations in the horizontal plane (bending plane). This is attributed to the fairly small entrance gap and the varying distance between the electrodes. The vertical emittance growth of the beam is below 3 % for all test cases.
Since the switchyard will mainly be used to deflect the beam into a ToF mass spectrometer, where the beam quality is less critical than for the RFQ, the emittance growth can be tolerated in favour of a simple and affordable design of the deflector. During the straight forward extraction into the RFQ, the deflector is only used for small corrections and has a negligible impact on the beam quality. The injected beam has a small radius and will not suffer from strong aberrations.

Correcting deflectors
For small scale adjustments of the beam trajectory, the beamline features three short electrostatic correcting deflectors, which together with the switchyard deflector form two sets of vertical and horizontal correctors. In order to fit a large aperture deflector into the grounded vacuum chamber without suffering from strong field deformations, the electrode profile has been adjusted to produce a homogeneous field, as can be seen in figure 8. The shape of the electrodes was manually optimised with the help of 2D electrostatic simulations in ESTAT [11]. Afterwards 3D particle tracking simulations were performed using CST Particle Studio to validate the performance. For a beam with a kinetic energy of q · 30 kV the deflection strength is 1.27°for a total voltage of 1 kV between the deflector plates. For this deflection strength and a beam with 0.02 mm mrad normalised RMS emittance and a 90 % beam radius of 15 mm, the emittance growth is smaller than 5 %.

Gridded electrostatic lenses
Gridded electrostatic lenses were chosen as the main focusing elements for the LEBT due to their large focal strength and low aberrations. In the present design (cf. figure 9), the focusing field of the lens is formed between the flat wire-grid, which is operated at a high negative voltage, and the grounded walls of the surrounding vacuum chamber. It has been demonstrated that this convenient configuration can provide electrostatic focusing with small spherical aberrations, which is one of the main contributors to emittance growth [17]. The electrical field in a gridded lens is purely focusing, whereas a classical Einzel lens always features focusing and defocusing sections. This significantly reduces the required operation voltage -11 -2018 JINST 13 P08012 The mechanical design of the gridded lens is shown in figure 9. The wire grid, clamped into a metal support ring, is mounted in a double sided CF-160 flange. This modular approach facilitates the lens assembly and with a total thickness of just 50 mm, it requires much less space than a conventional Einzel lens. The feedthroughs and ceramic stand-offs were dimensioned for a holding voltage of up to 35 kV. The wire grid is expected to have a transmission of 89 %, with a wire spacing of 0.5 mm and a wire thickness of 30 µm. The thin wire will be subject to sputtering, but with an average carbon ion current of 1 µA and a sputter yield of about 1 atom/ion [18,19], the estimated lifetime corresponds to several years of continuous beam.

Grid induced aberrations
Besides the typical lens aberrations, a gridded lens can suffer from aberrations that are induced by the wire grid. At a large distance the grid appears to be a solid surface, but as particles approach the grid they start to move into the near field of the wires. Since the attractive potential of the wires is slightly stronger than that in the centre of each grid aperture, the grid acts like an array of weakly defocusing micro-lenses. This is a small perturbation superimposed on the overall strong focusing effect of the lens, but it can affect the beam quality as the particles get small, randomly directed kicks.
To assure that the chosen grid does not deteriorate the quality of the transported beam, the emittance growth has been determined as a function of the wire spacing in the grid. A comparable study for a gridded lens has been performed by Kropachev et al. [20], but the initial emittance of the beams considered in that study is significantly larger than expected for the extraction from -12 -TwinEBIS. The small emittance ion beam produced by an EBIS is much more sensitive to the kind of aberrations induced by the grid and will therefore show a larger relative emittance growth.
To quantify the emittance growth, a number of beams with varying initial emittances and a fixed 90 % beam radius has been traced through the field of gridded lenses with different wire spacings using CST Particle Studio. For the simulations the central part of the gridded lens (30 mm by 30 mm) was modelled in detail as a square grid of opaque wires with a diameter of 50 µm and varying wire spacings. The outer parts of the lens were modelled as a transparent solid sheet to reduce the complexity of the simulated model, since only a negligible fraction of all simulated particles crosses this domain. The lens was surrounded by a grounded vacuum chamber with an inner diameter of 150 mm. The grid voltage was −8 kV. To provide a baseline for comparison, the gridded lens has also been simulated as a flat sheet (wire spacing of 0 mm), corresponding to a perfect gridded lens. The beams were also tracked through an Einzel lens with the same parameters as introduced above. Space charge was not taken into account, in order to single out the emittance growth caused by aberrations of the lenses.
The results of these simulations are summarised in figure 10 (a). For the ideal gridded lens the emittance growth is virtually zero and confirms the almost perfect suppression of spherical aberrations. In the case of a real grid though, the emittance increases noticeably, due to the distortion of the phase space as illustrated in figure 10 (b). For wire spacings larger than 1 mm, the emittance growth is unacceptably large and worse than that of the equivalent Einzel lens. For a finer grid however, the emittance growth is acceptable and the gridded lens outperforms the Einzel lens. Based on these findings, it is concluded that the grids chosen for the TwinEBIS LEBT should have a wire spacing of less than 1 mm.

Secondary electron emission
Ions colliding with the wire grid of the lens will not only sputter the material but also release secondary electrons from the wire surface. Due to the negative polarity of the lens, secondary electrons will be repelled and could potentially interfere with the diagnostic devices that are installed in the beamline. Since the characterisation of the extracted ion beam is one of the key goals of this project, it is imperative to understand the behaviour of the generated electrons. Due to the complex electrical field around the wires, it is difficult to predict the dynamics of the secondary electrons, which initially have only a small kinetic energy. Therefore a 3D secondary emission model has been developed and is used to generate input parameters for a secondary electron tracking simulation, based on collision information of a primary beam simulation.
Here, the secondary electron generation model is presented briefly. The interaction of multiply charged ions at moderate energies with metal surfaces is a complex process, but an excellent overview over the field is given in [21]. The information and models therein have been combined with measured secondary electron yields for multiply charged carbon ions [22] and existing models for secondary electron generation [23][24][25] to develop the model outlined below.
For each ion colliding with the wire grid, a collection of secondary electrons is generated. The expected number of electrons scales with the incidence angle of the ion Θ, measured with respect to the surface normal, as Here γ 0 is a free scaling parameter and the incidence angles were capped to Θ < 80°to limit the number of generated secondaries for grazing incidence, an effect that is also observed in numerous measurements [21]. This value is used to draw the actual number of generated secondaries from a Poisson distribution with the given expectation value Each secondary electron is randomly assigned an initial kinetic energy which is distributed according to a Γ-distribution with the probability density function Here, T 0 is a free parameter and determines the mode of the distribution. Finally, the emission angle ϑ of the secondary electron, measured with respect to the surface normal, follows a cosine distribution and the azimuthal angle (rotation around the surface normal) is uniformly distributed To simulate the propagation of secondary electrons around the gridded lens, a simulation model equivalent to that in the previous section is set up in CST Particle Studio and a primary ion beam is tracked through the electrostatic field. The ion tracks are exported and processed with a Python script that uses the FreeCAD software library [26] to determine the coordinates and the -14 - local surface normal vector for each collision of an ion with the model of the wire grid. These input parameters are used to generate the secondary electrons. Finally these electrons are tracked in the same electrostatic field as the primary beam.

JINST 13 P08012
To simulate the TwinEBIS LEBT, the secondary particle tracking was run for a gridded lens with a wire thickness of 50 µm and a wire spacing of 0.5 mm. The corresponding transmission of only 81 % presents a worst case scenario; the actual transmission will be close to 90 %. The primary beam of 12 C 6+ initially had a 10 mm radius (90 %) and kinetic energy of 180 keV. The lens was set to −8 kV. The free parameters of the emission model were chosen as γ 0 = 9 and T 0 = 10 eV, based on measured emission characteristics [21,22]. To estimate the severity of space charge effects, the particle tracking was performed both with and without space charge forces. For the space charge simulations an ion beam with a current of 3 mA was considered and simulated iteratively to arrive at a self-consistent solution accounting for space charge defocussing. Subsequently, the secondary electrons were tracked through the combined gridded lens-and ion space charge-field. Although the total number of generated secondary electrons turns out to be approximately 2.5 times the number of ions, it was observed that their contribution to the total space charge can be neglected in good approximation. This is because the electron velocity greatly exceeds the ion velocity even in close proximity to the grid (∼ 2 mm), which diminishes the effective electron charge density and the resulting space charge field strength down to a small fraction of the ion-induced field.
The results of the simulation without space charge forces are summarised in figure 11. Since the ions collide on the front side of the grid and electron emission is pronounced in the direction of the surface normal, most of the electrons are emitted backwards, opposite to the direction of the ion beam. Only a small fraction of all secondaries travels along with the ion beam in the forward direction, typically with large angles relative to the beam axis. Other than an Einzel lens, a gridded lens acts inversely on particles of opposite charge and, therefore, defocuses the emerging electron beam. This drives the electrons towards the vacuum chamber wall and separates them -15 -from the ion beam. As an example, the effect on a Faraday cup, located 200 mm downstream, was evaluated. With an aperture of 40 mm, the signal on the Faraday cup is strongly dominated by the ion beam, while most of the electrons miss the cup, as demonstrated in figure 11 (b). The total electronic contribution within the aperture is < 10 % and will be even smaller for the real grid with the higher transparency. Comparing simulations with and without space charge, it was found that the ion beam has a small focusing effect on the escaping electrons. This causes a slight increase of the electron-to-ion ratio within the aperture of the Faraday cup, but it remains smaller than 10 %. Thus, the electron-to-ion fraction is expected to be essentially independent of the ion current for all relevant scenarios, that means currents < 3 mA.

Beam diagnostics
The beamline is equipped with several diagnostic devices to characterise the transported ion beams. Faraday cups are available in the diagnostic chamber and just before the accelerating RFQ. The Faraday cup in the diagnostic chamber is bidirectional such that it can also read out the current of an ion beam injected through the switchyard. Figure 12 shows the conceptual design of this device. The Faraday cup in front of the RFQ is split into two concentric zones, to facilitate the tuning of the focusing strength of the second gridded lens. Additionally, a ToF spectrometer will be attached to a 20°arm of the switchyard. It is a copy of the Mamyrin-type spectrometer used for EBIS studies at BNL [27,28].
Additionally, the ion beam line is equipped with a universal diagnostics tool, see figure 13, located in the diagnostic chamber of the beamline. This device, based on a prototype from Brookhaven National Laboratory [29], is essentially a pepperpot emittance meter used to measure the beam profile and the transverse Twiss parameters. An electrical isolation of the pepperpot mask allows the measurement of the ion beam current. The device is mounted on a rotary-linear vacuum feedthrough. The two working positions of the diagnostics tool are mechanically fixed with high precision and correspond to the orientation of the diagnostic tool toward either an ion beam extracted from the EBIS or to the ion beam being injected from an external ion source.
When the pepperpot device is in use, the ion beam hits the mask, which has an array of pinholes. The beamlets from the pinholes propagate towards the Micro-channel Plate (MCP) and subsequently the electrons released by the MCP create an image on the phosphor screen. A set of mirrors relays the image into the objective of a CCD camera located outside of the vacuum on the rotational axis of the pepperpot. The total picture created by the individual spots gives information about the ion beam intensity profile and its transverse position in horizontal and vertical directions. The size of the individual spot depends on the divergence of the beam and on the distance from the mask to the MCP, which is adjustable from 65 mm to 145 mm. This information allows the reconstruction of the Twiss parameters of the beam. Combined with the ability to rotate the pepperpot, this will also facilitate the matching of the injected beam parameters with the extraction optics on the shared section of the beamline.
Recent studies have shown, that MCP based pepperpots are susceptible to saturation which prevents an accurate reconstruction of the phase space [30]. For proper emittance measurements, the beam intensity on the pepperpot has to be adjustable. In the future, the extraction region of the EBIS may be redesigned and a fast chopper could be included to adjust the instantaneous intensity  . Mechanical design of the multi-purpose pepperpot diagnostic tool for TwinEBIS, with the light shielding plate on the front hidden to provide a look at the inside of the device. The beam hits the pepperpot mask (1) and the created beamlets propagate onto a MCP / phosphor screen that is mounted on face (2). The light emitted by the screen is guided via a set of mirrors (3) through a light shield (4) out of the vacuum vessel. The device is mounted on a rotary linear feedthrough (5), and the alignment is assured with two pins (6) falling into a baseplate attached to the light shield.

JINST 13 P08012
of the extracted beam. Until then the pepperpot will be used for ion beam imaging and determining the Twiss parameters of incoming and outgoing beams.

Conclusion
The beamline presented in this article will be an important extension of the TwinEBIS setup. It provides a flexible beam transport system and the necessary diagnostic infrastructure for detailed studies of the charge breeding performance and the ion beam quality. Extensive simulations of the ion extraction from the EBIS and the ion transport through the LEBT have demonstrated an efficient injection of the ion beam into the RFQ. With a conservative estimate of the initial ion beam emittance, it is possible to inject about 88 % of the charge bred ions into the RFQ acceptance at the full peak current of 3 mA, if attenuation due to the gridded lenses is ignored. Moreover, the simulations indicate that the majority of the beam quality deterioration occurs in the EBIS extraction region, where the high ion current beam passes small apertures at a low velocity. Along the LEBT, the emittance growth is negligible. With a redesign of the EBIS electron collector and extraction electrode in the future, the end to end beam transport may become even more efficient.
A three way switchyard allows the simultaneous connection of several lines (RFQ, ToF spectrometer, ion source) to the EBIS and ensures a high flexibility of the setup. The ±20°deflector, consisting of two concave cylindrical electrodes, is the result of finding a compromise between beam quality and setup complexity. Its simple design and the small necessary deflection voltage make this solution very attractive. Yet, simulations have shown that small ion beams can be deflected by 20°w ith an emittance growth of less than 5 % even for offsets of up to 10 mm from the centre. For larger ion beams, like the extracted high current carbon beam, the beam emittance grows significantly under deflection, but since the ToF spectrometer does not depend on a small emittance and the RFQ located in the forward direction is not affected, this behaviour is acceptable.
Gridded lenses are used in the beamline as cost-effective, short, and strong focusing elements. High resolution simulations of the gridded lens have been used to determine the emittance growth due to micro-lensing of the wire grid, and yield a maximum acceptable wire spacing of < 1 mm for the small ion beam emittances expected in the beamline. In addition, the emission of secondary electrons on the wires has been modelled. It was found that a large number of secondary electrons are produced, but that they are not expected to interfere significantly with the diagnostic equipment, since the electric fields in the beamline separate them from the positively charged ion beam. A set of two gridded lenses is expected to attenuate the ion beam by about 20 %, but their very strong and highly linear focusing behaviour outweighs this disadvantage.
After the beamline commissioning, the first task for the extended setup will be to demonstrate the high rate production of fully stripped carbon ions for medical applications and the suitability of the extracted beam for injection into the accelerating RFQ.