Abstract
The total charm-quark production cross section per unit of rapidity $$\textrm{d}\sigma ({{\textrm{c}}\overline{\textrm{c}}})/\textrm{d}y$$ d σ ( c c ¯ ) / d y , and the fragmentation fractions of charm quarks to different charm-hadron species $$f(\textrm{c}\rightarrow {\textrm{h}}_{\textrm{c}})$$ f ( c → h c ) , are measured for the first time in p–Pb collisions at $$\sqrt{s_\textrm{NN}} = 5.02~\text {Te}\hspace{-1.00006pt}\textrm{V} $$ s NN = 5.02 Te V at midrapidity ( $$-0.96