From 87e3e12e60122d051ff01e8468ce2d615694c96e Mon Sep 17 00:00:00 2001
From: John Chapman <John.Chapman@cern.ch>
Date: Thu, 10 Apr 2025 15:26:06 +0200
Subject: [PATCH] Move away from syntax deprecated in Geant4 11.2

---
 .../ForwardTransport/src/ForwardTransportModel.cxx            | 4 ++--
 .../LArG4/LArG4FastSimulation/src/LArFastShower.cxx           | 4 ++--
 .../G4Utilities/G4FastSimulation/src/DeadMaterialShower.cxx   | 4 ++--
 Simulation/G4Utilities/G4FastSimulation/src/FastCaloSim.cxx   | 4 ++--
 .../G4Utilities/G4FastSimulation/src/SimpleFastKiller.cxx     | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx b/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx
index 29772d4d788..ad59751e517 100644
--- a/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx
+++ b/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "ForwardTransportModel.h"
@@ -207,7 +207,7 @@ void ForwardTransportModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS
     abort(); // to keep Coverity happy
   }
   fastStep.ProposePrimaryTrackFinalPosition(postTransportPosition, false); // position in global coordinates
-  fastStep.SetPrimaryTrackFinalMomentum(postTransportMomentum, false);
+  fastStep.ProposePrimaryTrackFinalMomentumDirection(postTransportMomentum, false); // FIXME This only sets the normalised direction of the momentum - possible use ProposePrimaryTrackFinalKineticEnergyAndDirection instead?
   fastStep.KillPrimaryTrack();
 }
 
diff --git a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx
index bee55bbec3d..29d018cbf9e 100644
--- a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx
+++ b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArFastShower.h"
@@ -216,7 +216,7 @@ void LArFastShower::KillParticle(const G4FastTrack&, G4FastStep& fastStep)
 
   // Kill the particle
   fastStep.KillPrimaryTrack();
-  fastStep.SetPrimaryTrackPathLength(0.0);
+  fastStep.ProposePrimaryTrackPathLength(0.0);
 
   return;
 }
diff --git a/Simulation/G4Utilities/G4FastSimulation/src/DeadMaterialShower.cxx b/Simulation/G4Utilities/G4FastSimulation/src/DeadMaterialShower.cxx
index 95e056a56cf..400066b9472 100644
--- a/Simulation/G4Utilities/G4FastSimulation/src/DeadMaterialShower.cxx
+++ b/Simulation/G4Utilities/G4FastSimulation/src/DeadMaterialShower.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "DeadMaterialShower.h"
@@ -68,5 +68,5 @@ G4bool DeadMaterialShower::ModelTrigger(const G4FastTrack& fastTrack)
 void DeadMaterialShower::DoIt(const G4FastTrack&, G4FastStep& fastStep)
 {
   fastStep.KillPrimaryTrack();
-  fastStep.SetPrimaryTrackPathLength(0.0);
+  fastStep.ProposePrimaryTrackPathLength(0.0);
 }
diff --git a/Simulation/G4Utilities/G4FastSimulation/src/FastCaloSim.cxx b/Simulation/G4Utilities/G4FastSimulation/src/FastCaloSim.cxx
index a7fbdbc5ea0..f681ca2cb97 100644
--- a/Simulation/G4Utilities/G4FastSimulation/src/FastCaloSim.cxx
+++ b/Simulation/G4Utilities/G4FastSimulation/src/FastCaloSim.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
 */
 
 // Header include
@@ -321,7 +321,7 @@ void FastCaloSim::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastStep)
 
   // Finally kill the primary track after all simulation steps done
   fastStep.KillPrimaryTrack();
-  fastStep.SetPrimaryTrackPathLength(0.0);
+  fastStep.ProposePrimaryTrackPathLength(0.0);
 }
 
 CaloCellContainerSD * FastCaloSim::getCaloCellContainerSD(){
diff --git a/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKiller.cxx b/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKiller.cxx
index d4df9e7f535..b1213aa5175 100644
--- a/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKiller.cxx
+++ b/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKiller.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
 */
 
 // class header include
@@ -15,5 +15,5 @@ SimpleFastKiller::SimpleFastKiller(const std::string& name)
 void SimpleFastKiller::DoIt(const G4FastTrack&, G4FastStep& fastStep)
 {
   fastStep.KillPrimaryTrack();
-  fastStep.SetPrimaryTrackPathLength(0.0);
+  fastStep.ProposePrimaryTrackPathLength(0.0);
 }
-- 
GitLab