In this work we derive three sets of non-perturbative fragmentation functions, with uncertainties, for B-hadrons, J/ψ’s and muons resulting from semileptonic B decays. All three sets are with next-to-next-to leading order accuracy and include next-to-next-to leading logarithmic soft gluon resummation. The novel feature of these new sets is that they are fully consistent with our formalism for next-to-next-to leading order (NNLO) calculations for final states with identified B, J/ψ or a μ. We employ the fragmentation functions derived in this work to make state of the art predictions for such final states in $$ t\overline{t} $$
t
t
¯
events at the LHC. A special emphasis is placed on observables sensitive to the top quark mass. The present work opens the door for many LHC applications, like, open B production or B production in association with bosons.