Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
+39 -17
View File
@@ -31,15 +31,21 @@
#include "G4HadParticles.hh"
// p, n, pi+, pi-, pbar, nbar
// p, n, pi+, pi-
const std::vector<G4int> G4HadParticles::sLightHadrons = {
2212, 2112, 211, -211, -2212, -2112
2212, 2112, 211, -211
};
// Lambda, Sigma+, Sigma0, Sigma-, Xi0, Xi-, Omega-, anti_hyperons
// Lambda, Sigma+, Sigma-, Xi0, Xi-, Omega-
// (note that Sigma0 has not been included because it decays very quickly)
const std::vector<G4int> G4HadParticles::sHyperons = {
3122, 3222, 3212, 3112, 3322, 3312, 3334,
-3122, -3222, -3212, -3112, -3322, -3312, -3334
3122, 3222, 3112, 3322, 3312, 3334
};
// anti_Lambda, anti_Sigma+, anti_Sigma-, anti_Xi0, anti_Xi-, anti_Omega-
// (note that anti_Sigma0 has not been included because it decays very quickly)
const std::vector<G4int> G4HadParticles::sAntiHyperons = {
-3122, -3222, -3112, -3322, -3312, -3334
};
// K+, K-, KS, KL
@@ -47,26 +53,32 @@ const std::vector<G4int> G4HadParticles::sKaons = {
321, -321, 310, 130
};
// Note: etac, JPsi, SigmaC++, SigmaC+, SigmaC0, Upsilon,
// SigmaB+, SigmaB0, SigmaB- are not included because
// they decay very quickly (therefore, their hadronic
// interactions can be neglected, as for pi0 and Sigma0).
const std::vector<G4int> G4HadParticles::sBCHadrons = {
// D+, D0, D-, D0bar, Ds+, Ds-
411, 421, -411, -421, 431, -431,
// B+, B0, B-, B0bar, Bs0, Bs0bar, Bc+, Bc-,
521, 511, -521, -511, 531, -531, 541, -541,
// eta, eta', etaC, JPsi, Upsilon
221, 331, 441, 443, 553,
// LambdaC+, SigmaC++, SigmaC+, SigmaC0, XiC+, XiC0, OmegaC0
4122, 4222, 4212, 4112, 4232, 4132, 4332,
// LambdaB, SigmaB+, SigmaB0, SigmaB-, XiB0, XiB-, OmegaB-
5122, 5222, 5212, 5112, 5232, 5132, 5332,
// anti_baryons
-4122, -4222, -4212, -4112, -4232, -4132, -4332,
-5122, -5222, -5212, -5112, -5232, -5132, -5332
// LambdaC+, XiC+, XiC0, OmegaC0
4122, 4232, 4132, 4332,
// LambdaB, XiB0, XiB-, OmegaB-
5122, 5232, 5132, 5332,
// corresponding anti_baryons
-4122, -4232, -4132, -4332,
-5122, -5232, -5132, -5332
};
// d, t, He3, alpha, anti-ions
// d, t, He3, alpha
const std::vector<G4int> G4HadParticles::sLightIons = {
1000010020, 1000010030, 1000020030, 1000020040,
-1000010020, -1000010030, -1000020030, -1000020040,
1000010020, 1000010030, 1000020030, 1000020040
};
// pbar, nbar, light anti-ions
const std::vector<G4int> G4HadParticles::sLightAntiIons = {
-2212, -2112, -1000010020, -1000010030, -1000020030, -1000020040
};
// charged particles for EM physics
@@ -102,6 +114,11 @@ const std::vector<G4int>& G4HadParticles::GetHyperons()
return sHyperons;
}
const std::vector<G4int>& G4HadParticles::GetAntiHyperons()
{
return sAntiHyperons;
}
const std::vector<G4int>& G4HadParticles::GetKaons()
{
return sKaons;
@@ -117,6 +134,11 @@ const std::vector<G4int>& G4HadParticles::GetLightIons()
return sLightIons;
}
const std::vector<G4int>& G4HadParticles::GetLightAntiIons()
{
return sLightAntiIons;
}
const std::vector<G4int>& G4HadParticles::GetHeavyChargedParticles()
{
return sHeavyChargedPart;
@@ -0,0 +1,172 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//---------------------------------------------------------------------------
//
// ClassName: G4HadProcesses
//
// Author: 8 July 2020 V.Ivanchenko
//
// Modified:
//
//----------------------------------------------------------------------------
//
#include "G4HadProcesses.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysListUtil.hh"
#include "G4ParticleTable.hh"
#include "G4Neutron.hh"
#include "G4CrossSectionDataSetRegistry.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4ComponentGGHadronNucleusXsc.hh"
#include "G4ComponentGGNuclNuclXsc.hh"
#include "G4ComponentAntiNuclNuclearXS.hh"
const G4ParticleDefinition* G4HadProcesses::FindParticle(const G4String& pname)
{
return G4ParticleTable::GetParticleTable()->FindParticle(pname);
}
G4HadronicProcess* G4HadProcesses::FindInelasticProcess(const G4ParticleDefinition* ptr)
{
return G4PhysListUtil::FindInelasticProcess(ptr);
}
G4HadronicProcess* G4HadProcesses::FindInelasticProcess(const G4String& pname)
{
return FindInelasticProcess( FindParticle(pname) );
}
G4HadronicProcess* G4HadProcesses::FindElasticProcess(const G4ParticleDefinition* ptr)
{
return G4PhysListUtil::FindElasticProcess(ptr);
}
G4HadronicProcess* G4HadProcesses::FindElasticProcess(const G4String& pname)
{
return FindElasticProcess( FindParticle(pname) );
}
G4HadronicProcess* G4HadProcesses::FindCaptureProcess()
{
return G4PhysListUtil::FindCaptureProcess(G4Neutron::Neutron());
}
G4HadronicProcess* G4HadProcesses::FindFissionProcess()
{
return G4PhysListUtil::FindFissionProcess(G4Neutron::Neutron());
}
G4CrossSectionInelastic* G4HadProcesses::InelasticXS(const G4String& compName)
{
G4CrossSectionInelastic* xs = nullptr;
auto comp = G4CrossSectionDataSetRegistry::Instance()->GetComponentCrossSection(compName);
if( comp != nullptr ) {
xs = new G4CrossSectionInelastic(comp);
} else if( "Glauber-Gribov" == compName ) {
xs = new G4CrossSectionInelastic(new G4ComponentGGHadronNucleusXsc());
} else if( "Glauber-Gribov Nucl-nucl" == compName ) {
xs = new G4CrossSectionInelastic(new G4ComponentGGNuclNuclXsc());
} else if( "AntiAGlauber" == compName ) {
xs = new G4CrossSectionInelastic(new G4ComponentAntiNuclNuclearXS());
}
return xs;
}
G4CrossSectionElastic* G4HadProcesses::ElasticXS(const G4String& compName)
{
G4CrossSectionElastic* xs = nullptr;
auto comp = G4CrossSectionDataSetRegistry::Instance()->GetComponentCrossSection(compName);
if( comp != nullptr ) {
xs = new G4CrossSectionElastic(comp);
} else if( "Glauber-Gribov" == compName ) {
xs = new G4CrossSectionElastic(new G4ComponentGGHadronNucleusXsc());
} else if( "Glauber-Gribov Nucl-nucl" == compName ) {
xs = new G4CrossSectionElastic(new G4ComponentGGNuclNuclXsc());
} else if( "AntiAGlauber" == compName ) {
xs = new G4CrossSectionElastic(new G4ComponentAntiNuclNuclearXS());
}
return xs;
}
G4bool G4HadProcesses::AddInelasticCrossSection(const G4ParticleDefinition* ptr,
G4VCrossSectionDataSet* xs)
{
G4bool isOK(false);
if( ptr != nullptr ) {
G4HadronicProcess* had = FindInelasticProcess( ptr );
if( had != nullptr ) {
isOK = true;
had->AddDataSet( xs );
}
}
return isOK;
}
G4bool G4HadProcesses::AddInelasticCrossSection(const G4String& pname, G4VCrossSectionDataSet* xs)
{
return AddInelasticCrossSection( FindParticle(pname), xs );
}
G4bool G4HadProcesses::AddElasticCrossSection(const G4ParticleDefinition* ptr, G4VCrossSectionDataSet* xs)
{
G4bool isOK(false);
if( ptr != nullptr ) {
G4HadronicProcess* had = FindElasticProcess( ptr );
if( had != nullptr ) {
isOK = true;
had->AddDataSet( xs );
}
}
return isOK;
}
G4bool G4HadProcesses::AddElasticCrossSection(const G4String& pname, G4VCrossSectionDataSet* xs)
{
return AddElasticCrossSection( FindParticle(pname), xs );
}
G4bool G4HadProcesses::AddCaptureCrossSection(G4VCrossSectionDataSet* xs)
{
G4bool isOK(false);
G4HadronicProcess* had = FindCaptureProcess();
if( had != nullptr ) {
isOK = true;
had->AddDataSet( xs );
}
return isOK;
}
G4bool G4HadProcesses::AddFissionCrossSection(G4VCrossSectionDataSet* xs)
{
G4bool isOK(false);
G4HadronicProcess* had = FindFissionProcess();
if( had != nullptr ) {
isOK = true;
had->AddDataSet( xs );
}
return isOK;
}
@@ -32,6 +32,7 @@
// Author: 2007 Gunter Folger
//
// Modified:
// 07.10.2020 V.Ivanchenko added InitialiseParameters method
//
//----------------------------------------------------------------------------
//
@@ -40,6 +41,18 @@
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4NistManager.hh"
#include "G4EmParameters.hh"
#include "G4HadronicParameters.hh"
#include "G4NuclearLevelData.hh"
void G4PhysListUtil::InitialiseParameters()
{
G4NistManager::Instance();
G4EmParameters::Instance()->SetDefaults();
G4HadronicParameters::Instance();
G4NuclearLevelData::GetInstance();
}
G4HadronicProcess*
G4PhysListUtil::FindInelasticProcess(const G4ParticleDefinition* p)
@@ -49,8 +62,27 @@ G4PhysListUtil::FindInelasticProcess(const G4ParticleDefinition* p)
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
size_t n = pvec->size();
for(size_t i=0; i<n; ++i) {
if(fHadronInelastic == ((*pvec)[i])->GetProcessSubType()) {
had = static_cast<G4HadronicProcess*>((*pvec)[i]);
auto proc = (*pvec)[i];
if(proc != nullptr && fHadronInelastic == proc->GetProcessSubType()) {
had = static_cast<G4HadronicProcess*>(proc);
break;
}
}
}
return had;
}
G4HadronicProcess*
G4PhysListUtil::FindElasticProcess(const G4ParticleDefinition* p)
{
G4HadronicProcess* had = nullptr;
if(p) {
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
size_t n = pvec->size();
for(size_t i=0; i<n; ++i) {
auto proc = (*pvec)[i];
if(proc != nullptr && fHadronElastic == proc->GetProcessSubType()) {
had = static_cast<G4HadronicProcess*>(proc);
break;
}
}
@@ -66,8 +98,9 @@ G4PhysListUtil::FindCaptureProcess(const G4ParticleDefinition* p)
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
size_t n = pvec->size();
for(size_t i=0; i<n; ++i) {
if(fCapture == ((*pvec)[i])->GetProcessSubType()) {
had = static_cast<G4HadronicProcess*>((*pvec)[i]);
auto proc = (*pvec)[i];
if(proc != nullptr && fCapture == proc->GetProcessSubType()) {
had = static_cast<G4HadronicProcess*>(proc);
break;
}
}
@@ -83,8 +116,9 @@ G4PhysListUtil::FindFissionProcess(const G4ParticleDefinition* p)
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
size_t n = pvec->size();
for(size_t i=0; i<n; ++i) {
if(fFission == ((*pvec)[i])->GetProcessSubType()) {
had = static_cast<G4HadronicProcess*>((*pvec)[i]);
auto proc = (*pvec)[i];
if(proc != nullptr && fFission == proc->GetProcessSubType()) {
had = static_cast<G4HadronicProcess*>(proc);
break;
}
}