Electron and photon energy calibration with the ATLAS detector using 2015–2016 LHC proton-proton collision data

This paper presents the electron and photon energy calibration obtained with the ATLAS detector using about 36 fb−1 of LHC proton-proton collision data recorded at √s=13 TeV in 2015 and 2016. The different calibration steps applied to the data and the optimization of the reconstruction of electron and photon energies are discussed. The absolute energy scale is set using a large sample of Z boson decays into electron-positron pairs. The systematic uncertainty in the energy scale calibration varies between 0.03% to 0.2% in most of the detector acceptance for electrons with transverse momentum close to 45 GeV . For electrons with transverse momentum of 10 GeV the typical uncertainty is 0.3% to 0.8% and it varies between 0.25% and 1% for photons with transverse momentum around 60 GeV . Validations of the energy calibration with J/ψ → e+e− decays and radiative Z boson decays are also presented.

It consists of an inner tracking detector surrounded by a thin superconducting solenoid, electromagnetic and hadronic calorimeters, and a muon spectrometer incorporating three large superconducting toroidal magnets with eight coils each. The inner-detector system (ID) is immersed in a 2 T axial magnetic field and provides charged-particle tracking in the range |η| < 2.5.
The high-granularity silicon pixel detector covers the vertex region and typically provides four measurements per track. It is followed by the silicon microstrip tracker, which usually provides four two-dimensional measurement points per track. These silicon detectors are complemented by the transition radiation tracker, which enables radially extended track reconstruction up to |η| = 2.0. The transition radiation tracker also provides electron identification information based on the fraction of hits (typically 30 in total) above a higher energy-deposit threshold corresponding to transition radiation.
The electromagnetic (EM) calorimeter is a lead/liquid-argon (LAr) sampling calorimeter with an accordion geometry. It is divided into a barrel section (EMB), covering the pseudorapidity region |η| < 1.475 and two endcap sections (EMEC), covering 1.375 < |η| < 3.2. For |η| < 2.5, the EM calorimeter is divided into three layers in depth. Each layer is segmented in η-φ projective readout cells. The first layer is finely segmented in the η direction for the regions 0 < |η| < 1.4 and 1.5 < |η| < 2.4 with a cell size in ∆η × ∆φ varying from 0.003 × 0.1 in the barrel region to 0.006 × 0.1 in the region |η| > 2.0. The fine segmentation in the η direction provides event-by-event discrimination between single-photon or single-electron showers and overlapping showers produced in the decays of neutral hadrons. The first layer's thickness varies between 3 and 5 radiation lengths, depending on η. The second layer collects most of the energy deposited in the calorimeter by electron and photon showers. Its thickness is between 17 and 20 radiation lengths and the cell size is 0.025 × 0.025 in ∆η × ∆φ. A third layer with cell size of 0.050 × 0.025 and thickness of 2 to 10 radiation lengths is used to correct for the leakage beyond the EM calorimeter. A high-voltage system generates an electric field of about 1 kV/mm between the lead absorbers and copper electrodes located at the middle of the liquid-argon gaps. It induces ionization electrons to drift in the gap. In the region |η| < 1.8, a thin presampler layer, located in front of the accordion calorimeter, is used to correct for energy loss upstream of the calorimeter. It consists of an active liquid-argon layer with a thickness of 1.1 cm (0.5 cm) in the barrel (endcap) with a cell size of 0.025 × 0.1 in ∆η × ∆φ.
In the transition region between the EMB and the EMEC, 1.37 < |η| < 1.52, a large amount of material is located in front of the first calorimeter layer, ranging from 5 to almost 10 radiation lengths. This section is instrumented with scintillators located between the barrel and endcap cryostats, and extending up to |η| = 1.6.
Hadronic calorimetry is provided by the steel/scintillator-tile calorimeter, divided into three barrel structures within |η| < 1.7 and two copper/LAr hadronic endcap calorimeters. The solid angle coverage is completed in the region 3.2 < |η| < 4.9 with forward copper/LAr and tungsten/LAr calorimeter modules optimized for electromagnetic and hadronic measurements respectively.
The muon spectrometer comprises separate trigger and high-precision tracking chambers measuring the deflection of muons in a magnetic field generated by superconducting air-core toroid magnets. The field integral ranges between 2.0 and 6.0 T m across most of the detector. A set of precision chambers covers the region |η| < 2.7 with three layers of monitored drift tubes, complemented by cathode-strip chambers in the forward region, where the background is highest. The muon trigger system covers the range |η| < 2.4 with resistive-plate chambers in the barrel and thin-gap chambers in the endcap regions.
A two-level trigger system is used to select interesting events [3]. The first-level trigger is implemented in hardware and uses a subset of detector information to reduce the event rate to a design value of at most 100 kHz. This is followed by a software-based high-level trigger which reduces the event rate to about 1000 Hz.

EM calorimeter cell energy estimate
The deposit of energy in the liquid-argon gap induces an electric current proportional to the deposited energy. For a uniform energy deposit in the gap, the signal has a triangular shape as a function of time with a length corresponding to the maximum drift time of the ionization electrons, typically 450 ns. This signal is amplified and shaped by a bipolar filter in the front-end readout boards [4] to reduce the effect of out-of-time energy deposits from collisions in the following or previous bunch crossings. To accommodate the required dynamic range, three different gains (high, medium and low) are used. The shaped and amplified signals are sampled at 40 MHz and, for each first-level trigger, digitized by a 12-bit analogue-to-digital (ADC) converter. The medium gain for the sample corresponding to the maximum expected amplitude is digitized first to choose the most suited gain. Four time samples for the selected gain are then digitized and sent to the off-detector electronics via optical fibres. The position of the maximum of the signal is in the third sample for an energy deposit produced in the same bunch crossing as the triggered event.
From the digitized time samples (s i ), the total energy deposited in a calorimeter cell can be estimated as • p is the readout electronics pedestal. It is measured for each gain in dedicated electronics calibration runs [4].
• a i are optimal filtering coefficients [5] used to estimate the amplitude of the pulse. They are derived from the predicted pulse shape and the noise correlation functions between time samples so as to minimize the total noise arising from the electronics and the fluctuations of energy deposits from additional interactions in the same bunch crossing as the triggered event or in neighbouring crossings.
• F ADC→µA is the conversion factor from ADC counts to input current. It is determined from dedicated electronics calibration runs and takes into account the difference in the response between the injected current from the pulser in calibration runs and the ionization current created by energy deposited in the gap [6].
• F µA→MeV converts the ionization current to the total deposited energy in one cell. It is determined from test-beam studies [6].
-3 - • The estimation of the energy of the electron or photon from the energy deposits in the calorimeter: the properties of the shower development are used to optimize the energy resolution and to minimize the impact of material in front of the calorimeter. The multivariate regression algorithm used for this estimation is trained on samples of simulated events. The same algorithm is applied to data and simulation. This step relies on an accurate description of the material in front of the calorimeter in the simulation.
• The adjustment of the relative energy scales of the different layers of the EM calorimeter: this adjustment is based on studies of muon energy deposits and electron showers. It is applied as a correction to the data before the estimation of the energy of the electron or photon. This step is required for the correct extrapolation of the energy calibration to the full energy range of electrons and photons.
-4 - • The data were collected with 25 ns spacing between the proton bunches instead of 50 ns.
In addition the number of readout samples was reduced from five to four. This reduction was required in order to increase the maximum first-level trigger rate. The optimal filtering coefficients for the cell energy estimate (see section 2.2) were derived to minimize the total noise for a pile-up of 25 interactions per bunch crossing with 25 ns spacing between bunches, using four readout samples. For the Run 1 dataset, the noise minimization was performed for 20 interactions per bunch crossing with 50 ns spacing, using five readout samples. These changes can affect the energy scale of the different layers of the calorimeter.
• The data were collected with a higher number of pile-up interactions. This significantly impacts the measurements of muon-induced energy deposits in the calorimeter.
• The material in front of the calorimeter is mostly the same, with the exception of the addition of a new innermost pixel detector layer together with a thinner beam pipe and changes in the layout of the services of the pixel detector.
• In the data reconstruction, the calorimeter area used to collect the energy of unconverted photons was changed in order to be same size as for electrons and converted photons. This simplifies the estimate of the impact on the energy calibration of uncertainties in the conversion reconstruction efficiency. The corresponding increase of the cluster size for unconverted photons implies an increase in the noise which has a limited impact on the energy resolution: for E T >20 (50) GeV, the energy resolution for unconverted photons is degraded by less than 10 (5)%.

