Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Step Physics #128

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/PhysicsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <TRestGeant4PhysicsLists.h>

#include <G4EmConfigurator.hh>
#include <G4StepLimiterPhysics.hh>
#include <G4VModularPhysicsList.hh>
#include <globals.hh>

Expand All @@ -17,7 +18,6 @@ class PhysicsList : public G4VModularPhysicsList {
~PhysicsList() override;

protected:
// Construct particle and physics
virtual void InitializePhysicsLists();

void ConstructParticle() override;
Expand All @@ -34,6 +34,8 @@ class PhysicsList : public G4VModularPhysicsList {

G4VPhysicsConstructor* fDecPhysicsList = nullptr;
G4VPhysicsConstructor* fRadDecPhysicsList = nullptr;
G4StepLimiterPhysics* fStepLimiterPhysics = nullptr;

std::vector<G4VPhysicsConstructor*> fHadronPhys;

TRestGeant4PhysicsLists* fRestPhysicsLists = nullptr;
Expand Down
5 changes: 5 additions & 0 deletions src/PhysicsList.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <G4Region.hh>
#include <G4RegionStore.hh>
#include <G4StepLimiter.hh>
#include <G4StepLimiterPhysics.hh>
#include <G4StoppingPhysics.hh>
#include <G4SystemOfUnits.hh>
#include <G4UAtomicDeexcitation.hh>
Expand Down Expand Up @@ -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;
}

Expand Down
Loading