Prompt D$^{0}$, D$^{+}$, and D$^{*+}$ production in Pb-Pb collisions at $\sqrt{s_{\rm NN}}$ = 5.02 TeV

The production of prompt D$^{0}$, D$^{+}$, and D$^{*+}$ mesons was measured at midrapidity (|y|<0.5) in Pb-Pb collisions at the centre-of-mass energy per nucleon-nucleon pair $\sqrt{s_{\rm NN}}$ = 5.02 TeV with the ALICE detector at the LHC. The D mesons were reconstructed via their hadronic decay channels and their production yields were measured in central (0-10%) and semicentral (30-50%) collisions. The measurement was performed up to a transverse momentum ($p_{\rm T}$) of 36 or 50 GeV/$c$ depending on the D meson species and the centrality interval. For the first time in Pb-Pb collisions at the LHC, the yield of D$^0$ mesons was measured down to $p_{\rm T}$ = 0, which allowed a model-independent determination of the $p_{\rm T}$-integrated yield per unit of rapidity (d$N$/d$y$). A maximum suppression by a factor 5 and 2.5 was observed with the nuclear modification factor ($R_{\rm AA}$) of prompt D mesons at $p_{\rm T}$ = 6-8 GeV/$c$ for the 0-10% and 30-50% centrality classes, respectively. The D-meson $R_{\rm AA}$ is compared with that of charged pions, charged hadrons, and J/$\psi$ mesons as well as with theoretical predictions. The analysis of the agreement between the measured $R_{\rm AA}$, elliptic ($v_2$) and triangular ($v_3$) flow, and the model predictions allowed us to constrain the charm spatial diffusion coefficient $D_s$. Furthermore the comparison of $R_{\rm AA}$ and $v_2$ with different implementations of the same models provides an important insight into the role of radiative energy loss as well as charm quark recombination in the hadronisation mechanisms.