Data and simulation samples 4.1 Data samples
The results presented in this article are based on proton−proton collision data at √ s = 13 TeV, recorded in 2015 and 2016 with the ATLAS detector. During the period relevant to this paper, -5 -the LHC circulated 6.5 TeV proton beams with a 25 ns bunch spacing. The peak instantaneous luminosity was 1.37 · 10 34 cm −2 s −1 . Only data collected while all the detector components were operational are used. The integrated luminosity of this dataset is 36.1 fb −1 . The mean number of proton−proton interactions per bunch crossing is 23.5.
To select Z → ee events, a trigger requiring two electrons is used. For the 2015 (2016) dataset, the transverse energy (E T ) threshold applied at the first-level trigger is 10 (15) GeV. It is 12 (17) GeV at the high-level trigger, which uses an energy calibration scheme close to the one applied in the offline reconstruction. At the high-level trigger, the electrons are required to fulfil the Loose (Very Loose) likelihood-based identification criteria for 2015 (2016) data.
To select J/ψ → ee events, three dielectron triggers with different thresholds are used. At the first-level trigger, E T thresholds of either 3, 7 or 12 GeV were applied for the candidate with highest E T , and a 3 GeV threshold was applied on the second candidate. At least one electron was required to fulfil the Tight identification criteria at the high-level trigger with E T larger than 5, 9 and 14 GeV depending on the trigger. The second electron was only required to have E T above 4 GeV. The integrated luminosity collected with these prescaled triggers varies from 4 pb −1 to 640 pb −1 depending on the trigger threshold used. The total luminosity collected is 710 pb −1 .
To select Z → µµ events, two main triggers are used. The first one requires two muons with transverse momentum (p T ) above 14 (10) GeV at the high-level (first-level) trigger. The second one requires one muon with p T above 26 (20) GeV with isolation criteria applied at the high-level trigger.
For the samples of radiative Z boson decays (eeγ and µµγ), the same triggers as for the Z → ee and Z → µµ samples are used.
To select a sample of inclusive photons, a single-photon trigger is used, with an E T threshold of 22 GeV at the first-level trigger and the Loose photon identification criteria with E T larger than 140 GeV applied at the high-level trigger.

Simulation samples
Monte Carlo (MC) samples of Z → ee and Z → µµ decays were simulated at next-to-leading order (NLO) in QCD using POWHEG-BOX v2 [11] interfaced to the PYTHIA8 [12] version 8.186 parton shower model. The CT10 [13] parton distribution function (PDF) set was used in the matrix element. The AZNLO set of tuned parameters [14] was used, with PDF set CTEQ6L1 [15], for the modelling of non-perturbative effects. The EvtGen 1.2.0 program [16] was used to model b-and c-hadron decays. Photos++ 3.52 [17] was used for QED emissions from electroweak vertices and charged leptons.
Samples of Z → eeγ and Z → µµγ events with transverse momentum of the photon above 10 GeV were generated with SHERPA version 2.1.1 [18] using QCD leading-order (LO) matrix elements with up to three additional partons in the final state. The CT10 PDF set was used in conjunction with the dedicated parton shower tuning developed by the SHERPA authors.
Both non-prompt (originating from b-hadron decays) and prompt (not originating from bhadron decays) J/ψ → ee samples were generated using PYTHIA8. The A14 set of tuned parameters [19] was used together with the CTEQ6L1 PDF set. The EvtGen program was used to model the b-and c-hadron decays. Three different samples were produced with different selections on the transverse momenta of the electrons produced in the J/ψ decay.

JINST 14 P03017
Samples of inclusive photon production were generated using PYTHIA8. The PYTHIA8 simulation of the signal includes LO photon-plus-jet events from the hard subprocesses qg → qγ and qq → gγ and photon bremsstrahlung in LO QCD dijet events (called the "bremsstrahlung component"). The bremsstrahlung component was modelled by final-state QED radiation arising from calculations of all 2 → 2 QCD processes. The A14 set of tuned parameters was used together with the NNPDF23LO PDF set [20].
Backgrounds affecting the Z → ee sample were generated with POWHEG-BOX v2 interfaced to PYTHIA8 for the Z → ττ process, with SHERPA version 2.2.1 for the vector-boson pairproduction processes and with SHERPA version 2.1.1 for top-quark pair production in the dilepton final state.
For the optimization of the MC-based response calibration, samples of 40 million single electrons and single photons were simulated. Their transverse momentum distribution covers the range from 1 GeV to 3 TeV.
The generated events were processed through the full ATLAS detector simulation [21] based on GEANT4 [22]. The MC events were simulated with additional interactions in the same or neighbouring bunch crossings to match the pile-up conditions during LHC operations and were weighted to reproduce the distribution of the average number of interactions per bunch crossing in data. The overlaid proton−proton collisions were generated with the soft QCD processes of PYTHIA8 version 8.186 using the A2 set of tuned parameters [23] and the MSTW2008LO PDF set [24].
The detector description used in the GEANT4 simulation was improved using data collected in Run 1 [1]. Compared with this improved description, the changes for the results presented in this paper are: the addition of the new innermost pixel layer and the new beam pipe in , the modification of the pixel detector services at small radius [28] and a re-tuning in the simulation of the amount of material in the transition region between the barrel and endcap calorimeter cryostats to agree better with the measurement performed with Run 1 data. The amount of material in front of the presampler detector is about 1.8 radiation lengths at small values of |η|, reaching ≈ 4 radiation lengths at the end of the EMB acceptance and up to 6 radiation lengths close to |η| = 1.7. The amount of material located between the presampler and the first layer of the calorimeter is typically 0.5 to 1.5 radiation lengths except in the transition region between the EMB and EMEC, where it is larger. For |η| > 1.8, the total amount of material in front of the calorimeter is typically 3 radiation lengths. The simulation models the details of the readout electronics response following the same ingredients as described in eq. (2.1).
For studies of systematic uncertainties related to the detector description in the simulation, samples with additional passive material in front of the EM calorimeter were simulated. The samples vary by the location of the additional material: in the inner-detector volume, in the first pixel detector layer, in the services of the pixel detector at small radius, in the regions close to the calorimeter cryostats, between the presampler and the electromagnetic calorimeter or in the transition region between the barrel and endcap calorimeters. Table 1 lists the kinematic selections applied to the different samples and the number of events recorded in 2015 and 2016. The average electron transverse energy is around 40-50 GeV in the -7 - Table 1. Summary of the kinematic selections applied to the main samples used in the calibration studies and number of events fulfilling all the requirements described in the text in the 2015-2016 dataset, except for the Z → γ and inclusive photon samples, which use only data collected in 2016. The symbol denotes an electron or a muon.

Event selection
Z → ee sample and 10 GeV in the J/ψ → ee sample. For photons, the average transverse energy is about 25 GeV in the Z → eeγ and Z → µµγ samples.
To select Z → ee candidates, both electrons are required to satisfy the Medium selection of the likelihood discriminant and to fulfil the Loose isolation criteria, based on both ID-and calorimeter-related variables [10]. In the inclusive photon selection, the photons are required to fulfil the Tight identification selection and to be isolated, using the Tight criterion based only on calorimetric variables. To select muons in the Z → µµ sample, the Medium muon identification working point [29] is used.
To select J/ψ → ee candidates, both electrons are required to fulfil the Tight identification and the Loose isolation criteria.
For the Z → eeγ sample (Z → µµγ), the electrons (muons) are required to satisfy the Loose (Medium) identification level while the photon candidate is required to fulfil the Tight identification and the Loose isolation criteria [8]. The dilepton invariant mass is restricted to the range 40-80 GeV to enhance the sample in radiative Z decays. The photon candidate is required to be significantly separated from any charged-lepton candidate, ∆R( ,γ) > 0.4, with ∆R = (∆φ) 2 + (∆η) 2 .

Algorithm for estimating the energy of electrons and photons
The energy of electrons and photons is computed from the energy of the reconstructed cluster, applying a correction for the energy lost in the material upstream of the calorimeter, for the energy deposited in the cells neighbouring the cluster in η and φ, and the energy lost beyond the LAr calorimeter. A single correction for all of these effects is computed using multivariate regression -8 -algorithms tuned on samples of simulated single particles without pile-up, separately for electrons, converted photons and unconverted photons. The training of the algorithm, based on Boosted Decision Trees, is done in intervals of |η| and of transverse energy. An updated version of the method described in ref. [1] is implemented. The set of input variables is refined and the procedure is extended to the whole EM calorimeter up to |η| = 2.5, including the transition region between the barrel and the endcap.
The variables considered in the regression algorithm are: the energy deposited in the calorimeter, the energy deposited in the presampler, the ratio of the energies deposited in the first and second layers (E 1 /E 2 ) of the EM calorimeter, the η impact point of the shower in the calorimeter, and the distances in η and in φ between the impact point of the shower and the centre of the closest cell in the second calorimeter layer. The impact point of the shower is computed from the energyweighted barycentre of the positions of the cells in the cluster. For converted photon candidates, the estimated radius of the photon conversion in the transverse plane as well as the properties of the tracks associated with the conversion are added. These variables are identical to those used in the Run 1 version except that E 1 /E 2 is used instead of the longitudinal shower depth. The ratio E 1 /E 2 is strongly correlated with the longitudinal shower depth but it has been studied in more detail, comparing data with simulations as described in section 6.1.
In the transition region between the barrel and endcap calorimeters, 1.4 < |η| < 1.6, the amount of material traversed by the particles before reaching the first active layer of the calorimeter is large and the energy resolution is degraded. To mitigate this effect, information from the E 4 scintillators [2] installed in the transition region is used. The E 4 scintillators are part of the intermediate tile calorimeter (ITC). The ITC is located in the gap region, between the long barrel and the extended barrels of the tile calorimeter and it was designed to correct for the energy lost in the passive material that fills the gap region. Electrons and photons in the gap region deposit energy in the barrel and the endcap of the EM calorimeter, as well as in the E 4 scintillators. In this region, the energy deposited in the E 4 cells (each of size ∆η × ∆φ = 0.1 × 0.1) and the difference between the cluster position and the centre of the E 4 cell are added to the set of input variables for the regression algorithm. Due to this additional information the energy resolution is improved as shown in figure 1 for simulated electrons generated with transverse energy between 50 GeV and 100 GeV. In this range, the improvement is largest for electrons (around 20%), while it is smaller for unconverted photons (5%). Such behaviour is expected, as the degradation of the energy resolution due to inactive material in front of the calorimeter is much higher for electrons.

