  Heavy flavor measurements in high multiplicity proton-proton and
proton-nucleus collisions at collider energies enable unique insights into
their production and hadronization mechanism because experimental and
theoretical uncertainties cancel in ratios of their cross-sections relative to
minimum bias events. We explore such event engineering using the Color Glass
Condensate (CGC) effective field theory to compute short distance charmonium
cross-sections. The CGC is combined with heavy-quark fragmentation functions to
compute $D$-meson cross-sections; for the $J/\psi$, hadronization is described
employing Nonrelativistic QCD (NRQCD) and an Improved Color Evaporation model.
Excellent agreement is found between the CGC computations and the LHC heavy
flavor data in high multiplicity events. Event engineering in this CGC+NRQCD
framework reveals a very rapid growth in the fragmentation of the $^3S_1^{[8]}$
state in rare events relative to minimum bias events.
