Semiautomatic beam-based LHC collimator alignment

Full beam-based alignment of the LHC collimation system was a time-consuming procedure (up to 28 hours) as the collimators were set up manually. A yearly alignment campaign has been sufficient for now, although in the future due to tighter tolerances this may lead to a decrease in the cleaning efficiency if machine parameters such as the beam orbit drift over time. Automating the collimator setup procedure can reduce the beam time for collimator setup and allow for more frequent alignments, therefore reducing the risk of performance degradation. This article describes the design and testing of a semiautomatic algorithm as a first step towards a fully automatic setup procedure. The parameters used to measure the accuracy and performance of the alignment are defined and determined from experimental data. A comparison of these measured parameters at 450 GeV and 3.5 TeV with manual and semiautomatic alignment is provided.


I. INTRODUCTION
The CERN Large Hadron Collider (LHC) is built to store and collide two counterrotating 7 TeV beams each with 362 MJ of stored energy with nominal beam parameters [1]. The nominal proton intensity is $3 Â 10 14 p, and uncontrolled beam losses of only 7:6 Â 10 6 ps À1 m À1 in a superconducting magnet can induce enough heating to cause a quench [2]. A powerful collimation system is needed to protect the LHC against unavoidable losses, which may also damage beam pipe equipment or cause radiation effects such as the degradation of electronics [3]. The collimation system is intended to work with protons and heavy ions [4]. The LHC collimation system advances the state of the art found at the Tevatron [5] and RHIC [6]. The presently installed system consists of over 100 collimators, and is designed as a hierarchical system with four stages [7][8][9]. The LHC consists of 8 arcs and 8 straight sections, called insertion regions (IRs). The experiments are installed in the insertion points (IPs) of 4 IRs, where the beams collide. The collimators are located mainly in IR3 and IR7 for momentum and betatron cleaning, respectively. They are also positioned in the experimental IRs to protect the triplet magnets, as well as near the transfer lines and the beam dump in IR6. Figure 1 gives a graphical overview of the collimator layout in the LHC.
Every collimator providing cleaning of normal beam losses consists of two blocks (jaws) of graphite or tungsten. An example of a collimator with its jaws in the casing is shown in Fig. 2. The jaws must be positioned symmetrically around the beam with one jaw on each side [see Figs. 3(a) and 3(b)]. A collimator can clean in either of the horizontal, vertical, or skew planes depending on the rotation angle of the jaws. The required positioning accuracy is 5 m, corresponding to 1:82 Â 10 À2 for a horizontal primary collimator at 7 TeV. A three-tier control system allows the upstream and downstream edges of each jaw to be moved separately [10].
Beam-based alignment of the LHC collimators is necessary to determine the beam center (Áx i ) and beam size ( inf i ) at each collimator i. This ensures that a correct collimator hierarchy is established for normal operation. In the four-stage hierarchy, the primary collimator (TCP) jaws are positioned closest to the beam in units of . The jaws of the secondary collimators (TCSG) are retracted further, followed by the jaws of the tertiary collimators (TCT) and the absorbers (TCLA), which are positioned furthest from the beam.
Regular collimator setups may be required as the beam orbit could change over a few months due to ground motion, thermal effects, and machine effects such as multipole field errors [11]. Setups of a subset of the collimators are also performed when machine parameters are changed, such as the Ã (the optics) at the experimental IPs. The amount of time needed for a full alignment (up to 28 hours) means that setups cannot be performed frequently, which means that margins in the hierarchy settings are necessary to account for drifts. This increases the smallest aperture that can be protected, and places constraints on the minimum Ã achievable [12].
The beam-based alignment procedure relies on feedback from beam loss monitors (BLMs) [13]. They consist of ionization chambers placed downstream of the collimators, and intercept secondary particles created by the hadronic and electromagnetic showers caused by beam particles impacting on the collimators. A collimator jaw is set up to the beam halo when a clear loss spike is observed in the BLM signal after a jaw movement towards the beam. The alignment is done remotely from the CERN Control Center (CCC) using a top-level application implemented in Java [14,15].
In 2010, the setups were performed ''manually,'' meaning that human feedback was required to determine when the jaw is aligned to the beam. This was achieved by observing the BLM signal on a screen following a jaw movement. A disadvantage of this method is the setup time required, which is data lost for the experiments and beam time for other users. Human error results in incorrect FIG. 1. LHC collimator layout from [27]. Collimators are located mainly in IR3 and IR7 (on the left and right of the illustration), but also protect the experiments, the beam dump, and the transfer line regions.
FIG. 2. LHC collimator viewed from one end, showing the beam trajectory in red (from [9]). The jaws lie inside the casing on either side of the beam, with the rf fingers in the foreground. They can be positioned with an accuracy of 5 m.
FIG. 3. The collimator coordinate system (a) and the jaw tilt angular convention (b) as viewed from above, from [20]. The four motors positioned at the edges of each jaw allow 4 degrees of freedom. jaw movements, causing high losses and beam dumps, therefore contributing to the setup time. In order to speed up the collimator alignment and minimize the intervention required from the operator, a semiautomatic algorithm has been developed. This paper first gives an overview of the collimator setup procedure and describes the parameters measured during the setup. This is followed by an analysis of the possible measurement errors that could affect the precision of the alignment procedure. The semiautomatic algorithm developed for automating the setup is presented. Finally, a comparison of the setup results obtained in 2011 with those of 2010 using data from the proton runs is presented.