Energy resolution in the simulation
The energy resolution after application of the regression algorithm in the MC samples is illustrated in figure 2, using simulated single-particle samples. The resolution is defined as the interquartile range of E calib /E gen , i.e. the interval excluding the first and last quartiles of the E calib /E gen distribution in each bin, divided by 1.35, to convert to the equivalent standard deviation of a Gaussian distribution. The quantity E gen is the true energy of the generated particle and E calib is the reconstructed energy after applying the regression algorithm.
For unconverted photons, the energy resolution in these MC samples, which do not have any simulated pile-up, closely follows the expected sampling term of the calorimeter (≈ 10%/ E/GeV in the barrel and ≈ 15%/ E/GeV in the endcap). For electrons and converted photons, the degraded energy resolution at low energies reflects the presence of significant tails induced by interactions with the material upstream of the calorimeter. This degradation is largest in the regions with the largest amount of material upstream of the calorimeter, i.e. for 1.2 < |η| < 1.8.

Corrections applied to data
In this section, the corrections applied to the data to account for residual differences between data and simulation are discussed. They include the intercalibration of the different calorimeter layers, corrections for energy shifts induced by pile-up and corrections to improve the uniformity of the energy response. Since the absolute energy scale is set with Z → ee decays, only the relative calibration of the energy scales of the first two layers and the presampler is needed. Given the small fraction of the energy deposited in the third layer of the calorimeter, no dedicated corrections for its intercalibration are applied.

Intercalibration of the first and second calorimeter layers
Muon energy deposits, which are insensitive to the amount of passive material in front of the EM calorimeter, are used to study the relative calibration of the first and second calorimeter layers. This relative calibration is derived by comparing the energy deposits in data with simulation predictions. The deposited muon energy, expressed on the same cell-level energy scale as described by eq. (2.1), is about 30 to 60 MeV depending on η in the first layer and 240 to 300 MeV in the second layer. The signal-to-noise ratio varies from about 2 to 0.5 (4 to 3) as a function of |η| for the first (second) layer. A significant contribution to the noise, especially in the first layer of the endcap calorimeter, is due to fluctuations in the pile-up energy deposit.
The analysis uses muons from Z → µµ decays, requiring p   taking into account the geometry of the calorimeter, the misalignment between the inner detector and the calorimeter (up to a few millimetres) and the magnetic field encountered by the muon along its path.
In the first layer, where the cell size in the η direction is small, the muon signal is estimated by summing the energies measured in three adjacent cells along η centred around the cell crossed by the extrapolated muon trajectory. Using three cells instead of only one gives a measurement that is less sensitive to the detailed modelling of the cross-talk between neighbouring cells and to the exact geometry of the calorimeter. In the second layer, due to the accordion geometry, the energy is most often shared between two adjacent cells along φ and the signal is estimated from the sum of the energies in the cell crossed by the extrapolated muon trajectory and in the neighbouring cell in φ with higher energy.
The observed muon energy distribution in each layer can be described by the convolution of a Landau distribution, representing the energy deposit, and a noise distribution. The most probable -11 -

JINST 14 P03017
value (MPV) of the deposited muon energy is extracted using a fit of the convolution function to the observed muon energy distribution ("fit method"). Alternatively, the deposited energy can be estimated using a truncated-mean approach, where the mean is computed over a restricted window to minimize the sensitivity to the tails of the distribution ("truncated-mean method"). The same procedure is applied to data and MC samples and the relative calibration of the two layers is computed as in the first (second) layer. The relative calibration of the two layers is computed as a function of |η|, since within the uncertainties all measured values are consistent between positive and negative η values.
In the fit method, the noise distribution is determined from data and MC samples separately to avoid a dependency on a possible pile-up noise mismodelling in the simulation. Events triggered on random LHC proton bunch crossings, with a trigger rate proportional to the instantaneous luminosity ("zero-bias events"), are used to estimate the noise distribution in data. The noise distribution is determined in intervals of |η| and of µ , where µ is the average number of pile-up interactions per bunch crossing. Figure 3 shows examples of the muon energy deposits in data and MC samples. It also shows the Landau distribution, the noise distribution and their convolution.
In the truncated-mean method, different choices for the window are investigated: ranges of ±2 and ±1.5 times the RMS of the distribution around the initial mean computed in a wide range, or the smallest range containing 90% of the energy distribution. The average of the results obtained with these choices is used as the estimate of α 1/2 .
To further reduce residual pile-up dependencies of the extracted MPV values, for both the fit and truncated-mean methods the analysis is performed as a function of the average number of interactions per bunch crossing. The result is extrapolated to a zero pile-up value to measure the intrinsic energy scale of each calorimeter layer for a pure signal. This extrapolation is performed using a first-order polynomial fit, which is found to describe data and MC results well. The fit is performed in the range from 12 to 30 interactions per bunch crossing to avoid low-statistics bins with a large range of the number of interactions per bunch crossing. The method is validated by comparing the MC extrapolated results with the ones obtained in a MC sample without any pile-up. The final result is given by the average of the two signal extraction methods, fit and truncated mean. Figure 4 shows examples of the fitted MPV of the deposited muon energy as a function of the number of interactions per bunch crossing. The accurate noise modelling, performed separately for data and simulation, allows the extraction of the MPV of the muon energy deposit with only a small dependence with pile-up. The small slope of the fitted line limits the impact of the extrapolation from the average amount of pile-up in data to the zero pile-up point to the percent level.
The following effects are investigated to estimate the uncertainty in the α 1/2 value measured with muons from the average of the results of the fit and truncated mean methods: • Accuracy of the method to measure the genuine muon energy loss at zero pile-up: the uncertainty is taken from the difference between the result from the pile-up extrapolation in the MC sample with pile-up and the value observed in a MC sample without pile-up. It is typically 0.2% to 0.5% depending on |η|, up to 1.5% in some |η| intervals in the endcap.  the boundaries in φ (η) between the first (second) layer cells a significant fraction of the muon energy deposit can be outside the used cells. To assess the uncertainty from the modelling of these effects in the simulation, the analysis is repeated using only muons crossing the centre of the first (second) layer within 0.04 (0.008) in the φ (η) direction and the change induced by these requirements is taken as the uncertainty. The uncertainty varies from 0.5% to 1%.
• Choice of the cell in φ for the second layer: the analysis is repeated using as the second cell in layer two the neighbour closer to the extrapolated muon trajectory instead of the neighbour with the higher energy. The difference between the results of these two choices, typically 0.2%, is taken as the uncertainty.
• For the truncated-mean method, the results obtained with the different ranges for the truncatedmean computation are compared. The maximum deviation of these results from their average is taken as the uncertainty. The change in the result when varying the upper energy limit used to compute the initial mean is also taken into account in the uncertainty. The resulting uncertainty is 0.5%.
• Half of the difference between the fit and truncated-mean methods is taken as an uncertainty in the result. This leads to an uncertainty varying from 0.5% to 1% depending on |η|.  Figure 5 shows the results for α 1/2 and the comparison of the two methods. The average result is shown with its total uncertainty defined as the sum in quadrature of the statistical uncertainty and all the systematic uncertainties described above. The total systematic uncertainty is estimated to be correlated within |η| regions corresponding to the intervals 0-0.6, 0.6-1.4, 1.4-1.5, 1.5-2.4 and 2.4-2.5, and uncorrelated between two different intervals. In the last |η| range, no measurement with muons is performed, and a large uncertainty of ±20% in the layer calibration is assigned, derived from a comparison between data and simulation of the ratio E 1 /E 2 of electron showers. Despite the high level of pile-up in the data, the accuracy of the measurement with muons is typically 0.7% to 1.5% (1.5% to 2.5%) depending on η in the barrel (endcap) calorimeter, for |η| < 2.4, except in the transition region between the barrel and endcap calorimeters.
The features as a function of |η| observed for α 1/2 are similar to the ones observed in the Run 1 calibration performed with muons [1]. A change in the relative energy scales of the two layers, at a level of less than 1.5%, can be expected from the re-optimization of the pulse reconstruction performed for Run 2 data to minimize the expected pile-up noise. Within their respective uncertainties, the Run 1 result and this result are in agreement with this expectation.
In addition to the systematic uncertainties specific to the measurement of energy deposits from muons in the calorimeter layers, the interpretation of this measurement as an estimate of the relative -14 -energy scale of the two layers relies on a proper modelling in the simulation of the ionization current induced by muons. This is subject to the following sources of uncertainty: uncertainty in the exact path length traversed by the muons, related to the uncertainty in the geometry of the readout cells; uncertainty in the effect of reduced electric field at the transition between the different calorimeter layers; uncertainty in the modelling of the conversion of deposited energy to ionization current due to variations in the electric field following the accordion structure of the calorimeter, and uncertainty in the cross-talk between different calorimeter cells. These sources of uncertainty affect muon energy deposits and electron/photon showers differently. The values of these uncertainties are exactly the same as estimated in ref. [1]. They induce an uncertainty varying from 1% to 1.5% depending on |η| in the relative calibration of the first and second calorimeter layers. Uncertainties related to possible non-linearities of the energy response for the different calorimeter layers are discussed in section 8.5.
as a function of |η|, as obtained from the study of the muon energy deposits in the first two layers of the calorimeters. The results from the two methods are shown with their statistical uncertainties. The final average measurement is shown with its total uncertainty including the statistical and systematic uncertainties.
The relative calibration of the first two layers of the calorimeter can also be probed using Z → ee decays by investigating the variation of the mean of the dielectron invariant mass as a function of the ratio of the energies of the electron or positron candidates in the first two layers. Good agreement with the results obtained with muons is observed except in the |η| range 1.2 to 1.8. In this region, the results of the method based on Z → ee are very sensitive to the interval used to compute the average invariant mass. Better agreement with the muon-based results is seen when a narrow mass range around the Z boson mass is used. This points to differences between data and simulation in the modelling of the tails of the electron energy resolution. The impact of the mass range variation on the energy calibration is studied in section 7. Similar results are found if the ratio of the track momentum measured in the ID to the energy measured in the calorimeter is used instead of the invariant mass to probe the energy calibration.

