Simulator for beam-based LHC collimator alignment

In the CERN Large Hadron Collider, collimators need to be set up to form a multistage hierarchy to ensure efficient multiturn cleaning of halo particles. Automatic algorithms were introduced during the first run to reduce the beam time required for beam-based setup, improve the alignment accuracy, and reduce the risk of human errors. Simulating the alignment procedure would allow for off-line tests of alignment policies and algorithms. A simulator was developed based on a diffusion beam model to generate the characteristic beam loss signal spike and decay produced when a collimator jaw touches the beam, which is observed in a beam loss monitor (BLM). Empirical models derived from the available measurement data are used to simulate the steady-state beam loss and crosstalk between multiple BLMs. The simulator design is presented, together with simulation results and comparison to measurement data.


I. INTRODUCTION
High-intensity proton beams are circulated in the Large Hadron Collider (LHC) to collide at a nominal center of mass energy of 14 TeV [1].If not properly cleaned by a dedicated collimation system, the beam losses could cause quenches of the LHC superconducting magnets.Beam collimation is considered to be one of the main challenges to achieve the design high intensity performance.As a result, a multistage collimation system is in place to clean the beam halo and protect against possible damage and radiation effects [2].Each collimator consists of two blocks (jaws) of carbon, tungsten, or copper material.To ensure maximal cleaning efficiency, both jaws of each of the 86 collimators need to be positioned symmetrically around the beam at a particular gap in mm depending on the mechanical aperture, local optics, and beam energy.The jaw gap openings form a hierarchy, whereby the primary collimators (TCP) are closest to the beam, followed by the secondary collimators (TCSG), tertiary collimators (TCT), and absorbers (TCLA).The collimation system layout in insertion regions (IRs) of the LHC rings is shown in Fig. 1.
The local beam centers and beam sizes at the collimators around the LHC are determined via a beam-based alignment procedure described in [4][5][6].During alignment, each jaw is moved in steps of 5-20 μm towards the beam axis until a sharp spike is observed on a beam loss monitor (BLM) located downstream of the collimator.A BLM [7] consists of an ionization chamber which intercepts secondary particles created by the hadronic and electromagnetic showers caused by beam particles impacting on the collimators.The losses are proportional to the current induced in the BLM, which is converted to units of Gy=s.Photographs of an ionization chamber and the BLMs attached to the walls of the LHC are shown in Figs.2a and 2b, respectively.
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 translates into lost integrated luminosity for the experiments.Human error results in incorrect jaw movements, causing high losses and beam dumps, therefore contributing to the setup time.In order to speed up and automate the collimator alignment, several automatic algorithms have been developed [6,8].
A simulator that can predict the beam losses as a function of time for a given collimator jaw movement would be very useful to validate future alignment algorithms, without requiring beam time for testing.In this paper, the typical beam loss pattern observed during alignment is presented, and a model is developed for each pattern component.The operation of the simulator is described, and the simulation results obtained are compared with the measurements during an alignment.

