From ebc7a144c66008374e322c4fe67ce184c4b352a3 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 24 Apr 2023 12:09:19 +0200 Subject: [PATCH 1/2] Remove checks for Geant4 version After upgrading to Geant4 11.1, these checks can be removed. --- .../Application/src/ParametrisedEMPhysics.cc | 7 ++----- .../interface/CMSEmStandardPhysicsEMMT.h | 5 ----- .../CMSEmStandardPhysicsTrackingManager.h | 5 ----- .../interface/CMSHepEmTrackingManager.h | 5 ----- .../PhysicsLists/plugins/FTFPCMS_BERT_EMM.cc | 8 -------- .../PhysicsLists/plugins/FTFPCMS_BERT_EMMT.cc | 5 ----- .../PhysicsLists/plugins/FTFPCMS_BERT_EMMT.h | 5 ----- SimG4Core/PhysicsLists/plugins/module.cc | 5 ----- .../PhysicsLists/src/CMSEmStandardPhysics.cc | 15 ++------------- .../PhysicsLists/src/CMSEmStandardPhysicsEMMT.cc | 5 ----- .../src/CMSEmStandardPhysicsTrackingManager.cc | 5 ----- .../PhysicsLists/src/CMSEmStandardPhysicsXS.cc | 13 ++----------- .../PhysicsLists/src/CMSHadronPhysicsFTFP_BERT.cc | 4 ---- .../PhysicsLists/src/CMSHepEmTrackingManager.cc | 5 ----- 14 files changed, 6 insertions(+), 86 deletions(-) diff --git a/SimG4Core/Application/src/ParametrisedEMPhysics.cc b/SimG4Core/Application/src/ParametrisedEMPhysics.cc index b2598e004c844..6cf22870ee60a 100644 --- a/SimG4Core/Application/src/ParametrisedEMPhysics.cc +++ b/SimG4Core/Application/src/ParametrisedEMPhysics.cc @@ -36,7 +36,6 @@ #include "G4SystemOfUnits.hh" #include "G4Transportation.hh" #include "G4UAtomicDeexcitation.hh" -#include "G4Version.hh" #include #include @@ -78,10 +77,9 @@ ParametrisedEMPhysics::ParametrisedEMPhysics(const std::string& name, const edm: param->SetGeneralProcessActive(genp); bool pe = p.getParameter("PhotoeffectBelowKShell"); - int type = p.getParameter("G4TransportWithMSC"); - -#if G4VERSION_NUMBER >= 1110 param->SetPhotoeffectBelowKShell(pe); + + int type = p.getParameter("G4TransportWithMSC"); G4TransportationWithMscType trtype = G4TransportationWithMscType::fDisabled; if (type == 1) { trtype = G4TransportationWithMscType::fEnabled; @@ -89,7 +87,6 @@ ParametrisedEMPhysics::ParametrisedEMPhysics(const std::string& name, const edm: trtype = G4TransportationWithMscType::fMultipleSteps; } param->SetTransportationWithMsc(trtype); -#endif bool mudat = theParSet.getParameter("ReadMuonData"); param->SetRetrieveMuDataFromFile(mudat); diff --git a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsEMMT.h b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsEMMT.h index 1758959f59db6..0d6906707ecf2 100644 --- a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsEMMT.h +++ b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsEMMT.h @@ -1,9 +1,6 @@ #ifndef SimG4Core_PhysicsLists_CMSEmStandardPhysicsEMMT_h #define SimG4Core_PhysicsLists_CMSEmStandardPhysicsEMMT_h -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "G4VPhysicsConstructor.hh" #include "globals.hh" #include "G4MscStepLimitType.hh" @@ -23,5 +20,3 @@ class CMSEmStandardPhysicsEMMT : public G4VPhysicsConstructor { }; #endif - -#endif diff --git a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h index f86dc57b38962..c55ea1757433c 100644 --- a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h +++ b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h @@ -1,9 +1,6 @@ #ifndef SimG4Core_PhysicsLists_CMSEmStandardPhysicsTrackingManager_h #define SimG4Core_PhysicsLists_CMSEmStandardPhysicsTrackingManager_h -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "G4VTrackingManager.hh" #include "globals.hh" #include "G4MscStepLimitType.hh" @@ -65,5 +62,3 @@ class CMSEmStandardPhysicsTrackingManager : public G4VTrackingManager { }; #endif - -#endif diff --git a/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h b/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h index 1a6abd953e64d..1aea030f139e5 100644 --- a/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h +++ b/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h @@ -1,9 +1,6 @@ #ifndef SimG4Core_PhysicsLists_CMSHepEmTrackingManager_h #define SimG4Core_PhysicsLists_CMSHepEmTrackingManager_h -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "G4HepEmTrackingManager.hh" class CMSHepEmTrackingManager final : public G4HepEmTrackingManager { @@ -22,5 +19,3 @@ class CMSHepEmTrackingManager final : public G4HepEmTrackingManager { }; #endif - -#endif diff --git a/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMM.cc b/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMM.cc index d09b79f6475e2..1c046c352d2a1 100644 --- a/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMM.cc +++ b/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMM.cc @@ -8,11 +8,7 @@ #include "G4IonPhysics.hh" #include "G4StoppingPhysics.hh" #include "G4HadronElasticPhysics.hh" - -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1110 #include "G4HadronicParameters.hh" -#endif FTFPCMS_BERT_EMM::FTFPCMS_BERT_EMM(const edm::ParameterSet& p) : PhysicsList(p) { int ver = p.getUntrackedParameter("Verbosity", 0); @@ -33,18 +29,15 @@ FTFPCMS_BERT_EMM::FTFPCMS_BERT_EMM(const edm::ParameterSet& p) : PhysicsList(p) // Synchroton Radiation & GN Physics G4EmExtraPhysics* gn = new G4EmExtraPhysics(ver); RegisterPhysics(gn); -#if G4VERSION_NUMBER >= 1110 bool mu = p.getParameter("G4MuonPairProductionByMuon"); gn->MuonToMuMu(mu); edm::LogVerbatim("PhysicsList") << " Muon pair production by muons: " << mu; -#endif } // Decays this->RegisterPhysics(new G4DecayPhysics(ver)); if (hadPhys) { -#if G4VERSION_NUMBER >= 1110 bool ngen = p.getParameter("G4NeutronGeneralProcess"); bool bc = p.getParameter("G4BCHadronicProcess"); bool hn = p.getParameter("G4LightHyperNucleiTracking"); @@ -55,7 +48,6 @@ FTFPCMS_BERT_EMM::FTFPCMS_BERT_EMM(const edm::ParameterSet& p) : PhysicsList(p) edm::LogVerbatim("PhysicsList") << " Eneble neutron general process: " << ngen << "\n Enable b- and c- hadron physics: " << bc << "\n Enable light hyper-nuclei physics: " << hn; -#endif // Hadron Elastic scattering RegisterPhysics(new G4HadronElasticPhysics(ver)); diff --git a/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.cc b/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.cc index 9eccd50ef75c8..b6998643d7c6c 100644 --- a/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.cc +++ b/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.cc @@ -1,6 +1,3 @@ -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "FTFPCMS_BERT_EMMT.h" #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsEMMT.h" #include "SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT.h" @@ -46,5 +43,3 @@ FTFPCMS_BERT_EMMT::FTFPCMS_BERT_EMMT(const edm::ParameterSet& p) : PhysicsList(p RegisterPhysics(new G4IonPhysics(ver)); } } - -#endif diff --git a/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.h b/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.h index 51e2aa4ce45f2..318d850f07863 100644 --- a/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.h +++ b/SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMMT.h @@ -1,9 +1,6 @@ #ifndef SimG4Core_PhysicsLists_FTFPCMS_BERT_EMMT_H #define SimG4Core_PhysicsLists_FTFPCMS_BERT_EMMT_H -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "SimG4Core/Physics/interface/PhysicsList.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -13,5 +10,3 @@ class FTFPCMS_BERT_EMMT : public PhysicsList { }; #endif - -#endif diff --git a/SimG4Core/PhysicsLists/plugins/module.cc b/SimG4Core/PhysicsLists/plugins/module.cc index c55d9ee5b440e..a3115195a4ec8 100644 --- a/SimG4Core/PhysicsLists/plugins/module.cc +++ b/SimG4Core/PhysicsLists/plugins/module.cc @@ -6,10 +6,7 @@ #include "FTFPCMS_BERT_EMH.h" #include "FTFPCMS_BERT_EML.h" #include "FTFPCMS_BERT_EMM.h" -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 #include "FTFPCMS_BERT_EMMT.h" -#endif #include "FTFPCMS_BERT_EMN.h" #include "FTFPCMS_BERT_EMM_TRK.h" #include "FTFPCMS_BERT_HP_EMM.h" @@ -40,10 +37,8 @@ typedef FTFPCMS_BERT_EML FTFP_BERT_EML; DEFINE_PHYSICSLIST(FTFP_BERT_EML); typedef FTFPCMS_BERT_EMM FTFP_BERT_EMM; DEFINE_PHYSICSLIST(FTFP_BERT_EMM); -#if G4VERSION_NUMBER >= 1100 typedef FTFPCMS_BERT_EMMT FTFP_BERT_EMMT; DEFINE_PHYSICSLIST(FTFP_BERT_EMMT); -#endif typedef FTFPCMS_BERT_EMN FTFP_BERT_EMN; DEFINE_PHYSICSLIST(FTFP_BERT_EMN); typedef FTFPCMS_BERT_EMM_TRK FTFP_BERT_EMM_TRK; diff --git a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysics.cc b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysics.cc index 14fe8f7d56f02..559411667a76a 100644 --- a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysics.cc +++ b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysics.cc @@ -39,11 +39,8 @@ #include "G4GammaGeneralProcess.hh" #include "G4LossTableManager.hh" -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1110 #include "G4ProcessManager.hh" #include "G4TransportationWithMsc.hh" -#endif #include "G4RegionStore.hh" #include "G4Region.hh" @@ -150,7 +147,6 @@ void CMSEmStandardPhysics::ConstructProcess() { msc3->SetLocked(true); } -#if G4VERSION_NUMBER >= 1110 G4TransportationWithMscType transportationWithMsc = param->TransportationWithMsc(); if (transportationWithMsc != G4TransportationWithMscType::fDisabled) { // Remove default G4Transportation and replace with G4TransportationWithMsc. @@ -176,9 +172,7 @@ void CMSEmStandardPhysics::ConstructProcess() { transportWithMsc->AddMscModel(msc3, -1, bRegion); } procManager->AddProcess(transportWithMsc, -1, 0, 0); - } else -#endif - { + } else { // Multiple scattering is registered as a separate process G4eMultipleScattering* msc = new G4eMultipleScattering; msc->SetEmModel(msc1); @@ -225,7 +219,6 @@ void CMSEmStandardPhysics::ConstructProcess() { msc3->SetLocked(true); } -#if G4VERSION_NUMBER >= 1110 if (transportationWithMsc != G4TransportationWithMscType::fDisabled) { G4ProcessManager* procManager = particle->GetProcessManager(); // Remove default G4Transportation and replace with G4TransportationWithMsc. @@ -250,9 +243,7 @@ void CMSEmStandardPhysics::ConstructProcess() { transportWithMsc->AddMscModel(msc3, -1, bRegion); } procManager->AddProcess(transportWithMsc, -1, 0, 0); - } else -#endif - { + } else { // Register as a separate process. G4eMultipleScattering* msc = new G4eMultipleScattering; msc->SetEmModel(msc1); @@ -279,13 +270,11 @@ void CMSEmStandardPhysics::ConstructProcess() { ph->RegisterProcess(new G4eplusAnnihilation(), particle); ph->RegisterProcess(ss, particle); -#if G4VERSION_NUMBER >= 1110 if (fG4HepEmActive) { auto* hepEmTM = new CMSHepEmTrackingManager(highEnergyLimit); G4Electron::Electron()->SetTrackingManager(hepEmTM); G4Positron::Positron()->SetTrackingManager(hepEmTM); } -#endif // generic ion particle = G4GenericIon::GenericIon(); diff --git a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsEMMT.cc b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsEMMT.cc index 59b3901f025a9..262c2dce8d9c5 100644 --- a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsEMMT.cc +++ b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsEMMT.cc @@ -1,6 +1,3 @@ -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsEMMT.h" #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -85,5 +82,3 @@ void CMSEmStandardPhysicsEMMT::ConstructProcess() { ph->RegisterProcess(muNucProcess, G4MuonPlus::MuonPlus()); ph->RegisterProcess(muNucProcess, G4MuonMinus::MuonMinus()); } - -#endif diff --git a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsTrackingManager.cc b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsTrackingManager.cc index 9eae0872384cd..3cafba1b4a09e 100644 --- a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsTrackingManager.cc +++ b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsTrackingManager.cc @@ -1,6 +1,3 @@ -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h" #include "TrackingManagerHelper.h" @@ -726,5 +723,3 @@ void CMSEmStandardPhysicsTrackingManager::HandOverOneTrack(G4Track *aTrack) { aTrack->SetTrackStatus(fStopAndKill); delete aTrack; } - -#endif diff --git a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsXS.cc b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsXS.cc index 189287601c308..def39f9031402 100644 --- a/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsXS.cc +++ b/SimG4Core/PhysicsLists/src/CMSEmStandardPhysicsXS.cc @@ -48,11 +48,8 @@ #include "G4BuilderType.hh" #include "G4GammaGeneralProcess.hh" -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1110 #include "G4ProcessManager.hh" #include "G4TransportationWithMsc.hh" -#endif #include "G4RegionStore.hh" #include "G4Region.hh" @@ -184,7 +181,6 @@ void CMSEmStandardPhysicsXS::ConstructProcess() { msc3->SetLocked(true); } -#if G4VERSION_NUMBER >= 1110 G4TransportationWithMscType transportationWithMsc = G4EmParameters::Instance()->TransportationWithMsc(); if (transportationWithMsc != G4TransportationWithMscType::fDisabled) { G4ProcessManager* procManager = particle->GetProcessManager(); @@ -210,9 +206,7 @@ void CMSEmStandardPhysicsXS::ConstructProcess() { transportWithMsc->AddMscModel(msc3, -1, bRegion); } procManager->AddProcess(transportWithMsc, -1, 0, 0); - } else -#endif - { + } else { // Register as a separate process. G4eMultipleScattering* msc = new G4eMultipleScattering; msc->SetEmModel(msc1); @@ -286,7 +280,6 @@ void CMSEmStandardPhysicsXS::ConstructProcess() { msc3->SetLocked(true); } -#if G4VERSION_NUMBER >= 1110 if (transportationWithMsc != G4TransportationWithMscType::fDisabled) { G4ProcessManager* procManager = particle->GetProcessManager(); // Remove default G4Transportation and replace with G4TransportationWithMsc. @@ -311,9 +304,7 @@ void CMSEmStandardPhysicsXS::ConstructProcess() { transportWithMsc->AddMscModel(msc3, -1, bRegion); } procManager->AddProcess(transportWithMsc, -1, 0, 0); - } else -#endif - { + } else { // Register as a separate process. G4eMultipleScattering* msc = new G4eMultipleScattering; msc->SetEmModel(msc1); diff --git a/SimG4Core/PhysicsLists/src/CMSHadronPhysicsFTFP_BERT.cc b/SimG4Core/PhysicsLists/src/CMSHadronPhysicsFTFP_BERT.cc index 1475b23362a23..f295498200bf6 100644 --- a/SimG4Core/PhysicsLists/src/CMSHadronPhysicsFTFP_BERT.cc +++ b/SimG4Core/PhysicsLists/src/CMSHadronPhysicsFTFP_BERT.cc @@ -14,8 +14,6 @@ #include "G4SystemOfUnits.hh" #include "G4Threading.hh" -#include "G4Version.hh" - CMSHadronPhysicsFTFP_BERT::CMSHadronPhysicsFTFP_BERT(G4int) : CMSHadronPhysicsFTFP_BERT(3 * CLHEP::GeV, 6 * CLHEP::GeV, 12 * CLHEP::GeV, 3 * CLHEP::GeV, 6 * CLHEP::GeV) {} @@ -41,7 +39,6 @@ void CMSHadronPhysicsFTFP_BERT::ConstructProcess() { } void CMSHadronPhysicsFTFP_BERT::Neutron() { -#if G4VERSION_NUMBER >= 1100 G4bool useNGeneral = G4HadronicParameters::Instance()->EnableNeutronGeneralProcess(); if (useNGeneral) { auto theFTFP = new G4TheoFSGenerator("FTFP"); @@ -61,7 +58,6 @@ void CMSHadronPhysicsFTFP_BERT::Neutron() { G4HadProcesses::BuildNeutronInelasticAndCapture(ni); return; } -#endif G4HadronPhysicsFTFP_BERT::Neutron(); } diff --git a/SimG4Core/PhysicsLists/src/CMSHepEmTrackingManager.cc b/SimG4Core/PhysicsLists/src/CMSHepEmTrackingManager.cc index 371730b4964de..9ccc74daab0e4 100644 --- a/SimG4Core/PhysicsLists/src/CMSHepEmTrackingManager.cc +++ b/SimG4Core/PhysicsLists/src/CMSHepEmTrackingManager.cc @@ -1,6 +1,3 @@ -#include "G4Version.hh" -#if G4VERSION_NUMBER >= 1100 - #include "SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h" #include "G4EventManager.hh" @@ -63,5 +60,3 @@ void CMSHepEmTrackingManager::HandOverOneTrack(G4Track* aTrack) { delete aTrack; } } - -#endif From ca09e9cb096d337a174bed17baf5c1c5d83d562d Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 24 Apr 2023 13:03:04 +0200 Subject: [PATCH 2/2] Fix code-check issues --- .../interface/CMSEmStandardPhysicsTrackingManager.h | 2 +- SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h | 2 +- SimG4Core/PhysicsLists/src/TrackingManagerHelper.icc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h index c55ea1757433c..eb4247d6a010d 100644 --- a/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h +++ b/SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsTrackingManager.h @@ -20,7 +20,7 @@ class G4GammaGeneralProcess; class CMSEmStandardPhysicsTrackingManager : public G4VTrackingManager { public: CMSEmStandardPhysicsTrackingManager(const edm::ParameterSet &p); - ~CMSEmStandardPhysicsTrackingManager(); + ~CMSEmStandardPhysicsTrackingManager() override; void BuildPhysicsTable(const G4ParticleDefinition &) override; diff --git a/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h b/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h index 1aea030f139e5..7a7d9fc52dbd0 100644 --- a/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h +++ b/SimG4Core/PhysicsLists/interface/CMSHepEmTrackingManager.h @@ -6,7 +6,7 @@ class CMSHepEmTrackingManager final : public G4HepEmTrackingManager { public: CMSHepEmTrackingManager(G4double highEnergyLimit); - ~CMSHepEmTrackingManager(); + ~CMSHepEmTrackingManager() override; void BuildPhysicsTable(const G4ParticleDefinition &) override; diff --git a/SimG4Core/PhysicsLists/src/TrackingManagerHelper.icc b/SimG4Core/PhysicsLists/src/TrackingManagerHelper.icc index c217b3ed57688..255ae261ec517 100644 --- a/SimG4Core/PhysicsLists/src/TrackingManagerHelper.icc +++ b/SimG4Core/PhysicsLists/src/TrackingManagerHelper.icc @@ -419,7 +419,7 @@ void TrackingManagerHelper::TrackNeutralParticle(G4Track* aTrack, PhysicsImpl& p G4double MakeStep(G4Track& track, G4Step& step, G4double physicalStep) override { G4ThreeVector pos = track.GetPosition(); - G4ThreeVector dir = track.GetMomentumDirection(); + const G4ThreeVector& dir = track.GetMomentumDirection(); G4StepPoint& postStepPoint = *step.GetPostStepPoint(); G4double safety = 0.0;