Presampler energy scale
The presampler energy scale α PS is determined from the ratio of the presampler energies in data and simulation. The measured energy in the presampler for electrons from Z boson decays is sensitive to both α PS and the amount of material in front of the presampler. In order to be sensitive only to α PS , the procedure to measure α PS [1] exploits the correlation between the shower development and the amount of material in front of the presampler; more precisely, several simulations with additional passive material upstream of the presampler are considered, and correlation factors between the presampler energy deposit (E 0 ) and the ratio of the energies deposited in the first two layers (E 1/2 ) are extracted. The relative calibration of the first two layers, which is described in section 6.1, is applied. To minimize the impact on E 1/2 of any mismodelling of the material between the presampler and the calorimeter, an additional correction is applied. This last correction is extracted from a sample of unconverted photons with small energy deposit in the presampler to be insensitive to the material in front of the calorimeter. The presampler energy scale is extracted as • E data 0 (η) and E MC 0 (η) are the average energies deposited in the presampler by the electrons from Z decays in data and simulation.
• b 1/2 (η) is the ratio of E 1/2 in data and simulation for unconverted photons with small energy deposit in the presampler. It is estimated using photons from radiative Z boson decays at low E T and inclusive photons at high E T . The average value of these two samples is used.
• E data 1/2 (η) and E MC 1/2 (η) are the average values of the ratio of the energy deposited in the first layer to the energy deposited in the second layer for electrons from Z decays in data and simulation, respectively. After the correction with b 1/2 (η), this ratio is directly proportional to the amount of material in front of the presampler.
• A(η) represents the correlation between the changes in E 1/2 and E 0 when varying the material in front of the presampler. This correlation is estimated using simulations with different amounts of material (quantity and location in radius) added in front of the presampler. It varies between 2.5 and 1.5 for different values of |η|.
This procedure is validated using the simulation. The measurement is performed in intervals of size 0.05 in |η|, excluding the transition region between the barrel and endcap calorimeters (1.37 < |η| < 1.52). Within a presampler module of ∆η-size 0.2 in the barrel or 0.3 in the endcap, no significant energy scale difference is expected, so the measurements are averaged in |η| over each module.
Uncertainties in the measurements of α PS include the statistical uncertainties of the various input quantities in the data and simulation. The residual variations of the measured presampler scale within a presampler module is also taken as an uncertainty, uncorrelated between the different modules. In the last module of the barrel, the b 1/2 correction exhibits a significant deviation from unity for |η| > 1.3. The reason of this deviation is not understood. For this last module, an -16 -uncertainty is obtained by comparing the b 1/2 correction averaged in the neighbouring lower |η| interval with the value observed in this module. Finally, the choice of E 0 interval used in the computation of b 1/2 is studied. From simulation studies, an upper bound in the range from 0.5 to 1.2 GeV reduces the impact of uncertainties in the material in front of the presampler on b 1/2 . A variation of the result in the data, not expected from simulation, is observed when the upper bound is changed from 0.5 to 1.2 GeV. It is taken as a systematic uncertainty, fully correlated across the whole barrel presampler. Figure 6 shows the result for α PS as a function of |η|. The uncertainty in α PS varies between 3% and 1.5% depending on |η|.

Pile-up energy shifts
After bipolar shaping, the average energy induced by pile-up interactions should be zero in the ideal situation of bunch trains with an infinite number of bunches and with the same luminosity in each pair of colliding bunches. In practice, bunch-to-bunch luminosity variations and the finite bunch-train length can create significant energy shifts which depend on the position inside the bunch train and on the luminosity. For most of the 2016 data, the bunch trains were made of 2 sub-trains of 48 bunches, with a bunch spacing of 25 ns between the bunches and of 225 ns between the two sub-trains. To mitigate this effect on the estimation of the cell energies, the average expected pile-up energy shift is subtracted cell-by-cell. The average is computed as a function of the bunch position inside the full LHC ring, taking into account the instantaneous luminosity per bunch, the expected pulse shape as a function of the time, the optimal filtering coefficients used to estimate the amplitude of the signal and a normalization factor derived from data with single colliding bunches.
Summing the cell-level contributions over an area equal to the size of an electron or photon cluster, the correction can reach 500 MeV of transverse energy, about 75 ns after the beginning of a bunch train for an average of 20 interactions per bunch crossing. After the correction, residual -17 -effects up to around 30 MeV are observed in zero-bias events. They arise mostly from inaccuracies in the predicted pulse shape. For instance in the presampler layer, the predicted pulse shape assumes a drift time corresponding to a high-voltage value of 2000 V while in the 2016 data a significantly lower high voltage of 1200 V was applied to reduce sporadic noise in the presampler.
To further reduce the impact of pile-up-induced energy shifts for electromagnetic clusters, an additional correction is applied separately for each calorimeter layer as a function of the average number of interactions per bunch crossing and as a function of η. The parameters of this cluster-level correction are derived from random clusters in zero-bias data.
After this second correction, the residual energy shift from pile-up is less than 10 MeV in transverse energy for the data collected in 2015 and 2016.

Improvements in the uniformity of the energy response
After all corrections described above are applied to the electron or photon candidates in data separately for each calorimeter layer, the energy is computed using the regression algorithm described in section 5. Corrections for variations in the energy response as a function of the impact point of the shower in the calorimeter affecting only the data are derived and applied to the energy of the electron or photon. Two effects are considered and corrected: • Energy loss between the barrel calorimeter modules: the barrel calorimeter is made of 16 modules of size 0.4 each in ∆φ. The gap between absorbers increases slightly at the boundaries between modules, which leads to a reduced energy response. This effect varies as a function of φ since gravity causes the gaps to be smaller at the bottom of the calorimeter and larger at the top. A correction of this variation is parameterized using the ratio E/p of the calorimeter energy to the track momentum as a function of φ. This correction is 2%. It is very similar to the effect observed with the Run 1 data [1].
• Effect of high-voltage inhomogeneities: in a small number of sectors (of size 0.2 × 0.2 in ∆η × ∆φ) of the calorimeter, the applied high voltage is set to a non-nominal value due to short circuits occurring in specific LAr gaps. The value of the high voltage is used to derive a correction applied in the cell-level calibration. Residual effects can arise for cases where large currents are drawn. In these cases, the correction is not computed accurately. The η-φ profiles of E/p in 2015 and 2016 data are used to derive empirical corrections in the regions which are known to be operated at non-nominal HV values. The values of the corrections are typically 1% to 7% and affect 2% of the |η| < 2.5 calorimeter acceptance. Most of these corrections are similar to the ones computed in ref. [1] with the exception of a few cases where the high-voltage setting was changed between Run 1 and Run 2.
These two corrections are validated by checking that the dielectron invariant mass in Z → ee events is uniform as a function of φ around the η-φ regions where these corrections are applied.
7 Data/MC energy scale and resolution measurements with Z → ee decays

Description of the methods
The difference in energy scale between data and MC simulation, after all the corrections described in section 6 have been applied to the data, is defined as α i , where i corresponds to different regions -18 -

JINST 14 P03017
in η. Similarly the difference in energy resolution is assumed to be an additional constant term in the energy resolution, c i , depending on η: where the symbol ⊕ denotes a sum in quadrature. For samples of Z → ee decays, with two electrons in regions i and j in η, the difference in average dielectron invariant mass is given at first order by m data To extract the values of α i j and c i j , the shapes of the invariant mass distributions in data are compared with histograms of the invariant mass created from the simulation separately for each (i, j) region. In the simulation distributions the mass scale is shifted by α i j and an extra resolution contribution of c i j is applied. The best estimates of α i j and c i j are found by minimizing the χ 2 of the difference between data and simulation templates. The measurements are performed using only (i, j) regions which have at least 10 events and for which the kinematic requirement on the ∆η between the electrons does not significantly bias the Z mass peak position: the minimum invariant mass implied by the ∆η and E T requirements must not exceed 70 GeV for a back-to-back configuration in φ. The α i and c i parameters are estimated from the α i j and c i j values by a χ 2 minimization of the overconstrained set of equations. The procedure is validated using pseudo-data samples generated from the simulation samples. From these studies, the residual bias of the method in the estimate of α i and c i parameters is computed, comparing the extracted values with the values used to generate the pseudo-data samples. This bias, which is assigned as an uncertainty, is typically (0.001-0.01)% for α i and (0.01-0.03)% for c i , depending on |η|.
Another method to derive the values of α i and c i is used as a cross-check of the results. In this second method, both the data and MC invariant mass distributions are fitted in each i-j bin by an analytic function. A sum of three Gaussian functions provides accurate modelling of the invariant mass distribution. The parameters describing these functions are fixed to the ones fitted in the simulation sample. When fitting the data, additional parameters corresponding to an overall energy-scale shift and a resolution correction per η region are added. These α i and c i parameters are then extracted from a simultaneous fit of all i-j regions. The procedure is optimized and validated using studies based on pseudo-data samples. The residual bias of the method is smaller than 0.01% in the energy scale and 0.1% in c i , except in the transition region between the barrel and endcap calorimeters, where slightly larger effects are observed.

