Beam based alignment of focusing solenoids at ARES

ARES is an electron linear accelerator at the SINBAD facility at DESY. It aims to deliver reliable high-brightness beams with an energy in the range of 50 MeV to 150 MeV with fs to sub-fs bunch lengths. This is ideal for injection into novel high-gradient acceleration devices, such as dielectric laser accelerators (DLA), accelerator components R&D and medical applications. The ARES linac has been recently commissioned. Here we report the results of beam based alignment of focusing solenoids of ARES. The alignment is an important part of commissioning and is crucial for the beam quality.


Introduction
One of the key points of high brightness beams is low emittance.Generating low emittance from a photoinjector and preserving it during beam transport in accelerating cavities is greatly affected by the alignment of the beamline elements due to deflection forces by the accelerating electric fields.Moreover, an off-axis beam in a magnetic focusing field experiences an additional kick and can dilute the emittance [1,2].Solenoids are an effective device for focusing electron beams at low energies.They focus the beam in both transverse planes simultaneously.The misaligned solenoid introduces a kick resulting in a subsequent off-axis trajectory.Also an offset of the angle of the incoming beam with respect to the magnetic axis of the solenoid provokes a kick in the beam trajectory.Therefore, beam-based alignment (BBA) of focusing solenoids is an important part of commissioning.
Many procedures have been developed to align the beam trajectory with the solenoid axis to preserve emittance.As described in [3], dedicated programs have been developed to fit the measured results to determine the beam orbit.Numerical simulations in an iterative process are used for fitting the measured beam position as a function of solenoid current as applied at PITZ and the photoinjector of the VUV-FEL at XFEL.On a few occasions, transfer matrices have been used for alignment of the beam trajectory.For example in [4], the transfer matrices are calculated by a special script [5] to fit the measured beam orbit.However, the procedure for determining the parameters of the beam orbit in [4] is not described.In [6] the kick from the solenoid is minimized by measuring the beam position as a function of solenoid current and adjusting the gun position in an iterative process.Recently, the use of transfer matrices for the correction of beam trajectory through a solenoid has been reported [7].
A new algorithm to perform the BBA at ARES has been developed [8].It uses linear transfer matrices to determine the specific input beam position and angles which minimize the solenoid kick.This implies an equal misalignment of the solenoid in opposite direction with respect to the beam axis, which is corrected to obtain an on-axis beam trajectory.A Matlab script with a graphical user interface was developed to determine the misalignment.The developed method is validated against numerical simulations performed with the tracking code ASTRA [9], an aspect which is mostly missing in the above mentioned references.The algorithm has been described in detail in [8].In this paper, the experimental results for the beam based alignment of the focusing solenoids of ARES at DESY are presented and discussed.The algorithm used is simple, efficient and gives reliable and reproducible results within the accuracy of the solenoid micromover system used, which is 100 µm, at ARES.