Introduction
Ultra-relativistic heavy-ion collisions allow the study of quantum chromodynamics (QCD) at high energy density and temperature. According to lattice QCD (lQCD) calculations, these extreme conditions lead to a transition of hadronic matter into a strongly-interacting medium, called quark-gluon plasma (QGP), in which quarks and gluons are deconfined and chiral symmetry is partially restored [1][2][3][4][5]. A QGP is formed and studied in high-energy heavy-ion collisions at the Relativistic Heavy Ion Collider (RHIC) and at the CERN Large Hadron Collider (LHC). The existing measurements indicate that the QGP behaves as a strongly-coupled low-viscosity liquid-like system [6] and its lifetime at the energy densities reached at the LHC is of the order of 10 fm/c [7].
Heavy quarks, like charm and beauty, are mostly produced in primary hard scattering processes between the partons of the incoming nuclei, which occur in the early stages of the collisions. The time scales for heavy-quark production (≤ 0.07 fm/c for cc and ≤ 0.02 fm/c for bb pairs [8]) are shorter than the QGP formation time, which is about 0.3-1.5 fm/c at LHC energies [9]. Therefore, heavy quarks experience the full space-time evolution of the hot and dense QCD medium.
During their propagation in the QGP, heavy quarks interact with the medium constituents, by exchanging energy and momentum via elastic [10][11][12] and inelastic [13,14] processes. Low-momentum heavy quarks (i.e. 3-4 GeV/c) mainly interact via elastic scatterings and are expected to acquire some collective behaviour of the system, like radial and anisotropic azimuthal flow, as a consequence of multiple interactions with the medium [15,16]. The typical momentum exchange in the interactions of heavy quarks with the medium is small compared to the charm-quark mass. Therefore, heavy quarks undergo Brownian motion in the medium characterised by many small-momentum kicks. The degree of heavy-quark thermalisation provides unique insight into the thermalisation process of the system. Substantial theoretical efforts were made to describe the charm-quark transport in a hydrodynamically expanding medium [17]. The relevant transport parameter is the spatial diffusion coefficient D s , which does not depend on the precise value of the heavy-quark mass and, hence, is a medium property. It can be estimated via the comparison of the measured differential yields as a function of transverse momentum (p T ) and azimuthal distributions of D mesons with model predictions.
For high-p T quarks (i.e. 8-10 GeV/c) the main manifestation of the interactions with the medium is energy loss, which can occur via collisional processes and gluon radiation [18], with the latter expected to be the dominant mechanism. In particular, the amount of radiative energy loss is influenced by the colour charge of the parton interacting with the medium. According to QCD calculations, gluons are expected to lose more energy than quarks, due to their stronger coupling to the medium [13,14]. At LHC energies, light-flavour particles in the momentum interval 5 < p T < 20 GeV/c are expected to originate mostly from the fragmentation of gluons produced in hard scattering processes, while at higher p T the contribution of light-quark jets becomes relevant [19]. On the other hand, charm mesons provide an experimental tag for a quark parent at all momenta. Thus, the comparison of heavy-flavour hadron production with that of light-flavour particles at high p T can provide insight into this aspect. In addition, the energy loss of quarks can be affected by several mass-dependent effects like the deadcone effect, which reduces the small-angle gluon radiation for quarks with moderate energy-over-mass values [20][21][22][23]. Similarly, collisional energy loss is predicted to depend on the quark mass and to be smaller for heavy quarks [24].
Heavy-flavour hadron yields and momentum distributions can be influenced by the modification of the parton distribution function (PDF) due to initial state effects, like nuclear shadowing [18]. It was also suggested that low-momentum heavy quarks could hadronise via recombination with other quarks from the medium, in addition to the fragmentation in the vacuum [16,25].
The aforementioned effects can be investigated with the measurement of the nuclear modification factor R AA of heavy-flavour hadrons. It is defined as the ratio of the p T -differential production yield in nucleus-nucleus collisions (dN AA /dp T ) and the production cross section in proton-proton collisions (dσ pp /dp T ) scaled by the average nuclear overlap function T AA R AA (p T ) = 1 T AA dN AA /dp T dσ pp /dp T , where T AA is defined as the average number of binary nucleon-nucleon collisions ( N coll ), which can be estimated via Glauber model calculations [26][27][28], divided by the inelastic nucleon-nucleon cross section.
Measurements of prompt D-meson production were performed by the ALICE Collaboration in Pb-Pb collisions at √ s NN = 2.76 TeV [29] and 5.02 TeV [30] in the 0-10% and 30-50% centrality classes for both collision energies and in the 60-80% for the highest one. The D-meson yields show a suppression in central (0-10%) and semi-central (30-50%) collisions that reaches up to a factor of 5 and 2.5, respectively, at p T of 6-10 GeV/c. It then decreases with increasing p T , while the suppression factor is of 1.25 without a pronounced p T dependence in peripheral (60-80%) collisions. The prompt D 0 production was also measured by the CMS Collaboration in the most central Pb-Pb collisions at √ s NN = 5.02 TeV [31] in the p T range 2-100 GeV/c and the result is in agreement with ALICE measurements. Furthermore, also the STAR Collaboration measured the production of the prompt D 0 mesons in Au-Au collisions at √ s NN = 200 GeV [32] and the comparison with this result can provide insight into the √ s dependence of energy-loss effects. Conversely, the D-meson nuclear modification factor measured by the ALICE Collaboration in p-Pb collisions at √ s NN = 5.02 TeV [33], where an extended QGP is not expected to form, is compatible with unity for the whole measured p T range.
Complementary information on the interactions of heavy quarks with the medium constituents and their possible thermalisation can be obtained from the measurements of the anisotropies in the Dmeson azimuthal distributions, which are characterised in terms of the Fourier coefficients [34,35]. In particular, the second order coefficient v 2 , called elliptic flow, is defined as v 2 = cos(2ϕ) where ϕ is the azimuthal angle. Recently, the ALICE Collaboration reported the latest measurements of prompt D-meson azimuthal anisotropic flow [36] in Pb-Pb collisions at √ s NN = 5.02 TeV.
In this paper, the measurements of the p T -differential yields and nuclear modification factors of prompt D 0 , D + , and D * + mesons (i.e. produced via the hadronisation of charm quarks or from the decays of excited charmed hadron states) and their charge conjugates, in central (0-10%) and semicentral (30-50%) Pb-Pb collisions at √ s NN = 5.02 TeV are reported. The statistical and systematic uncertainties have been reduced due to the Pb-Pb data sample collected with the ALICE detector at the end of 2018, that is larger by a factor eight (four) for central (semicentral) collisions with respect to the data sample collected in 2015 used for the previous publication [30], and to the production cross section measured in pp collisions at the same centre-of-mass energy [37]. The larger data sample allowed the reduction of the statistical uncertainties and the extension of the p T reach of the measurements down to p T = 0 for D 0 mesons. Moreover, the previous measurements [30] were affected by the uncertainty on the √ s scaling of the pp production cross section. The new measurements do not include such uncertainty since they use the measured pp production cross section at the same collision energy [37].
The paper is structured as follows. The data sample and the experimental apparatus are briefly introduced in Section 2. The D-meson reconstruction procedure and the corrections applied to the raw yields are presented in Section 3, while the estimation of the systematic uncertainties is described in Section 4. The results are presented in Section 5, together with a comparison with the charged-pion, proton, and prompt and non-prompt J/ψ R AA , along with model calculations. In addition, a simultaneous comparison of the measured R AA and elliptic flow v 2 [36] at low and intermediate p T with transport-model calculations is discussed, together with an estimate of the spatial diffusion coefficient. This comparison will provide insights into the participation of the charm quark in the collective expansion of the medium [38], as well 2 Detector and data sample The ALICE experimental apparatus includes several detectors for particle tracking and identification as well as electromagnetic calorimeters at midrapidity (|η| < 0.9), a forward muon spectrometer (−4 < η < −2.5), and a set of forward and backward detectors used for triggering, background rejection, and event characterisation. A detailed description of the apparatus and its performance can be found in Refs. [39,40].
displaced from the primary vertex, exploiting the separation of few hundreds µm due to the weak decays of D 0 and D + (cτ of ∼ 123 and ∼ 312 µm, respectively [49]). In the case of the strong decay of the D * + meson, the decay topology of the produced D 0 was exploited. This method allowed the reconstruction of D 0 candidates for p T > 1 GeV/c in both centrality classes and of D + (D * + ) candidates for p T > 2.5 (3) GeV/c and for p T > 2 (2) GeV/c in the 0-10% and 30-50% centrality classes, respectively. D 0 and D + candidates were built using pairs and triplets of tracks with proper charge-sign combination, |η| < 0.8, p T > 0.4 GeV/c, a minimum number of two hits (out of six) in the ITS, with at least one in the two innermost layers, at least 70 out of 159 crossed TPC pad rows, and a fit quality χ 2 /ndf < 1.25 in the TPC (where ndf is the number of degrees of freedom involved in the track fit procedure). D * + candidates were reconstructed by combining D 0 candidates with tracks, which were required to have |η| < 0.8, p T > 0.1 GeV/c, and at least three associated hits in the ITS.
These track selection criteria reduce the D-meson acceptance in rapidity, which, depending on p T , varies from |y| > 0.5 at low p T and |y| > 0.8 for p T > 5 GeV/c. Consequently, a p T -dependent fiducial acceptance selection, |y| < y fid (p T ), was applied, with y fid (p T ) defined according to a second-order polynomial function increasing from 0.5 to 0.8 in the range 0 < p T < 5 GeV/c, and fixed to 0.8 for The D-meson selection strategy is similar to the one used in previous analyses and the variables used to distinguish between signal and background candidates are based on the impact parameters (i.e. the distance of closest approach between the track and the primary vertex in the plane transverse to the beam direction) of the decay particles, the separation of the primary and secondary vertices, and the pointing of the reconstructed D-meson momentum to the primary vertex, as described in Refs. [30,50]. These selection criteria tend to enhance reconstructed feed-down D mesons, originating from beautyhadron decays, over those promptly produced. An additional selection was therefore applied on the normalised difference between the measured and expected impact parameters of each of the decay particles, which allows for a significant rejection of background candidates and feed-down D mesons, while keeping a large fraction of prompt D mesons as reported in Ref. [51]. Further reduction of the combinatorial background was obtained by applying PID for charged pions and kaons with the TPC and TOF detectors. A ±3σ window around the expected mean values of dE/dx and time-of-flight was used for the identification, where σ is the resolution on these two quantities. A tighter PID selection criterion (±2σ ) was used for D + (for p T < 3 GeV/c) and D * + candidate daughters in central collisions because of the large background of track triplets.
An alternative analysis method, not based on the reconstruction and selection of the displaced decayvertex topology, was previously developed and applied for the two-body decay of D 0 mesons in pp and p-Pb collisions, in order to extend the measurement down to p T = 0 [37,52]. This technique, which is used for the first time in the analysis of Pb-Pb collisions, does not use geometrical selections on the displaced decay vertex (which are not effective at very low p T ), but relies mainly on particle identification and on the estimation and subtraction of the combinatorial background. The D 0 candidates were formed combining pairs of tracks with opposite charge sign (unlike sign, ULS), with |η| < 0.8 and p T > 0.4 GeV/c. Single-track and particle identification selections as well as the fiducial acceptance selection of the reconstructed candidates were performed using the same strategy adopted in the analysis with decayvertex reconstruction previously described. The contribution to the invariant-mass distribution of ULS Kπ pairs due to combinatorial background is estimated with the event-mixing technique. The events are grouped in pools, before the event-mixing, based on the primary vertex position along z and on the event multiplicity, quantified by the number of track segments reconstructed in the two innermost layers of the ITS. Then, the kaon tracks of a given event are mixed with the pion tracks of other events. The top left panel of Fig. 1 shows the invariant-mass distribution of ULS Kπ pairs together with that of the background estimated with the event-mixing technique in the interval 0 < p T < 1 GeV/c. The latter distribution was normalised to match the yield of ULS pairs at one edge of the invariant-mass interval      µ, width σ , and raw yield S are also reported. Top row: D 0 -meson candidates with 0 < p T < 1 GeV/c without reconstructing the decay vertex. The invariant-mass distributions are shown before (left) and after (right) the subtraction of the combinatorial background estimated from event-mixing. Middle row: D 0 -meson candidates with 1 < p T < 1.5 GeV/c with reconstruction of the decay vertex before (left) and after (right) background subtraction. The width of the Gaussian in this and in the previous p T interval is fixed to the value obtained from simulations. Bottom row: D + -meson candidates with 5 < p T < 5.5 GeV/c (left) and D * + -meson candidates with 16 < p T < 24 GeV/c (right). considered for the extraction of the D 0 raw yield.
The D-meson raw yields, including particles and antiparticles, were obtained from binned maximumlikelihood fits to the D 0 and D + candidate invariant mass (M) distribution and to the mass difference ∆M = M(Kππ) − M(Kπ) distribution for D * + candidates. Figure 1 shows examples of fits for these distributions in the 0-10% centrality class and for four p T intervals. In the analysis of the D 0 meson without decay-vertex reconstruction, the fit is performed after subtracting the estimated background from the ULS Kπ invariant-mass distribution as shown in the top right panel.
The fit function was composed of a Gaussian term to describe the signal and an exponential function for the background for D 0 and D + candidates at intermediate and high p T in the analysis with vertex reconstruction. At low p T (p T < 3 GeV/c for D 0 and p T < 5 GeV/c for D + ), a second-order polynomial function is used to model the background invariant-mass shape in both centrality classes. In the D 0 analysis without vertex reconstruction, instead, the background was parametrised for p T < (>) 2 GeV/c with a fourth-order (third-order) polynomial function. The ∆M distribution of D * + candidates was fitted with a Gaussian function for the signal and the following function for the background: where m π is the pion mass and a and b are free parameters.
In some cases a D 0 -meson candidate can be also identified as a D 0 meson when the two daughter tracks are compatible with both the kaon and pion hypothesis, leading to an irreducible correlated background. Hence, in the D 0 meson analyses, an additional term was included in the fit function to take into account this contribution to the invariant mass of signal candidates, which is called reflections. It was parametrised with a double-Gaussian distribution based on detailed Monte Carlo simulations. This contribution ranges between 2% and 3% of the raw signal depending on p T [30]. Given the critical signal extraction for the D 0 meson at low p T in the analysis with vertex reconstruction, due to the small signalto-background ratio, the width of the Gaussian for the signal was fixed to the value obtained from the simulation for p T < 1.5 GeV/c. We verified that the widths from the simulation were consistent with those extracted from the data. For the same reason, in the analysis without vertexing the Gaussian width was fixed to the one from the simulation in the whole p T range. The statistical significance of the signal, defined as S/ √ S + B where S is the raw signal yield obtained by integrating the Gaussian function and B is the background under the peak (within 3σ ), varies from 4 to 60, depending on the D-meson species, the p T interval, and the centrality class. In the D 0 analysis without decay-vertex reconstruction, the S/B in the p T range 0-1 GeV/c is approximately ∼ 8.5×10 −6 before the mixed-event background subtraction.