II. COLLIMATOR SETUP PROCEDURE
Each collimator is aligned in a four-step procedure, as established in [16]. The procedure was tested with a prototype collimator in the SPS [17] and was first used in the 2010 LHC run [18]. The alignment sequence, involving the reference collimator and the collimator i to be aligned, is shown in Fig. 4. The jaw of a reference collimator is moved in steps towards the beam to form a reference cut in the beam halo (step 1 in Fig. 4). The reference collimator is usually taken to be the TCP in the same plane (horizontal, vertical, or skew) as the collimator i.
A BLM signal spike can be attributed to a particular jaw movement if only that jaw was moving when the spike occurs. Therefore, the left and right jaws are moved towards the beam separately. After aligning the reference collimator, the same procedure is performed for the collimator i (2), and the reference collimator is aligned once again (3). The beam center can then be determined from the final jaw positions of collimator i: where x L;m i and x R;m i are the measured left and right jaw setup positions. The jaw gap can also be calculated from these values: (2) The inferred beam size is expressed as a function of the half gap, with n 1 being the cut of the reference collimator in units of : The nominal 1 beam size at each collimator is determined from the nominal geometrical emittance , the nominal beta functions x;i and y;i at the collimator i, and the rotation angle of the collimator jaws c i : The dispersive beam size contribution D i p in the horizontal plane at collimator i is considered, assuming negligible dispersion in the vertical plane. Here D i is the dispersion function and p is the rms momentum spread of the beam particles. For a horizontal collimator with with as the betatron beam size and p as the momentum beam size. However, at the start of the horizontal collimator alignment, the momentum halo is cut using the primary collimator in the high-dispersion region in IR3. This ensures that the halo intercepted by the other collimators is dominated by the betatron contribution. The contribution from 2 p is rendered negligible, and can be omitted from the calculation of the nominal beam size.
The reference collimator is aligned both before and after the setup of collimator i, in order to account for the halo that is scraped away during the alignment when calculating the beam size. The half-gap opening n 1 in units of for the two TCP alignments can be calculated as The nominal beam size at the primary collimator is used in each case and k is an index for the number of alignments of FIG. 4. The four-stage beam-based alignment procedure for collimator i. The reference collimator is aligned to form a reference cut in the beam halo (1). Collimator i is aligned (2), followed by a realignment of the reference collimator (3). Finally, collimator i is opened to its position in the hierarchy (4).
the reference collimator. The dispersive beam size contribution can be ignored for this calculation, as the reference collimator is located in a low-dispersion region (IR7). The beam size at all other collimators can then be inferred from the jaw positions of collimator i and the reference collimator, assuming nominal emittance and the real, imperfect function. Substituting n 1 as the average of Eqs. (6) and The final step is to set the left and right jaws of collimator i using the values obtained for the beam center and beam size to maintain the collimation hierarchy (4): where N i is the half-gap opening specific to a collimator family. The nominal collimator settings were defined during the design of the LHC collimation system [19], however in practice these are relaxed for non-nominal beam parameters. A summary of the half-gap openings used in the 2011 run is shown in Table I. The number and types of collimators to be set up depend on the set of machine configurations for which the beam centers at the collimators must be known. At 450 GeV (injection energy), all 86 collimators installed in the LHC ring are set up. One nominal bunch containing $1:15 Â 10 11 protons is used per beam. When the LHC is ramped to flattop at 3.5 TeV, a setup is performed for all collimators except for the 6 injection protection collimators (TCLI and TDI). After squeezing both beams to the operational Ã in the experimental IPs, the 16 TCTs are aligned. This is done as a large change occurs in the beam sizes for these collimators. When the orbit separation bumps are collapsed and the beams are brought into collisions, an alignment of the TCTs is required once again as their beam centers change in the crossing plane. This results in four setup operating points.
From experience during LHC operation, the determination of the beam size by beam-based alignment provides a consistent collimation hierarchy at injection, but not at 3.5 TeV [20]. This is because the collimator gaps are smaller in mm at top energy, which makes the setup procedure more sensitive to gap measurement errors as explained in Sec. III. The top energy collimator settings therefore rely on the nominal betatron beam size [Eq.
On the other hand, the orbit determined from beam-based alignment is used at all stages.

III. ERROR ANALYSIS OF THE SETUP PROCEDURE
Possible misalignments of the collimator jaws in the tunnel are the major source of error that could affect the measurements. This is because the alignment procedure assumes that the jaws are parallel to the beam trajectory during the setup. Figure 5 shows a jaw with an angular offset of i with respect to the beam axis. The n 1 parameter refers to the cut of the primary collimator into the beam in units of during the alignment, r i is the real beam size at the collimator, and L i is the length of the jaw in meters. There are three independent position measurements for each jaw, namely, a motor step counter, a resolver, and a linear variable differential transformer (LVDT) [10].  5. Schematic of the position of the jaws of a collimator i misaligned by an angle i , which introduces an error in the measured gap [21]. The reference primary collimator is assumed to be perfectly aligned.
A scale error Á i exists due to a difference between the position sent using the counter and the resolver to the motor and the actual position as read out from the LVDT. When possible measurement errors are taken into account, the measured gap is [21] Rearranging Eq. (11), the real beam size at collimator i for small misalignment angles is given by The inferred beam size is expressed as Assuming a perfect reference primary alignment, the error in the beam size at collimator i is the difference between the real beam size, given by Eq. (12), and the inferred beam size: The error can be minimized by working at the maximum n 1 . However, this does not provide much room as the primary collimators should not be opened beyond 6 at 3.5 TeV due to machine protection requirements. The value for n 1 during the setup decreases over time as the jaws cut further into the beam. Considering typical values for beambased alignment, a scale error of 0.05 mm, angle error of 0.1 mrad, and a collimator length of 1 m result in an error of 0.025 mm for n 1 ¼ 3. This amounts to an error of 2.38% at 450 GeV and $7% at 3.5 TeV.
Another error source is the beat, which can be corrected to between 10% and 20% in the LHC [22]. If this error is included in Eq. (4), then the error from the beat alone in the inferred beam size is between 5% and 10%, which is independent of energy. The contribution to the error by the angle of the n-sigma beam envelope is typically 20-50 rad, which is less than measured misalignment angle of 1.6 mrad. For the current LHC configuration, this contribution is ignored, especially as the alignment of the jaw corners is not done separately.

IV. SEMIAUTOMATIC COLLIMATOR JAW ALIGNMENT ALGORITHM
A. Single collimator movement The semiautomatic jaw alignment algorithm allows the user to specify four input parameters to move in one or both collimator jaws to the beam. The four inputs consist of the left and right jaw step sizes in m, Áx L i and Áx R i , a BLM signal threshold S thres i , and the time interval between each step t s i . A set of predefined possible values exists for each input, based on experience with the collimation system in the 2010 LHC run. With every jaw step, the algorithm obtains feedback from the BLM associated with the collimator being moved, and stops the jaw movement if the loss threshold is exceeded. The BLM data is acquired at a rate of 1 Hz.
When the jaw stops, human feedback is required to decide whether the jaw appears to be touching the beam halo from the BLM loss spike displayed. Hence, the algorithm is semiautomatic. A flowchart of the alignment algorithm is shown in Fig. 6, and a description of the variable names used is given in Table II. The left and right collimator jaw positions are logged automatically, so that the beam center and beam size can be displayed. The algorithm was implemented into the top-level collimator control software [14], and was tested and commissioned

B. Parallel collimator movement
A parallel collimator setup was developed to attempt to optimize the setup time, where any number of collimators can be aligned simultaneously to the beam. This means that the collimator jaw alignment algorithm presented previously is executed for each selected collimator. Currently, parallel collimator setup is used to provide a coarse but quick way of positioning a set of collimator jaws around the beam, after which each collimator is finely aligned in sequence. The parallel movement was optimized throughout the 2011 run.
During the testing of this technique an expected cross-talk effect was observed, in which the loss patterns registered on the BLM of a particular collimator were also detected on other collimator BLMs downstream. An example is illustrated in Fig. 7, where the BLM threshold was set to 5 Â 10 À6 Gy=s for all collimators. Three have stopped moving as the losses on their BLMs have exceeded the threshold. Cross talk prevented the parallel setup method from functioning efficiently, and therefore another algorithm was designed to identify which collimator jaw is at the beam.
The parallel setup algorithm uses a timer task (CheckColls) to check whether any collimators have stopped moving. As soon as a collimator stops moving due to an exceeded BLM threshold, another timer task (CheckCollsT) is started to determine whether any other collimators also stop within a predefined time period T. If this is the case, then all the other collimators moving in parallel are stopped so that the algorithm can concentrate on the collimators that stop within T. In case the BLM threshold S thres i set during the previous movement is now below the background signal, an option allows the user to instruct the program to automatically increase the threshold in steps up to a maximum amount S thres max . If the threshold is exceeded after the second step or thereafter, the collimator jaw is declared to be aligned to the beam, and the algorithm terminates to allow the operator to start the sequential alignment. For a flowchart of the parallel collimator setup algorithm, see Fig. 8. The variables employed are described in Table III. A full description of the setup options is given in [23]. Testing was carried out during an LHC machine development (MD) time slot on the 2nd of July 2011, and will continue in the 2012 LHC run.

C. Alignment algorithm input heuristics
The input parameters need to be adjusted as a function of the particle momentum, the stored beam intensity, and the depth of the jaw cut into the beam halo. Examples of values for the alignment inputs and the equivalent in beam for the step size are presented in Table IV. At injection energy step sizes of 15 m were required to be able to observe a significant loss spike, while at 3.5 TeV step sizes of 5 m were sufficient. At higher energies the beam distribution is narrower, and a large step size would make an unnecessarily large beam cut.
At the start of the alignment, the steady-state loss rate is $4 Â 10 À7 Gy=s. Hence, the loss threshold is set to 1 Â 10 À6 Gy=s, which corresponds to a loss of 1:25 Â 10 6 protons per second using an empirical calibration factor for converting between BLM signal and intensity loss [24]. As the collimator jaws cut further into the beam, the threshold is set manually according to the level of the steady-state BLM signal observed after each loss spike, FIG. 8. A flowchart of the software process that automatically identifies which collimator jaw is at the beam after multiple collimators stop moving due to cross talk. The threshold increment value.

S thres max
The maximum threshold that can be set. up to a maximum value of 1 Â 10 À4 Gy=s. The steadystate signal is a measure of the particle loss rate, and increases as the jaw cuts further into the beam and more secondary particles are scattered into the BLM. The time interval t s i is initially set to one second, and is then increased to two or three seconds after the first loss spike is obtained. This caters for rare occasions where the BLM signal is not updated immediately and a jaw makes an extra movement before stopping.

A. Inferred beam sizes
The nominal and inferred beam sizes are calculated using Eqs. (4) and (8). The differences between these values can indicate the accuracy of the alignment. However, this is true only if certain machine parameters remain constant, such as the beat. The proximity of the inferred beam size to the nominal beam size can be expressed by the ratio of the two parameters, which is ideally unity: Step size Áx i (m) 1 5 Step size () a 0.014 Loss threshold S thres i (Gy=s) 1-100 Step time interval t s i (s) 1-3 3.5 TeV Step size Áx i (m) 5 Step size () a 0.013 Loss threshold S thres The histograms in Figs. 9(a)-9(d) contrast the beam size ratios obtained during collimator setups for the 2010 and 2011 runs at 450 GeV and 3.5 TeV. In all cases the beam size ratios for 2011 are comparable with those for 2010, meaning that the setup accuracy is maintained with semiautomatic alignment. Overpopulated tails may affect the beam size measurements, and its properties are currently under study [24]. A detailed analysis of the errors in the inferred beam size was given in Sec. III, which derive from possible jaw misalignments and the beat.
At both 450 GeV and 3.5 TeV, large beam size ratios were observed for the TCLA.A7R7.B1, TCTH.4L2.B1, and TCSG.A5L3.B2 collimators. An inspection in the LHC tunnel revealed that the tanks housing these collimators were misaligned by an angle of $1:6 mrad. After their positions were corrected, beam-based alignment was performed again and the beam size ratios decreased by 38%, 35%, and 39%, respectively, at 3.5 TeV. The predicted misalignment angles for these collimators were calculated from Eq. (14), assuming a scale error of 0.05 mm, and ignoring the small contribution of the beat to the measured gap error.
The results for the inferred and nominal beam sizes at 3.5 TeV are given in Table V(a), while Table V(b) displays the recalculated values after the realignment in the tunnel. The predicted misalignment angles were found to agree within a factor 2 assuming no further misalignments of the jaws with respect to the tanks. The decrease in the beam size ratios after the tunnel realignment means that the model can be used as an indication of the correct positioning of the collimators in the tunnel.

B. Beam intensity loss during setup
Throughout collimator setup, a certain amount of beam intensity must be maintained to obtain reproducible beam loss spikes. In the 2010 run, occasional human errors led to substantial sudden decreases in the beam intensity, if not beam dumps due to high losses, as illustrated in Fig. 10(a). Semiautomatic setup makes it easier for smaller step sizes to be used, leading to a smoother ''shaving'' of the beam shown in Fig. 10(b).

C. Setup times
The time taken to set up collimators is the most important indicator of the efficiency of a setup algorithm. The average time per collimator T average and the total time required T setup are defined as follows: where T beam is the beam time used for setup, C is the number of collimators set up, and d is the number of beam dumps caused by collimator setup. The turnaround   Table VI. The results given in Table VII indicate an increase in the setup time by a factor of 1.7 for the February 2011 injection setup compared to the same setup in 2010. This increase was due to the time required to test the new alignment software. The two beam dumps in this setup were caused by human error when using the manual alignment technique during a phased changeover from manual to semiautomatic software. After debugging the software, an improvement by a factor of 1.5 in the setup time at 3.5 TeV flattop (March 2011) was registered.
For the setups with squeezed and colliding beams (11th of March), the software was upgraded to allow both jaws to move in parallel to the beam. A speed-up by a factor of up to 6 for both modes, respectively, was achieved when compared to the setups at this operating point in 2010. The improvements in time are mainly due to the elimination of beam dumps caused by human error. The average setup time achieved in 2011 was 1.7 minutes less compared to 2010.
The setup results with the semiautomatic alignment algorithm are summarized in Figs. 11(a)-11(d). A comparison of the setup time and total time consumed by collimator setup in 2010 and 2011 is given in Fig. 11(a). In 2011, 295 collimators were aligned, compared to 273 collimators in 2010 [see Fig. 11(b)]. However, the time used for setup decreased by roughly 17 hours. The total time includes the time required for several machine sequences (e.g. ramp and squeeze) when the machine needs to be refilled either at the start of the alignment or when the beam is dumped for reasons other than high losses caused by collimator movement. This value remained approximately the same, although in 2011 three more setups at 3.5 TeV were performed, which in all required $10 hours to reach the operating point.

D. Stability of the alignment settings
The stability of the beam centers at the collimator positions is important to ensure maximal efficiency of the system over time. A case study was available for the IR3 collimators, which were aligned in the 3.5 TeV flattop setup in March 2011, and realigned in July 2011 during a LHC machine development (MD) slot. In the second setup, attempts were made to correct the beam orbit as close as possible to the orbit established in the first setup. The changes in the beam centers of these collimators over a period of four months are presented in Fig. 12. The results show that the centers measured in the second setup are within less than 135 m from the previous values, except the TCSG.5L3.B1 collimator, for which a 243 m shift was registered. Regular monitoring of the collimation system through beam loss maps has shown that the shifts in the centers of this order of magnitude do not reduce the cleaning efficiency of the system [26].

VI. SUMMARY AND OUTLOOK
The motivation for automating LHC collimator setup is to be able to save beam time for physics data taking and beam studies. The development and implementation of the semiautomatic algorithm is part of a phased transition from manual to fully automated collimator setup. It has managed to decrease the setup time (by up to a factor 6), reducing the need for manual intervention. The usage of a user-defined BLM threshold as a stopping value for the jaw alignment algorithm has proven to be efficient as no BLM-triggered beam dumps were recorded.
The parameters used to measure the LHC collimator setup accuracy and performance (beam size ratio and stability) have been defined and discussed. The results show that the semiautomatic collimator alignment method maintains the same collimator setup quality obtained with the slower manual method. Future work will concentrate on a full automation of the collimator setup. A simulator will be used to recreate the beam loss signals as observed on the BLMs when a jaw touches the beam halo. The setup will be modeled as a learning problem.