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
@@ -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;
}