Simultaneous Global and Local Alignment of the Belle II Tracking Detectors

The alignment of the Belle II tracking system, composed of a pixel and strip vertex detectors and central drift chamber, is described by approximately sixty thousand parameters; from local alignment of sensors and wires to relative global alignment of the sub-detectors. In the next data reprocessing, scheduled since Spring 2021, we aim to determine all parameters in a simultaneous fit by Millepede II, where recent developments allow to achieve a direct solution of the full problem in about one hour and make it practically feasible for regular detector alignment. The tracking detectors and the alignment technique are described and the alignment strategy is discussed in the context of studies on simulations and experience obtained from recorded data. Preliminary results and further refinements based on studies of real Belle II data are presented.


Introduction
The Belle II detector at the SuperKEKB accelerator (KEK, Tsukuba, Japan) [1] has accumulated approximately 90 fb −1 of collision data by the end of 2020. One of its main goals is precision measurement of Time-Dependent CP-Violation, which require excellent performance of the vertex detector and its alignment. At the beginning of Spring 2021, a reprocessing and recalibration of the whole dataset is planned to deliver the best available performance for physics analyses on top of a preliminary, so-called prompt calibration. The prompt calibration is performed regularly after data taking in blocks spanning several weeks, called buckets, and is mostly automated [2].
The alignment of the Belle II vertex detector and the drift chamber is unified [3] and solved simultaneously at local and global level. Local level alignment degrees of freedom are parameters of sensors and (optionally) wires. Global level alignment describes larger structures, like layers of the drift chamber. The main motivation for this approach is to avoid systematic biases, which naturally occur when the alignment of (correlated) local and global degrees of freedom, especially for different sub-detectors, is performed separately.
In the prompt calibration, the individual wires of the drift chamber were not aligned and the alignment constants for the wires were kept from Spring 2019, where a large amount of data taken without magnetic field was available. To fully understand and optimize the full alignment with wires, studies were performed on simulations -to understand the impact of sub-detector alignable elements alignment parameters parameters IP primary vertex position x, y, z 3 VXD 20 (PXD) + 187 (SVD) sensors u, v, w, α, β, γ 120 + 1,122 (PXD + SVD) P 20 , P 11 , P 02 60 + 561 P 30 , P 21 , P 12  various data samples and constraints on the residual systematic misalignment. These studies became practically feasible due to recent developments and optimizations of our central alignment tool, Millepede II [4,5].
The following sections summarize the method and further tests and optimizations based on misalignment studies, as well as preliminary results using a subset of the Belle II dataset. The main alignment challenge are linear combinations of the alignment parameters to which residual minimization is generally insensitive, known as weak modes. Weak modes usually describe long-range correlated systematic distortions of the detector which can negatively impact physics observables. For example, the radial expansion discussed later would result in a shift of invariant masses of decaying particles. Weak modes dominate the final alignment solution errors, referred later as alignment systematics or residual misalignment. The methods to mitigate weak modes range from using rich variety of data sample topologies to special constraints. For the vertex detector, an important role plays a geometrical constraint resulting from overlapping sensors and usage cosmic ray particles with wide range of impact parameters.