Yield corrections and beauty feed-down subtraction
The D-meson raw yields were corrected to obtain the p T -differential yields of prompt D-mesons according to: The raw yield values N D+D,raw , which contain the contribution of feed-down from beauty-hadron decays, were multiplied by the fraction of promptly produced D mesons f prompt and divided by a factor of two to obtain the charged-averaged yields. Furthermore, they were divided by the product of prompt D-meson acceptance and efficiency (Acc × ε) prompt , the branching ratio BR of the decay channel, the width of the p T interval (∆p T ), and by the number of events N events . The factor α y (p T ) normalises the corrected yields measured in ∆y = 2y fid (p T ) to one unit of rapidity. It was computed as the ratio between the generated Dmeson yield in |y| < y fid (p T ) and that in |y| < 0.5 using a data-driven p T shape and a rapidity distribution from fixed order plus next-to-leading logarithms (FONLL) [53,54] perturbative QCD calculations, after verifying that the D-meson rapidity distributions in FONLL are consistent with those from PYTHIA 8 [55].
The (Acc × ε) correction was obtained separately for prompt and feed-down D mesons using simulations with the GEANT3 transport package [56], including a detailed description of the detector geometry and response as well as of the LHC beam conditions. The Pb-Pb collisions at √ s NN = 5.02 TeV were produced with the HIJING v1.36 [57] event generator and D-meson signals were added by injecting cc or bb pairs generated with the PYTHIA v8.2.43 event generator with Monash tune [58]. The D-meson p T distributions from the simulations were reweighted in order to use realistic momentum distributions in the determination of the acceptance and the efficiency, which depend on p T . The weights were defined with an iterative procedure to match the p T dependence measured for D 0 mesons in the intervals used in the analysis, for both centrality classes and in the momentum interval 1< p T < 50 GeV/c.        D * + (bottom right panel) mesons with |y| < y fid as a function of p T in the 0-10% centrality class. For the analysis that does not exploit the selections on the D 0 -meson decay vertex (top left panel), the efficiency is higher by a factor of about 100 (5) at low (high) p T as compared to the analysis with decay-vertex reconstruction (top right panel). The (Acc × ε) is almost independent of p T (the mild increase with increasing p T is mainly determined by the geometrical acceptance of the detector) and is the same for prompt and feed-down D 0 , as expected when no selection is made on the displacement of the D 0 -meson decay vertex from the interaction point.
The efficiencies for the analysis with geometrical selections on the displaced decay-vertex topology range from about 10 −3 at low p T to 0.1-0.3 at high p T , depending on the D-meson species. The decreasing efficiency with decreasing p T is due to the fact that more stringent selection criteria are needed at low p T because of the larger background and the smaller average displacement of the decay vertex from the interaction point. The trend of the efficiency with p T is not completely smooth, especially for D 0 and D * + , reflecting the p T intervals in which the optimisation of the selection criteria was performed. The (Acc × ε) is higher for semicentral collisions than for central collisions, since less stringent selections are applied because of the lower combinatorial background. The difference between the efficiencies for prompt and feed-down D mesons is due to the geometrical selections applied since the latter are more displaced from the primary vertex due to large B-meson lifetime (τ ≈ 500 µm) and are therefore more efficiently selected by the majority of the selection criteria applied in the analysis. However, the requirement on the difference between measured and expected decay track impact parameter rejects efficiently D mesons coming from beauty-hadron decays. This is particularly effective for D + mesons ( Fig. 2 bottom left panel) whose feed-down efficiencies become lower than the prompt efficiencies after a selection on the aforementioned variable is applied.
The fraction of selected prompt D mesons f prompt was obtained with the procedure introduced in Refs. [30,59] to account for the contribution of D mesons from beauty-hadron decays in the measured raw yield. The f prompt factor was estimated in each p T interval using perturbative QCD calculations for the cross section of feed-down D mesons, efficiencies from the simulations, and a hypothesis on the R AA of feeddown D mesons. In detail, the expression for f prompt is: where N D+D raw is the measured raw yield and N D+Dfeed-down raw is the estimated raw yield of D mesons from beauty-hadron decays. The beauty-hadron production cross section in pp collisions at √ s = 5.02 TeV, estimated with FONLL calculations [60], was folded with the beauty-hadron→ D + X decay kinematics from PYTHIA 8 and multiplied by the (Acc × ε) of feed-down D mesons, by the T AA of the corresponding centrality class, and by the other factors introduced in Eq. 2. Finally, the nuclear modification factor of D mesons from beauty-hadron decays (R feed-down AA ) was accounted for.
The comparison of the R AA of prompt D mesons (R prompt AA ) at √ s NN = 5.02 TeV [30] with that of J/ψ from B-meson decays at the same energy measured by the CMS [61] and the ATLAS [62] collaborations indicates that prompt charmed hadrons are more suppressed than non-prompt charmed hadrons. The difference between the R AA values is about a factor two in central collisions at a p T value of about 10 GeV/c [30] and it is described by model calculations with parton-mass-dependent energy loss. Therefore, for the centrality classes 0-10% and 30-50%, the value R feed-down AA = 2 × R prompt AA was assumed to compute the f prompt factor for D mesons with 3 < p T < 24 GeV/c. To estimate a systematic uncertainty, this hypothesis was varied in the range 1 < R feed-down AA /R prompt AA < 3 considering the data uncertainties and model variations. For p T < 3 GeV/c and 24 < p T < 50 GeV/c, since model calculations predict a lower difference between R prompt AA and R feed-down AA [63,64], the hypothesis R feed-down

