Calibration of the photon spectrometer PHOS of the ALICE experiment

The procedure for the energy calibration of the high granularity electromagnetic calorimeter PHOS of the ALICE experiment is presented. The methods used to perform the relative gain calibration, to evaluate the geometrical alignment and the corresponding correction of the absolute energy scale, to obtain the nonlinearity correction coefficients and finally, to calculate the time-dependent calibration corrections, are discussed and illustrated by the PHOS performance in proton-proton (pp) collisions at √s=13 TeV. After applying all corrections, the achieved mass resolutions for π0 and η mesons for pT > 1.7 GeV/c are σmπ0 = 4.56 ± 0.03 MeV/c2 and σmη = 15.3 ± 1.0 MeV/c2, respectively.

The procedure for the energy calibration of the high granularity electromagnetic calorimeter PHOS of the ALICE experiment is presented. The methods used to perform the relative gain calibration, to evaluate the geometrical alignment and the corresponding correction of the absolute energy scale, to obtain the nonlinearity correction coefficients and finally, to calculate the time-dependent calibration corrections, are discussed and illustrated by the PHOS performance in proton-proton (pp) collisions at √ s = 13 TeV. After applying all corrections, the achieved mass resolutions for π 0 and η mesons for p T > 1.7 GeV/c are σ π 0 m = 4.56 ± 0.03 MeV/c 2 and σ η m = 15.3 ± 1.0 MeV/c 2 , respectively. K : Calorimeters; Detector alignment and calibration methods (lasers, sources, particlebeams) A X P : 1902.06145

Introduction
The ALICE experiment [1] is one of the four major experiments at the Large Hadron Collider (LHC) at CERN. Its primary goal is the study of the properties of the hot and dense quark-gluon matter created in ultrarelativistic heavy-ion collisions. This dictates the unique features of the ALICE detector design: ability to register and identify both soft particles, reflecting collective behavior of the hot matter, and hard penetrating probes, i.e. jets, direct photons, etc., carrying information about the inner, hottest part of the created fireball. The ALICE experiment incorporates detectors based on a number of particle identification techniques. The tracking system is able to detect and identify relatively soft charged particles with transverse momenta p T > 50 − 100 MeV/c and process high-multiplicity events. ALICE includes an electromagnetic calorimeter system: the PHOton Spectrometer (PHOS) [1,2] and the Electromagnetic Calorimeter (EMCal) [3] with the Di-Jet Calorimeter (DCal) [4]. The PHOS calorimeter is designed to measure spectra, collective flow and correlations of thermal and prompt direct photons, and of neutral mesons via their decay into -1 -photon pairs. This requires high granularity as well as excellent energy and position resolution. The electromagnetic calorimeter EMCal/DCal is used for the measurement of electrons from heavy flavour decays and the electromagnetic component of jets, spectra and correlations of isolated direct photons and spectra of neutral mesons. This requires a large acceptance but less strict requirements on the energy and position resolution. In this paper, the methods used for the calibration of the PHOS detector during the LHC data taking campaigns of 2009−2013 (Run 1) and 2015−2017 (Run 2) are described and results of the calibration are presented. The procedure for electromagnetic calorimeter calibration, developed by high-energy experiments, depends on physics objectives, detector resolution, beam availability and hardware implementation of the calorimeters and their front-end electronics. The four LHC experiments use different approaches: the electromagnetic calorimeter (ECAL) of the LHCb experiment [5] was pre-calibrated with an energy flow method, requiring the transverse energy distribution over the calorimeter to be a smooth function of the coordinates. A final detailed calibration was carried out using the π 0 peak, using invariant mass distributions and the minimization of event-by-event variables [6,7]. The electromagnetic calorimeter (ECAL) of the CMS experiment [8] was pre-calibrated with laboratory measurements of crystal light yield, and the gain and quantum efficiency of the photodetectors. These were followed by beam tests with high-energy electrons and cosmic-ray muons. The absolute calibration was determined by using the Z-boson mass and channel-by-channel relative calibration. The relative calibration involved the measurement of transverse energy and the use of ϕ-symmetry, the π 0 and η meson invariant mass fit, and a comparison of the energy measured in the ECAL to the track momentum measured in the silicon tracker for isolated electrons from W − and Z-boson decays [9,10]. The longitudinally segmented liquid-argon calorimeter of the ATLAS experiment [11] was calibrated by using a multivariate algorithm to simulate the e/γ response [12]. The absolute energy scale was calibrated by using electrons from a large sample of Z → e + e − decays and validated with J/ψ → e + e − decays.
The energy calibration of PHOS includes four mutually dependent aspects: relative gain calibration, absolute energy calibration, nonlinearity correction, and time-dependent calibration correction. The PHOS detector will be briefly described in section 2. The relative gain calibration is presented in section 3, including the pre-calibration using the LED monitoring system and the calibration using the π 0 peak position which are described in sections 3.2 and 3.3, respectively.
Fixing the absolute energy calibration of a calorimeter using the π 0 mass peak suffers from systematic uncertainties due to the geometrical alignment of the calorimeter and the energy scale. Because of that the absolute energy calibration is validated using the electron E/p ratio, as described in section 4.1, and the detector geometrical alignment is checked as described in section 4.2. The estimation of the nonlinearity correction is described in section 5 and the calculation of the timedependent energy calibration correction is discussed in section 6. The final calibration results are presented in section 7.

