The measurements of the production of prompt ${\rm D^0}$, ${\rm D^+}$, ${\rm D^{*+}}$, and ${{\rm D^+_s}}$ mesons in proton--proton (pp) collisions at $\sqrt{s}=5.02$ TeV with the ALICE detector at the Large Hadron Collider (LHC) are reported. D mesons were reconstructed at mid-rapidity ($|y|<0.5$) via their hadronic decay channels ${\rm D}^0 \to {\rm K}^-\pi^+$, ${\rm D}^+\to {\rm K}^-\pi^+\pi^+$, ${\rm D}^{*+} \to {\rm D}^0 \pi^+ \to {\rm K}^- \pi^+ \pi^+$, ${\rm D^{+}_{s}\to \phi\pi^+\to K^{+} K^{-} \pi^{+}}$, and their charge conjugates. The production cross sections were measured in the transverse momentum interval $0
$p_{\rm T}$-differential cross section of prompt $\rm{D}^{0}$ mesons in pp collisions at $\sqrt{\rm{s_{NN}}}$=5.02 TeV in the rapidity interval $|y|$<0.5. Branching ratio of $\rm{D}^{0}\rightarrow K\pi$ : 0.0389.
$p_{\rm T}$-differential cross section of prompt $\rm{D^{+}}$ mesons in pp collisions at $\sqrt{\rm{s_{NN}}}$=5.02 TeV in the rapidity interval $|y|$<0.5. Branching ratio of $\rm D^{+-}\rightarrow K{\rm{\pi}}{\rm{\pi}}$ : 0.0898.
$p_{\rm T}$-differential cross section of prompt $\rm D^{*}$ mesons in pp collisions at $\sqrt{\rm{s_{NN}}}$=5.02 TeV in the rapidity interval $|y|$<0.5. Branching ratio of $\rm{D}^{*+}\rightarrow \rm{D}^{0}\pi\rightarrow K\pi\pi$ : 0.02633.
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.
$p_{\rm T}$-differential cross section of prompt $\rm{D}^{0}$ mesons in pp collisions at $\sqrt{s_{\rm{NN}}}$=7 TeV in the rapidity interval $|y|$<0.5. Branching ratio of $\rm{D}^{0}\rightarrow K\pi$ : 0.0393.
$p_{\rm T}$-differential cross section of prompt $\rm{D^{+}}$ mesons in pp collisions at $\sqrt{s_{\rm{NN}}}$=7 TeV in the rapidity interval $|y|$<0.5. Branching ratio of $\rm D^{+-}\rightarrow K{\rm{\pi}}{\rm{\pi}}$ : 0.0946.
$p_{\rm T}$-differential cross section of prompt $\rm D^{*}$ mesons in pp collisions at $\sqrt{s_{\rm{NN}}}$=7 TeV in the rapidity interval $|y|$<0.5. Branching ratio of $\rm{D}^{*+}\rightarrow \rm{D}^{0}\pi\rightarrow K\pi\pi$ : 0.0266.