Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
@@ -61,6 +61,9 @@
#include "G4IonParametrisedLossModel.hh"
#include "G4NuclearStopping.hh"
#include "G4LossTableManager.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -72,11 +75,11 @@ ElectromagneticPhysics::ElectromagneticPhysics(const G4String& name)
G4EmParameters* param = G4EmParameters::Instance();
param->SetDefaults();
param->SetVerbose(0);
param->SetStepFunction(0.2, 1*mm); //default= 0.1, 100*um
param->SetStepFunctionMuHad(0.2, 1*mm);
param->SetStepFunctionLightIons(0.2, 100*um);
param->SetStepFunctionIons(0.2, 50*um);
param->SetStepFunction(0.2, 100*um);
param->SetStepFunctionMuHad(0.1, 10*um);
param->SetStepFunctionLightIons(0.1, 10*um);
param->SetStepFunctionIons(0.1, 1*um);
param->SetDeexcitationIgnoreCut(true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -157,6 +160,11 @@ void ElectromagneticPhysics::ConstructProcess()
ph->RegisterProcess(new G4hIonisation(), particle);
}
}
// Deexcitation
//
G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
G4LossTableManager::Instance()->SetAtomDeexcitation(de);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file HadronElasticPhysicsHP.hh
/// \file HadronElasticPhysicsHP.cc
/// \brief Definition of the HadronElasticPhysicsHP class
//
//
@@ -34,8 +34,7 @@
#include "HadronElasticPhysicsHP.hh"
#include "NeutronHPMessenger.hh"
#include "G4GenericMessenger.hh"
#include "G4HadronicProcess.hh"
#include "G4ParticleHPElastic.hh"
#include "G4ParticleHPElasticData.hh"
@@ -48,16 +47,17 @@
HadronElasticPhysicsHP::HadronElasticPhysicsHP(G4int ver)
: G4HadronElasticPhysics(ver),
fThermal(false), fNeutronMessenger(0)
fMessenger(nullptr), fThermal(false)
{
fNeutronMessenger = new NeutronHPMessenger(this);
// define commands for this class
DefineCommands();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HadronElasticPhysicsHP::~HadronElasticPhysicsHP()
{
delete fNeutronMessenger;
delete fMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -73,11 +73,30 @@ void HadronElasticPhysicsHP::ConstructProcess()
process->AddDataSet(new G4ParticleHPElasticData());
if (fThermal) {
model1->SetMinEnergy(4*eV);
model1->SetMinEnergy(4*eV);
G4ParticleHPThermalScattering* model2 = new G4ParticleHPThermalScattering();
process->RegisterMe(model2);
process->AddDataSet(new G4ParticleHPThermalScatteringData());
process->AddDataSet(new G4ParticleHPThermalScatteringData());
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HadronElasticPhysicsHP::DefineCommands()
{
// Define /testhadr/phys command directory using generic messenger class
fMessenger = new G4GenericMessenger(this,
"/testhadr/phys/",
"physics list commands");
// thermal scattering command
auto& thermalCmd
= fMessenger->DeclareProperty("thermalScattering", fThermal);
thermalCmd.SetGuidance("set thermal scattering model");
thermalCmd.SetParameterName("thermal", false);
thermalCmd.SetDefaultValue("false");
thermalCmd.SetStates(G4State_PreInit);
}
//..oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,7 +45,6 @@ HistoManager::HistoManager()
HistoManager::~HistoManager()
{
delete G4AnalysisManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,6 +55,7 @@ void HistoManager::Book()
// The choice of analysis technology is done via selection of a namespace
// in HistoManager.hh
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->SetDefaultFileType("root");
analysisManager->SetFileName(fFileName);
analysisManager->SetVerboseLevel(1);
analysisManager->SetActivation(true); //enable inactivation of histograms
@@ -53,7 +53,10 @@
#include "ElectromagneticPhysics.hh"
#include "G4EmStandardPhysics_option3.hh"
#include "G4DecayPhysics.hh"
#include "RadioactiveDecayPhysics.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "G4Neutron.hh"
@@ -117,7 +120,8 @@ PhysicsList::PhysicsList()
RegisterPhysics(fDecay);
// Radioactive decay
fRadioactiveDecay = new G4RadioactiveDecayPhysics();
fRadioactiveDecay = new RadioactiveDecayPhysics();
////fRadioactiveDecay = new G4RadioactiveDecayPhysics();
RegisterPhysics(fRadioactiveDecay);
}
@@ -23,49 +23,84 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file NeutronHPMessenger.cc
/// \brief Implementation of the NeutronHPMessenger class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "NeutronHPMessenger.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "HadronElasticPhysicsHP.hh"
#include "RadioactiveDecayPhysics.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithABool.hh"
#include "G4Radioactivation.hh"
#include "G4GenericIon.hh"
#include "G4PhysicsListHelper.hh"
#include "G4EmParameters.hh"
#include "G4VAtomDeexcitation.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4LossTableManager.hh"
#include "G4NuclearLevelData.hh"
#include "G4DeexPrecoParameters.hh"
#include "G4NuclideTable.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
NeutronHPMessenger::NeutronHPMessenger(HadronElasticPhysicsHP* phys)
:G4UImessenger(),fNeutronPhysics(phys),
fPhysDir(0), fThermalCmd(0)
{
fPhysDir = new G4UIdirectory("/testhadr/phys/");
fPhysDir->SetGuidance("physics list commands");
fThermalCmd = new G4UIcmdWithABool("/testhadr/phys/thermalScattering",this);
fThermalCmd->SetGuidance("set thermal scattering model");
fThermalCmd->SetParameterName("thermal",false);
fThermalCmd->AvailableForStates(G4State_PreInit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
NeutronHPMessenger::~NeutronHPMessenger()
RadioactiveDecayPhysics::RadioactiveDecayPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{
delete fThermalCmd;
delete fPhysDir;
// mandatory for G4NuclideTable
//
////G4NuclideTable::GetInstance()->SetThresholdOfHalfLife(0.1*picosecond);
////G4NuclideTable::GetInstance()->SetLevelTolerance(1.0*eV);
// hadronic physics extra configuration
//
G4DeexPrecoParameters* deex =
G4NuclearLevelData::GetInstance()->GetParameters();
deex->SetStoreICLevelData(true);
deex->SetMaxLifeTime(G4NuclideTable::GetInstance()->GetThresholdOfHalfLife()
/std::log(2.));
deex->SetIsomerProduction(true);
deex->SetCorrelatedGamma(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void NeutronHPMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if (command == fThermalCmd)
{fNeutronPhysics->SetThermalPhysics(fThermalCmd->GetNewBoolValue(newValue));}
RadioactiveDecayPhysics::~RadioactiveDecayPhysics()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RadioactiveDecayPhysics::ConstructParticle()
{
G4GenericIon::GenericIon();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RadioactiveDecayPhysics::ConstructProcess()
{
G4Radioactivation* radioactiveDecay = new G4Radioactivation();
G4bool ARMflag = false;
radioactiveDecay->SetARM(ARMflag); //Atomic Rearangement
// EM physics extra configuration
// this physics constructor should be defined after EM constructor
G4EmParameters::Instance()->SetFluo(ARMflag);
G4EmParameters::Instance()->SetAugerCascade(ARMflag);
G4EmParameters::Instance()->SetDeexcitationIgnoreCut(ARMflag);
G4LossTableManager* man = G4LossTableManager::Instance();
G4VAtomDeexcitation* ad = man->AtomDeexcitation();
// EM physics constructors are not used
if( ad == nullptr ) {
ad = new G4UAtomicDeexcitation();
man->SetAtomDeexcitation(ad);
man->ResetParameters();
}
G4PhysicsListHelper::GetPhysicsListHelper()->
RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -65,6 +65,7 @@ void Run::SetPrimary(G4ParticleDefinition* particle, G4double energy)
void Run::CountProcesses(const G4VProcess* process)
{
if (process == nullptr) return;
G4String procName = process->GetProcessName();
std::map<G4String,G4int>::iterator it = fProcCounter.find(procName);
if ( it == fProcCounter.end()) {
@@ -257,7 +258,7 @@ void Run::EndOfRun()
//particles count
//
G4cout << "\n List of generated particles:" << G4endl;
G4cout << "\n List of generated particles (with meanLife != 0):" << G4endl;
std::map<G4String,ParticleData>::iterator itc;
for (itc = fParticleDataMap1.begin(); itc != fParticleDataMap1.end(); itc++) {
@@ -63,6 +63,7 @@ void TrackingAction::PreUserTrackingAction(const G4Track* track)
G4String name = track->GetDefinition()->GetParticleName();
G4double meanLife = track->GetDefinition()->GetPDGLifeTime();
G4double energy = track->GetKineticEnergy();
//do not count excited states with meanlife = 0.
if (meanLife != 0.) run->ParticleCount(name,energy,meanLife);
}