Setup
The PHOS is a single arm, high-resolution electromagnetic calorimeter which detects and identifies photons and electrons in a wide p T range from ∼ 100 MeV/c to ∼ 100 GeV/c at mid-rapidity and, additionally, provides a trigger in case of a large energy deposition by an energetic particle. The -2 -

JINST 14 P05025
main parameters of the detector are summarized in table 1. PHOS is located inside the solenoid magnet providing a 0.5 T magnetic field. The TRD and TOF detectors are designed to have windows in front of the PHOS modules to reduce the material budget in front of the PHOS down to 0.2 X 0 [13]. The PHOS is subdivided into four independent units, named modules, positioned at the bottom of the ALICE detector at a radial distance of 460 cm from the interaction point (IP) to the front surface of crystals as shown in figure 1. It covers approximately a quarter of a unit in pseudo-rapidity, |η| ≤ 0.125, and 70 • in azimuthal angle. Its total active area is 6 m 2 .  figure 2, left. The PHOS modules are numbered counterclockwise in figure 1 [1]. Each detection element comprises a 22 × 22 × 180 mm 3 lead-tungstate crystal, PbWO 4 [14], coupled to a 5 × 5 mm 2 Avalanche PhotoDiode (APD Hamamatsu S8664-55) whose signal is processed by a low-noise preamplifier. The APD and the preamplifier are integrated in a common body glued onto the end face of the crystal with optically transparent glue with a high refractive index, see figure 2, right. The PbWO 4 was chosen as an active medium because it is a dense, fast and relatively radiation-hard scintillating crystal. Its radiation length is only 0.89 cm and its Molière radius is 2.0 cm. It has a broad emission spectrum with bands around 420 and 550 nm [14].
The light yield of PbWO 4 crystals is relatively low and strongly depends on temperature (temperature coefficient of −2%/ • C). In order to increase the light yield by about a factor 3 compared to standard conditions, the PHOS crystals are operated at a temperature of −25 • C. The energy resolution of a PHOS prototype measured under these conditions in beam tests [15] is described by a parametrization as follows where a = 0.013 GeV, b = 0.0358 GeV 1/2 and c = 0.0112. The temperature of the PbWO 4 crystals is stabilized with a precision of 0.3 • C. Temperature monitoring is based on resistive temperature sensors of thickness 30−50 µm inserted in the gap between the crystals. For the purpose of -3 - temperature stabilization, a PHOS module is subdivided by thermo-insulation into "cold" and "warm" volumes. Strip units, comprising two rows of eight detection elements, are mounted onto the main mechanical assembly points in a module. The crystal strips are located in the cold volume, whereas the readout electronics are located outside, in the warm volume. The APDs belonging to one strip unit, and their associated preamplifiers, provide 2 × 8 analog signals to a T-shaped connector which passes the signals from the cold zone to the front-end and trigger electronics located in the warm zone. All six sides of the cold volume are equipped with cooling panels. The heat is removed by a liquid coolant (perfluorohexane, C 6 F 14 ) circulating through the pipes on the inner panel surfaces. Moisture condensation is prevented by making airtight cold and warm volumes ventilated with nitrogen.
-4 -Every channel in the PHOS detector is monitored with an LED system that is driven by stable current injectors [16]. The system consists of LED matrices for each PHOS module, having one LED per PHOS cell with controlled light amplitude and flashing rate.
The PHOS electronic chain includes energy digitization and trigger logic for generating trigger inputs to the zero (L0) and first (L1) levels of the ALICE Central Trigger Processor (CTP) [17]. In order to cover the required large dynamic range from 10 MeV to 100 GeV, each energy shaper channel provides two outputs with low and high amplification, digitized in separate ADCs. The upper limit of the dynamic ranges in high-and low-gain channels are 5 GeV and 80 GeV, with the ratio of these amplifications varying slightly from channel to channel with a mean of approximately 16.8. The gain of each APD can be set individually, by adjusting the bias voltage through the voltage distribution and control system. To equalize the energy response of all cells, the bias voltage of each APD can be set to a precision of 0.2 V, which corresponds to a ∼ 0.5% gain variation (see figure 5, left for more details). The timing information is derived from an offline pulse-shape analysis.

