From c11833bea0e1e3ea539720af86a8a3b7ed125788 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Mon, 11 Dec 2023 13:58:44 +0100 Subject: [PATCH] Set the edm4hep momentum as doubles once it becomes possible --- DDG4/edm4hep/Geant4Output2EDM4hep.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp index 9d9ed446d..2d9d0c3ca 100644 --- a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp +++ b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp @@ -24,6 +24,7 @@ #include #include #include +#include /// podio include files #include #include @@ -342,12 +343,13 @@ void Geant4Output2EDM4hep::saveParticles(Geant4ParticleMap* particles) { auto mcp = m_particles.create(); mcp.setPDG(p->pdgID); - float ps_fa[3] = {float(p->psx/CLHEP::GeV),float(p->psy/CLHEP::GeV),float(p->psz/CLHEP::GeV)}; - mcp.setMomentum( ps_fa ); - - float pe_fa[3] = {float(p->pex/CLHEP::GeV),float(p->pey/CLHEP::GeV),float(p->pez/CLHEP::GeV)}; - mcp.setMomentumAtEndpoint( pe_fa ); - +#if edm4hep_VERSION < EDM4HEP_VERSION(0, 10, 3) + mcp.setMomentum( {float(p->psx/CLHEP::GeV),float(p->psy/CLHEP::GeV),float(p->psz/CLHEP::GeV)} ); + mcp.setMomentumAtEndpoint( {float(p->pex/CLHEP::GeV),float(p->pey/CLHEP::GeV),float(p->pez/CLHEP::GeV)} ); +#else + mcp.setMomentum( {p->psx/CLHEP::GeV, p->psy/CLHEP::GeV, p->psz/CLHEP::GeV} ); + mcp.setMomentumAtEndpoint( {p->pex/CLHEP::GeV, p->pey/CLHEP::GeV, p->pez/CLHEP::GeV} ); +#endif double vs_fa[3] = { p->vsx/CLHEP::mm, p->vsy/CLHEP::mm, p->vsz/CLHEP::mm } ; mcp.setVertex( vs_fa );