Alignment Degrees of Freedom
The alignment parameters discussed in this contribution are listed in Table 1. In the global coordinate system, the z-axis is defined as the Belle II solenoid axis; the y-axis is vertical upwards.
At SuperKEKB, the size of the interaction region is very small (about 10 µm in x, < 1 µm in y and about 300 µm in z) to reach record luminosities. Using this information during the alignment process can lead to significant improvements, but the calibrated position of the interaction point (IP), parametrized by three global offsets (x, y, z), is highly correlated to alignment and thus should be ideally aligned simultaneously with the detector or separately after the detector alignment is already well known.
The vertex detector (VXD) is composed of two 1 layers of DEPFET pixel sensors (PXD) [6] and four layers of double-sided strip silicon sensors (SVD) [7], see Fig. 1. VXD is further organized in ladders and (four) half-shells. The sensors and half-shells are treated as rigid bodies with three shifts and three rotations around the respective local axes 2 (u, v, w, α, β, γ) 3 and (x, y, z, α, β, γ), respectively. To account for surface deformations of the silicon sensors, the sensors' surfaces are parametrized by Legendre polynomials up third order (parameters P 20 , P 11 , P 02 for second order and P 30 , P 21 , P 12 , P 03 for third order). 1 Currently, only four sensors are installed in the second layer. 2 The local axes correspond to global coordinates in case of the half-shells 3 With origin at sensor center, w is perpendicular to sensor surface, v (corresponding to the global z-direction for nominal sensor placement) points along the longer and u along the shorter side of the sensor (R − φ-direction).  The Central Drift Chamber (CDC) is composed of 56 layers 4 , organized in nine superlayers (with alternating stereo and axial layers) and three main mechanical parts -small cell chamber, conical section and main part, see Fig. 2. The alignment of the CDC layers is parametrized by two shifts and a rotation at the backward plane (x, y, φ) and the differences of the shifts and rotation between forward and backward plane (dx, dy, dφ). The alignment is determined relative to the mechanical survey of the CDC, where also wire tensions are measured to parametrize gravitational sagging of the wires.
Global movements of the tracking system are suppressed by imposing constraints on average of corrections in the CDC layer parameters x, y, φ, dx and dy. In addition, usually a constraint on the sum of corrections to dφ is used: 55 l=0 dφ l = 0, effectively fixing the twist of the drift chamber. Finally a z-offset constraint: 55 l=0 R l tan(φ stereo l ) φ l = 0, where R l is the radius of layer l and φ stereo l is the stereo angle of the layer (zero for axial layers), is necessary due to a very limited CDC resolution in the z-coordinate. The z-offset constraint can be omitted, similarly as x and y constraint, if another reference is provided by previously determined position of the interaction point.
The CDC has about 14 × 10 3 sense wires, whose alignment is parametrized by two shifts at the backward (x B , y B ) and forward end-plate (x F , y F ) relative to their position in the layer.
The additional global degrees of freedom introduced for VXD half-shell and CDC layer alignment are removed by imposing corresponding equality constraints on parameters of sen- 4 The layers of CDC are numbered from zero, so layer 55 is the last (outer) layer.  Figure 3. The impact of radial constraints on residual radial misalignment. Full alignment with wires is performed using all three data samples (IP fixed) from Sec. 3 on MC without initial misalignment. The projection of the residual wire misalignment into radial coordinate ∆R is averaged over wires in bins of wire radius R. Open and full markers show corrections at backward and forward end-plate, respectively. The trivial case with layer radius constraint used for all layers (black) is compared to layer radius constraint for outer layer (red -with a sizable weak mode deformation), CDC radius constraint (green) and their combination (blue). sors and wires. In addition, preliminary studies on simulated events revealed the need to remove very weakly defined radial degrees of freedom leading to the modification of the outer radius of the drift chamber. Two types of constraints are considered:

Belle II Simulation
• Layer radius constraints for a particular layer l, implemented by projecting wire offsets into the radial coordinate as where φ w is the angle of the vector pointing to wire w from the origin.
• CDC radius constraints fixing average radius change over all wires at both sides: The effect of these constraints and their combination is illustrated in Fig. 3. Most of the simulation studies are performed using the layer radius constraint for all layers (black points). However, the combination of the CDC radius constraint and the layer radius constraint for some outer layer can be used for real data alignment, too, especially in case the real layer radius misalignment is significantly larger than residual variations in range ≈ ±20 µm, visible in the figure (blue points).