Energy calibration procedure
Photons and electrons hitting an electromagnetic calorimeter produce electromagnetic showers with a transverse profile determined by the Molière radius of the calorimeter material. When the transverse cell size of the calorimeter is comparable with the Molière radius, such as in PHOS, the electromagnetic shower is developed in several adjacent cells around the impact point. The group of cells with common edges, containing the electromagnetic shower generated by a photon, is referred to as a cluster (see section 4.5.2 of [2]). The sum of energies deposited by the shower in each cell of the cluster, is the measured photon energy [18]. With the PHOS granularity, the energy deposited in the central cell of the cluster is about 80% of the total cluster energy.
The amplitude of the signals measured in the cells of the cluster is proportional to the deposited energy in the cells. A set of calibration procedures is necessary to convert these data to an appropriate energy scale. Relative energy calibration means equalization of the response of all channels to the same energy deposition. In the case of PHOS, calibration at the hardware level via -5 -adjusting the APD bias voltage is complemented by refinement of the calibration parameters in an offline analysis. In order to ensure the uniformity of trigger response over the PHOS acceptance, the amplification in all channels was adjusted to make the trigger efficiency response turn-on curve as sharp as possible. This adjustment was performed once during the PHOS commissioning in LHC Run 1 and just before the start of the LHC Run 2 data taking period. The final calibration is done in an offline analysis described hereafter in detail. In order to disentangle calibration effects from effects related to cluster overlaps in the high occupancy environment of heavy-ion collisions, the calibration is performed in low occupancy events provided by pp collisions.
At first, two approaches were tested: calibration using the Minimum-Ionizing Particle (MIP) peak and equalization of mean energies in each channel. The minimum ionization signal of charged particles in the PHOS detector has a most probable value of about 250 MeV which is close to the lower end of the dynamic range. The calibration based on the MIP peak has a poor accuracy because of several effects such as relatively low number of counts of charged particles per cell, low signalto-background ratio of the MIP signal in the PHOS energy spectrum, a wide spread of incident angles of charged particles which lead to the MIP energy variation. The second method, based on the mean energy equalization, had a poor convergence and large uncertainties on the calibration parameters. Without pre-calibration using the APD gain adjustment, the mean energy strongly depends on the range of averaging which, in turn, depends on the initial calibration. Nevertheless, this method was used to provide a reasonable calibration for the first measurement of neutral meson spectra in 2010 [19], when the accumulated number of counts was not sufficient for more precise methods. Later, a more precise calibration based on the π 0 peak equalization described below was deployed in all subsequent papers [20-24].
Our final strategy of the PHOS relative calibration is based on APD gain equalization as a pre-calibration (see section 3.2) and the π 0 peak adjustment as a final step (see section 3.3).  The LED monitoring system, with its capability to emit signals at high rate and with variable amplitudes covering the whole dynamic range of the PHOS, was used to measure the high-to-low -6 -gain ratio. The gain ratio distribution for all active PHOS cells is shown in figure 3 and spans from 15 to 18 with an average of about 16.8. The gain ratio is used for high energy amplitudes exceeding the high-gain dynamic range. In this case, the energy is the product of the high-gain calibration parameter and the high-to-low gain ratio. The high-to-low gain ratio is stable and does not need to be frequently measured and updated.

Gain ratio calibration
The ratio of high-to-low gain is defined by the electronics components of the amplifiers and may vary from channel to channel. Therefore it is considered as one of the calibration parameters to be determined. The calibration methods discussed in the section 3.3 of this paper are based on data collected with beam, and ensure a good calibration of high-gain channels within the high-gain dynamic range, E < 5 GeV. Low-gain channels can hardly be calibrated with the π 0 peak adjustment method described in section 3.3, because of the limited statistics of high-energy clusters. Therefore the ratio of high-to-low gain has to be measured independently using signals of amplitudes which are detected simultaneously in both high-and low-gain channels.

