From 524436ae1d0476bdeb3cf97169ea71e59f7558df Mon Sep 17 00:00:00 2001
From: tmadlener <thomas.madlener@desy.de>
Date: Wed, 10 Apr 2024 15:57:23 +0200
Subject: [PATCH] Switch to non-deprecated setter for newer EDM4hep versions

---
 DDG4/edm4hep/Geant4Output2EDM4hep.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
index 228531d66..537c6b3c1 100644
--- a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
+++ b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp
@@ -525,7 +525,11 @@ void Geant4Output2EDM4hep::saveCollection(OutputContext<G4Event>& /*ctxt*/, G4VH
       sth.setEDep(hit->energyDeposit/CLHEP::GeV);
       sth.setPathLength(hit->length/CLHEP::mm);
       sth.setTime(hit->truth.time/CLHEP::ns);
+#if EDM4HEP_BUILD_VERSION >= EDM4HEP_VERSION(0, 10, 99)
+      sth.setParticle(mcp);
+#else
       sth.setMCParticle(mcp);
+#endif
       sth.setPosition( {pos.x()/CLHEP::mm, pos.y()/CLHEP::mm, pos.z()/CLHEP::mm} );
       sth.setMomentum( {float(mom.x()/CLHEP::GeV),float(mom.y()/CLHEP::GeV),float(mom.z()/CLHEP::GeV)} );
       auto particleIt = pm->particles().find(trackID);
-- 
GitLab