Systematic uncertainties
The systematic uncertainties on the corrected yields of D 0 , D + , and D * + mesons were estimated as a function of p T for the 0-10% and 30-50% centrality classes considering the following sources: (i) extraction of the raw yield from the invariant-mass distributions; (ii) reconstruction efficiency of the Table 2: Relative systematic uncertainties on prompt D-meson yields in Pb-Pb collisions at √ s NN = 5.02 TeV for representative p T intervals. The first p T interval of the D 0 corresponds to the analysis without decay vertex reconstruction. For the uncertainties on the correction factors, values below 0.5% are considered negligible. Centrality limits 2% decay-particle tracks; (iii) D-meson selection efficiency; (iv) PID efficiency; (v) generated D-meson p T and rapidity shape; (vi) subtraction of the contribution originating from beauty-hadron decays. In addition, a global normalisation uncertainty due to the branching-ratio uncertainty and the centrality interval determination was considered. The estimated values of the systematic uncertainties are summarised in Table 2 for the three D-meson species in representative p T intervals.
The systematic uncertainty on the D-meson raw yield was estimated in each p T interval by varying the invariant-mass interval considered in the fit and the functional form of the background fit function. The sensitivity to the line shape of the signal was tested by considering the raw yield values obtained by counting the candidates in the invariant-mass region of the signal peak after subtracting the background estimated from the side bands. In the case of the D 0 -meson analysis without decay-vertex reconstruction, an additional contribution related to the line shape of the signal was estimated by varying the width of the Gaussian function by ±10% with respect to the Monte Carlo expectation, based on the deviations between the Gaussian width values observed in data and simulations for the analysis with decay-vertex reconstruction. The systematic uncertainty was defined as the RMS of the distribution of the signal yields obtained from all these variations. In the case of D 0 mesons, an additional contribution due to the modelling of the reflection contribution in the fit was estimated by varying (by ±20%) the ratio of the integral of the reflections to the integral of the signal and the shape of the templates used in the invariantmass fits. The assigned uncertainty ranges from 2% to 11% depending on the D-meson species and p T interval, being on average smaller in the 30-50% centrality class due to the larger signal-to-background ratio in this class as compared to central collisions.
The systematic uncertainty on the track reconstruction efficiency has two contributions. The first one was estimated by varying the track quality selection criteria. The second contribution originates from possible differences in the probability to match the TPC tracks to the ITS hits in data and in simulations. It was estimated by comparing the matching efficiency in data and simulations after weighting the relative abundances of primary and secondary particles in the simulation to match those observed in data. The uncertainty was estimated for the single track and propagated to the reconstructed D mesons using the decay kinematics. The estimated uncertainty is the quadratic sum of the two contributions and it depends on the D-meson species and p T , ranging from 3% to 10.5% for the two-body decay of D 0 mesons and from 5.5% to 15.5% for the three-body decays of D + and D * + mesons.
The uncertainty on the D-meson selection efficiency originates from imperfections in the description of the D-meson kinematic properties and of the detector resolution and alignment in the simulation. For the analyses with decay-vertex reconstruction, the systematic uncertainty was estimated by comparing the corrected yields obtained by repeating the analysis with different sets of selection criteria resulting in a significant modification of the raw yields, signal-to-background ratios, and efficiencies. The estimated uncertainty depends on the D-meson species and p T interval, being larger at low p T and for central collisions, where more stringent selections are used to obtain a good statistical significance of the signal. The values obtained in these analyses range from 2% (3%) to 8% (13%) for the two-(three-) body decay channel. In the case of the D 0 -meson analysis without decay-vertex reconstruction, no geometrical selections on the displaced decay-vertex topology are applied, and the efficiencies are higher than those of the analysis with decay-vertex reconstruction and almost independent of p T . The stability of the corrected yield was tested against variations of the single-track p T selection and no systematic effect was observed.
The uncertainty on the PID selection efficiency was estimated by repeating the analyses with decayvertex reconstruction without applying the PID selections. The resulting corrected yields were found to be compatible with those obtained with the PID selection and therefore no systematic uncertainty was assigned. For the D 0 -meson analysis without decay-vertex reconstruction, the analysis without applying PID selections could not be performed due to the insufficient statistical significance of the signal. More stringent PID criteria (at 2σ level on TPC, or TOF or both) were tested and compatible values for the corrected yields were obtained. Based on this result and on the fact that the PID selections are the same as used in the analysis with decay-vertex reconstruction, no uncertainty due to PID was assigned. In the case of the D * + analysis, more stringent PID selection criteria were used in the 0-10% centrality class. A systematic uncertainty of 1% was estimated by comparing the pion and kaon PID selection efficiencies in the data and in the simulation and combining the observed differences using the D * + -meson decay kinematics. For this study, pure pion samples were selected from strange-hadron decays, while pure kaon samples in the TPC (TOF) were obtained using a tight PID selection in the TOF (TPC).
An additional contribution to the systematic uncertainty on the efficiency originates from a possible difference between the real and simulated D-meson p T and rapidity distributions. The effect of the p T shape was estimated by calculating the efficiency using alternative D-meson transverse momentum shapes via a reweighting technique. In particular, the p T distributions from FONLL calculations with and without hot-medium effects parametrised based on the R AA in central collisions from different models were considered. For the analyses with decay-vertex reconstruction, the resulting uncertainty, which also includes the effect of the p T dependence of the nuclear modification factor, was estimated to be negligible for p T > 5 GeV/c and to increase to 1-1.5% in the lowest p T intervals considered in the analysis, where the efficiency varies steeply with p T . Instead, no sensitivity to the generated D 0 p T shape was observed in the results of the D 0 -meson analysis without decay-vertex reconstruction. The simulated rapidity shape of D mesons affects the Acc × ε and the α y factors in the calculation of the cross section. It was verified that the D-meson rapidity distributions in the PYTHIA 8 simulations and FONLL calculations are similar, resulting in a negligible effect on the Acc × ε and α y correction factors. For the latter factor, an extreme assumption of a flat rapidity shape was tested and the difference with respect to the FONLL case was found to be smaller than 1% for p T < 10 GeV/c and to be smaller than 2% at higher p T .
Considering that at high p T the assumption of a flat rapidity shape is an extreme variation, the effect of the generated dN/dy shape was considered to be negligible and no systematic uncertainty was assigned.
The systematic uncertainty on the f prompt correction factor was estimated by varying (i) the FONLL parameters (b-quark mass and factorisation and renormalisation scales, according to the prescription in Ref. [60]) in the calculation of the p T -differential production cross section of feed-down D mesons, and (ii) the ratio between the feed-down and prompt D-meson R AA , as described above. The resulting uncertainty ranges between 2% and 14%, depending on the D-meson species and p T and centrality interval.
The normalisation uncertainty due to the centrality interval definition was estimated from the variation of raw yield observed when varying the limits of the centrality classes to account for the uncertainty on the fraction of the hadronic cross section used in the Glauber fit to determine the centrality percentiles (see Ref. [29] for details).
In the calculation of the nuclear modification factor, the systematic uncertainties on the D-meson yield in Pb-Pb collisions and on the pp reference cross section were propagated as uncorrelated, except for the uncertainty on the BR, which cancels out in the ratio, and the contribution to the feed-down uncertainty originating from the variation of the parameters of the FONLL calculation, which was considered to be fully correlated between the Pb-Pb and pp measurements. In particular, the contributions of the uncertainties on (i) the normalisation of the pp cross section (due to the luminosity determination), (ii) the centrality limits of the Pb-Pb samples, and (iii) the T AA estimated with the Glauber model are common to all the p T intervals and therefore they constitute a normalisation uncertainty on the R AA , which is shown separately from the other sources when displaying the results.

