The production cross sections of the prompt charmed mesons ${\rm D^0}$, ${\rm D^+}$, ${\rm D^{*+}}$ and ${\rm D_s^+}$ were measured at mid-rapidity in proton-proton collisions at a centre-of-mass energy $\sqrt{s}=7$ TeV with the ALICE detector at the Large Hadron Collider (LHC). D mesons were reconstructed from their decays ${\rm D}^0 \to {\rm K}^-\pi^+$, ${\rm D}^+\to {\rm K}^-\pi^+\pi^+$, ${\rm D}^{*+} \to {\rm D}^0 \pi^+$, ${\rm D_s^{+}\to \phi\pi^+\to K^-K^+\pi^+}$, and their charge conjugates. With respect to previous measurements in the same rapidity region, the coverage in transverse momentum ($p_{\rm T}$) is extended and the uncertainties are reduced by a factor of about two. The accuracy on the estimated total $\rm c\overline c$ production cross section is likewise improved. The measured $p_{\rm T}$-differential cross sections are compared with the results of three perturbative QCD calculations.
We report measurements of the production of prompt D$^0$, D$^+$, D$^{*+}$ and D$^+_{\rm s}$ mesons in Pb-Pb collisions at the centre-of-mass energy per nucleon-nucleon pair $\sqrt{s_{\rm NN}}=5.02$ TeV, in the centrality classes 0-10%, 30-50% and 60-80%. The D-meson production yields are measured at mid-rapidity ($|y|<0.5$) as a function of transverse momentum ($p_{\rm T}$). The $p_{\rm T}$ intervals covered in central collisions are: $1<p_{\rm T}<50$ Gev/$c$ for D$^0$, $2<p_{\rm T}<50$ GeV/$c$ for D$^+$, $3<p_{\rm T}<50$ GeV/$c$ for D$^{*+}$, and $4<p_{\rm T}<16$ GeV/$c$ for D$^+_{\rm s}$ mesons. The nuclear modification factors ($R_{\rm AA}$) for non-strange D mesons (D$^0$, D$^+$, D$^{*+}$) show minimum values of about 0.2 for $p_{\rm T}$ = 6-10 GeV/$c$ in the most central collisions and are compatible within uncertainties with those measured at $\sqrt{s_{\rm NN}}=2.76$ TeV. For D$^+_{\rm s}$ mesons, the values of $R_{\rm AA}$ are larger than those of non-strange D mesons, but compatible within uncertainties. In central collisions the average $R_{\rm AA}$ of non-strange D mesons is compatible with that of charged particles for $p_{\rm T} > 8$ GeV/$c$, while it is larger at lower $p_{\rm T}$. The nuclear modification factors for strange and non-strange D mesons are also compared to theoretical models with different implementations of in-medium energy loss.