Systematic uncertainties
Several sources of uncertainty affecting the comparison of the dielectron invariant mass distribution in Z → ee events between data and simulation are investigated and their effects on the extraction of α i and c i are estimated.
• Accuracy of the method: the residual bias of the main method, estimated using pseudo-data samples, described in section 7.1, is assigned as a systematic uncertainty.
• Method comparison: the difference between the results of the two methods, discussed in section 7.1, is assigned as an uncertainty. For instance, the two methods have a different -19 -sensitivity to possible mismodelling of non-Gaussian tails in the energy resolution. The difference between the results of the two methods when applied to data can thus be larger than expected from the accuracy of the methods estimated using pseudo-data samples. In addition, for the c i measurement, different implementations of the extraction of the c i parameters from the measured c i j values are compared.
• Mass range: the results are sensitive to the mass range used to perform the comparison between data and simulation if the non-Gaussian tails of the energy resolution are not accurately modelled. The mass range is changed from the nominal 80-100 GeV to 87-94.5 GeV; the difference is assigned as a systematic uncertainty.
• The selection used to remove i-j regions with a biased mass distribution is changed by varying the requirement on the minimum invariant mass implied by the ∆η selection in a given i-j region.
• Background with prompt electrons: the small contribution of backgrounds from Z → ττ, diboson pair production and top-quark production, leading to a dielectron final state with both electrons originating from τ-lepton or vector-boson decays, is neglected in the extraction of the parameters α i and c i . The procedure is repeated with the contributions from these backgrounds, as estimated from MC simulations, included in the mass template distribution. The differences between the results are assigned as systematic uncertainties in α i and c i .
• Electron isolation: the requirement on the electron isolation strongly rejects the backgrounds where at least one electron does not originate from a vector-boson or τ-lepton decay, but from semileptonic heavy-flavour decay, from conversions of photons produced in jets or from hadrons. To estimate the residual effect of these backgrounds on the result, the extraction of α i and c i is repeated without the isolation selection and the differences are assigned as systematic uncertainties.
• Electron identification: the selection uses Medium quality electrons. Small correlations between the electron energy response and the quality of the electron identification are expected, since the latter uses as input the lateral shower development in the calorimeter. If these correlations are not properly modelled in the simulation, the data-to-MC energy scale and resolution corrections can depend on the identification requirement. In order to make the corrections applicable to measurements using electron selections that are different from those used in this paper, additional systematic uncertainties are estimated by comparing the results for α i and c i obtained using the Tight identification requirement instead of the Medium quality requirement.
• Electron bremsstrahlung probability: electrons can lose a significant fraction of their energy by bremsstrahlung before reaching the calorimeter.
To determine to what extent the measured α i and c i parameters are intrinsic to the calorimeter response and to what extent they are sensitive to the modelling of energy loss before the calorimeter, a requirement on the fraction of electron bremsstrahlung is applied, using the change in track curvature between the perigee and the last measurement before the calorimeter. The difference in α i and c i values obtained with or without this additional requirement applied is assigned as an uncertainty.
-20 -  • Electron reconstruction, trigger, identification and isolation efficiencies: the MC simulation is corrected for the difference in efficiencies between data and simulation [10]. These corrections, which depend on E T and η, can slightly change the shape of the invariant mass distribution predicted by the MC simulation. The corrections are varied within their uncertainties and the resulting uncertainty in α i and c i is estimated.
All the listed uncertainties are computed separately in each η interval. The typical values in different η ranges are given in table 2. The table shows a wide range of uncertainties for the interval 1.2 < |η| < 1.8. Inside this interval, the uncertainties are largest for the region around |η| = 1.5. For |η| > 2.4, near the end of the acceptance, the uncertainties are significantly larger than for the other regions.
The total systematic uncertainty in α i and c i is computed adding in quadrature all the effects described above. This procedure may lead to slightly pessimistic uncertainties because some of the variations discussed above can double-count the same underlying source of uncertainty and also because the results must remain valid in a variety of final states and with different event selections. The systematic uncertainty in α i varies from ≈ 0.03% in the central part of the barrel calorimeter, to ≈ 0.1% in most of the endcap calorimeter and reaches a few per mille in the transition region between the barrel and endcap calorimeters. The uncertainty in c i is typically 0.1% in most of the barrel calorimeter, 0.3% in the endcap and as large as 0.6% in the transition region. The statistical uncertainty from the size of the Z → ee sample in the 2016 dataset is significantly smaller than the systematic uncertainty.
Uncertainties from the modelling of the Z boson production and decay, including the modelling of final-state QED radiation from the charged leptons, were investigated in ref. [1] and found to be negligible compared with the total uncertainty quoted above.

Results
The extraction of the energy scale correction is performed in 68 intervals in η. These intervals cover a range of 0.1 in the barrel calorimeter and are usually a bit smaller in the endcap calorimeter. The -21 -resolution corrections c i are computed in 24 intervals. In each of these η regions, c i corresponds to the effective additional constant term for the data after the fine-grained η-dependent energy scale corrections are applied. Figure 7 shows the results for α i and c i from the 2015 and 2016 datasets. The energy scale correction factors are derived separately for the 2015 and 2016 datasets to take into account the difference in instantaneous luminosity between the two samples which is detailed in section 7.4. As the resolution corrections are consistent between the two years, they are derived from the combined dataset, after the energy scale correction has been applied. The additional constant term of the energy resolution present in the data is typically less than 1% in most of the barrel calorimeter. It is between 1% and 2% in the endcap, with slightly larger values in the transition region between the barrel and endcap calorimeters and in the outer |η| range of the endcap.
No parameterization of the α i as a function of φ is performed. The calorimeter uniformity in φ is typically at the 0.5-1% level and the residual variations of the energy response with φ -22 -

JINST 14 P03017
contribute at this level to the additional constant term. These variations are a bit larger in the endcap calorimeter because of the larger variation of the calorimeter gaps under the influence of gravity as a function of φ. Figure 8 shows a comparison of the invariant mass distribution for Z → ee candidates between data and simulation after the energy scale correction has been applied to the data and the simulation corrected for the difference in energy resolution between data and simulation. No background contamination is taken into account in this comparison. The non-(Z → ee) background is smaller than ≈ 1% over the full shown mass range. The uncertainties in the ratio of the data and simulation distributions are computed varying the α i and c i correction factors within their uncertainties. These uncertainties are estimated as discussed in section 7.2 and take into account changes in the selections applied to Z → ee candidates and variations in the mass window used to extract the calibration. The decrease in the ratio near a mass of 96 GeV is most likely related to imperfect modelling of the tails of the energy resolution by the simulation, which affects the extraction of the energy scale and resolution correction factors. This variation is covered by the estimated uncertainties in the correction factors. Within these uncertainties, the data and simulation are in fair agreement. • The large amount of deposited energy increases the temperature of the calorimeter, creating a small drop in the energy response of about -2%/K [30]. The LAr temperature is measured -23 -

JINST 14 P03017
with probes inside the cryostat at the inner and outer radius of the endcap entrance face. The measured temperature increase is 0.07 K at the inner radius (|η| = 2.65) when collisions occur at high luminosity and 0.02 K at the outer radius (|η| = 1.4). The effect on the energy response is estimated assuming a linear temperature variation as a function of η in the endcap. In addition, there is a small change in the LAr temperature of the different cryostats in the absence of collisions between 2015 and 2016.
• The large amount of deposited energy in the liquid-argon gap creates a current in the HV lines. The current I induced on the HV line is equal to the total ionization current, from the drift of electrons and ions, which is created by the steady flux of deposited energy in the calorimeter. Since there is a significant resistance, R, between the power supply where the voltage is set to a constant value and the LAr gap, the voltage effectively applied to the gap is reduced by R × I. The pattern of resistances across the LAr electrodes [31] is quite complex, but the dominant contribution to the resistance is due to the filter-box resistance in the high-voltage feedthrough [32]. The HV drop can thus be estimated from the current drawn by the power supply and the value of the filter-box resistance, which is 100 kΩ for the EM calorimeter (|η| < 2.5). The change in HV induces a change in the calorimeter response because the drift velocity of ionization electrons varies approximately with the power 0.3 of the electric field in the gap [33][34][35] and the amplitude of the shaped calorimeter signal is proportional to the drift velocity.
The predictions for the energy scale difference are included in figure 9. The changes observed in the data in the endcap are qualitatively reproduced although the difference seen in the data is somewhat smaller than expected for the highest |η| values.

JINST 14 P03017
the number of interactions per bunch crossing is well below the 0.1% level in the data. No effect is visible in the simulation either. Figure 10(b) shows the stability of the energy scale as a function of time, probed with Z → ee events. The stability is significantly better than 0.1%.

Systematic uncertainties in the energy scale and resolution
Several systematic uncertainties impact the measurement of the energy of electrons or photons (converted or unconverted) in a way that depends on their transverse energy and pseudorapidity. After the Z-based calibration, which fixes the energy scale and its uncertainty for electrons with transverse energy close to the average of those produced in Z decays, the relative uncertainty for any given electron or photon with transverse energy E T and pseudorapidity η can be written as: T , η is zero. In addition, for most of the considered uncertainty variations, their impact on photon energy is computed separately for reconstructed converted and unconverted photons. The converted photons have a shower development more similar to that of electrons and therefore usually smaller energy scale systematic uncertainties than unconverted photons. The different uncertainties affecting the energy scale of electrons and photons are described in this section.