Track Parametrization and Data Samples
For the parametrization of tracks in the alignment, the General Broken Lines (GBL) track model [8] is used, integrated in the GENFIT toolkit [9] and the Belle II software framework [10]. To take multiple scattering effects properly into account, the detector material distribution along the track is obtained during extrapolation and translated into a sequence of equivalent thin scatterers [11]. In the GBL formalism, the entire covariance matrix of a track or a combined object (multiple tracks related via transformation at a common point) is constructed. This matrix is essential for the global alignment approach by Millepede II.
One of the goals of this study is to reach good alignment without the cosmic ray sample where the magnetic field is turned off, where data can be collected only during a limited period at the start and end of data taking. Instead, we utilize three main data samples with large amount of recorded events and their MC equivalents: • Cosmics (in magnetic field): Special reconstruction is used for cosmic-ray tracks, merging them into a single trajectory. For data, a dedicated calibration skim with cosmic ray tracks recorded during collisions is used.  • Hadrons: For MC, charged tracks from generic B-decays are used. For data, alignment does not select B decays specifically and uses a general hadron skim, which contains mainly multi-track hadronic events. This is a low momentum sample with a large amount of tracks available for alignment. For earlier data taking periods with lower luminosity, all reconstructed tracks 5 were used instead in the prompt alignment.
• Dimuons: e + e − → µ + µ − events have a similar cross-section as Υ(4S ) production, have a very clean signature and low background and constitute an important data sample for many calibrations. The alignment framework performs a vertex fit and constructs a GBL trajectory which combines both tracks in a single fit correlating them via the parameters at the common point of the vertex. In addition, an external measurement is added to the vertex position with a residual equal to the difference of the calibrated position of the IP and the reconstructed vertex. As an uncertainty of this external measurement, we use calibrated covariance of the interaction region ellipsoid. The alignment can be configured to use this position as a fixed constraint (IP fixed) or determine a general offset (IP free).
To study the performance of the prompt alignment on MC, we model real data scenario by a combination of cosmic (≈ 10 6 tracks) and hadron (≈ 5 × 10 5 tracks) samples. For preliminary MC studies of the full alignment with wires, all three previously named data samples are combined (≈ 5 × 10 5 cosmics, ≈ 2 × 10 6 hadrons and ≈ 5 × 10 5 dimuons). Based on simulations, the sample composition was further optimized by using twice as large dimuon sample (≈ 1 × 10 6 ). Approximately the same size and composition of data samples is used for real data.
We confirmed that dimuons are essential to remove the main weak modes in the full alignment with wires. This is illustrated in Fig. 4, where the alignment settles in a sizable weak mode without dimuons (blue points). The residual misalignment without dimuons also shows a degradation of VXD alignment at both half-shell and sensor level, and would be not acceptable for precision physics.

Solution Methods and Computing Requirements
In Millepede II [4], the alignment problem is solved by means of the linearized least squares method. The objective χ 2 function is a sum of (uncorrelated) normalized track-to-hit residuals: where m i, j is a single measurement (hit), p i, j is the prediction from the track model and σ i, j is the measurement uncertainty. The minimization is performed over (many millions of) parameters of all trajectories (single tracks or combined objects for decays) q i and thousands of alignment parameters p. The structure of the matrix allows to reduce by block matrix algebra the dimension of the problem to the number of alignment parameters, keeping all correlations in the solution. The reduced matrix problem does however still require the solution of linear equation in N ≈ 60 × 10 3 variables.
For the smaller problem without wires (N ≈ 3 × 10 3 ), only several minutes are needed for the solution by inversion or diagonalization 6 . For the large problem with wires, we have investigated an approximate solution method based on generalized minimization of residuals (GMRES, with about 1 hour solution time) as well as an exact solution via decomposition [5]. The latter was found to perform better in both, technical and practical aspects.
Recent developments utilizing libraries for high-performance matrix algebra decreased solution times for Cholesky decomposition to about one hour or less for the full problem with N = 60, 000. In Millepede II, the matrix problem is by default solved once and further iterations update the solution by removing outliers. These operations as well as the elimination of linear equality constraints may be subject to further optimizations.
The memory requirements are dominated by the need to store the reduced matrix and are smaller than 20 GB for the full problem with wires. The recent speed-ups allow significantly faster alignment studies and better utilization of the existing infrastructure already available for the alignment.

