From 9e89b0930ca20666c6dd30f73d5aa8a222f43dcb Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:46:27 +0200
Subject: [PATCH] Migrate G4UserActions and TrackWriteFastSim packages to use
 (Const)GenParticlePtr

---
 .../G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx      | 2 +-
 Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx b/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx
index d5180ab1f8ba..510a5a664d3f 100644
--- a/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx
@@ -46,7 +46,7 @@ namespace G4UA
     {
       // Why a const_cast???
       // This is an ugly way to communicate the GenParticle...
-      HepMC::GenParticle* part =
+      HepMC::GenParticlePtr part =
         const_cast<HepMC::GenParticle*>( trackHelper.GetTrackInformation()->
                                          GetHepMCParticle() );
 
diff --git a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
index 67c21f18f55a..297f99d5f8e1 100644
--- a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
+++ b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
@@ -51,7 +51,7 @@ G4bool NeutronFastSim::ModelTrigger(const G4FastTrack& fastTrack)
 
   // Not a neutron... Pick it up if the primary had eta>6.0
   EventInformation *eventInfo=static_cast<EventInformation*>(G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
-  HepMC::GenParticle *gp = eventInfo->GetCurrentPrimary();
+  HepMC::GenParticlePtr gp = eventInfo->GetCurrentPrimary();
   if (fabs(gp->momentum().eta())>m_etaCut && gp->barcode()<200000){
     return true;
   } else {
-- 
GitLab