Uncertainties related to pile-up
After correction, the energy shift induced by pile-up is estimated to be less than ±10 MeV in transverse energy (see section 6.3). The energy scale uncertainty after the Z-based calibration is thus δE For electrons or photons with E T = 10 GeV, the uncertainty is ≈ 0.075% and it is ≈ 0.02% for E T > 100 GeV.

Impact of the layer calibration uncertainties
The uncertainties in the calibration of the first two layers of the calorimeter and of the presampler are discussed in sections 6.1 and 6.2. The impact of these uncertainties depends on the reconstructed particle energy since the fraction of energy observed in the presampler and in the different calorimeter layers is a function of the energy and of the particle type. Typically, the fraction of energy deposited in the presampler and in the first layer increases when the energy decreases and these fractions are higher for electrons and converted photons than for unconverted photons. The effect of the uncertainties in the layer calibration is propagated to the energy measurement using parameterizations of these fractions as a function of E T and η. In the low-|η| region of the barrel calorimeter, the impact of the uncertainties affecting the calibration of the different calorimeter layers and of the presampler is for instance ≈ ±0.2% on the electron energy scale in the range 10 < E T < 200 GeV.
Since only a small energy fraction is deposited in the third layer of the EM calorimeter, uncertainties in the relative calibration of this layer have a negligible impact on the total calibration uncertainty.

Impact of the E 4 scintillator calibration
In the region 1.4 < |η| < 1.6, the signals of the E 4 scintillators are used as input to the energy measurement, as discussed in section 5. The accuracy of the calibration of the energy deposited in these scintillators varies from 4% to 6% depending on |η|. These uncertainties are based on the comparison of the energy deposited in E 4 between data and simulation for electrons from Z → ee events and the monitoring accuracy of the time-dependence of the reconstructed signal of the scintillator. The impact on the total electron energy is found to be typically 0.3 times the uncertainty in the E 4 scintillator calibration, where the factor 0.3 reflects the typical weight of the E 4 cell information in the calibration regression algorithm.

Uncertainties due to the material in front of the calorimeter
The material in front of the calorimeter was studied in ref. [1] using data collected in 2012. The impact of the material on the energy response depends on the radial location of the material. Different uncertainty variations are thus considered for material in different regions in front of the calorimeter.
• Material inside the active area of the ID. From measurements performed during the detector construction [2], the material integral is known with a ±5% accuracy in four independent |η| regions. In addition, uncertainties in the description of the material in the new innermost pixel layer and in the modified layout of the pixel detector services at low radius are added for the 2015-2016 data. These uncertainties (expressed in units of radiation lengths) range from 0.01 or less for |η| < 1.5 to 0.05 at |η| = 2.0 and 0.2 at |η| = 2.3. These uncertainties include the impact of missing some detector components in the description of the new innermost pixel layer and uncertainties in the description of the modified services for the detector description used in this paper, which corresponds to the original geometry model described in ref. [28].
• Material between the end of the active area of the ID and the presampler (or the calorimeter for |η| > 1.8) and material between the presampler and the calorimeter (for |η| < 1.8). The uncertainties in the amount of material in these regions are the same as the ones derived from the Run 1 studies, since the detector layout is unchanged. The amount of material in these regions was constrained by the longitudinal development of electron-and photoninduced showers in Run 1 data. The uncertainties include the longitudinal shower shape modelling uncertainties after calibration of the presampler and the first two calorimeter layers, in addition to the uncertainties in the GEANT4 simulation. The latter is estimated by varying the associated GEANT4 options to test refinements in the theoretical description of bremsstrahlung and photon conversion cross sections, as well as alternative electron multiplescattering models. The total uncertainty in the amount of material between the end of the active ID area and the presampler is typically 0.03 to 0.1 radiation lengths for |η| < 1.4, up to 0.7 radiation lengths at |η| = 1.5 and 0.1 to 0.3 radiation lengths for 1.5 < |η| < 1.8. The uncertainty in the amount of material between the presampler and the first calorimeter layer is typically 0.04 to 0.1 radiation lengths in the full range |η| < 1.8. Finally, the uncertainty in the material in front of the calorimeter for the region 1.8 < |η| < 2.5 is about 0.1 to 0.15 radiation lengths.
In the low-|η| region of the barrel calorimeter, the total uncertainties related to the description of material in front of the calorimeter give an uncertainty in the energy scale of ±0.3% for E T =10 GeV electrons. This uncertainty increases to ±0.5% at |η| = 2.3.

Non-linearity of the cell energy measurement
Non-linearity in the cell energy measurement induces a dependence of the energy response on the energy of the particle. The linearity of the readout electronics is better than 0.1% [4] in each of the three gains used to digitize the calorimeter signals in the ranges where they are used to collect data. However, the relative calibration of the different readout gains is less well known. To study the accuracy of this relative calibration, data recorded under special conditions in 2015 and 2017 -27 -are used, corresponding to an integrated luminosity of 12 pb −1 in 2015 and 160 pb −1 in 2017. For these data, the threshold to switch from high gain (HG) to medium gain (MG) readout for the cells in the second layer was significantly lowered, by a factor 5. With this special configuration, almost all electrons from Z boson decays have at least the highest-energy cell in layer two recorded in the MG readout. In the standard configuration, the HG readout is almost always used, at least in the barrel, where the transition between the two gains is typically at an energy of ≈ 25 GeV for the cells in the second layer at low |η|.
The reconstructed dielectron invariant mass distribution in these data is compared with the one in data recorded with the standard gain transition configuration taken around the same time. To properly calibrate the ADC-to-current conversion function for low numbers of ADC counts in the MG range in the special configuration, a non-linear ADC-to-current conversion is used, derived from dedicated pulser calibration runs. Uncertainties at the 0.05% level in this conversion can arise from non-linearity of the calibration system for this situation. Figure 11 shows the measured values of the energy scale difference between the two datasets, α G , as a function of |η|. If the HG and MG are perfectly intercalibrated, α G will be zero. A small but significant difference is observed, especially in the region 0.8 < |η| < 1.37. Further investigations did not reveal any significant energy dependence or further η dependence of this effect. The observed difference is assigned as a systematic uncertainty. This uncertainty is assumed to be a scale factor between the calibration of the two gains, independent of the cell energy.  Figure 11. Difference of energy scales, α G , extracted from Z → ee events, as a function of |η| between data recorded with the standard thresholds for the transition between HG and MG in the readout of the layer-two cells and data with lowered thresholds. Only statistical uncertainties are shown.
From this measurement, the impact of the gain intercalibration uncertainty for data taken under standard conditions can be written as a function of the particle type and of E T and η as follows: where: • α G (η) is the measured energy scale difference as a function of η from Z → ee decays, comparing the data recorded with lower gain threshold with data recorded in standard conditions.
• δ Z (η) quantifies the fractional change in energy for electrons from Z boson decays between the data with lower and standard thresholds for a given change in the energy recorded in MG -28 -in the second layer. This sensitivity factor is about 0.3 to 0.4 in the barrel calorimeter and about 0.2 to 0.25 in the endcap calorimeter. It takes into account the fact that only a fraction of the electron energy is recorded in MG layer-two cells in the data with special settings and that in the data with normal settings some layer-two cells can be read out in MG, especially in the endcap where the electron energies are larger.
• δ e,γ G (η, E T ) quantifies, for a given particle, the fractional change in the total energy for a given change in the energy recorded in MG in the second layer, when the standard settings of the gain threshold are used. It is estimated using simulated single-particle samples. It is close to 0 up to E T ≈ 40 to 60 GeV, depending on η and on the particle type, and then rises to reach an asymptotic value of about 0.8 for E T above a few hundred GeV, reflecting the fraction of electron energy measured with second-layer cells read out in MG.
The calibration uncertainty for the low-gain readout is assumed to be the same as for the MG. The low-gain readout is used in the second layer for electrons or photons with transverse energy above 350 to 500 GeV (100 to 300 GeV) depending on η in the barrel (endcap). Studies of a small sample of high transverse momentum Z boson decays, where some of the electrons are recorded in low gain, do not indicate any significantly larger effect.
The uncertainty in the total energy is typically 0.05% to 0.1% depending on η for photons of E T = 60 GeV. It reaches 0.2% to 1% for very high energy electrons and photons.
The uncertainty in the MG-to-HG relative calibration in the first layer has a much smaller effect than the one in the second layer, except in the endcap for 1.8 < |η| < 2.3. In this region, the relative calibration of the two gains in the first layer was found to be sensitive to the pile-updependent optimization of the optimal filtering coefficients with an uncertainty rising from 1% to 5%. In this region, the highest-energy cell in the first layer of most high-E T electromagnetic showers is recorded in MG. The application of the muon-based layer calibration to electrons or photons therefore leads to an uncertainty in the energy scale for electrons or photons, which reaches about 0.8% for unconverted photons with |η| > 2.0.
In the studies reported in ref. [1], the gain calibration uncertainty was investigated by splitting the sample of Z boson decays recorded in standard conditions according to the gain used to measure the highest-energy cell in the second layer. The uncertainty estimated in this way combined the effect of the genuine intercalibration of the different readout gains with systematic effects related to the modelling of lateral shower shapes. The latter impacts a selection based on the gain of the highest-energy cell since showers with narrow lateral shape are more likely to have a second-layer cell with high energy deposit and thus are more likely to have this cell recorded in MG. For the results presented in this paper, the two uncertainties are separated with the relative gain calibration discussed above and with a separate investigation of the impact of the modelling of lateral shower shape on the energy response, reported in section 8.6.

