backport of GenParticles2HepMCConverter from 70X