Experimental Results and Discussion
The ARES linac [10,11,12,13,14] was commissioned in 2021 and the measured results for electron beam characterization have been published [15].A schematic overview of the gun and the linac is shown in Fig. 1.The ARES linac consists of an RF gun followed by two S-band travelling wave structures (TWS).The diagnostic line is dedicated for commissioning of the novel PolariX-TDS for diagnostics of ultra-short bunches produced at ARES [16,17].Moreover, under the ARIES transnational access program [18], a part of ARES beam time was made available to external users to conduct experiments.A focusing solenoid located at 40.6 cm from the cathode is used for transverse focusing of the electron bunches.The effect of misalignment of this solenoid on beam parameters like emittance and beam sizes has been studied in detail in [19].In the linac part four solenoids for each travelling wave structure will allow to optimize the beam quality while compressing the beam via velocity bunching.The experimental results for BBA of the gun solenoid and the TWS solenoids are discussed in this section.
The gun solenoid consists of two coils of equal length.Each coil can be adjusted to different polarities and hence allows for better control of the beam.Scintillator screens are installed at ARES for beam transverse profile measurements.The screens that were used to obtain the results discussed in this paper are located after the gun, one before the first TWS and one after the first TWS, respectively referred to as X1, R1 and R2.A picture of the installed solenoid is shown in Fig. 2.
The photocathode laser should be well aligned on the cathode as a prerequisite for BBA of the gun solenoid.If this is not the case, the electron beam will be travelling off axis in the gun cavity, and hence can experience an additional kick due to the focusing effects of the RF fields in the gun cavity.This can be easily validated by scanning gun phase as a function of beam positions measured on screen.The gun was conditioned up to 5.1 MW with 5 µs long pulses.Following the gun conditioning, the BBA of the gun solenoid was performed.The beam positions were measured as a function of the gun solenoid current.Twenty beam and background images were stored for each set point and then averaged.The current range corresponds to the values for which the beam was visible on the screen.The images were processed to calculate the centroid positions.From this information, the misalignment in the gun solenoid was calculated via a script.The detailed method is reported in [8] .According to the calculated offsets, the solenoid position was adjusted in the tunnel using the micro mover system.For an aligned solenoid, when changing the solenoid current, the beam does not move on the screen anymore since the beam moves on axis and hence does not experience kicks in the transverse planes.If this is not the case, another iteration of the correction of the alignment needs to be performed.Since it is an iterative process, multiple iterations may be needed to reduce the error.
Multiple data sets were taken to ensure repeatability of the results.Three iterations were performed until the solenoid was well aligned within the achieveable accuracy of the mover system which is 100 µm.Figure 3 shows the comparison of offsets in beam centroids as a function of solenoid current before and after the BBA.
To validate the BBA procedure, the calculated misalignments were introduced in the gun solenoid in ASTRA and the simulated beam position on the screen was compared with the measured data.The ASTRA simulation shows a good agreement with the measurement data.The ASTRA simulation data is plotted for the full current range of the gun solenoid (from minimum to maximum) and also for the measured range, i.e. from -70 A to -68 A. This comparison also determined the coordinates of the screen X1, since from Fig. 4, it can be observed that the measured data lies on the ASTRA scan but does not overlap with the measured current range simulated in ASTRA.This means that the center of the ASTRA simulation does not correspond to the center of the screen for an aligned solenoid to observe the beam at the center of screen implying that the camera optics is not looking at the center of the screen and needs to be adjusted.The BBA measurement result and its comparison with the ASTRA simulations thus determined the screen coordinates.Comparison of the last iteration, after adjusting the field of view of screen X1, with ASTRA simulations is shown in Fig. 5.The measurement is in agreement with the ASTRA simulations validating the successful BBA of the gun solenoid.
The BBA of the gun solenoid at ARES resulted in a well aligned stable beam as a function of solenoid current.The comparison of measurement results with ASTRA simulations validates the proposed algorithm based on a linear transfer matrix base formalism.
BBA of the solenoids around TWSs was started with the fourth solenoid of the first TWS.The TWS was powered off during these measurements to avoid the effects of the RF fields on the beam trajectory.The beam stability on screen R2 as a function of the solenoid current before and after the BBA of fourth solenoid of TWS1 solenoid is shown in Fig. 6.The fourth solenoid was well aligned according to the measured data represented by the orange curve in Fig. 6 as shown by beam offset as a function of solenoid current.The beam trajectory for TWS solenoid is a helix since these solenoids are single coil, as opposed to Gun solennoid straight trajectory for which two coils are operated at opposite polarities to eliminate the angular kick.The other  Figure 7 shows the comparison of ASTRA simulations and the measured data.The blue helical path represents the simulated beam trajectory for the full range of solenoid current up to the maximum value of -130 A. The orange curve shows the measured data which is in agreement with the ASTRA simulations.

Conclusion
The ARES linac has been fully commissioned with the beam characterized and optimized.Beam-based alignment of the focusing solenoids is an important part of the commissioning to optimize the beam trajectory and to preserve low emittance.For the ARES commissioning, the algorithm developed to determine the misalignment of the solenoids installed at the RF gun and around the travelling wave structures [8] was used to measure and correct the misalignment of the focusing solenoid at ARES.The comparison of the measured results with ASTRA simulations validates the measurement results.The developed algorithm is generic and could be applied to any accelerator facility for aligning of the focusing solenoids.In summary, the developed algorithm used is simple, efficient, has been validated against ASTRA simulations and gives reliable results within the accuracy of the micromover system.

Figure 2 .
Figure 2. Picture of the gun solenoid installed at ARES.Also visible is the gun cavity.Right hand side picture shows the mover system with adjustable screws to align the gun solenoid.

Figure 3 .
Figure 3. Beam trajectory on screen X1 as a function of the gun solenoid current before and after the BBA.Three iterations were performed.The beam is stable on screen X1 as a function of solenoid current, a signature of an aligned solenoid.

Figure 4 .
Figure 4.The calculated misalignment is applied to the TWS solenoid in ASTRA and the simulated beam trajectory is compared with the measured data.The ASTRA simulation shows good agreement with the measurement data.The dashed rectangular area is the field of view on the screen X1: ±4.35 mm in x and ±2.57mm in y.

Figure 5 .
Figure 5.The calculated misalignment for the aligned solenoid and after adjusting the field of view of screen X1 is applied to the gun solenoid in ASTRA and the simulated beam trajectory is compared showing good agreement with the measurement data.The dashed rectangular area is the field of view on the screen X1: ±4.35 mm in x and ±2.57mm in y.

Figure 6 .
Figure 6.Beam trajectory on screen R2 as a function of the SOL4 solenoid current before and after the BBA of gun solenoid.The beam is stable on screen R2, a signature of an aligned solenoid.

Figure 7 .
Figure 7.The misalignment values obtained from the routine added in an ASTRA simulation and the beam trajectory were compared with the measurement data.For the measurement data, the current scan range was [-48, -38] A. For ASTRA, the beam trajectory for the full current range [-130, 0] A is plotted.The dashed rectangle represents the field of view of screen R2: ± 4.35 mm in x and ± 2.61 mm in y.