Photodetector gain equalization
Each APD has a particular gain dependence on bias voltage. At low bias voltages, the APD gain is assumed to be unity. The APD gain is calculated as the ratio of the measured amplitude at a given voltage to a reference amplitude at 20 V where the dark current in the APD is negligible. The dependence of the APD gain on the bias voltage was measured using the PHOS LED monitoring system, whose programmable light output was shown to be very stable over several hours, a period far longer than necessary for gain measurements. The amplitude distribution from the LED flash is measured at several values of APD bias voltage in the range from 20 to 395 V. Figure 4 shows the LED amplitude for different voltages for one example channel.   After the equalization of the APD gains, the calibration needs to be further refined to take into account the specific light yield of the different crystals. However, the spread of light yields of the different PbWO 4 crystals is about 12% [14], which is relatively small compared to the initial precalibration, and has been neglected. The APD gain equalization can thus be considered as a first step towards the energy calibration based on physics signals from collision events such as the π 0 peak. The invariant mass of photon pairs is constructed as follows: where E γ,i is the energy of the reconstructed photon i, and θ 12 is the opening angle between the two photons. The invariant mass distribution of cluster pairs detected in PHOS was measured in pp collisions, at √ s = 13 TeV, with a cut on the cluster pair transverse momentum of p T > 1.7 GeV/c. Figure 6 shows the invariant mass distribution after APD gain equalization. The choice of the low-p T cut is driven by maximizing the signal-to-background ratio and minimizing the energy nonlinearity effects which will be discussed in section 5. A clear π 0 peak above the combinatorial background is -8 -observed. The invariant mass distribution is fitted in the range 35 − 210 MeV/c 2 with the sum of a Gaussian and a second order polynomial. The extracted π 0 peak position m ≈ 113.8 ± 0.6 MeV/c 2 is ∼ 15% lower than the PDG value [25] and its width σ m ≈ 13.8 ± 0.9 MeV/c 2 is approximately 3 times larger than the expected resolution of 4.5 MeV/c 2 for an ideally calibrated PHOS as described in GEANT-based Monte Carlo simulations [18]. However, these values are an acceptable starting point for the final relative PHOS calibration based on π 0 peak equalization described in the following section.

Calibration using the π 0 peak position
The calibration procedure calculates the calibration coefficient α i relating the energy deposition E dep and the measured response amplitude, A, with E dep = α i · A, for each detector channel. To find the coefficients, the di-photon invariant mass distribution is constructed, see eq. (3.1). One of the two photons must directly hit the detector channel under consideration. The second photon can be anywhere in PHOS.
The invariant mass distribution shows a peak corresponding to the π 0 meson at m i with some mass shift due to miscalibration. A correction to the calibration coefficient, which relates the measured amplitude A and corrected energy E corr as E corr = α i ·c i · A, is defined by the following equation: where m π 0 is the true neutral pion mass and n > 0 is a parameter that has to be optimized. The procedure is iteratively applied, with α i obtained at iteration j being updated to α j+1 i = α j i · c i , until no further improvement of a calibration is found. If we assume that the calibration coefficients (for all cells where partner photons are registered) fluctuate around some mean value, and therefore their energies are correct on average, then the shift of the peak position can be attributed to the miscalibration of the current cell. From eq. (3.1) E γ,1 = m 2 i /(2E γ,2 (1 − cos θ 12 )), the correction coefficient for the current cell i is PDG /m 2 i and one can expect that the most appropriate power is n = 2. However, this assumption is not completely true. To illustrate this, the procedure is applied to a toy model implementing several values of n as described in the next section.

