From f65e6ea8ad18dd7816c17d9063250bb750e77b7e Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 2 Dec 2020 18:13:37 +0100
Subject: [PATCH] Geant4InputHandling: create G4PrimaryParticle with 4 vector
 that constrains also the mass, setting the mass after, affects the momentum

---
 DDG4/src/Geant4InputHandling.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/DDG4/src/Geant4InputHandling.cpp b/DDG4/src/Geant4InputHandling.cpp
index 902a43f5f..f708b1ec9 100644
--- a/DDG4/src/Geant4InputHandling.cpp
+++ b/DDG4/src/Geant4InputHandling.cpp
@@ -344,11 +344,11 @@ int dd4hep::sim::smearInteraction(const Geant4Action* caller,
 static G4PrimaryParticle* createG4Primary(const Geant4ParticleHandle p)  {
   G4PrimaryParticle* g4 = 0;
   if ( 0 != p->pdgID )   {
-    g4 = new G4PrimaryParticle(p->pdgID, p->psx, p->psy, p->psz);
+    g4 = new G4PrimaryParticle(p->pdgID, p->psx, p->psy, p->psz, p.energy());
   }
   else   {
     const G4ParticleDefinition* def = p.definition();
-    g4 = new G4PrimaryParticle(def, p->psx, p->psy, p->psz);
+    g4 = new G4PrimaryParticle(def, p->psx, p->psy, p->psz, p.energy());
     g4->SetCharge(p.charge());
   }
   g4->SetMass(p->mass);
-- 
GitLab