  The recent observation by the IceCube experiment of cosmic neutrinos at
energies up to a few PeV heralds the beginning of neutrino astronomy. At such
high energies, the conventional neutrino flux is suppressed and the prompt
component from charm meson decays is expected to become the dominant background
to astrophysical neutrinos. Charm production at high energies is however
theoretically uncertain, both since the charm mass is at the boundary of
applicability of perturbative QCD, and also because the calculations are
sensitive to the poorly-known gluon PDF at small-x. In this work we provide
detailed perturbative QCD predictions for charm and bottom production in the
forward region, and validate them by comparing with recent data from the LHCb
experiment at 7 TeV. Finding good agreement between data and theory, we use the
LHCb measurements to constrain the small-x gluon PDF, achieving a substantial
reduction in its uncertainties. Using these improved PDFs, we provide
predictions for charm and bottom production at LHCb at 13 TeV, as well as for
the ratio of cross-sections between 13 and 7 TeV. The same calculations are
used to compute the energy distribution of neutrinos from charm decays in pA
collisions, a key ingredient towards achieving a theoretically robust estimate
of charm-induced backgrounds at neutrino telescopes.