Modelling of the lateral shower shape
Any energy-dependent mismodelling of the energy response as a function of the lateral shower shape can create differences between data and simulation in the energy response relative to the energy response for electrons at E T = 40 GeV, the average value of E T for electrons from Z boson decays.

JINST 14 P03017
Two effects are investigated to derive uncertainties related to the modelling of the lateral shower shape: • The variation of the electron energy response as a function of the shower width in the η direction is studied using Z boson decays. The measured differences between data and simulation are used to derive uncertainties in the energy response for electrons and photons of any transverse energy.
• To take into account possible differences between electron and photon showers related to the different interaction probabilities with the material in front of the calorimeter, the lateral energy leakage in the calorimeter outside the area of the cluster is studied directly in data and simulation. From the differences between data and simulation, an uncertainty in the photon energy calibration is derived.
To characterize the lateral shower shape in the η direction, the measurement of the shower width using first-layer cells (ω stot ) is used. The variable ω stot is defined as the RMS of the energy distribution as a function of η using all first-layer cells included in the cluster. The energy response as a function of the lateral shower shape is investigated by examining the reconstructed Z mass as a function of ω stot , separately for data and simulation. This is illustrated in figure 12. In most of the detector, the difference between data and simulation is small albeit not zero. However, in the region around |η| = 1.7 a large difference between data and simulation is observed. This area is where the material in front of the calorimeter is the largest. Changes in the amount of material in the simulation do not, however, reproduce the effect observed in data. In addition, an overall difference in lateral shower shape, as observed in refs.
[36] and [37], can also induce a difference in the energy response, even if the dependence of the energy response on the shower width is the same in data and simulation. A systematic uncertainty in the energy response from the dependence of the energy response on the shower width is thus estimated.
This uncertainty, taking into account the calibration performed with Z → ee events, can be estimated as where A (B) is the slope of the energy response as a function of ω stot in data (MC simulation) in a given η bin. This slope is extracted from the variation of the dielectron mass as a function of ω stot in Z → ee events. The variation of ω stot as a function of E T and η for electrons and photons is parameterized from the Z → ee and inclusive photon samples separately for data and MC simulation. Simulated single-particle MC samples are used to extrapolate the behaviour to the highest energies.
The resulting energy scale uncertainty is significantly smaller than 0.1% in most of the detector acceptance except in the region with |η| between 1.52 and 1.82 where it is up to 1% for electrons with E T > 500 GeV, up to 1.5% for unconverted photons with E T > 400 GeV and around 0.5% for converted photons.
The lateral energy leakage in the calorimeter is estimated as the difference between the energy collected in an area corresponding to 7 × 11 second-layer cells and the energy collected in the cluster size, which is 3 × 7 (5 × 5) second-layer cells in the barrel (endcap) calorimeter. The leakage measured for photons from radiative Z boson decays is compared with the leakage measured for electrons from Z decays. This is done separately for converted and unconverted photons in wide |η| regions and for transverse energies below and above 25 GeV.
The energy measured in 7 × 11 layer-two cells is corrected for the pile-up-induced energy shifts, in the same way as for the cluster energy (see section 6.3). Figure 13 shows the distribution of the energy leakage for electrons and unconverted photons with E T > 25 GeV in the |η| range 0 to 0.8. The average leakage is larger in the data than in the simulation, which is consistent with a wider lateral shower shape in data. The differences between data and simulation are, within statistical uncertainties, mostly consistent between electrons and photons. To quantify the effect, the double difference of lateral leakage between electrons and photons and between data and simulation is investigated. The largest deviations of the double difference from zero are observed for converted photons with |η| < 0.8, with a value of (0.25 ± 0.10 stat )% and for unconverted photons across the full η range where an average value of around −0.1% is observed. The impact of the photon conversion reconstruction and the classification between converted and unconverted photon categories is estimated by applying the procedure discussed in section 8.7. The measured double differences are taken as additional systematic uncertainties in the photon energy calibration. If the double difference is consistent with zero within its statistical uncertainty, the statistical uncertainty is taken instead as an estimate of the systematic uncertainty.

Modelling of the photon reconstruction classification
The energy estimating algorithm (section 5.1) is trained separately for reconstructed converted and unconverted photons. Misclassifications in conversion category arise from inefficiencies in the conversion-finding algorithm and from fake classification of genuine unconverted photons as converted photons by matching the cluster to pile-up-induced track(s). For conversions occurring at a radius smaller than 800 mm from the beam line, the typical reconstruction efficiency, as estimated by the simulation, is 65% to 85% depending on η. The fake rate, i.e. the fraction of genuine unconverted photons reconstructed as converted photon candidates, is typically 1% to 4% depending on η for the pile-up conditions of the 2015 and 2016 datasets. The efficiency and fake rate are smaller for |η| > 2.0 where the absence of transition radiation tracker coverage does not allow reconstruction of photon conversions occurring at large radius.
If the misclassification rate is different between data and simulation, a bias in the photon energy scale is induced. The efficiency and fake rate are studied using a sample of radiative Z boson decays, Z → µµγ [8]. The longitudinal shower shape of the photon candidates is used to provide a statistical discrimination between genuine converted and unconverted photons and to estimate the efficiencies and fake rate in both data and simulation. The ratio of the efficiencies of the conversion finding algorithm in data and simulation is typically around 0.9. The ratio of fake rates is between 1 and 1.7 depending on η. The impact on the photon energy measurement is estimated by reweighting the MC events with the data-to-MC ratio of efficiencies and fake rates. The uncertainty is taken as the difference between this reweighted MC sample and the original MC sample. This is done separately for the efficiency and the fake rate, which are treated as independent uncertainty sources. A change of the conversion-finding efficiency mostly affects the energy scale of the reconstructed unconverted photon candidates while a change in the fake rate mostly affects the sample of reconstructed converted photon candidates. For photons with E T = 60 GeV, the uncertainty in the energy scale is about 0.04% (0.2% to 0.02%) in the barrel (endcap) for reconstructed unconverted photon candidates and about 0.05% (0.005%) in the barrel (endcap) for reconstructed converted photon candidates.
-32 - Table 3. List of the different independent systematic uncertainties affecting the energy calibration and their divisions in |η| regions between which the uncertainties are not correlated. Uncertainties with one |η| region are fully correlated across the full η acceptance.

Summary of systematic uncertainties in the energy scale
The systematic uncertainties are described by a set of 64 independent uncertainty variations. A given systematic uncertainty can be described by multiple variations for different regions in |η|.
The list of these uncertainties is given in table 3. For simplification, only one uncertainty variation is assigned to the statistical accuracy of the Z → ee calibration since this uncertainty is always negligible compared with the other uncertainties. Figure 14 illustrates the impact of the main systematic uncertainties affecting the energy scale of electrons, unconverted photons and converted photons at |η| = 0.3 as a function of the transverse energy. For a given uncertainty variation, the effect on the energy can be positive or negative with a possible change of sign near the average E T of electrons from Z decays. This is illustrated in this figure by showing the signed uncertainty, i.e. the impact of a one-sided variation of the systematic -33 -uncertainties. The opposite-sign variation will give a systematic impact with the opposite sign. Keeping track of the relative sign across E T and η of the impact of each uncertainty source is important for properly computing the total uncertainty for a sample covering a range of E T and η values. At given values of both E T and η, the total systematic uncertainty is given by the sum in quadrature of the uncertainties related to each of the independent uncertainty sources.  To illustrate the η-dependence of the different uncertainties, table 4 gives the photon energy scale systematic uncertainties for E T = 60 GeV in wide η regions corresponding to either the barrel or the endcap acceptance. A uniform η distribution of the photons is assumed. The typical photon energy scale uncertainty is 0.2% to 0.3% averaged over the barrel and 0.45% to 0.8% in the endcap. For this value of E T , the uncertainties from the relative calibration of the different layers is significantly smaller for converted photons than for unconverted photons as they have a longitudinal shower development closer to that of E T = 40 GeV electrons. The cell energy nonlinearity uncertainty is higher for unconverted photons as they have a higher probability to use medium-gain readout in the second layer, given that they deposit a higher energy fraction in the  second calorimeter layer. The total uncertainties are only partially correlated between converted and unconverted photons.

