Import Geant4 11.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2022-12-09 14:43:28 +01:00
parent c07cea1fe0
commit 9f34590941
3810 changed files with 200490 additions and 182326 deletions
+5 -1
View File
@@ -16,6 +16,7 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/materials/include \
-I$(G4BASE)/track/include \
-I$(G4BASE)/particles/shortlived/include \
-I$(G4BASE)/particles/management/include \
@@ -28,8 +29,11 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/processes/hadronic/cross_sections/include \
-I$(G4BASE)/processes/hadronic/management/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/management/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/photon_evaporation/include \
-I$(G4BASE)/processes/hadronic/models/parton_string/diffraction/include \
-I$(G4BASE)/processes/hadronic/processes/include \
-I$(G4BASE)/processes/hadronic/util/include \
-I$(G4BASE)/processes/management/include \
-I$(G4BASE)/materials/include
-I$(G4BASE)/run/include
include $(G4INSTALL)/config/common.gmk
+32 -2
View File
@@ -1,9 +1,39 @@
# Category phys-util History
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
which **must** added in reverse chronological order (newest at the top). It must **not**
be used as a substitute for writing good git commit messages!
which **must** added in reverse chronological order (newest at the top).
It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2022-11-24 Gabriele Cosmo (phys-util-V11-00-09)
- Fixed compilation warnings for implicit type conversions on macOS/XCode 14.1.
## 2022-09-05 Ben Morgan (phys-util-V11-00-08)
- Update public/private dependencies for consistency
## 2022-08-24 Vladimir Ivanchenko (phys-util-V11-00-07)
- G4PhysListUtil - use enumerator for neutron general process
instead of hard-coded number
## 2022-08-24 Gabriele Cosmo (phys-util-V11-00-06)
- Added missing dependencies on G4hadronic_deex_photon_evaporation
and G4run in GNUmakefile and CMake script.
Added missing dependency on G4procman to GNUmakefile.
## 2022-08-21 Vladimir Ivanchenko (phys-util-V11-00-05)
- G4PhysListUtil, G4HadProcesses - added extra methods needed for
neutron general process initialisation
- GNUmakefile, source.cmake - added dependences on needed hadronic
sub-libraries in order to fix granular build
## 2022-08-16 Alberto Ribon (phys-util-V11-00-04)
- G4PhysListUtil : in the method InitialiseParameters(), called
the singleton G4FTFTunings::Instance() to allow the setting of
a FTF tune via UI commands at PreInit state.
## 2022-08-09 Vladimir Ivanchenko (phys-util-V11-00-03)
- G4PhysListUtil - extended InitialiseParameters() method
## 2022-03-26 Vladimir Ivanchenko (phys-util-V11-00-02)
- G4PhysListUtil - use dynamic_cast instead of static_cast
@@ -52,10 +52,10 @@ class G4HadProcesses
{
public:
// convert name to pointer
// convert particle name to a pointer
static const G4ParticleDefinition* FindParticle(const G4String&);
// access to a process
// access to a process created before
static G4HadronicProcess* FindInelasticProcess(const G4ParticleDefinition*);
static G4HadronicProcess* FindInelasticProcess(const G4String&);
@@ -80,6 +80,12 @@ public:
static G4bool AddCaptureCrossSection(G4VCrossSectionDataSet*);
static G4bool AddFissionCrossSection(G4VCrossSectionDataSet*);
// build neutron physics, neutron inelastic and elastic processes
// and list of models should be defined before call to this functions
static void BuildNeutronInelasticAndCapture(G4HadronicProcess*);
static void BuildNeutronElastic(G4HadronicProcess*);
};
#endif
@@ -43,6 +43,7 @@
#include "G4ParticleDefinition.hh"
#include "G4HadronicProcess.hh"
#include "G4VProcess.hh"
#include "G4NeutronGeneralProcess.hh"
class G4PhysListUtil
{
@@ -60,5 +61,7 @@ public:
static G4HadronicProcess* FindFissionProcess(const G4ParticleDefinition*);
static G4NeutronGeneralProcess* FindNeutronGeneralProcess();
};
#endif
+5 -1
View File
@@ -19,11 +19,15 @@ geant4_module_link_libraries(G4physlist_util
G4globman
G4hadronic_mgt
G4hadronic_xsect
G4hadronic_proc
G4partman
G4procman
PRIVATE
G4baryons
G4emutils
G4hadronic_deex_management
G4hadronic_deex_photon_evaporation
G4hadronic_util
G4had_string_diff
G4materials
G4procman)
G4run)
@@ -44,6 +44,13 @@
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4ComponentGGNuclNuclXsc.hh"
#include "G4ComponentAntiNuclNuclearXS.hh"
#include "G4HadronicParameters.hh"
#include "G4PhysicsListHelper.hh"
#include "G4NeutronCaptureProcess.hh"
#include "G4NeutronRadCapture.hh"
#include "G4NeutronInelasticXS.hh"
#include "G4NeutronElasticXS.hh"
#include "G4NeutronCaptureXS.hh"
const G4ParticleDefinition* G4HadProcesses::FindParticle(const G4String& pname)
{
@@ -170,3 +177,47 @@ G4bool G4HadProcesses::AddFissionCrossSection(G4VCrossSectionDataSet* xs)
}
return isOK;
}
void G4HadProcesses::BuildNeutronInelasticAndCapture(G4HadronicProcess* nInel)
{
G4HadronicParameters* param = G4HadronicParameters::Instance();
G4bool useNeutronGeneral = param->EnableNeutronGeneralProcess();
G4HadronicProcess* nCap = new G4NeutronCaptureProcess("nCapture");
nCap->RegisterMe(new G4NeutronRadCapture());
if(useNeutronGeneral) {
auto nGen = G4PhysListUtil::FindNeutronGeneralProcess();
nGen->SetInelasticProcess(nInel);
nGen->SetCaptureProcess(nCap);
} else {
auto neutron = G4Neutron::Neutron();
G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
nInel->AddDataSet(new G4NeutronInelasticXS());
nCap->AddDataSet(new G4NeutronCaptureXS());
ph->RegisterProcess(nInel, neutron);
ph->RegisterProcess(nCap, neutron);
if( param->ApplyFactorXS() ) {
nInel->MultiplyCrossSectionBy( param->XSFactorNucleonInelastic() );
}
}
}
void G4HadProcesses::BuildNeutronElastic(G4HadronicProcess* nEl)
{
G4HadronicParameters* param = G4HadronicParameters::Instance();
G4bool useNeutronGeneral = param->EnableNeutronGeneralProcess();
if(useNeutronGeneral) {
auto nGen = G4PhysListUtil::FindNeutronGeneralProcess();
nGen->SetElasticProcess(nEl);
} else {
auto neutron = G4Neutron::Neutron();
nEl->AddDataSet(new G4NeutronElasticXS());
G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
ph->RegisterProcess(nEl, neutron);
if( param->ApplyFactorXS() ) {
nEl->MultiplyCrossSectionBy( param->XSFactorNucleonElastic() );
}
}
}
@@ -45,12 +45,16 @@
#include "G4EmParameters.hh"
#include "G4HadronicParameters.hh"
#include "G4NuclearLevelData.hh"
#include "G4Neutron.hh"
#include "G4FTFTunings.hh"
void G4PhysListUtil::InitialiseParameters()
{
G4NistManager::Instance();
G4EmParameters::Instance();
G4HadronicParameters::Instance();
G4NuclearLevelData::GetInstance();
G4FTFTunings::Instance();
}
G4VProcess* G4PhysListUtil::FindProcess(const G4ParticleDefinition* part,
@@ -60,8 +64,8 @@ G4VProcess* G4PhysListUtil::FindProcess(const G4ParticleDefinition* part,
if(nullptr == part) { return proc; }
G4ProcessVector* pvec = part->GetProcessManager()->GetProcessList();
if(nullptr == pvec) { return proc; }
size_t n = pvec->size();
for(size_t i=0; i<n; ++i) {
G4int n = (G4int)pvec->size();
for(G4int i=0; i<n; ++i) {
auto ptr = (*pvec)[i];
if(ptr != nullptr && subtype == ptr->GetProcessSubType()) {
proc = ptr;
@@ -98,3 +102,14 @@ G4PhysListUtil::FindFissionProcess(const G4ParticleDefinition* p)
auto proc = FindProcess(p, fFission);
return dynamic_cast<G4HadronicProcess*>(proc);
}
G4NeutronGeneralProcess* G4PhysListUtil::FindNeutronGeneralProcess()
{
auto neutron = G4Neutron::Neutron();
auto proc = dynamic_cast<G4NeutronGeneralProcess*>(FindProcess(neutron, fNeutronGeneral));
if(nullptr == proc) {
proc = new G4NeutronGeneralProcess();
neutron->GetProcessManager()->AddDiscreteProcess(proc);
}
return proc;
}