Optimization of the calibration procedure with a toy model
The toy model describes the influence of the simultaneous calibration of different cells of a calorimeter. In a real calorimeter a photon cluster includes a cell with a dominant energy deposition plus a few additional cells. The simplified model assumes that the entire photon energy is deposited in one cell of a calorimeter. In the model, the calorimeter covers a pseudorapidity |η| < 1 and full azimuthal angle with a granularity of 100 × 100 cells in the ϕ and η directions. Each cell has an independent calibration coefficient which initially is randomly assigned according to a Gaussian distribution with mean 1 and a width of 20%.
The particle generator is tuned to produce neutral pions with a flat rapidity and azimuthal distribution and a realistic p T spectrum as measured in pp collisions at √ s = 7 TeV [19]. The generated π 0 mesons are forced to decay into photon pairs. The photon energies are smeared according to eq. (2.1). A cut on the minimal reconstructed photon energy E γ > E min = 0.3 GeV is applied to ensure that energy distributions in the model and data are similar (see section 3.3.2).
-9 - Figure 7 shows the dependence of a residual de-calibration σ c , defined as the RMS of the difference between estimated and true calibration coefficients α i − α true i for all cells of the toy simulation, versus iteration number. All calibration procedures start from the same initial de- calibration of cells and use the same sample of π 0 mesons. The final precision of the calibration depends on the accuracy of the reconstructed pion peak position for a typical cell, which in turn depends on the peak width (defined by the energy and position resolution) and the available statistics. In the model, the number of the simulated pions is defined by a requirement to have 10 3 reconstructed photons per cell after a p T cut of 1.7 GeV/c on the reconstructed photon pairs. This corresponds to the calibration using real data, as described in section 3.3.2.
To study the dependence of the final calibration accuracy on the energy resolution, the default energy resolution of the toy calorimeter was decreased by a factor of 2; these simulations are marked as 2σ E . For powers n < 2, the residual de-calibration stabilizes at values corresponding to the final precision of the calibration. In the case of n = 2, the residual de-calibration rapidly decreases at the first iteration, but after 2−3 iterations start to oscillate with much slower convergence compared to values of n < 2.
In order to find the optimal value of n, the RMS of the de-calibration distribution is studied as a function of iteration number for several values of n, see figure 8 (left), and versus n for several iterations (right). For large values of n, only a few iterations are needed to reach saturation. However, better accuracy is obtained for lower values of n. Since each iteration, in an analysis with real data, is very time-consuming we chose a value of n = 1.6 in the next analysis steps, which provides the best accuracy after 2−3 iterations.

π 0 calibration using pp collision data
The procedure described above is used in the final step of the calibration of the PHOS detector. The calibration is performed using physics data from pp collisions at √ s = 13 TeV recorded in 2017. The sample contains 7.7 · 10 8 minimum bias (MB) events and 5 · 10 7 events recorded with the PHOS L0 trigger [26,27], corresponding to an integrated luminosity of L int = 12 nb −1 and -10 -   5.9 pb −1 , respectively. The calibration correction is only applied to the central cell of a cluster. Clusters that are close to a dead cell are not removed. Instead, the standard approach is extended to such clusters. As a result, the shower leakage to bad cells is compensated by higher calibration coefficients in adjacent good cells. A set of cuts are applied: on the minimum number of cells in a cluster, N cells > 2, the minimum cluster energy E clu > E min = 0.3 GeV, and the cut accepting only clusters above a minimum lateral cluster dispersion [18]. These cuts are used to select photon clusters and reject rare events induced by hadron interactions directly in the APD which result in disproportionally high signals [28]. A minimum pion transverse momentum cut p T > 1.7 GeV/c is imposed to reduce the combinatorial background.

JINST 14 P05025
At each iteration the correction for the calibration coefficients is calculated using power n = 1.6. Figure 9 shows that about 3 iterations are sufficient to reach an almost final calibration. This is in good agreement with the predictions of the toy Monte Carlo. The width of the peak in modules 2 and 3 is close to what is expected from Monte Carlo simulations by taking into account the PbWO 4 response and ideal calibration. In modules 1 and 4, the width is larger because of a batch of front-end electronics cards with somewhat higher noise characteristics.

Check of the energy scale
Fixing the π 0 peak position to the PDG value is not sufficient to fix the absolute energy scale of the calorimeter. As shown in eq. (3.1), the measured mass depends both on the cluster energy and on the opening angle.
The reconstructed opening angle is dependent on the distance of the detector to the IP. An evaluation and check of the detector geometry is discussed in section 4.2. To study possible biases to the absolute energy scale, an independent cross-check was performed using the E/p ratio using identified electrons. The electrons were identified using the ALICE central tracking system, consisting of the Inner Tracking System (ITS) and the Time Projection Chamber (TPC) [29,30], and by matching tracks with PHOS clusters.

