Methods for separation of deuterons produced in the medium and in jets in high-energy collisions