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

physics: increase default time threshold for decays #160

Merged
merged 2 commits into from
Dec 2, 2024
Merged
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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ if(Geant4_FOUND)
message(STATUS "Found Geant4 v" ${Geant4_VERSION})
endif()

if(Geant4_VERSION VERSION_GREATER_EQUAL "11.2.0")
set(RMG_HAS_GEANT4_11_2_OR_LATER 1)
else()
set(RMG_HAS_GEANT4_11_2_OR_LATER 0)
endif()

# check for optional components
find_package(Geant4 QUIET OPTIONAL_COMPONENTS hdf5 usolids multithreaded gdml ui_all vis_all)

Expand Down
1 change: 1 addition & 0 deletions cmake/RMGConfig.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
#define RMG_HAS_BXDECAY0_THREADSAFE @BxDecay0_THREADSAFE@
#define RMG_HAS_GDML @RMG_HAS_GDML@
#define RMG_HAS_HDF5 @RMG_HAS_HDF5@
#define RMG_HAS_GEANT4_11_2_OR_LATER @RMG_HAS_GEANT4_11_2_OR_LATER@

#endif
9 changes: 9 additions & 0 deletions src/RMGPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "G4StoppingPhysics.hh"
#include "G4ThermalNeutrons.hh"

#include "RMGConfig.hh"
#include "RMGLog.hh"
#include "RMGNeutronCaptureProcess.hh"
#include "RMGOpWLSProcess.hh"
Expand Down Expand Up @@ -182,6 +183,14 @@ void RMGPhysics::ConstructProcess() {

// Hadronic Physics

#if RMG_HAS_GEANT4_11_2_OR_LATER
// Geant4 11.2 changed this to 1 year, which is rather short for our use case.
// Reset it to the old default of Geant4 11.0/11.1.
// note: this still might be too short for very rare decays, but it can be increased with
// a macro command.
G4HadronicParameters::Instance()->SetTimeThresholdForRadioactiveDecay(1.0e+27 * u::ns);
#endif

/*
G4ParticleHPManager::GetInstance()->SetSkipMissingIsotopes( false );
G4ParticleHPManager::GetInstance()->SetDoNotAdjustFinalState( true );
Expand Down