Energy resolution uncertainties
The different contributions to the energy resolution are: the shower and sampling fluctuations in the calorimeter, the fluctuations in energy loss upstream of the calorimeter, the effect of electronics and pile-up noise and the impact of residual non-uniformities affecting the measurement of the energy in the data. The total contributions of the effects of shower and sampling fluctuations, energy loss before the calorimeter and electronics noise are given in section 5. The intrinsic energy resolution, defined as the expected resolution in the absence of upstream material and with uniform response, is derived from the energy resolution in the simulation of genuine unconverted photons. A 10% relative uncertainty is assumed for this intrinsic energy resolution, based on test-beam studies [38]. The impact of uncertainties in the detector material upstream of the calorimeter on the energy resolution is derived from simulations with additional material as described in section 8.4. The uncertainty in the electronics and pile-up noise modelling is derived from a comparison of data -35 -and simulation for a sample of zero-bias events introduced in section 6.1. The noise is typically 350-400 MeV expressed in transverse energy. The noise uncertainty is defined as the difference in quadrature between the noise in data and simulation and is found to be 100 MeV in terms of transverse energy. Finally, the energy resolution's constant term is derived from the data-tosimulation comparison of the energy resolution for electrons from Z → ee decays, as described in section 7.
A formalism similar to that for the energy scale uncertainty can be used to describe the resolution uncertainties. If ∆σ e,γ i (E T , η) is the uncertainty in the relative energy resolution for a given particle from a given uncertainty variation i, the residual uncertainty after the adjustment of the resolution based on the Z decays can be written as where Σ denotes the square of the relative energy resolution σ.
The uncertainty in the energy resolution comparison between data and simulation for Z → ee decays is described by an additional uncertainty in the constant term of the energy resolution. Figure 16 shows the energy resolution, its total uncertainty and the different contributions to the total relative uncertainty in the resolution as a function of transverse energy for electrons and unconverted photons at two different η values. The uncertainty ∆Σ e,γ i (E T , η) due to the material in front of the calorimeter is estimated as the change of the core Gaussian component of the energy resolution in simulated single-particle samples with different amounts of material in front of the calorimeter. The term ∆Σ i E e(Z→ee) T , η is computed from simulated Z → ee samples. Energy resolution corrections are derived by comparing samples simulated with additional material with the nominal geometry simulation, following the same procedure as used for the data and discussed in section 7.
For electrons or photons in the transverse energy range 30-60 GeV, the energy resolution is known to a precision of the order of 5% to 10%. For high-energy electrons or photons, where the resolution is better, the relative uncertainty in the energy resolution reaches 20% to 50%. Compared with the results reported in ref. [1], the main change is the smaller uncertainty in the constant term of the energy resolution extracted from the Z → ee samples. This uncertainty reduction is mainly due to an improvement of the validation step performed on pseudo-data as discussed in section 7.1 and from better agreement between the two methods considered.
9 Cross-checks with J/ψ → ee and Z → γ decays The energy scale of low-energy electrons (average transverse energy around 10 GeV) is probed using J/ψ → ee events. The known mass of the J/ψ resonance provides a completely independent check of the energy calibration for low-energy electrons. The full calibration procedure discussed in the previous sections, including the energy scale derived from Z → ee events, is applied. The difference between data and simulation for J/ψ → ee events is then quantified using residual energy scale differences, ∆α, extracted from the peak positions of the reconstructed invariant mass. The formalism is very similar to the one used for the Z → ee data-to-simulation energy scale corrections,  but fewer |η| regions are defined, given the smaller size of the collected J/ψ → ee sample. If the energy calibration is correct, ∆α should be consistent with zero within the combined uncertainties of the J/ψ → ee measurement and the systematic uncertainty of the energy calibration. The event selection and data and MC samples are introduced in section 4.
To compare data and simulation, the relative fraction of J/ψ produced in b-hadron decays compared to promptly produced J/ψ is determined, since the electrons from J/ψ produced in b-hadron decays are less isolated. This fraction is extracted from a fit to the proper decay-time distribution, following the procedure discussed in ref. [39]. The fraction of prompt J/ψ is found to be between 68% and 83% depending on the E T requirement imposed on the electron with highest E T , with uncertainties between 3% and 14%.
To extract the energy scale differences between data and simulation from J/ψ events, a procedure similar to the simultaneous fit used for Z → ee events, described in section 7.1, is applied. The significant contributions from the continuum background and the ψ(2S) resonance have to be taken into account. The typical signal-to-background ratio integrated over the 2.6-3.4 GeV mass range, which contains most of the signal, is around 10 to 1.
The dielectron invariant mass distribution in the range 2.1 to 4.1 GeV is described by the following function: with the J/ψ and ψ(2S) mass distributions described by a double-sided Crystal Ball function ( f DSCB ) and the background mass distribution ( f bkg ) described by a second-order Chebyshev polynomial.
-37 -Since in the simulation the continuum background is not considered, the last term is used only when fitting data.
The parameters describing the ψ(2S) mass distribution are related to the ones describing the J/ψ mass distribution by a scaling factor equal to the ratio of the masses of these two resonances. All the parameters but the m ee peak position are fixed to the DSCB parameters extracted from the MC samples. This free parameter is expressed as a function of ∆α. The ∆α factors are extracted from a simultaneous fit of the different i-j data regions in η. The normalizations of the J/ψ, ψ(2S) and background yields as well as the parameters describing the background shape are also free in the fit.
The systematic uncertainties affecting the extraction of ∆α include the uncertainties in the shape of the signal mass distribution (choice of DSCB function and parameters of the DSCB functions), in the modelling of the background mass distribution, in the results of the proper-time fit and in the modelling of the η distribution of the electrons in the simulation. These systematic uncertainties are significantly smaller than the statistical uncertainties. Figure 17 shows the extracted ∆α values with their uncertainties as a function of η. They are compared with the systematic uncertainty of the calibration procedure for electrons with the E T distribution of those observed in the J/ψ sample. No measurement is reported in the transition region between the barrel and endcap calorimeters due to the limited measurement accuracy in this region. The uncertainty in the calibration for low-E T electrons arises mostly from uncertainties in the amount of material in front of the calorimeter and in the relative calibration of the different calorimeter layers. Good agreement is observed between the residual energy scale differences and the calibration described in this paper. This agreement confirms that the method to extract the nominal scales and the estimate of the systematic uncertainties are valid over a wide range of electron energies.
The width of the reconstructed J/ψ → ee mass distribution can also be used to probe the energy resolution for low-energy electrons. The observed width in the data is consistent with the predicted resolution within its uncertainties.

Z → γ decays
The energy scale correction of photons is assumed to be the same as the one extracted from Z → ee decays, as described in section 7, within the uncertainties described in section 8. The radiative decays of the Z boson can be used to check the energy scale of photons, in the low-energy region in particular. Converted and unconverted photons are studied separately. The electron and muon channels are treated independently and then combined. All the corrections previously described are applied to electrons and photons, and residual energy scale factors for photons are derived by comparing the data with simulations. The samples of simulated events and the selection are described in section 4.
The residual photon energy scale difference is parameterized as an additional correction to the photon energy ∆α, similarly to the J/ψ study. The mass distribution of the γ system in the simulation is modified by applying ∆α to the photon energy and the value of ∆α that minimizes the χ 2 comparison between the data and the simulation is computed. A second method based on an analytic function adjusted to the simulation to describe the shape of the mass distribution is also investigated. The two methods give consistent results.
The measurement is limited by the statistical accuracy. The considered systematic uncertainties are from the lepton energy scale and the background contamination, and they are negligible compared with the statistical uncertainty. Figure 18 shows the measured ∆α as a function of E T , separately for converted and unconverted photons. The value of ∆α is consistent with zero within the uncertainties in the measurement and in the photon energy scale.

Summary
The calibration of the energy measurement of electrons and photons collected with the ATLAS detector during 2015 and 2016 using about 36 fb −1 of LHC proton−proton collisions at √ s = 13 TeV is presented. The estimate of the energy is optimized in simulation using variables related to the -39 -

JINST 14 P03017
shower development in the calorimeter and the properties of the photon conversions. In the transition region between the barrel and endcap calorimeters, the energy resolution is improved using information provided by gap scintillators.
To achieve good linearity of the energy response, an accurate intercalibration of the different longitudinal layers of the calorimeter is required. The intercalibration of the first two layers of the calorimeter is derived from a study of muon energy deposits. Despite the moderate signal-to-noise ratio for muon energy deposits at the luminosity where the data are collected, an accuracy of 0.7% to 2.5% is achieved for this measurement. The calibration of the presampler layer is derived from a detailed study of electron and photon showers, with an accuracy varying between 1.5% and 3%. The impact of pile-up on the energy measurement is investigated and small effects are corrected.
The overall calorimeter energy scale is set from a large sample of Z → ee events, comparing the invariant mass distribution in data and simulation. Differences between data and simulation for the energy resolution are derived and energy scale corrections are extracted. The accuracy of the energy scale measurement varies from 0.03% to 0.2% depending on |η|. The constant term of the energy resolution in the data is less than 1% in the barrel calorimeter and typically 1-2% in the endcap calorimeter.
The calorimeter energy scale is found to be stable with time and with changes in luminosity, with effects of up to few per mille observed in the endcap calorimeter and less than one per mille in the barrel calorimeter.
Uncertainties in the amount and location of material in front of the calorimeter are mostly the same as in the Run 1 studies. The impact of the detector components that were changed before data taking started in 2015 is investigated and small additional uncertainties in the energy response are derived.
Uncertainties in the linearity of the measurement of the energy deposited in each calorimeter readout cell are estimated using data collected with special settings in 2015 and 2017 and found to be at the few per mille level for most of the calorimeter acceptance.
From these measurements, the energy calibration and its total uncertainty are derived for electrons and photons at all energies. The systematic uncertainty in the energy scale calibration is about 0.03% to 0.2% in most of the detector acceptance (|η| < 2.5) for electrons with transverse momentum close to 45 GeV. For electrons with transverse momentum of 10 GeV the typical uncertainty is 0.3% to 0.8% and it is about 0.25% to 1% for photons with transverse momentum around 60 GeV. This energy calibration was used for the Higgs boson mass measurement performed by the ATLAS Collaboration using the two-photon and four-lepton decay channels with data collected in 2015 and 2016 [40].
The accuracy of this calibration is probed with low-energy electrons from J/ψ → ee events and with photons from radiative Z boson decays and good agreement is found.  [41].