From 19713b46b3b0a260e85076460bc4dffdd19414fb Mon Sep 17 00:00:00 2001 From: AsgerGaardsvoll <104432907+AsgerGaardsvoll@users.noreply.github.com> Date: Thu, 8 Feb 2024 12:04:38 +0100 Subject: [PATCH] Update HepMCToEDMConverter.cpp (mass conversion) (#28) * Update HepMCToEDMConverter.cpp Added line to get mass. Mass was not converted which would result in mass being 0 for all particles after conversion. * Update HepMCToEDMConverter.cpp Changed type from float to double for mass --- k4Gen/src/components/HepMCToEDMConverter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/k4Gen/src/components/HepMCToEDMConverter.cpp b/k4Gen/src/components/HepMCToEDMConverter.cpp index 9b8148c..06adc13 100644 --- a/k4Gen/src/components/HepMCToEDMConverter.cpp +++ b/k4Gen/src/components/HepMCToEDMConverter.cpp @@ -17,6 +17,7 @@ edm4hep::MutableMCParticle HepMCToEDMConverter::convert(std::shared_ptrmomentum(); edm_particle.setMomentum( {float(p.px()), float(p.py()), float(p.pz())} ); + edm_particle.setMass( double ( hepmcParticle->generated_mass() ) ); // add spin (particle helicity) information if available std::shared_ptr spin = hepmcParticle->attribute("spin");