From 6028a5d3b482802b8da86e8cfd11302fab55be58 Mon Sep 17 00:00:00 2001
From: Frank Gaede <frank.gaede@desy.de>
Date: Tue, 2 Feb 2016 12:25:34 +0000
Subject: [PATCH]  - set momentum at endpoint (if lcio version > 2.6 )    -
 note: this does not yet seemt to be filled by DDG4!

---
 DDG4/lcio/Geant4Output2LCIO.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/DDG4/lcio/Geant4Output2LCIO.cpp b/DDG4/lcio/Geant4Output2LCIO.cpp
index 4ae43bf90..a059081f7 100644
--- a/DDG4/lcio/Geant4Output2LCIO.cpp
+++ b/DDG4/lcio/Geant4Output2LCIO.cpp
@@ -226,6 +226,10 @@ lcio::LCCollectionVec* Geant4Output2LCIO::saveParticles(Geant4ParticleMap* parti
       float ps_fa[3] = {float(p->psx/CLHEP::GeV),float(p->psy/CLHEP::GeV),float(p->psz/CLHEP::GeV)};
       q->setMomentum( ps_fa );
 
+#if LCIO_VERSION_GE(2,7)
+      float pe_fa[3] = {float(p->pex/CLHEP::GeV),float(p->pey/CLHEP::GeV),float(p->pez/CLHEP::GeV)};
+      q->setMomentumAtEndpoint( pe_fa );
+#endif
       double vs_fa[3] = { p->vsx/CLHEP::mm, p->vsy/CLHEP::mm, p->vsz/CLHEP::mm } ;
       q->setVertex( vs_fa );
 
-- 
GitLab