Alignment Strategy
It was repeatedly verified on data and simulations that our method can recover even from large initial misalignments. This process is not automated, but can be achieved by simply relaxing track quality requirements and scaling measurement errors in several iterations with the full reconstruction, with increasing tracking efficiency.
It should be noted that for recovery from large misalignment, only a combination of cosmic (with or without magnetic field) and collision tracks should be used For recovery from large misalignment, only a combination of cosmic (with or without magnetic field) and collision tracks should is used and therefore also wires are not be aligned. It can be seen in Fig. 4 that without dimuons, the alignment shows a large weak mode. With IP-constrained dimuons (with floating IP) used from the beginning, the method was observed to not converge from large misalignment to correct values on simulations.
While the alignment of the IP position is implemented within our method, the timedependence observed in real data is not determined during alignment. The issue is not the larger number of parameters, but the need to utilize a very large amount of data to reach desired statistical precision in each time interval. The position of the IP can vary by more than 50 µm inside a bucket. On the other hand, relative movements of the VXD with respect to CDC seem to be on order of 10 − 20 µm over a bucket. Thus, the drifts of the IP need to be corrected before being used as a constraint in the full alignment with wires, while VXD movements may be neglected and corrected ad hoc later in the final run-dependent alignment.
Therefore the alignment is split into two stages. The first stage is the prompt calibration, where initial alignment is performed, followed by full intra-run dependent IP calibration, which takes all available (pre-scaled) di-muon events into account. The second stage is the reprocessing calibration, where the previously determined time-dependent IP position is fixed, providing an additional constraint 7 . This is equivalent to keeping the global offsets of VXD and IP as determined by prompt calibration. According to MC studies, these offsets are in the range of several micrometers (largest for z-direction -about 10 µm) and can be neglected. In Fig. 5, we show the global offset in the y direction, caused by the dominant   Figure 6. The sensors of the VXD are misaligned according to the nine typical systematic distortions (radial expansion, telescope, twist, etc.) and aligned with the MC model of the prompt alignment (cos-mics+hadron, without wires). For each mode, fit of the amplitude of the initial misalignment A(0) (red curves) and final alignment A(n) (blue curves) at the final n-th iteration with full reconstruction is shown. The fit parameters are scaled such that the amplitude corresponds to deviation of the most misaligned sensor (at R ≈ 14 cm and z ≈ 30 cm for the top and bottom row, respectively). The iterations are stopped when alignment corrections are compatible with statistical errors of the parameters. The misaligned sensor positions (black points) are shown in local coordinates before a shift to the constraints' reference system. Aligned sensor positions (red points) are shown in local coordinates, too, such that global half-shell movements are subtracted. residual systematics in CDC layers 8 . We compare the alignment without wires (prompt) and with wires. With wires, the residual systematic misalignment of the layers can be seen to slightly increase by several micrometers in some cases and even the sign of the deformation is reverted (at layer level -compare this to Fig. 4 where residual misalignment for wires in the same study is shown using the same color code), but the layers are still aligned on average better than 10 µm. Note that the global offsets of VXD (and IP) are due to the remaining deformations in CDC layers induced by the alignment and do not represent relative misalignment of VXD with respect to CDC, which is controlled to ≈ 1 µm precision.

Misalignment Studies
Without wire alignment, the final residual misalignment is almost independent of the initial misalignment applied. It was verified our method can recover from the initial misalignment (extracted from real data) as well as random and/or certain correlated misalignments. For the VXD, the alignment of the nine typical global systematic distortions (weak modes) [13] for a cylindrical detector in magnetic field is tested explicitly, see Fig. 6. For most of these, both large (≈ 700 µm, an example is shown for curl deformation) and medium (≈ 50 µm) initial deformation were exercised. In all cases, the alignment is able to recover to negligible residual systematic misalignment. The largest remaining recognizable deformation is the z-expansion (z-scale), with an amplitude ≈ −1.4 µm. Some systematic patterns can be also recognized in φ-dependent systematics, where elliptical effects are the next most significant weak mode with an amplitude ≈ 1.0 µm. The largest individual deviations are due to slanted SVD sensors. Systematic deformations at this scale have a negligible impact on physics performance. The residual misalignment for VXD sensor parameters, measured as the standard deviation of the difference of true and aligned values is better than required targets for no physics impact -for example about 1 µm is achieved for u, v, w while the upper limit is about 3 µm as determined in previous studies [12].
With the wire alignment, we have discovered additional residual distortions in misalignment studies, which we reduce by imposing radial and R − φ constraints separately for wires in upper/lower and left/right hemisphere in the outer layer at both sides, removing four more degrees of freedom.
For a realistic test, the wires are misaligned with data-like misalignment, which respects the basic constraints and radial constraints. No average radial misalignment per layer is applied. The outer layer is subject of the additional constraints, but the misalignment does not respect it. This introduces small additional artificial, but somewhat realistic, systematic misalignment. The comparison of the initial and residual misalignment is shown in Fig. 7. For this study, the vertex detector and CDC layers are not misaligned to check for possible degradation due to the additional degrees of freedom from wires. No significant degradation is observed in comparison to alignment without wires. To verify the negligible physics impact of the residual misalignment reached in this study, we compare distributions of the reconstructed momentum and impact parameters to ideal MC simulation without misalignment, see Fig. 8.

