Prompt D0, D+, and D*+ production in Pb–Pb collisions at sNN\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \sqrt{s_{\mathrm{NN}}} $$\end{document} = 5.02 TeV

The production of prompt D0, 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 sNN\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \sqrt{s_{\mathrm{NN}}} $$\end{document} = 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 (pT) 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 D0 mesons was measured down to pT = 0, which allowed a model-independent determination of the pT-integrated yield per unit of rapidity (dN/dy). A maximum suppression by a factor 5 and 2.5 was observed with the nuclear modification factor (RAA) of prompt D mesons at pT = 6–8 GeV/c for the 0–10% and 30–50% centrality classes, respectively. The D-meson RAA is compared with that of charged pions, charged hadrons, and J/ψ mesons as well as with theoretical predictions. The analysis of the agreement between the measured RAA, elliptic (v2) and triangular (v3) flow, and the model predictions allowed us to constrain the charm spatial diffusion coefficient Ds. Furthermore the comparison of RAA and v2 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.


JHEP01(2022)174
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 charmquark 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, lightflavour 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 dead-cone 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 Tdifferential 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 , (1.1) 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.

JHEP01(2022)174
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 AL-ICE 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 D-meson 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 -3 -

D-meson raw yields
The D mesons and their charge conjugates were reconstructed via the following hadronic decay channels: D 0 → K − π + (with branching ratio, BR = 3.950±0.031%), D + → K − π + π + (BR = 9.38 ± 0.16%), and D * + → D 0 π + (BR = 67.7 ± 0.5%) [49]. The analysis was based on the reconstruction of decay vertices 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 chargesign 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 p T > 5 GeV/c.
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 beauty-hadron 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 -5 -

JHEP01(2022)174
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 decay-vertex 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 decay-vertex 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 figure 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 considered for the extraction of the D 0 raw yield.
The D-meson raw yields, including particles and antiparticles, were obtained from binned maximum-likelihood 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 values for the Gaussian mean µ, 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). the background: a √ ∆M − m π e b(∆M −mπ) , 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 -7 -

JHEP01(2022)174
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 signal-to-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 Dmesons according to: The raw yield values N D+D,raw , which contain the contribution of feed-down from beautyhadron 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 D-meson 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.          (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 decayvertex 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 -9 -JHEP01(2022)174 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 (figure 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 beautyhadron 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 feed-down D mesons. In detail, the expression for f prompt is: where N D+D raw is the measured raw yield and N D+D feed-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. (3.1). 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

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 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 invariant-mass 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 -11 -

JHEP01(2022)174
Centrality limits 2% 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 -12 -

JHEP01(2022)174
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 decayvertex 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 decay-vertex 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 figure 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 figure 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.  (SHMc) [66,67] (right panels of figure 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 Tdifferential 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 figure 5, were fit with two different functions (a constant and a constant plus logarithmic function) in order to extrapolate the ratios in the interval 0 < p T < 2 GeV/c, where the yields could not be measured. The extrapolation in the high-p T range is negligible because the fraction of D-meson yield in central (semicentral) collisions with p T > 50 (36) GeV/c is negligible. The yields of D + and D * + mesons in the interval 0 < p T < 2 GeV/c were obtained by multiplying the measured D 0 yield in this p T interval by the extrapolated ratio from the fit function. For the D + /D 0 ratios, which show a flat trend as a function of p T , the fit to a constant was used in the determination of the central value of the D + yield, while for the D * + /D 0 ratio the fit with a constant plus a logarithmic function was used. The systematic uncertainty due to the extrapolation was estimated by evaluating the yields using the other fit function and the shape of the SHMc predictions with normalisation parameter left free. The difference between the central  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.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 figure 4. The obtained results are shown in figure 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 D-meson 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 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 figure 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 figure 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 figure 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].

JHEP01(2022)174
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 -integrated yield in Pb-Pb collisions reported above and the D 0 production cross section measured in pp collisions at √ s NN = 5.02 TeV [37]. The results in the 0-10% and 30-50% centrality classes are: 117 −0.120 (syst.).
(5.1) 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 T -integrated 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 figure 8. They include a modelling of the centrality dependence of the nuclear modification of the PDFs. The uncertainty bands represent a 90% confidence level 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.
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 in-medium 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 figure 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  [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. 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 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 -23 -JHEP01(2022)174 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 refs. [84,88]) in the 0-10% and 30-50% centrality classes are compared in figure 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 softcollinear 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 figure 9, to provide insight into the predicted quarkmass 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  [36] and pions (charged hadrons) [84,85,88] compared with predictions from models based on pQCD calculations, namely CUJET3.1 [89][90][91], DREENA-A [92], and SCET M,G [95].
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 figure 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 -25 -

JHEP01(2022)174
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 figure 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 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 parametrisa- LGR Catania | < 0.8 y 50%, | − Centrality 30 Figure 11. Average R AA (left) and elliptic flow v 2 [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].
tion 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 constituents 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 figure 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, -27 -

JHEP01(2022)174
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 datato-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 between 2 and 6 [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 figures 12 and 13. In figure 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  [124] and LGR [121] predictions obtained with and without including radiative processes in the charm-quark interactions with the medium. 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 figure 12 where the predictions without these processes overestimate (underestimate) the measured R AA (v 2 ) for p T 5-6 GeV/c.
Similarly, figure 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 Dmeson 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 figure 13, the predictions are provided with (solid line) and without (dashed line) the implementation of 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.  [125], POWLANG [117,118], and DAB-MOD [116] predictions obtained with and without including hadronisation via recombination.

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 finalstate effects, since it is not observed in minimum bias p-Pb collisions [33]. However, it was pointed out in refs. [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 Tintegrated 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.

JHEP01(2022)174
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 heavy-quark 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.