Skip to content

Commit

Permalink
physics: increase default time threshold for decays
Browse files Browse the repository at this point in the history
back to the old default of Geant4 11.0 - 11.1
  • Loading branch information
ManuelHu committed Nov 13, 2024
1 parent 70827ef commit f8670c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
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
10 changes: 10 additions & 0 deletions src/RMGPhysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "G4HadronPhysicsQGSP_BIC_AllHP.hh"
#include "G4HadronPhysicsQGSP_BIC_HP.hh"
#include "G4HadronPhysicsShielding.hh"
#include "G4HadronicParameters.hh"
#include "G4HadronicProcessStore.hh"
#include "G4IonConstructor.hh"
#include "G4IonPhysics.hh"
Expand Down Expand Up @@ -65,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 @@ -179,6 +181,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

0 comments on commit f8670c4

Please sign in to comment.