From 1c2f91138be789db0b7afb201b2e980ab8bb069e Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Tue, 12 Mar 2024 10:56:43 +0100 Subject: [PATCH] initialize step physics --- include/PhysicsList.h | 4 +++- src/PhysicsList.cxx | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/PhysicsList.h b/include/PhysicsList.h index ee1cdb8b..6bf0adbd 100644 --- a/include/PhysicsList.h +++ b/include/PhysicsList.h @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -17,7 +18,6 @@ class PhysicsList : public G4VModularPhysicsList { ~PhysicsList() override; protected: - // Construct particle and physics virtual void InitializePhysicsLists(); void ConstructParticle() override; @@ -34,6 +34,8 @@ class PhysicsList : public G4VModularPhysicsList { G4VPhysicsConstructor* fDecPhysicsList = nullptr; G4VPhysicsConstructor* fRadDecPhysicsList = nullptr; + G4StepLimiterPhysics* fStepLimiterPhysics = nullptr; + std::vector fHadronPhys; TRestGeant4PhysicsLists* fRestPhysicsLists = nullptr; diff --git a/src/PhysicsList.cxx b/src/PhysicsList.cxx index 55748595..a943dda9 100644 --- a/src/PhysicsList.cxx +++ b/src/PhysicsList.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -159,6 +160,10 @@ void PhysicsList::InitializePhysicsLists() { fHadronPhys.push_back(new G4EmExtraPhysics()); } + fStepLimiterPhysics = new G4StepLimiterPhysics(); + fStepLimiterPhysics->SetApplyToAll(true); // by default only applies to charged particles + RegisterPhysics(fStepLimiterPhysics); + G4cout << "Number of hadronic physics lists added " << fHadronPhys.size() << G4endl; }