(Left) \RAA\ for prompt and non-prompt D mesons as a function of \pT\, in the 10\% most central \PbPb\ collisions at \sqrtsNN = 5.02 TeV . (Right) \RAA\ for prompt D mesons and non-prompt J/$\psi$ mesons (CMS ) as a function of the collision centrality for Pb--Pb collisions at \sqrtsNN = 2.76 TeV, compared to a model calculation with mass-dependent energy loss .