Studies of heavy flavour production in $pp$ collisions at the LHC both provide the means to verify the predictions of perturbative quantum chromodynamics (pQCD) and are crucial for an accurate description of background channels in Standard Model (SM) measurements and new physics searches. A wide program of studies of heavy flavour production at the LHC is performed by the ATLAS and CMS collaborations and their recent results in this field are reviewed in this paper.
For the CMS collaboration, we report the measurement of differential prompt production cross sections of S-wave quarkonia in $pp$ collisions at $\sqrt{s}=13$ TeV and of production cross sections of $B_c^+$ ($\rightarrow J/\psi\pi^+$) and $B^+$($\rightarrow J/\psi K^+$) in $pp$ collisions at $\sqrt{s}= 7$ TeV. The first observation of resolved $\chi_{b1}(3P)$ and $\chi_{b2}(3P)$ peaks and the measurement of their masses through their decays to $\Upsilon(3S)\gamma$ is also reported.
For the ATLAS collaboration, recent results in measurements of pair b-quark production and the measurement of quarkonium production in $pp$ collisions at $5.02$ TeV are reviewed. Also, differential cross sections and lifetimes measurements are presented for the prompt and non-prompt production of the states $X(3872)$ and $\psi(2S)$, in their decay mode to $J/\psi\pi^{+}\pi^{-}$ in $pp$ collisions at $\sqrt{s} = 8$ TeV.