Transverse-momentum-differential yields
In this section, the results on the p T -differential (d 2 N/dydp T ) and p T -integrated (dN/dy) yields of prompt D 0 , D + , and D * + mesons at midrapidity in Pb-Pb collisions at √ s NN = 5.02 TeV in the 0-10% and 30-50% centrality classes are presented. In the case of the D 0 mesons, two results for the d 2 N/dydp T were obtained from the analyses with and without selections on the decay-vertex topology. They are compared in Fig. 3, with the inset showing their ratio in the common p T range. In the calculation of the ratio, the results in the narrower p T intervals of the analysis with decay-vertex reconstruction were merged together to match the binning of the analysis without vertexing, and the systematic uncertainties were propagated treating the raw yield extraction as uncorrelated between the two analyses, and all the other sources of uncertainty as correlated. The vertical error bars represent the statistical uncertainties and the systematic uncertainties are depicted as boxes except for the BR uncertainty, which is reported separately. The symbols, representing the data points, are positioned horizontally at the center of each interval and the horizontal bars represent the width of the p T interval. This convention is adopted in all the figures shown in this section.
The two results for the p T -differential yield of prompt D 0 mesons are found to be consistent within statistical uncertainties, which are independent between the two analysis techniques because of the largely different signal-to-background ratios and efficiencies. The usage of these two techniques allows the measurement of the D 0 p T -differential yields in a wide transverse momentum range extending down to p T = 0 for the first time in Pb-Pb collisions. The most precise measurement of the prompt D 0 -meson p T spectrum, which will be shown and used for comparisons throughout the paper, is obtained by using the results of the analysis without decay-vertex reconstruction in the p T interval 0 < p T < 1 GeV/c and those from the analysis with decay-vertex reconstruction for p T > 1 GeV/c.
The p T -differential yields d 2 N/dydp T of prompt D 0 , D + , and D * + mesons are shown in Fig. 4 for the 0-10% and 30-50% centrality classes. They are compared with the reference yields from pp collisions, which are computed as T AA × dσ pp /dp T , where dσ pp /dp T is the D-meson p T -differential cross section measured in pp collisions at √ s = 5.02 TeV [37,65], and T AA is the average nuclear overlap function [47]. The D-meson production cross sections in pp collisions are measured up to 36 GeV/c and they are extrapolated with FONLL towards higher p T , with the method described in Refs. [29,30]. The spectra in the 30-50% centrality class are scaled by the factor reported in the legend for visibility. A clear suppression of the production yield for p T > 3 GeV/c is visible in Pb-Pb collisions and it is stronger in central than in semicentral collisions. Figure 5 shows the p T -dependent ratios of the production yields of prompt D + and D * + mesons relative to the D 0 ones, in the left panels, compared with the values measured in pp collisions at √ s = 5.02 TeV [37]. The systematic uncertainties were propagated to the ratios, considering the contributions from the tracking efficiency and the beauty-hadron feed-down subtraction as fully correlated among the different D-meson species. The values obtained in Pb-Pb and pp collisions are compatible within uncertainties and this indicates there is no modification of the relative abundances of D 0 , D + , and D * + mesons as a function of p T and for different centrality classes. The D + /D 0 and D * + /D 0 ratios are described within uncertainties by the GSI-Heidelberg statistical hadronisation model (SHMc) [66,67] (right panels of Fig. 5), which predicts the p T spectra of charm hadrons with a core-corona approach. The low-p T region is dominated by the core contribution described with a blast-wave function, while the corona contribution is more relevant at high p T and is parametrised from pp measurements. The rise predicted by the model, especially for D * + /D 0 , are due to the different D-meson masses and to the collective radial expansion of the system.
The visible production yields of prompt D 0 , D + , and D * + mesons in the two centrality classes were evaluated by integrating the d 2 N/dydp T over the p T intervals of the measurements. The results are  reported in Table 3. For the yield integration, the systematic uncertainty was propagated assuming all sources of uncertainty as fully correlated among p T intervals, except for the one on the raw-yield extraction, which was treated as uncorrelated because of the bin-to-bin variations of S/B and background invariant-mass shape.
The production yield of prompt D mesons per unit of rapidity, dN/dy, was obtained by extrapolating (where needed) the visible cross section to the full p T range. Since the p T -differential yields of D 0 mesons in the 0-10% and 30-50% centrality classes were measured down to p T = 0, it was possible to obtain the dN/dy at midrapidity for the first time in Pb-Pb collisions at the LHC without using models or assumptions to extrapolate the p T -differential yield to unmeasured momentum range at low p T . Conversely, the dN/dy of D + and D * + mesons were obtained via an extrapolation procedure exploiting the measured p T -differential ratios relative to the D 0 meson. The measured p T -differential D + /D 0 and D * + /D 0 ratios, shown in difference between the central value and the yields obtained with other functions for the extrapolation was assigned as systematic uncertainty and summed in quadrature to the uncertainty on the D 0 yield in the aforementioned p T interval. The results for the prompt D-meson production yields per unit of rapidity dN/dy in |y| < 0.5 are reported in Table 4. In the case of the D 0 meson, the result coincides with the visible yield because the measurement extends down to p T = 0 and the contribution of D 0 mesons with p T > 50 (36) GeV/c is negligible.
In the right column the dN/dy values predicted by the SHMc [66,67] are reported. In the SHMc approach, the yield of hadrons containing charm quarks can be calculated utilising as input values (i) the temperature T chem , (ii) the volume of the fireball at the chemical freeze-out estimated from a fit to light-flavour hadron yields, and (iii) the number of cc pairs produced in the Pb-Pb collision. The latter was calculated from the charm-quark production cross section estimated from measurements in pp and p-Pb collisions along with guidance from parameterisations of the nuclear modification of the PDFs [69]. The SHMc calculations agree with the measurements within uncertainties, even though the data lie on the upper edge of the uncertainty band of the theoretical predictions, which is related to the uncertainty on the total charm production cross section used in the calculation. It is useful to note that the charm production cross section in pp collisions, which was used to determine the charm content of the fireball in the SHMc calculations, is lower than the recent measurement reported in Ref. [70] and therefore the yields from the SHMc would increase if the measured cross section were used as the input to the calculations. However, a firmer conclusion on the SHMc predictions for charm hadrons will be    drawn when the measured dN/dy of D + s , Λ + c , and J/ψ will be available in Pb-Pb collisions and included in the comparison, since it is expected that the modifications of the hadronisation mechanisms in the presence of a QGP affect the relative abundances of different charm-hadron species [25,[71][72][73][74][75][76].

Nuclear modification factor
The R AA of prompt D 0 , D + , and D * + mesons was computed, as defined in Eq. 1, using the d 2 N/dydp T measured in Pb-Pb collisions and the pp reference at the same centre of mass energy reported in Fig. 4. The obtained results are shown in Fig. 6 for the two centrality classes. The nuclear modification factors of the three D-meson species are compatible among each other within statistical uncertainties.
The average R AA of D 0 , D + , and D * + mesons was computed as a weighted average using the inverse of the quadratic sum of the relative statistical and uncorrelated systematic uncertainties as weights, in the p T intervals where more than one D-meson R AA value is available. The systematic uncertainties due to the raw-yield extraction and selection efficiency were considered as uncorrelated among different Dmeson species and therefore they were used in the definition of the weights and propagated through the weighted average as uncorrelated, while the other sources of uncertainty (tracking efficiency, generated   [37,65], empty markers with the p T -extrapolated reference. p T shape, and beauty hadron feed-down) were treated as fully correlated.
The prompt D-meson average nuclear modification factors in the 0-10% and 30-50% centrality classes are shown in Fig. 7 together with the R AA in the 60-80% centrality class taken from Ref. [30], which was measured using the sample of Pb-Pb collisions collected in 2015. The suppression increases from peripheral to central collisions. The R AA shows a minimum value at p T = 6-8 GeV/c, corresponding to a suppression of the yields by a factor 5 and 2.5 with respect to the binary-scaled pp reference in the 0-10% and 30-50% classes, respectively. The stronger suppression observed in central collisions is due to the increasing medium density, size, and lifetime of the fireball from peripheral to central collisions. Also shown in Fig. 7 is the nuclear modification factor R pPb measured in p-Pb collisions at √ s NN = 5.02 TeV taken from Ref. [33], which is compatible with unity within uncertainties, confirming that the suppression observed in Pb-Pb collisions is to due final-state effects induced by the formation of a hot and dense QGP medium.
The right panel of Fig. 7 shows the R AA of prompt D mesons measured by the ALICE collaboration in Pb-Pb collisions at √ s NN = 5.02 TeV and 2.76 TeV [29] and of D 0 mesons measured at RHIC by the STAR collaboration in Au-Au collisions at √ s NN = 200 GeV [32]. The results from ALICE at the two different energies are compatible within uncertainties. This similarity originates from the interplay between the higher medium temperature and density at 5.02 TeV, which causes a larger energy loss and a lower R AA , and the harder p T distribution of charm quarks at 5.02 TeV, which would increase the R AA if the medium temperature were the same at the two collision energies [63]. The nuclear modification factor of D 0 mesons at RHIC energies shows a trend with p T similar to the one measured at the LHC, with a possible hint for a smaller R AA at low p T (< 2 GeV/c) and a larger R AA at high p T (> 4 GeV/c) in collisions at √ s NN = 200 GeV compared to LHC energies. This difference could be due to dependence with collision energy of the charm-quark p T distributions, the initial-/final-state effects, and the medium properties. However, the rather large uncertainties prevent a firm conclusion on a √ s NN dependence of the R AA from being drawn.
In addition, the p T -integrated R AA of prompt D 0 mesons at midrapidity was calculated from the p T -Prompt D 0 , D + , and D * + R AA in Pb-Pb ALICE Collaboration (4) Figure 8 shows the results obtained in Pb-Pb collisions compared with the nuclear modification factor R pPb measured in p-Pb collisions at the same centre-of-mass energy [33]. The total charm cross section is expected to scale with the number of binary collisions N coll , as introduced in Section 1, and thus the R AA should be equal to one. However, the nuclear shadowing effect reduces the charm production in Pb-Pb (and p-Pb ) collisions with respect to pp interactions. In addition, the possible enhanced production of D + s and Λ + c due to the hadronisation via recombination is expected to further decrease the fraction of charm quarks that hadronise into D 0 mesons in Pb-Pb collisions compared to pp collisions [25,[71][72][73][74][75][76]. The measured p T -integrated R AA is significantly below unity and this confirms the suppression of the D 0 -meson yield in Pb-Pb collisions with respect to the binary-scaled pp reference due to shadowing and the possible modifications in the hadronisation mechanism. Conversely, the p Tintegrated D 0 R pPb is closer to unity, as expected from the smaller shadowing effects in p-Pb compared to Pb-Pb collisions (where it affects the nucleons of both the projectile and the target nuclei). The integrated R AA is also compared with perturbative QCD calculations of D 0 -meson production including only initial-state effects modeled using two different sets of nuclear PDFs, namely nCTEQ15 [77][78][79][80][81] and EPPS16 [82,83]. The calculations with EPPS16 do not include the dependence of the shadowing on the impact parameter of the Pb-Pb collision and therefore they are the same in the central and semicentral event classes. The predictions with nCTEQ15 are obtained applying a Bayesian reweighting of the nuclear PDFs, which is constrained by measurements of heavy-flavour production in p-Pb collisions at the LHC [78], and are labelled as nCTEQ15 rwHF in Fig. 8. They include a modelling of the centrality The results are compared with calculations at 90% of confidence level of theoretical models nCTEQ15 (with Bayesian reweighting, see text for details) [77][78][79][80][81] and EPPS16 [82,83] that include only initial-state effects.
dependence of the nuclear modification of the PDFs. The uncertainty bands represent a 90% confidence level uncertainty. In the nCTEQ15 case they are determined by considering three different factorisation scales in addition to the PDF uncertainties, with the scale variation constituting the main source of uncertainty, as described in Ref. [78]. Both model calculations include only the initial-state effects due to the nuclear PDFs, but not the possible modifications of the relative abundances of different charm hadron species due to hadronisation via recombination. The measured R AA values lie on the upper edge of the theoretical predictions and this could be due to a smaller shadowing effect in the data with respect to the model expectations.

Discussion: energy loss regime
The comparison of the nuclear modification factor of prompt D mesons with that of pions and of particles originating from beauty-hadron decays can provide essential insights into the characteristics of the inmedium parton energy loss, in particular on its predicted dependence on the colour charge and the quark mass. To investigate possible differences with respect to light-flavour particles, the average R AA of prompt D 0 , D + , and D * + mesons in the 0-10% centrality class is compared in Fig. 9 with that of charged pions [84] and charged particles [85]. The charged-particle R AA is shown for p T > 20 GeV/c in order to extend the comparison to light-flavour particles up to the highest p T interval of the D-meson measurement. The R AA of charged particles can be used in this comparison at high p T in place of the pion one because for p T > 8-10 GeV/c. In this range, the nuclear modification factors of different light-flavour hadron species are found to be consistent with each other and the particle composition is compatible with that measured in pp collisions, that is dominated by pions [84,86].
The R AA of D mesons is larger than that of pions for p T < 8 GeV/c, providing a clear evidence for a different nuclear modification factor of D mesons and light-flavour particles at low and intermediate p T . This difference originates from the interplay of several effects that concur in determining the magnitude and the p T -dependence of the R AA , so the intepretation in terms of different in-medium parton energy loss of charm quarks, light quarks, and gluons is not straighforward. As pointed out in Ref. [19], also Charged particles 20%, |y| < 0.9 − , 0 ψ J/ , |y| < 2.4, CMS ψ Prompt J/ , |y| < 2.4, CMS ψ Non-prompt J/ Figure 9: Average R AA of prompt D 0 , D + , and D * + mesons in the 0-10% centrality class compared to R AA of charged pions [84], charged particles [85], inclusive J/ψ measured by ALICE [87], and of prompt and non-prompt J/ψ from CMS [61] in Pb-Pb collisions at √ s NN = 5.02 TeV.
in the presence of a colour-charge and quark-mass dependent energy loss, similar values of D-meson and pion R AA are expected at high p T ( 8 GeV/c) due to the harder p T distribution and the harder fragmentation function of charm quarks compared to those of light quarks and gluons. At low p T , where a large difference is observed between the D-meson and pion R AA 's, it should be considered that the pion yield can have a significant contribution from soft production up to transverse momenta of about 3-4 GeV/c due to the strong radial flow at LHC energies. This soft component, which is not present in the D-meson production, does not scale with the number of binary nucleon-nucleon collisions. In addition, effects due to the radial flow and the hadronisation can affect D-meson and light-hadron yields differently at a given p T , playing a role in the interpretation of their different R AA at low and intermediate p T . For instance, an enhanced production of D + s mesons and charm baryons in Pb-Pb collisions due to recombination would imply a reduction of the fraction of charm quarks hadronising into non-strange meson species compared to pp collisions.
A quantitative understanding of the parton in-medium energy-loss from the R AA measurements needs therefore to be carried out via comparisons with model calculations. In particular, in the high-p T region, where effects due to radial flow and modifications in the hadronisation mechanisms are expected to be negligible, models based on perturbative QCD (pQCD) calculations of high-p T parton energy loss are expected to describe the data. The R AA and the elliptic flow v 2 of prompt D mesons (taken from Ref. [36]) and pions (taken from Ref. [84,88]) in the 0-10% and 30-50% centrality classes are compared in Fig. 10 to three of these models, namely CUJET3.1 [89][90][91], DREENA-A [92][93][94], and SCET M,G [95]. The DREENA-A is a numerical framework that calculates the medium-modified distribution of high-p T hadrons based on a dynamical energy-loss formalism coupled with a modelling of initial parton momentum distributions, a full 3+1D hydrodynamic evolution of the medium, and fragmentation functions. The dynamical energy-loss formalism [96][97][98] is a model of jet-medium interactions incorporating collisional and radiative energy loss mechanisms in a QCD medium of finite size and temperature composed of dynamical scattering centers. It includes a colour-charge and quark-mass dependence as well as finite magnetic mass effects and running strong coupling constant. The CUJET3.1 framework provides a calculation of jet energy loss in a QCD medium described with relativistic viscous hydrodynamics. The jet-medium interactions are based on the DGLV opacity expansion model [22,99,100] including  both inelastic and elastic scatterings with their colour-charge and quark-mass dependence, and taking into account interactions with both chromo-electric and magnetic charges of the medium. The SCET M,G model implements medium-induced gluon radiation via modified splitting functions. It is based on a soft-collinear effective theory (SCET [101,102]) describing the parton shower formed in the vacuum via soft and collinear splittings. This effective theory was extended to the case of massless [103,104] and massive [95] quarks propagating in strongly-interacting matter by including additional splitting processes induced by the interactions of the incident parton with the QCD medium mediated by Glauber gluon exchange. These medium-induced splittings are calculated to first order in the opacity series expansion, thus limiting the applicability of these calculations to the high p T region.
The considered models provide a fair description of both the R AA and the v 2 of D mesons and pions for p T > 10 GeV/c, where radiative energy loss is expected to be the dominant interaction mechanism. This suggests that the dependences of radiative energy loss on the colour charge and the quark mass of the hard-scattered parton, as well as on the path length in the hot and dense medium are reasonably well described in these calculations.
The comparison of the nuclear modification factors of particles originating from charm and beauty quarks is also reported in Fig. 9, to provide insight into the predicted quark-mass dependence of parton energy loss. In particular, the R AA of inclusive J/ψ mesons measured by ALICE [87] at midrapidity in the 0-20% centrality class and those of prompt and non-prompt J/ψ from the CMS collaboration [61] are shown.
The R AA of prompt D mesons in the 0-10% centrality class is lower than that of non-prompt J/ψ mesons from beauty hadron decays measured in the same centrality interval. This difference provides an indication for the predicted quark-mass dependence of in-medium energy loss, even though a proper interpretation of the different nuclear modification factors in terms of energy loss requires a full modelling of the initial momentum distributions of charm and beauty quarks, of the heavy-quark fragmentation, and of the beauty-hadron decay kinematics. The model from Ref. [105], which includes all these effects, provides a good description of the measurements of prompt D and non-prompt J/ψ mesons. In this model, the large difference in the R AA 's in the p T interval around 10 GeV/c is mostly due to the different in-medium energy loss of c and b quarks, as the effects of initial distributions, quark fragmentation, and beauty-hadron decays are found to be small.
The comparison of the nuclear modification factors of prompt D mesons and prompt (inclusive) J/ψ mesons, also shown in Fig. 9, provides insight into the interplay of different QGP medium effects in the charm sector, where they are expected to affect differently the production of open charm and charmonium states. At high momentum (p T 10 GeV/c), the R AA of prompt D mesons is compatible within uncertainties with that of prompt J/ψ mesons, as well as with that of light-flavour hadrons. This may suggest that in this p T region the yield of charmonia has a significant contribution from production within the parton shower originating from the splitting of a hard-scattered gluon [106,107], which experiences in-medium energy loss before fragmenting [108,109]. At lower p T (2 p T 4 GeV/c), the results for inclusive J/ψ, which are dominated by the prompt contribution, show a magnitude and a trend of the R AA similar to that of D mesons. In this region, J/ψ production is likely dominated by recombination of c and c quarks in the medium either at the phase boundary or during the QGP expansion [87,110], similarly to the recombination of charm and light quarks forming D mesons. The similar R AA of J/ψ and D mesons in this momentum region may signal the dominant contribution of hadronisation via recombination after the interactions of the charm quarks with the QGP medium constituents [111][112][113][114], with possible small differences arising from the different kinematics involved in the charm-quark coalescence with c and light antiquarks.

Discussion: transport models and an estimate of the spatial diffusion coefficient
As discussed in Section 1, the charm-hadron yields and angular distributions at low and intermediate p T are sensitive to the diffusion and the possible thermalisation of charm quarks in the medium. The comparison of the measured D-meson R AA and v 2 to models implementing charm-quark transport in a hydrodynamically expanding QGP could therefore provide insight into the interactions of heavy quarks with the medium, constraining in particular the spatial diffusion coefficient, which is the relevant transport coefficient in the diffusion regime. In the left panels of Fig. 11 the measured nuclear modification factor of prompt D mesons for the 0-10% (top) and 30-50% (bottom) centrality class, respectively, is compared with various predictions from models implementing charm-quark transport in a hydrodynamically expanding medium [76,[115][116][117][118][119][120][121][122][123][124][125]. In particular, the TAMU [76], POWLANG-HTL [117,118], PHSD [125], and Catania [122,123] models describe the interactions of the charm quarks with the medium constituents solely via collisional processes, while the MC@sHQ+EPOS2 [115], DAB-MOD [116], LBT [119,120], LGR [121], and LIDO [124] calculations include also radiative processes. All the models, except for DAB-MOD, include initial-state effects by using nuclear PDFs (nPDFs) in the calculation of the initial p T distributions of charm quarks. A contribution of hadronisation via quark recombination, in addition to charm-quark fragmentation, is included in all theoretical predictions. The theoretical uncertainties, where available, are displayed with a coloured band.
Most of the models capture the measured p T trend and magnitude of the nuclear modification factor and provide a good description of the data in the p T interval 6 < p T < 10 GeV/c where the minimum of the R AA is observed, but many of them show significant deviations from the measurements at low p T (p T 4-5 GeV/c). In particular, the LBT [119,120], LIDO [124], MC@sHQ+EPOS2 [115], and Catania [122,123] calculations tend to underestimate the results for 2 < p T < 4 GeV/c in both centrality classes, while the PHSD [125] prediction is above the measured R AA in semicentral collisions for the  [36] (right) of prompt D 0 , D + , and D * + mesons in the 0-10% (top) and 30-50% (bottom) centrality classes compared with predictions of models implementing the charm-quark transport in a hydrodynamically expanding medium [76,[115][116][117][118][119][120][121][122][123][124][125].
same p T range. The POWLANG-HTL [117,118] calculation, instead, predicts a narrower and more pronounced radial flow peak at low p T as compared to the measured one for the 10% most central Pb-Pb collisions. Most of the models underestimate the measured R AA in both centrality classes for p T < 1.5 GeV/c, with the exception of Catania [122,123] calculations, which tend to overpredict the measured R AA at low p T in central and semicentral collisions and PHSD predictions, which overestimate the R AA in the 30-50% centrality class. Nevertheless, it is important to remark that the R AA at low p T is sensitive not only to the modelling of the charm-quark interactions with the medium but also to the parametrisation of the nPDFs used in the calculations and to the hydrodynamical description of the underlying medium.
More stringent constraints to the implementation of the heavy-quark interactions with the medium con-stituents can be provided by the simultaneous comparison of R AA and v 2 measurements in Pb-Pb collisions at √ s NN = 5.02 TeV [36] with models, as reported in Fig. 11. All the models describe reasonably well the v 2 in the most central collisions, while they tend to underestimate the measured points in the 2 < p T < 6 GeV/c interval for the 30-50% centrality class, except for LBT which reproduces well the measured v 2 but misses completely the R AA in the same p T range. In this p T region, the measured v 2 originates predominantly from the charm-quark interactions with the QGP constituents, which impart the flow of the medium to the heavy quarks, and from the hadronisation via recombination, which enhances the charm-hadron v 2 with respect to the one of the charm quark because the D meson picks up the v 2 of the light quark. Similarly, the peak observed in the R AA for 2 < p T < 6 GeV/c is also due to the interplay between the diffusion and recombination of the charm quarks with the medium constituents. Thus, the measurements of the R AA and v 2 in this p T region are particularly sensitive to quark diffusion and thermalisation with the medium, and to the hadronisation mechanisms.
The simultaneous description of R AA and v 2 is challenging for the models and therefore the data have the potential to constrain the model ingredients and parameters. The global agreement between the measured R AA and the theoretical models was evaluated by computing a χ 2 /ndf, as done in Refs. [36,126]. The statistical and systematic uncertainties (treating separately the contributions correlated and uncorrelated among p T intervals) were considered in the calculation together with the theoretical ones, when available. Since the upper p T limit of the predictions is different for each model, the χ 2 /ndf was computed in the 0 < p T < 8 GeV/c interval, which is common among all the models except for the LIDO predictions which start from 1.5 GeV/c. Therefore, the χ 2 /ndf computation for LIDO was performed excluding the first two p T intervals of the R AA . This low-p T range provides high sensitivity to charm-quark diffusion and hadronisation in the QGP. The χ 2 /ndf values are reported in Table 5. The large spread in the computed χ 2 /ndf is not only due to the improved precision of the measurement, but also to the differences among the theoretical models. They do not only differ in terms of the interaction of charm quarks with the medium, as previously highlighted, but also in terms of the considered nuclear PDFs, the bulk evolution of the medium (i.e. ideal or viscous hydrodynamics), the charm hadronisation mechanism (i.e. fragmentation and/or recombination), and whether a hadronic phase is included or not. In particular, the charm-quark recombination mechanism is implemented with different approaches in the various models: most of the models use an instantaneous recombination based on the Wigner function formalism [127], while TAMU implements a resonance-recombination model [128], PHSD a dynamical coalescence via a Monte Carlo approach [125], and POWLANG an in-medium string formation approach [117]. The R AA predictions are deeply influenced by these additional model ingredients, other than the transport properties of the medium. Therefore, a rather mild requirement on the data-to-model consistency, namely χ 2 /ndf < 5, was applied to select the models considered for the estimation of the heavy-quark spatial diffusion coefficient. With this criterion, the selected models are TAMU [76], MC@sHQ+EPOS2 [115], LIDO [124], LGR [121], and Catania [122,123]. A similar analysis was performed for the elliptic and triangular flow [36]. In order to further constrain the description of heavy-quark transport in the medium and the spatial diffusion coefficient D s , the results of the χ 2 /ndf analysis for the R AA model calculations were combined with those obtained for the elliptic and triangular flow in Ref. [36]. Note that some theoretical predictions for the v 2 were updated after the publication of Ref. [36], namely LBT [119,120], LIDO [124], LGR [121], PHSD [125], and TAMU [76]. Therefore the χ 2 /ndf of these predictions with respect to the measured v 2 and v 3 was re-computed. The outcome did not change significantly with respect to Ref. [36], with the only exception of LIDO [124] for which the updated predictions provide a better description of the data with respect to the old ones, resulting in a χ 2 /ndf < 2. Thus, the LIDO model is included among those providing a good description of v 2 and v 3 , while it was not considered in Ref. [36]. The models that describe reasonably well both R AA (with χ 2 /ndf < 5) and v 2 and v 3 (with χ 2 /ndf < 2) are TAMU [76], MC@sHQ+EPOS2 [115] , LIDO [124], LGR [121], and Catania [122,123]. These models use a value of heavy-quark spatial diffusion coefficient in the range 1.5 < 2πD s T c < 4.5 at the pseudocritical temperature T pc = 155 MeV [3]. According to lQCD calculations the 2πD s T c lies  [129][130][131], and these results are also in agreement with the D s range estimated from the v 2 measurements by ALICE (1.5-7 from Ref. [36]), STAR (2-12 from Ref. [132]), and PHENIX (value of ∼3 from Ref. [133]). The inclusion of the R AA in the χ 2 /ndf improved the constraint on the spatial diffusion coefficient with respect to the range reported in Ref. [36]. It is however important to remark that this coefficient is not the only key parameter of the models describing the heavy-quark transport in an expanding medium, but there are other ingredients (such as the parameters of the underlying hydrodynamics, the modelling of the hadronisation, the description of the interactions in the hadronic phase, amongst others, see e.g. Refs. [17,134]) playing an important role.
A deeper insight on the impact of the different implementations of the charm-quark interaction and hadronisation in the QGP can be obtained from Figs. 12 and 13. In Fig. 12 the R AA and the v 2 , measured in the 0-10% and 30-50% centrality classes, respectively, are compared with two different implementations of the LIDO [124] and LGR [121] models, in order to assess the role of elastic and radiative processes in the charm-quark interactions with medium constituents. In particular, the first implementation is the standard one including both elastic and radiative processes, while the second prediction was obtained by switching off the radiative processes. At low p T (i.e. 3-4 GeV/c), the collisional processes are expected to be the dominant interaction and this is confirmed by the similarity of the predictions for prompt D-meson R AA and v 2 with (full band) and without (striped band) radiative processes. This is further supported by the agreement, in the same p T range, between the experimental data and other theoretical models which implement only elastic processes, like TAMU [76], PHSD [125], and POWLANG-HTL [117,118]. Radiative processes, instead, become dominant at intermediate and high p T . This can be observed in Fig. 12 where the predictions without these processes overestimate (underestimate) the measured R AA (v 2 ) for p T 5-6 GeV/c.
Similarly, Fig. 13 shows the comparison of the experimental data for R AA and v 2 with two different versions of the PHSD [125], POWLANG-HTL [117,118], and DAB-MOD [116] models, in order to investigate the effects of the hadronisation mechanism, and in particular the role of recombination. This plays a key role in the predictions for R AA and v 2 , since the relation between the momentum of the charm hadron and that of the parent charm quark is different for the fragmentation process, where the hadron inherits a fraction of the initial quark momentum, and the recombination, where the D-meson p T is larger than the one of the charm quark and the charm hadron inherits also the collective flow of the light quark. In Fig. 13, the predictions are provided with (solid line) and without (dashed line) the implementation of  [124] and LGR [121] predictions obtained with and without including radiative processes in the charm-quark interactions with the medium.  Figure 13: Prompt D-meson R AA in the 0-10% centrality class (left panel) and v 2 in the 30-50% centrality class (right panel) compared with the PHSD [125], POWLANG [117,118], and DAB-MOD [116] predictions obtained with and without including hadronisation via recombination. the recombination process in the hadronisation mechanism. The calculations performed including only the fragmentation process underestimate both the R AA and v 2 , while the inclusion of the recombination of charm quarks with light quarks pushes the predictions closer to the experimental data. This indicates that recombination with light quarks from the medium plays a relevant role in the hadronisation of charm quarks at the QGP phase boundary.

Conclusions
We have reported the measurement of the p T -differential production yields of prompt D 0 , D + , and D * + mesons and charge conjugates at midrapidity (|y| < 0.5) in central and semicentral Pb-Pb collisions at a centre-of-mass energy per nucleon pair √ s NN = 5.02 TeV. The results were obtained with the data sample collected at the end of 2018 with the ALICE detector. The p T -spectra were measured in finer p T intervals with respect to the previous measurements at the same centre-of-mass energy [30], providing a more precise description of the p T distribution. The large data sample allowed for the first measurement of the D 0 -meson yield down to p T = 0 in Pb-Pb collisions at the LHC. This enabled the determination of the p T -integrated production yields of prompt D 0 , which is obtained in a model independent way, of prompt D + and D * + , and the comparison with predictions from the statistical hadronisation model [66,67]. The average R AA of the D 0 , D + , and D * + mesons reaches a maximum suppression value of 5.5 (i.e. R AA ∼ 0.18) and 2.7 (i.e. R AA ∼ 0.4) in the 0-10% and 30-50% centrality classes, respectively, at p T = 6-8 GeV/c. This suppression becomes less pronounced in peripheral collisions with a minimum value of 0.7-0.8, as observed in the 60-80% centrality class in Ref. [30], and it is due to final-state effects, since it is not observed in minimum bias p-Pb collisions [33]. However, it was pointed out in Ref. [135,136] that event selection and geometry biases can cause an apparent suppression of R AA , especially in peripheral collisions, even in the absence of nuclear effect. The R AA of prompt D mesons at p T > 8 GeV/c is well described by models which include both collisional and radiative energy loss processes. In addition, the p T -integrated R AA of prompt D 0 mesons was obtained and compared with the R pPb measured in p-Pb collisions at the same centre-of-mass energy [33]. The results lie on the upper edge of the calculations which consider nuclear modification of the PDFs.
In central collisions, the p T -differential R AA of prompt D mesons is compatible within uncertainties with that of charged particles for p T 8 GeV/c and prompt J/ψ mesons for p T 10 GeV/c, while an ordering in R AA is observed at lower p T . The latter is due to the interplay of different effects, such as the diffusion of charm quarks in the medium possibly leading to their thermalisation in the QGP and the hadronisation via recombination with light quarks from the medium, which along with energy loss contribute to the modification of the p T -distribution of the hadrons. The comparison of the R AA of prompt D mesons and non-prompt J/ψ for p T > 6 GeV/c together with model calculations supports the predictions of quark-mass dependent energy loss. At low and intermediate p T ( 6-8 GeV/c), the R AA is well described by different transport model calculations for the two centrality classes. However, most of them fail in describing simultaneously both R AA and v 2 in central and semicentral Pb-Pb collisions.
By considering the few models that are in fair agreement with both observables, the heavy-quark spatial diffusion coefficient was estimated to be in the range 1.5 < 2πD s T c < 4.5 at the pseudocritical temperature T pc = 155 MeV, which is a narrower interval as compared to estimations based on previous D-meson measurements at LHC energies [36,126]. Therefore, the simultaneous comparison of the data with the theoretical predictions for these observables allowed for more stringent constraints to the heavyquark spatial diffusion coefficient and for significant progress in the understanding of the interaction processes and the hadronisation mechanisms of charm quarks in the high-density QCD medium.