Calibration using identified electrons
Using electrons for the absolute energy calibration of an electromagnetic calorimeters is a widely used approach [10]. In the PHOS, electrons and photons effectively deposit all their energy in the calorimeter. It is possible to compare the energy measured in the calorimeter with the momentum of an electron reconstructed in the tracking system upstream of the calorimeter. There are two advantages of this approach compared to the calibration using the π 0 mass peak. First, only single clusters are considered and no iterative procedure is necessary. Second, the method does not depend on the exact position of the calorimeter. The geometrical mis-alignment, appearing in the calculation of the opening angle θ 12 in the eq. (3.1), is not mixed with the energy calibration. The disadvantages of this method concern the limited number of reconstructed electrons and the effects of the material budget in front of the calorimeter. Furthermore, this method can be used as a cross-check for the calibration using the π 0 mass peak.
The E/p calibration was carried out using pp collisions at √ s = 13 TeV in 2017, i.e. the same data set as that used for the π 0 calibration. Charged tracks were reconstructed with the ALICE central tracking system. Figure 10 shows the E/p ratio distribution for two ranges of cluster energies in a PHOS module. E is the energy of the cluster in the calorimeter and p is the reconstructed track momentum. Electrons can be identified in the region around E/p = 1 independently from the dE/dx method provided by the tracking system.
An optional cut is applied on the cluster dispersion, that corresponds to the expected electromagnetic shower transverse size. These E/p distributions are marked as 'EM clusters' in figure 10. This reduces the background from hadrons both at low and high p T , and keeps the efficiency close to 100%.
To improve the accuracy of the peak reconstruction, the signal-to-background ratio was further improved by selecting electrons that were identified through their specific ionization energy loss, dE/dx, in the TPC [29,31]. This method is efficient at low p T . However, in the region of relativistic rise for pions, p T 1 GeV/c, a separation of pions and electrons becomes increasingly difficult. The available statistics is not sufficient to perform a channel-by-channel calibration for all 12 544 channels with good accuracy. Figure 11 shows the E/p peak position and the peak width, after fitting the E/p distributions with the dispersion cut applied, as a function of cluster energy. The data are from the two middle -  Figure 10. [Color online] Distribution of the cluster energy to track momentum, E/p ratio, for two ranges of cluster energies E clu in one PHOS module. A peak around unity due to the electron contribution is visible. PHOS modules. These modules have the best energy resolution. Note that the non-linearity corrections, discussed in section 5 are applied in this analysis for comparisons with Monte Carlo simulations. At high p T , the mean is close to unity, but gradually decreases towards smaller p T , reflecting an increased relative energy loss of lower energy electrons. Figure 11 also shows the results from Monte Carlo simulations with the PYTHIA8 event generator [32] using the standard ALICE software framework for the analysis of real data. The simulation includes a remaining small mis-calibration describing an inaccuracy of our calibration to reproduce the π 0 mass peak position and width and their dependence on p T . The agreement is better than ∼ 0.2% providing an independent estimate of the absolute energy scale precision in the PHOS.

Geometrical alignment
The precise measurement of the distance between the IP and the calorimeter surface, R, is a difficult task because of the detectors installed in front of PHOS. Uncertainties in the measurement of R directly translate to uncertainties in the energy scale.

JINST 14 P05025
Equation (4.1) shows the dependence on R and the distance between the clusters, L 12 , in the calorimeter for the calculation of the two-photon invariant mass: The alignment of the PHOS was measured via the photogrammetry procedure [33]. In addition, an independent estimate of the PHOS alignment is performed by matching tracks reconstructed in the tracking system with clusters in PHOS. To study the alignment it is convenient to use the local coordinate system of the PHOS module where z is the coordinate along the beam and x is the coordinate perpendicular to the beam direction. The alignment in the z and x directions is straightforward, unlike checks for the radial distance.  Figure 12 shows the geometry and variables used to establish the radial distance of the PHOS from the IP. The difference between the z coordinate of the reconstructed cluster position in the calorimeter, z PHOS , and the point of the track extrapolated to the surface of the calorimeter, z track , through the ratio of true (R true ) and expected (R) radial distances is: In this analysis, the depth of the shower maximum for a photon is used as a reference point [18]. A correction for this depth is introduced to the cluster center of gravity so that the x and z coordinates correspond to those of the photon at the front surface of PHOS. In contrast to photons and electrons, because of the large nuclear interaction length of the EM calorimeter, the center of gravity of a hadronic shower is almost uniformly distributed in the depth of the calorimeter and therefore hadronic tracks are not suitable for such calibration. Electron showers reach their shower maximum about one unit in radiation length X 0 earlier than photons. The difference between the photon and electron cluster coordinate in the z direction can be written as: -14 - Figure 13 (left) shows the dz versus z dependence. The data from the two modules are very similar, with the same slope of −0.23 · 10 −2 . There are some oscillations around the linear dependence. The slope is slightly larger than the expected slope, B e , from eq. (4.3), of −0.19 · 10 −2 . This difference corresponds to ∼ 4 mm inward radial shift of the PHOS modules. These values were used to correct the radial PHOS position in the offline reconstruction.
The magnetic field causes charged tracks to be bent in the radial plane, which introduces complications in the dx versus x analysis that are not present for the dz versus z analysis. Figure 13 (right) shows the dx versus x dependence. The data for positive and negative charges have similar slopes, but opposite offsets, because of the track bending in the magnetic field. This results in different incident angles, for electrons and positrons, with respect to photons. These angles strongly depend on the particle p T , making this analysis much more complicated than the dz versus z study. Therefore, only the dz versus z data are used in the final PHOS alignment procedure.