II. ALIGNMENT PROCEDURE
Each collimator is aligned in a four-step procedure, as established in [4].The alignment sequence, involving the reference collimator and the collimator i to be aligned, is shown in Fig. 3.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. 3).The IR7 TCP in the same plane (horizontal, vertical, or skew) as the collimator i is used as a reference collimator.
A BLM signal spike can be attributed to a particular jaw movement if only that jaw was moving when the spike occurs.Hence, the left and right jaws are moved towards the beam separately.After aligning the IR7 TCP, the same procedure is performed for the collimator i (2), and the IR7 TCP is realigned (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 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 σ: One of the constraints during alignment is that a collimator jaw can be declared as aligned to the beam if it was the only one moving when the BLM signal spike occurs.However, the jaws often need to be moved by several mm from the initial parking positions to the aligned positions, and focusing on one collimator at a time has proven to be very time consuming.
As a result, several algorithms were developed to optimize the alignment time.An interpolation of the beam orbit measured by beam position monitors at the collimator locations enables the jaws to be moved in one step from parking positions to tighter settings [9].A certain amount of margin in mm has to be applied to avoid scraping any beam away during this operation.The parallel alignment algorithm FIG. 1 (color online).The LHC collimation system layout [3].The collimator jaw gap openings form a hierarchy, whereby the primary collimators (TCP) are closest to the beam, followed by the secondary collimators (TCSG), tertiary collimators (TCT), and absorbers (TCLA).
is capable of moving the collimator jaws simultaneously until each jaw touches the beam [6].This is followed by the sequential alignment algorithm [6], which realigns the TCP and each of the other collimators one by one to determine the final beam center and beam size.The parallel and sequential algorithms rely on feedback from BLMs to automatically move in the jaws until a predefined beam loss threshold is exceeded.

III. BEAM LOSSES DURING ALIGNMENT
The BLM data is acquired at a rate of 1 Hz, and each value consists of the integrated dose over the previous 1.3 s.A typical loss pattern observed in the BLM signal when a jaw touches the beam halo is illustrated in Fig. 4. The three pattern components include the loss spike, loss decay, and steady-state signal.During an alignment, the loss decay may last from approximately 3 to 10 s, depending on the transverse cut made by the jaw.
BLM signal crosstalk is another phenomenon that must be modeled on a global scale.Crosstalk occurs when a collimator jaw touches the beam, which causes beam loss spikes to appear in multiple BLM signals, some of which may be associated with other collimators.Any collimators relying on data from these BLMs may be stopped by the beam loss feedback algorithm, and hence understanding which collimators are likely to be stopped in the event of another collimator touching the beam is key to building an accurate simulator.

IV. BEAM LOSS MODEL
Data used to build the model described in this paper were collected from four collimator alignment campaigns with proton-proton beams: two in 2011, at 450 GeVand 3.5 TeV, FIG. 2 (color online).Beam loss monitor without its casing (top) and installed near a primary collimator in the LHC (bottom, encased in a red box).FIG. 3 (color online).The four-stage beam-based alignment procedure for collimator i [6].The IR7 TCP is aligned to form a reference cut in the beam halo (1).Collimator i is aligned (2), followed by a realignment of the IR7 TCP collimator (3).Finally, collimator i is opened to its position in the hierarchy (4).and two in 2012, at 450 GeV and 4 TeV, respectively.Models were developed for the three components of the loss signal structure.

A. Steady state
The steady-state BLM signal is the result of beam dynamics processes such as intrabeam and beam-gas scattering, and increases with the cut made by a collimator jaw in units of beam σ.An empirical analysis was performed, using data from four major alignments in 2011 and 2012, at beam energies of 450, 3500, and 4000 GeV.
A steady-state sample is defined to be the average of the last 5 s of values of a collimator BLM when no collimator was moving in the previous 10 s.A script was written to extract hundreds of samples for each collimator BLM.In many cases, the jaws were stationary for more than 10 s, and hence multiple samples were collected for a given jaw half gap in units of beam σ.Polynomial fits of the form were applied to plots of the samples as a function of the jaw half gap for each collimator, where a, b, and c are fitting parameters.The average BLM signal before and after the loss spike was found to increase exponentially with the half gap between the jaw position and the beam center (see Fig. 5).This is expected, as the beam halo population increases as the jaw approaches the beam core.An empirical model for this component of the BLM signal can therefore be developed.For simulation purposes, the steady-state loss rate can therefore be calculated from the fit equation depending on the distance of the jaw from the beam center.

B. Loss spike and decay
A beam diffusion model for the LHC [10], based on the one developed for the Tevatron data [11,12], is able to accurately predict the BLM signal spike and decay.The particle loss rate at the collimator is equal to the flux at that location: The rate measured by the BLMs can be expressed in terms of the particle loss rate L, a calibration constant k, and a background term B: The local losses are proportional to the gradient of the distribution function at the collimator.The value of the gradient at the collimator for an inward collimator step is given by The parameters A i and A f are the slopes of the distribution function before and after the step, with A c varying linearly between A i and A f as the collimator moves.The function PðxÞ is the cumulative Gaussian distribution, and the w term is defined as w ≡ ffiffiffiffiffiffiffiffi 2Dt p . An example of a fit to experimental BLM data using Eq. ( 4) following an inward jaw movement is shown in Fig. 6.

C. BLM signal crosstalk
Several simulation studies have been performed with the Monte Carlo particle code FLUKA [13] to predict the shower crosstalk generated when particles impact the collimators.A response matrix was developed in [14] to disentangle the individual contributions of showers from upstream collimators.Another study focused on evaluating the dependency of the BLM signal on parameters such as BLM misalignment, impact parameter, and beam-jaw angle [15].However, two factors tip the balance in favor of using an empirical approach.The first is that it is very time consuming to perform multiple FLUKA studies for the dynamic environment of collimator alignment, where there are a very large number of possible combinations for the jaw positions of 86 collimators.The second factor is that plenty of BLM data are available from alignments in the first few years of the LHC running period.
Hence, an empirical model of the ratios of the spikes in BLM signals of stationary collimators to the spike in the BLM signal of an aligned collimator was constructed.This type of model is independent of any assumptions related to jaw material, LHC geometry, and detector efficiency, and is only dependent on the two parameters relevant to the alignment, namely the relative distance of one BLM from another, and the jaw half gap.The model is based on data from four major alignments in 2011 and 2012 held at beam energies of 450 GeV, 3.5 TeV, and 4 TeV.
A script was written to extract 620 spike samples of 21 s each from the alignment data.The script ensures that only one collimator was moving in the 21-second interval, and extracts its BLM signal as well as the BLM signal for all other collimator BLMs with a peak amplitude for the same time stamp of > 1 × 10 −6 Gy=s (a factor 2 above the noise level).Examples of such samples is shown in Figs.7a  and 7b.Each of these 620 plots was then verified manually to ensure that only signals with a similar pattern to that of the aligned collimator were processed further.For example, virtually all of the BLM signals in Fig. 7a have an identical pattern to that of the BLM signal associated with the aligned collimator (TCP.C6R7.B2), but only a few signals in Fig. 7b have a similar pattern to that of the TCLA.6R3.B1 BLM signal.The ratios, or "factors," between the spikes of the other collimators to that of the aligned collimator were calculated and plotted as a function of the relative distance from the aligned collimator.An example of this "crosstalk factor map" is shown in Fig. 8.
The relative positions, jaw half gap of the aligned collimator, and factors were fed into RAPID-MINER, a software suite which allows for quick data import, processing, and output [16].The nearest neighbor algorithm [17] was used to develop a model that can predict the factor that must be applied to the BLM signal of an aligned collimator, for another collimator BLM at a given relative distance and

V. SIMULATOR DESIGN
Five "alignment policies" were developed, each of which combines the various alignment algorithms described in Sec.II to attempt to align the collimators in the shortest time possible.A policy is defined as a subgroup of several alignment algorithms, and one of the objectives of the simulator will be to determine which policy achieves the least alignment time.The alignment policies are: Policy 1-sequential alignment algorithm: Policy 2parallel alignment algorithm; sequential alignment algorithm: Policy 3-movement of all collimators with a half gap larger than 6σ from parking to tighter settings based on Beam Position Monitor (BPM) interpolation; parallel alignment algorithm; and sequential alignment algorithm; Policy 4-movement of all collimators with a half gap larger than 6σ from parking to tighter settings based on BPM interpolation; parallel alignment algorithm utilizing knowledge of crosstalk factors; and sequential alignment algorithm: Policy 5-movement of all collimators with a half gap larger than 6σ from parking to tighter settings based on BPM interpolation; initially, parallel alignment algorithm for all collimators (when the first jaw touches the beam, the collimators are aligned in subgroups utilizing knowledge of crosstalk factors); and sequential alignment algorithm.
The simulator was written in MATLAB, and was based on the existing user interface of the operational collimator application.The collimator and BLM data acquisition modules of the operational application were adapted to transmit and receive data to and from the simulator engine.The simulator algorithm works as follows.First, an initialization procedure is executed: (1) Choose beam centers randomly from a uniform distribution in the range of AE300 μm, based on past alignment data; (2) calculate the beam sizes at the collimators for a given geometrical beam emittance; (3) set the jaws to the initial positions around the beam center, in order that they respect the four-stage hierarchy; (4) initialize the BLM signals for each collimator to the steady-state signals given the starting jaw positions.The initial beam halo is defined to be at 3.5 beam σ, and no loss spikes are simulated for jaw movements beyond this limit.After the first jaw touches the beam, the halo is defined by the jaw closest to the beam.The initialization procedure is followed by a loop which aligns all the selected collimators according to the selected alignment policy (P s ), described in pseudo-code below: (i) If P s ¼ 3, 4, or 5, start by moving the jaws at a half gap of >6σ from parking to a tighter setting of ∼6σ around the interpolated center.The interpolated center is generated by choosing a random value in the AE500 μm range around the measured data.(ii) Then, or if P s ¼ 2, 3, 4, or 5: (a) Set the BLM thresholds using the threshold selection algorithm [18].If P s ¼ 2, 3, or 5, move both jaws of all collimators in the horizontal plane until one of the jaws exceeds the beam halo limit.If P s ¼ 4, move both jaws of collimators which have crosstalk factors < 1 with respect to (wrt) the collimator closest to the beam in units of nominal σ in the horizontal plane, until one of the jaws exceeds the beam halo limit.(b) Generate a spike and temporal decay with the diffusion model.(c) Generate crosstalk using the nearest neighbor model, and check if the thresholds of other BLMs are also exceeded.(d) If yes, execute the crosstalk recovery algorithm: Stop all collimators.Then move each collimator one by one until the one at the beam is identified.Then, if P s ¼ 2, 3, or 4, resume parallel alignment of the remaining collimators which are still far from the beam.If P s ¼ 5, resume parallel alignment of both jaws of collimators which have crosstalk factors < 1 wrt the collimator closest to the beam in units of nominal σ in the horizontal plane.(iii) Then, or if P s ¼ 1, repeat step 2, instead aligning the TCP in the same plane as the collimator C to be aligned, followed by alignment of collimator C, and so on until all collimators in the same plane are aligned.(iv) Repeat steps 1-3 for all horizontal, vertical, and skew collimators.
For every collimator movement, a command transmission time of 0.125 s is considered to simulate the delay between the alignment software application running in the CERN Control Center and the hardware in the LHC tunnel.The beam intensity is simulated by converting the BLM signal at the collimator closest to the beam to p/s using a calibration factor (1.25 × 10 12 p=Gy).It is assumed that the calibration factor determined for the IR7 primary collimators during dedicated beam scrapings as presented in [19] are equivalent for all other collimator BLMs.

VI. SIMULATION RESULTS
Simulations were performed for various beam energies and collimator settings using the simulator described in Sec.V.For each policy and beam energy, the simulation was run for 50 times to obtain the final results in a Monte Carlo fashion.The collimators were divided into subgroups which are frequently aligned, such as the IR7 or TCT collimators.The simulation outputs include the jaw positions for each collimator, the signal of each collimator BLM, and the beam intensity variation throughout the alignment.
Typical simulation results showing the jaw positions and BLM signal as a function of time are shown in Fig. 9a.Crosstalk appears during the sequential stage as the alignment is being done in parallel with a collimator in the other beam.Only the crosstalk spike and not the decay is plotted for clarity.A zoom of the final sequential alignment is shown in Fig. 9b.Measured data for similar jaw movements are provided in Fig. 9c for comparison.The simulated beam intensities throughout an alignment are provided in Fig. 10.Note that no beam instabilities or normal beam loss are taken into account, hence the smooth decrease in the beam intensity over time.
Simulation results for 450 GeV alignment are shown in Figs.11a to 11f.A 10 μm jaw step size was used, similar to real alignments.The initial beam centers which are later used as a basis for the uniform distribution were taken from alignment data at 450 GeV.The total alignment time and average time required by each collimator are shown in Figs.11a and 11b, respectively.Policy 3 achieves the best alignment time for the "IR3" and "All" collimator groups, while Policy 5 achieves the best time for the other groups.
It appears that Policy 4 performs even worse than Policy 2. Recall that Policy 3 and Policy 4 are similar, except that Policy 4 attempts to speed up the alignment by using knowledge of the crosstalk factors to align selected subgroups of collimators in parallel.A possible explanation for this is that although the subgroup of collimators with low crosstalk factors with respect to the closest collimator to the beam move for extended periods of time without   interruptions due to crosstalk, the gain achieved by moving all collimators in parallel in spite of more frequent interruptions is larger.Policy 5 allows a gain in time at the start, as all collimators are initially moved simultaneously until the beam is touched for the first time, and hence performs better than Policy 4 in each case.Nevertheless, it is outperformed by Policy 3 for the "IR3" and "All" groups, as crosstalk is mostly prevalent in IR7 where there is a large concentration of collimators.The final beam intensities for B1 and B2 at the end of the alignment are provided in Figs.11c and 11d, respectively.As expected, the larger the number of collimators that need to be aligned, the larger the intensity decrease, as the jaws cut further and further into the halo as the alignment progresses.This is linked to the final collimation depth in units of beam σ in Fig. 11e, which is the half gap of the last TCP collimator to be aligned during the sequential phase.The actual time required to complete the simulation is shown for reference in Fig. 11f.The simulations were performed on a Mac Pro desktop computer, with a 2.8 GHz Quad-Core Intel Xeon CPU and 8 GB of RAM.
Similar plots are shown in Figs.12a to 12f for 4000 GeV, and Figs.13a to 13f for 7000 GeV.At 4000 GeV, Policy 3 achieves the fastest alignment time for the "IR3" and "IR3 þ IR7" collimator groups, Policy 4 achieves the best time for IR7 and Policy 5 achieves the fastest time for an alignment of all collimators.For the simulations at 7000 GeV, similar results were achieved, except that for an alignment of all collimators, Policy 3 performs better than Policy 5.The change in performance for the various   policies is due to the different initial settings in each case.At 4000 GeV, the "tight" collimator settings [20] are used, where the IR7 collimators are much closer to the beam initially.Hence, the initial time gain provided by Policy 5 is attenuated, and it is expected that Policy 4 performs better for an alignment of the IR7 collimators.This is not the case for an alignment of all collimators, as the IR3 collimators    The step size was changed to 5 μm, which is used during alignments at 4000 GeV due to the smaller beam sizes.In each case, no results are shown for the TCT collimator subgroup for Policy 3 and Policy 4, as there is a poor comparison between the BPM-interpolated and the measured beam centers at these collimators, and hence the algorithm that moves the jaws from the initial settings to the tighter settings cannot be used.For every simulation, the jaw centers determined during the simulation agree with the initially generated beam centers within the specified jaw step size (5-10 μm).

VII. COMPARISON WITH MEASUREMENT DATA
The measured and simulated alignment times agree within less than a factor of 2 [6] for Policies Comparisons between measurements and simulations for Policies 1, 2, and 3 are also shown in Figs.15a, 15b, and 15c, respectively, where the number of collimators aligned is plotted as a function of time.The gaps in the simulated data for Policies 2 and 3 are due to the execution of the parallel alignment algorithm, in which the collimators are positioned coarsely around the beam before they are aligned sequentially together with the reference collimator.The pause in the measured data for Policy 2 derives from beam instabilities which were producing large beam losses, and hence no collimators could be aligned before they were corrected.
The final collimation depths are very similar to what is achieved in the real alignments [see Fig. 16a].There is less than a factor 2 difference between the final measured and simulated intensities [see Fig. 16b], as the steady-state intensity loss due to the jaw position is not taken into account.Nevertheless, the simulator provides a good means of validating the performance of future alignment algorithms without requiring beam, particularly in choosing which combination of alignment policies to be used for the subset of collimators which need to be aligned.

VIII. CONCLUSION
Beam-based collimator alignment is required in the LHC to ensure that the machine is protected from fast losses, and that the beams are cleaned from halo particles with the maximum efficiency.A simulator was developed to predict the BLM signal characteristics for a given set of collimator jaw positions.Separate empirical models based on previous alignment data predict the steady-state and crosstalk BLM signal, while a beam diffusion model predicts the signal spike and decay when a collimator jaw touches the beam.Simulations were performed for several alignment policies at three beam energies: 450 GeV, 4 TeV, and 7 TeV.The results show that a careful selection of the policy, based on the collimator group and initial jaw settings, will result in a quicker alignment time.The simulator will continue to be used to test future collimator alignment algorithms without requiring dedicated beam time.

FIG. 4 (
FIG.4(color online).BLM signal pattern observed when a collimator jaw touches the beam halo following a step of 10 μm at 9 s.

FIG. 5 (
FIG. 5 (color online).Example of a polynomial fit applied to the average BLM steady-state signal as a function of the jaw half gap, for a primary collimator in IR7.

FIG. 9 (
FIG. 9 (color online).Simulation results for the alignment of the TCLA.A6R7.B1 using Policy 3. The zoom into the sequential stage provides a better view of the simulated loss spikes and temporal decay.The impulses are BLM signal crosstalk generated by other moving collimators, with the temporal decay not being plotted for clarity.The measured data in the third plot serve as a comparison.(a) Full alignment (simulated data).(b) Zoom into sequential alignment (simulated data).(c) Zoom into sequential alignment (measured data).

FIG. 14 (
FIG. 14 (color online).Comparison of simulated and measured alignment times for full alignments at top energy for each policy.(a) Total alignment time.(b) Average alignment time.

FIG. 15 (
FIG. 15 (color online).Comparisons of the measured and simulated number of collimators aligned as a function of time, for Policy 1, Policy 2, and Policy 3. The alignment was paused for 1.5 hours in the 2012 setup (Policy 2) while beam instabilities were corrected.(a) Comparison for Policy 1.(b) Comparison for Policy 2. (c) Comparison for Policy 3.
1 and 2, and approximately a factor 4 for Policy 3, as shown in Figs.14a and 14b.The measured data was taken from the alignments at top energy in March 2011, March 2012, and October 2012.For the third data set, only half of the collimators were aligned, and hence the final measured time is calculated via linear extrapolation.Policies 4 and 5 are not included in the comparison as only simulation results exist.In practice, the alignment takes much longer due to unforeseen beam instabilities, human checks, the momentum cut in IR3 and imperfect loss spikes.

FIG. 16 (
FIG. 16 (color online).Comparison of measured and simulated beam intensities and collimation depths at the end of the alignment.(a) Collimation depths.(b) Beam intensities.
Phys.Rev.ST Accel.Beams 17, 021003 (2014)021003-5 with a given jaw half gap.This nonparametric supervised learning algorithm performs a regression which predicts a value depending on the closest class, and is useful when reliable parametric estimates of probability densities are unknown or difficult to determine.A test-to-train ratio of 50=50 was used.Note that for BLMs associated with collimators in the opposite beam, the jaw half gap parameter is weighted to 0. A root mean square error of 1.15 was achieved, which corresponds to a prediction error of 17% when normalized to the dynamic range.One model was obtained for each collimator BLM.A table showing the typical inputs and predicted factors is shown in TableI.
FIG. 7 (color online).Superimposition of the highest BLM signals following an alignment of the TCP.C6R7.B2 and TCLA.6R3.B1 (marked in solid red lines in the respective plots).(a) Aligned collimator: TCP.C6R7.B2.(b) Aligned collimator: TCLA.6R3.B1.FIG. 8 (color online).Crosstalk factor map for the TCP.C6L7.B1, consisting of the ratios between spikes observed in other collimator BLM signals to the spike at the BLM behind the collimator being aligned, as a function of the relative distance between the two BLMs in the LHC.The data is taken from alignments at 450 GeV.SIMULATOR FOR BEAM-BASED LHC COLLIMATOR …

TABLE I .
Typical input values, the factor predicted using the nearest neighbor model (F pred ), and the actual factor from the testing data set (F test ) for comparison to F pred .The root-meansquare error value for the whole data set is 1.15.
SIMULATOR FOR BEAM-BASED LHC COLLIMATOR … Phys.Rev. ST Accel.Beams 17, 021003 (2014) 021003-9 are initially much more open, and therefore Policy 5 performs best for this collimator group.At 7 TeV, the nominal collimator settings [20] are used, with the collimator openings in IR7 slightly more relaxed than at 4 TeV.Hence, similar results are obtained, with a shift to Policy 3 in terms of best performance for an alignment of all collimators.