Preliminary Results on Data
To demonstrate the method, data taken before the Summer shut-down in 2020 calibrated with prompt calibration are used 9 . Any previous 10 wire alignment was reset to the survey positions 11 . For a preliminary check, cosmic rays in magnetic field are utilized to analyze helix parameter correlations. The alignment generally performs well already without aligned wires, but we find evidence of potentially problematic correlations, which seem to be largely removed by the full reprocessing alignment.
In addition, preliminary studies revealed that the removal of some constraints does further improve the cosmic validation results. We achieve the best performance by using only the  Figure 7. Realistic misalignment is applied to CDC wires (black) and the full alignment is performed with the layer radius constraints for all layers (except last) and the hemisphere constraints for the outer layer. The residual misalignment after a single iteration is shown in red. Two left-most columns: Wire-by-wire misalignment in the alignment parameters x F , y F , x B , y B . RMS in the legend denotes the standard deviation of the initial/final misalignment parameters. Wires are numbered in increasing order in φ (starting at φ = 0) and radius. Vertical dashed lines show the beginning and the end of the conical section. Right column: same wire misalignment projected to radial (∆R, top) and circular coordinate (R∆φ, bottom) -mean (and its error) over all wires as function of azimuthal angle.  Figure 8. MC validation of the impact of residual misalignment using simple particle gun generating pions at exactly 2 GeV/c from IP (50 × 10 3 events). Reconstructed particle momentum (left), transverse impact parameter (middle) and longitudinal impact parameter (right) are compared for ideal (cyan) geometry and geometry with residual misalignment (black) from the study shown in Fig. 7. Note that the global offsets of VXD from prompt alignment would result in additional shifts of the impact parameter distributions, but these effects are (if small) only observable in MC studies like this one, where the true vertex of the generated particles is known.

Belle II Preliminary
Experiment 12; Runs 5888 -6427 (subset); June 18th -July 1st 2020 Belle II Preliminary Experiment 12; Runs 5888 -6427 (subset); June 18th -July 1st 2020 Figure 9. Cosmic ray tracks recorded during collisions in Summer 2020 are reconstructed with prompt calibration (black), prompt calibration realigned with wire alignment reset to design+survey (blue) and after full realignment with wires (red). The dataset used for this validation is statistically independent of the dataset used for alignment due to random pre-selection of files. Cosmic tracks are split and reconstructed separately. At the point of closest approach with respect to the origin, the mean values of their impact parameters are compared. Shown is a profile plot of the impact parameters versus the track helix parameters. The points are fitted with a linear function with parameters p 0 and p 1 . Only tracks with at least four VXD hits (in each arm; PXD hits are not explicitly required) and combinations with |∆z 0 | < 200 µm (left plot) and |∆d 0 | < 100 µm (right plot) are used for the profile plots.
CDC radius constraints combined with the layer radius constraints for layer 53 and the additional constraints separated to hemispheres for layer 55 (outer layer), together with removed z-offset and dφ (twist) constraints for CDC layers. The determined alignment constants show evidence for significant misalignment in the inner part of the CDC. We have verified on MC that a removal of these constraints does not introduce any new significant systematic effects besides the small oscillations of layer radius as seen in Fig. 3 (blue points). As an example of the validation results, we show the dependence of z 0 and d 0 bias versus helix angular parameters tan λ and φ 0 in Fig. 9. Such biases have a potential to deteriorate precision measurements of time-dependent CP-violation, if uncorrected.

Conclusion
This contribution describes the proposed full alignment approach for reprocessing with simultaneous determination of 60 × 10 3 parameters. Due to recent developments in Millepede II, this is the first time exact solutions of such a large alignment problem could be practically studied at Belle II. No comparable results have been achieved using approximate solution methods. Thus, the presented studies resulted from a natural need to carefully check the performance of the exact solution method on simulations.
Based on studies on simulation and experience from the analysis of data, a strategy was devised to utilize the preliminary prompt alignment, dedicated to recovery from small to medium misalignments, and calibrated time-dependent IP information in the reprocessing. The full alignment does perform well in simulation and was further refined based on the validation of real data. Preliminary studies indicate improvements beyond the prompt alignment and highlight the advantages of the simultaneous global alignment approach.
We expect further knowledge about the detector to be extracted by the application of the alignment at the reprocessing stage in 2021, where also finer time-dependence of the VXD