Estimate of the energy nonlinearity correction
There are several effects that may influence the linearity of PHOS energy measurement. At low energies, light attenuation in the crystals, electronic noise, electronic thresholds and amplitude digitization are important. At high energies, shower leakage contributes to a nonlinear response. For the physics analysis it is sufficient to reproduce the observed nonlinearity of the detector in the Monte Carlo simulations, but practically, it is more convenient to correct real data for the nonlinearity in order to reduce the mass resolution of a neutral meson peak in wide p T bins.
The nonlinearity is corrected through a recalculation of the cluster energy E by the following parameterization: where free parameters a, b, c, d, e, E 0 are chosen to provide a p T -independent reconstructed neutral pion mass m π 0 in pp collisions at √ s = 13 TeV and parameters α and β are fixed to ensure a smooth function at the point E = E 0 . [Color online] Estimation of PHOS nonlinearity using symmetric π 0 decays defined by |E γ,1 − E γ,2 | < 0.05(E γ,1 + E γ,2 ). Data fit with function (5.1). The final tuned nonlinearity is shown with a dashed curve. Figure 14 shows the ratio of the PDG π 0 mass to the measured π 0 peak position as a function of mean photon energy, E γ . The data were restricted to symmetric π 0 decays with |E γ,1 − E γ,2 | < 0.05(E γ,1 + E γ,2 ). A fit with the function E corr (E)/E (eq. (5.1)) is shown by the red curve.
However, this method is not reliable at very low energies where systematic uncertainties for the π 0 signal extraction are large because of the limited PHOS acceptance. The same is true at high p T where photons from symmetric decays start to merge into one cluster. To improve the nonlinearity parameterization, a set of invariant mass distributions were calculated as a function of p T , without requiring symmetric decays. Each mass distribution was corrected for nonlinearity with different sets of nonlinearity parameters (a, b, c, d, e, E 0 ). Figure 15 (left) shows examples of the dependence on d and e, on the peak position versus p T . Note that parameter a sets an absolute normalization and can be factorized in this analysis.
To find the best set of parameters, a fit of the peak p T -dependence with a constant function is performed in the range 0.6 − 25 GeV/c. The resulting χ 2 value for each set of parameters is shown in figure 15 (right). In this plot we fix optimal values of parameters a, b, c, E 0 and vary only parameters d, e. The optimal set, obtained by minimizing χ 2 , is (a = 1.02 ± 0.01, b = −0.2548 ± 0.0005 GeV 1/2 , c = 0.648 ± 0.001 GeV, d = −0.4743 ± 0.0002 GeV 3/2 , e = 0.1215 ± 0.0005 GeV 2 and E 0 = 5.17 ± 0.01 GeV). The nonlinearity correction corresponding to this set is shown with a black dashed line in figure 14. This parameter set, corresponding to the filled red circles in the left plot of figure 15, is used in the offline reconstruction.

Run-by-run energy calibration
The light yield from the crystals, and the gain in the APDs, are strongly temperature dependent [2,34]. To minimize this dependency on the PHOS energy scale, the PHOS crystal matrices were thermo-stabilized to within 0.3 • C. This temperature variation results in a change of about 0.6% in light yield and APD gain. Another effect that may influence the long-term stability of the amplitude measurement in the PHOS detector is the crystal transparency dependence on the radiation dose. A run-dependent calibration correction, common for all channels in each PHOS module, was implemented to account for all these effects. In order to estimate this correction, the standard calibrations and corrections were applied. For each run, the mean value of the π 0 mass peak in each module was extracted, using only photon pairs in that module.
The correction is calculated using the data sample collected with the PHOS L0 trigger since it has better statistics at high p T , where the signal-to-background ratio is larger. Figure 16 shows the reconstructed π 0 mass peak versus run number, for 400 sequential runs, from pp collisions at √ s = 13 TeV, recorded during 3 months of data taking from June to September 2017, with stable running conditions. The data are for the two middle PHOS modules. These have the largest acceptance and the best energy resolution.
On average the peak position is stable to within ∼ 2 MeV/c 2 in both modules, but reveals several correlated and uncorrelated trends in these two modules. Correlated trends are related to the powering of the PHOS front-end electronics in both modules, and therefore to the variation of the heat deposition and temperature of the crystal matrix. Uncorrelated trends may have different reasons: switching on or off isolated front-end cards, formation of ice jams in the cooling pipes of the cooling system, etc. There is no visible global correlated trend of a decrease of the peak position in all modules, which would indicate a radiation damage in the crystals and a decrease of their transparency with time. The total integrated dose in the PHOS crystals accumulated during 3 years of running with pp, p−Pb and Pb−Pb beams during Run 2, is estimated to be less than 0.1 Gy. The total hadron fluence was about 2 · 10 9 cm −2 .
In the calibration procedure the mean value of the peak position over the whole period is calculated and deviations with respect to this value are estimated. If the peak position in a module is known with uncertainty better than 1 MeV, all calibration coefficients in a module are corrected by the ratio m mean /m run . If a run is too short and fitting is not possible, the mean value over the whole period is used.

Results of calibration
The invariant mass spectrum of cluster pairs, after applying all calibration corrections, is shown in figure 17 in the region of the π 0 (left) and η-meson (right) peaks. All four PHOS modules were considered. It reveals a much narrower π 0 peak and better signal-to-background ratio compared to the pre-calibrated result shown in figure 6. The improved calibration allows to resolve details of the shape of the π 0 peak, therefore the mass distribution is fitted with a sum of a Crystal Ball function [35] for the peak description, and a polynomial of the second order for the combinatorial background.  GeV/c in the π 0 (left) and η (right) mass region after calibration with per-channel π 0 peak equalization. For the π 0 data, the solid curve shows the fitting function using the sum of the Crystal Ball and a polynomial function. For the η data, the solid curve shows the fit function composed of a Gaussian and a polynomial function. The dashed lines represent the background contributions in both plots.
-18 - Figure 18 shows the peak positions and peak widths of the π 0 and η mesons as a function of transverse momentum. The width of the π 0 peak reaches a minimum value σ ≈ 4 MeV/c 2 at p T = 3 − 8 GeV/c. The reconstructed mass remains approximately constant up to p T ∼ 25 GeV/c, and increases with p T afterwards. This is due to a considerable fraction of overlapping cluster pairs. The reconstruction software has a bias towards clusters that are better separated due to fluctuations in the energy deposition, thus increasing the extracted pion mass. This effect is not corrected for, instead MC simulations are used to account for it in the efficiency calculations. In the case of the η meson, the peak position is stable since the influence of the overlap in this case only appear above p T ∼ 80 GeV/c.

Conclusions
In this paper all the steps of the calibration of the ALICE electromagnetic calorimeter PHOS from a completely uncalibrated state to the final set of calibration parameters are presented. The results are equivalent to Monte Carlo simulations with an ideally calibrated detector. Pre-calibration, with the equalization of the photodetector gains, is provided by the use of the monitoring system with light-emitting diodes. This preliminary calibration serves as a starting point for the energy calibration based on adjusting the reconstructed π 0 mass from data collected in high-luminosity proton-proton collisions. The calibration coefficients averaged over a large period of data taking are obtained with this relative calibration procedure. The absolute energy scale is verified by analyzing pp data with electron tracks reconstructed in the ALICE central tracking system and matched with PHOS clusters. An accurate correction of the PHOS geometrical alignment in the radial direction, also achieved using electron tracks, is necessary for the absolute energy calibration. Further refining of the calibration is performed by correcting the PHOS response for energy nonlinearity effects. Finally, the calibration is corrected for time variations in performance due to changes in running conditions and power dissipation in the front-end electronics of the detector.
The resulting time-dependent calibration parameters of the PHOS spectrometer ensure a stable response and the best possible resolution of the detector over a large time span. After applying all calibration steps in the reconstruction of pp collision data at √ s = 13 TeV, the π 0 and η meson peak positions are close to their PDG mass values over a wide p T range. The achieved mass resolution is σ π 0 m = 4.56 ± 0.03 MeV/c 2  [17] ALICE collaboration, ALICE trigger data-acquisition high-level trigger and control system: technical design report, CERN-LHCC-2003-062, CERN, Geneva, Switzerland (2003).