Import Geant4 11.4.0 source tree
This commit is contained in:
@@ -319,10 +319,10 @@ G4EmDNABuilder::ConstructDNAElectronPhysics(const G4double emaxDNA,
|
||||
G4double emaxT = 7.4*CLHEP::eV;
|
||||
// limit for CPA100 models
|
||||
G4double emaxCPA100 = 250*CLHEP::keV;
|
||||
if (4 == opt || 8 == opt) {
|
||||
if (4 == opt) {
|
||||
emaxE = 10.*CLHEP::keV;
|
||||
emaxT = 10.*CLHEP::eV;
|
||||
} else if(5 < opt) {
|
||||
} else if(6 <= opt) {
|
||||
emaxT = 11.*CLHEP::eV;
|
||||
}
|
||||
|
||||
@@ -336,9 +336,9 @@ G4EmDNABuilder::ConstructDNAElectronPhysics(const G4double emaxDNA,
|
||||
auto pElasticProcess = FindOrBuildElastic(part, "e-_G4DNAElastic");
|
||||
G4VEmModel* elast;
|
||||
G4VEmModel* elast2 = nullptr;
|
||||
if(4 == opt || 8 == opt) {
|
||||
if(4 == opt) {
|
||||
elast = new G4DNAUeharaScreenedRutherfordElasticModel();
|
||||
} else if(5 < opt) {
|
||||
} else if(6 <= opt) {
|
||||
auto mod = new G4DNACPA100ElasticModel();
|
||||
mod->SelectStationary(stationary);
|
||||
elast = mod;
|
||||
@@ -346,6 +346,7 @@ G4EmDNABuilder::ConstructDNAElectronPhysics(const G4double emaxDNA,
|
||||
} else {
|
||||
elast = new G4DNAChampionElasticModel();
|
||||
}
|
||||
elast->SetLowEnergyLimit(emaxT);
|
||||
elast->SetHighEnergyLimit(lowEnergyMSC);
|
||||
pElasticProcess->AddEmModel(-2, elast, reg);
|
||||
|
||||
@@ -358,7 +359,7 @@ G4EmDNABuilder::ConstructDNAElectronPhysics(const G4double emaxDNA,
|
||||
|
||||
// *** Excitation ***
|
||||
auto theDNAExc = FindOrBuildExcitation(part, "e-_G4DNAExcitation");
|
||||
if(emaxE > 0.0) {
|
||||
if (emaxE > 0.0) {
|
||||
auto modE = new G4DNAEmfietzoglouExcitationModel();
|
||||
theDNAExc->AddEmModel(-1, modE, reg);
|
||||
modE->SelectStationary(stationary);
|
||||
@@ -446,8 +447,7 @@ G4EmDNABuilder::ConstructDNAProtonPhysics(const G4double e1DNA,
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
const G4double emax = param->MaxKinEnergy();
|
||||
G4ParticleDefinition* part = G4Proton::Proton();
|
||||
G4double e2DNA = (8 == opt) ?
|
||||
std::min(lowEnergyRPWBA, emax) : std::min(e1DNA, lowEnergyRPWBA);
|
||||
G4double e2DNA = (8 == opt) ? std::min(lowEnergyRPWBA, emax) : e1DNA;
|
||||
|
||||
// *** Elastic scattering ***
|
||||
auto pElasticProcess = FindOrBuildElastic(part, "proton_G4DNAElastic");
|
||||
@@ -481,12 +481,10 @@ G4EmDNABuilder::ConstructDNAProtonPhysics(const G4double e1DNA,
|
||||
// *** Ionisation ***
|
||||
auto theDNAIoni = FindOrBuildIonisation(part, "proton_G4DNAIonisation");
|
||||
G4VEmModel* modRI;
|
||||
if (2 == opt) {
|
||||
modRI = new G4DNARuddIonisationExtendedModel();
|
||||
} else if (8 == opt) {
|
||||
if (8 == opt) {
|
||||
modRI = new G4DNARuddIonisationDynamicModel();
|
||||
} else {
|
||||
modRI = new G4DNARuddIonisationModel();
|
||||
modRI = new G4DNARuddIonisationExtendedModel();
|
||||
}
|
||||
modRI->SetHighEnergyLimit(e2DNA);
|
||||
theDNAIoni->AddEmModel(-1, modRI, reg);
|
||||
@@ -580,12 +578,10 @@ G4EmDNABuilder::ConstructDNALightIonPhysics(G4ParticleDefinition* part,
|
||||
// *** Ionisation ***
|
||||
auto theDNAIoni = FindOrBuildIonisation(part, name + "_G4DNAIonisation");
|
||||
G4VEmModel* modRI;
|
||||
if (2 == opt) {
|
||||
modRI = new G4DNARuddIonisationExtendedModel();
|
||||
} else if (8 == opt) {
|
||||
if (8 == opt) {
|
||||
modRI = new G4DNARuddIonisationDynamicModel();
|
||||
} else {
|
||||
modRI = new G4DNARuddIonisationModel();
|
||||
modRI = new G4DNARuddIonisationExtendedModel();
|
||||
}
|
||||
modRI->SetHighEnergyLimit(elim2);
|
||||
theDNAIoni->AddEmModel(-2, modRI, reg);
|
||||
|
||||
@@ -96,9 +96,8 @@ void G4EmDNAPhysics::ConstructProcess()
|
||||
{
|
||||
// parameters
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
const G4double emaxDNA = 1.*CLHEP::MeV;
|
||||
const G4double emaxIonDNA = 300.*CLHEP::MeV;
|
||||
const G4double emaxLightIonDNA = 300.*CLHEP::MeV;
|
||||
const G4double emaxDNA = param->MaxDNAElectronEnergy();
|
||||
const G4double emaxIonDNA = param->MaxDNAIonEnergy();
|
||||
const G4double eminBorn = 500.*CLHEP::keV;
|
||||
const G4bool fast = param->DNAFast();
|
||||
const G4bool st = param->DNAStationary();
|
||||
@@ -125,13 +124,13 @@ void G4EmDNAPhysics::ConstructProcess()
|
||||
G4EmDNABuilder::ConstructDNALightIonPhysics(part, 0, 0, emaxIonDNA, fast, st);
|
||||
|
||||
part = G4Alpha::Alpha();
|
||||
G4EmDNABuilder::ConstructDNALightIonPhysics(part, 2, 0, emaxLightIonDNA, fast, st);
|
||||
G4EmDNABuilder::ConstructDNALightIonPhysics(part, 2, 0, emaxIonDNA, fast, st);
|
||||
|
||||
part = genericIonsManager->GetIon("alpha+");
|
||||
G4EmDNABuilder::ConstructDNALightIonPhysics(part, 1, 0, emaxLightIonDNA, fast, st);
|
||||
G4EmDNABuilder::ConstructDNALightIonPhysics(part, 1, 0, emaxIonDNA, fast, st);
|
||||
|
||||
part = genericIonsManager->GetIon("helium");
|
||||
G4EmDNABuilder::ConstructDNALightIonPhysics(part, 0, 0, emaxLightIonDNA, fast, st);
|
||||
G4EmDNABuilder::ConstructDNALightIonPhysics(part, 0, 0, emaxIonDNA, fast, st);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -49,7 +49,10 @@ G4_DECLARE_PHYSCONSTR_FACTORY(G4EmDNAPhysics_option4);
|
||||
|
||||
G4EmDNAPhysics_option4::G4EmDNAPhysics_option4(G4int ver, const G4String& nam)
|
||||
: G4EmDNAPhysics(ver, nam)
|
||||
{}
|
||||
{
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
param->SetDNAFast(true);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ G4EmDNAPhysics_option6::G4EmDNAPhysics_option6(G4int ver, const G4String& nam)
|
||||
: G4EmDNAPhysics(ver, nam)
|
||||
{
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
param->SetDNAFast(false);
|
||||
param->SetDNAFast(true);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -49,7 +49,10 @@ G4_DECLARE_PHYSCONSTR_FACTORY(G4EmDNAPhysics_option8);
|
||||
|
||||
G4EmDNAPhysics_option8::G4EmDNAPhysics_option8(G4int ver, const G4String& nam)
|
||||
: G4EmDNAPhysics(ver, nam)
|
||||
{}
|
||||
{
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
param->SetDNAFast(true);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -32,41 +32,57 @@
|
||||
//
|
||||
// Modified:
|
||||
//
|
||||
// 25.10.25 Changed the settings to the most accurate configuration of the
|
||||
// Goudsmit-Saunderson MSC model for e-/e+ multiple Coulomb
|
||||
// scattering. The class descrition has been changed to reflect the
|
||||
// new configuration (Mihaly Novak).
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// Standard EM physics constructor for HEP applications with the Goudsmit
|
||||
// -Saunderson MSC model for e-/e+ Coulomb scattering below 100 [MeV] (instead
|
||||
// of the Urban model). Note, that the Goudsmit-Saunderson MSC model used here
|
||||
// with its HEP settings (i.e. less accurate). The Goudsmit-Saunderson MSC
|
||||
// model with its most accurate settings is used in the G4EmStandard_opt4
|
||||
// physics constructor for e-/e+ Coulomb scattering.
|
||||
// This EM physics constructor utilises the Goudsmit-Saunderson (GS) MSC model
|
||||
// for e-/e+ multiple Coulomb scattering (below 1 GeV kinetic energies). The
|
||||
// GS MSC model has been changed in version 11.4 keeping only its accurate
|
||||
// stepping and boundary crossing algorithms while removeing the other, less
|
||||
// accurate alternatives. All the corrections offered by the GS model, including
|
||||
// the Mott, screening and scattering power corrections, are activated. This,
|
||||
// together with the Penelope model for e-/e+ ionisations (below 1 GeV),
|
||||
// offers an accurate an accurate e-/e+ simualtion down to few keV kinetic
|
||||
// enegies independently form the target material and geometry.
|
||||
//
|
||||
// The same settings of the GS MSC model has already been used for e-/e+ below
|
||||
// 100 MeV kinetic energies in the option4, Penelope and Livermore EM physics
|
||||
// constructors since version 10.6.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#include "G4EmStandardPhysicsGS.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4EmBuilder.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4EmStandUtil.hh"
|
||||
#include "G4EmBuilder.hh"
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
#include "G4RayleighScattering.hh"
|
||||
#include "G4LivermorePhotoElectricModel.hh"
|
||||
#include "G4RayleighScattering.hh"
|
||||
|
||||
#include "G4eMultipleScattering.hh"
|
||||
#include "G4hMultipleScattering.hh"
|
||||
#include "G4CoulombScattering.hh"
|
||||
#include "G4eCoulombScatteringModel.hh"
|
||||
#include "G4WentzelVIModel.hh"
|
||||
#include "G4UrbanMscModel.hh"
|
||||
#include "G4GoudsmitSaundersonMscModel.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4PenelopeIonisationModel.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4SeltzerBergerModel.hh"
|
||||
#include "G4Generator2BS.hh"
|
||||
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
@@ -80,6 +96,7 @@
|
||||
#include "G4PhysicsListHelper.hh"
|
||||
#include "G4BuilderType.hh"
|
||||
#include "G4EmModelActivator.hh"
|
||||
#include "G4GammaGeneralProcess.hh"
|
||||
|
||||
// factory
|
||||
#include "G4PhysicsConstructorFactory.hh"
|
||||
@@ -95,9 +112,23 @@ G4EmStandardPhysicsGS::G4EmStandardPhysicsGS(G4int ver, const G4String&)
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
param->SetDefaults();
|
||||
param->SetVerbose(ver);
|
||||
param->SetMscRangeFactor(0.06);
|
||||
// param->SetMscStepLimitType(fUseSafetyPlus); // corresponds to the error-free stepping
|
||||
// param->SetFluo(true);
|
||||
// use a denser discrete kinetic energy grid for more accurate interpolation
|
||||
param->SetNumberOfBinsPerDecade(16);
|
||||
// set the continuous step limit to: 0.2*Range that goes to Range below 10 um
|
||||
param->SetStepFunction(0.2, 10*CLHEP::um);
|
||||
// set the GS MSC model for e-/e+ to be used below 1.0 GeV with its (Mott,
|
||||
// screening, scattering power) corrections activated and with the accurate
|
||||
// stepping and boundary crossing algorithms (no other options since 11.4)
|
||||
// with a skin of 3 elastic MFP near boundary
|
||||
param->SetMscEnergyLimit(1.0*CLHEP::GeV);
|
||||
param->SetUseMottCorrection(true);
|
||||
param->SetMscStepLimitType(fUseSafetyPlus);
|
||||
param->SetMscSkin(3);
|
||||
param->SetMscRangeFactor(0.08);
|
||||
// activate fluoresence, i.e. emission of characteristic X-ray
|
||||
param->SetFluo(true);
|
||||
// set the energy loss fluctuation type
|
||||
param->SetFluctuationType(fUrbanFluctuation);
|
||||
SetPhysicsType(bElectromagnetic);
|
||||
}
|
||||
|
||||
@@ -129,63 +160,109 @@ void G4EmStandardPhysicsGS::ConstructProcess()
|
||||
G4NuclearStopping* pnuc(nullptr);
|
||||
|
||||
// high energy limit for e+- scattering models and bremsstrahlung
|
||||
G4double highEnergyLimit = G4EmParameters::Instance()->MscEnergyLimit();
|
||||
G4double mscEnergyLimit = G4EmParameters::Instance()->MscEnergyLimit();
|
||||
|
||||
// Add gamma EM processes
|
||||
|
||||
// gamma
|
||||
G4ParticleDefinition* particle = G4Gamma::Gamma();
|
||||
|
||||
G4PhotoElectricEffect* pee = new G4PhotoElectricEffect();
|
||||
pee->SetEmModel(new G4LivermorePhotoElectricModel());
|
||||
ph->RegisterProcess(pee, particle);
|
||||
G4PhotoElectricEffect* pe = new G4PhotoElectricEffect();
|
||||
pe->SetEmModel(new G4LivermorePhotoElectricModel());
|
||||
|
||||
ph->RegisterProcess(new G4ComptonScattering(), particle);
|
||||
ph->RegisterProcess(new G4GammaConversion(), particle);
|
||||
ph->RegisterProcess(new G4RayleighScattering(), particle);
|
||||
G4ComptonScattering* cs = new G4ComptonScattering;
|
||||
G4GammaConversion* gc = new G4GammaConversion;
|
||||
G4RayleighScattering* rs = new G4RayleighScattering;
|
||||
|
||||
if (G4EmParameters::Instance()->GeneralProcessActive()) {
|
||||
G4GammaGeneralProcess* sp = new G4GammaGeneralProcess();
|
||||
sp->AddEmProcess(pe);
|
||||
sp->AddEmProcess(cs);
|
||||
sp->AddEmProcess(gc);
|
||||
sp->AddEmProcess(rs);
|
||||
G4LossTableManager::Instance()->SetGammaGeneralProcess(sp);
|
||||
ph->RegisterProcess(sp, particle);
|
||||
} else {
|
||||
ph->RegisterProcess(pe, particle);
|
||||
ph->RegisterProcess(cs, particle);
|
||||
ph->RegisterProcess(gc, particle);
|
||||
ph->RegisterProcess(rs, particle);
|
||||
}
|
||||
|
||||
// e-
|
||||
particle = G4Electron::Electron();
|
||||
|
||||
G4eMultipleScattering* msc = new G4eMultipleScattering;
|
||||
// msc: GS[:100 MeV] + WentzelVI[100 MeV:]
|
||||
G4GoudsmitSaundersonMscModel* msc1 = new G4GoudsmitSaundersonMscModel();
|
||||
G4WentzelVIModel* msc2 = new G4WentzelVIModel();
|
||||
msc1->SetHighEnergyLimit(highEnergyLimit);
|
||||
msc2->SetLowEnergyLimit(highEnergyLimit);
|
||||
msc->SetEmModel(msc1);
|
||||
msc->SetEmModel(msc2);
|
||||
|
||||
msc1->SetHighEnergyLimit(mscEnergyLimit);
|
||||
msc2->SetLowEnergyLimit(mscEnergyLimit);
|
||||
G4EmBuilder::ConstructElectronMscProcess(msc1, msc2, particle);
|
||||
// (WVI is a mixed model, i.e. needs single scattering)
|
||||
G4eCoulombScatteringModel* ssm = new G4eCoulombScatteringModel();
|
||||
G4CoulombScattering* ss = new G4CoulombScattering();
|
||||
ss->SetEmModel(ssm);
|
||||
ss->SetMinKinEnergy(highEnergyLimit);
|
||||
ssm->SetLowEnergyLimit(highEnergyLimit);
|
||||
ssm->SetActivationLowEnergyLimit(highEnergyLimit);
|
||||
ss->SetMinKinEnergy(mscEnergyLimit);
|
||||
ssm->SetLowEnergyLimit(mscEnergyLimit);
|
||||
ssm->SetActivationLowEnergyLimit(mscEnergyLimit);
|
||||
|
||||
ph->RegisterProcess(msc, particle);
|
||||
ph->RegisterProcess(new G4eIonisation(), particle);
|
||||
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
|
||||
// ionisation: Penelope[:1.0 GeV] + Moller[1.0 GeV:]
|
||||
G4eIonisation* eioni = new G4eIonisation();
|
||||
eioni->SetFluctModel(G4EmStandUtil::ModelOfFluctuations());
|
||||
G4VEmModel* theIoniMod = new G4PenelopeIonisationModel();
|
||||
theIoniMod->SetHighEnergyLimit(1.0*CLHEP::GeV);
|
||||
eioni->AddEmModel(0, theIoniMod);
|
||||
|
||||
// bremsstrahlung: Seltzer-Berger[:1.0 GeV] + extended Bethe–Heitler[1.0 GeV:]
|
||||
G4eBremsstrahlung* brem = new G4eBremsstrahlung();
|
||||
G4SeltzerBergerModel* br1 = new G4SeltzerBergerModel();
|
||||
G4eBremsstrahlungRelModel* br2 = new G4eBremsstrahlungRelModel();
|
||||
br1->SetAngularDistribution(new G4Generator2BS());
|
||||
br2->SetAngularDistribution(new G4Generator2BS());
|
||||
brem->SetEmModel(br1);
|
||||
brem->SetEmModel(br2);
|
||||
br1->SetHighEnergyLimit(1.0*CLHEP::GeV);
|
||||
|
||||
ph->RegisterProcess(eioni, particle);
|
||||
ph->RegisterProcess(brem, particle);
|
||||
ph->RegisterProcess(ss, particle);
|
||||
|
||||
// e+
|
||||
particle = G4Positron::Positron();
|
||||
|
||||
msc = new G4eMultipleScattering;
|
||||
// msc: GS[:100 MeV] + WentzelVI[100 MeV:]
|
||||
msc1 = new G4GoudsmitSaundersonMscModel();
|
||||
msc2 = new G4WentzelVIModel();
|
||||
msc1->SetHighEnergyLimit(highEnergyLimit);
|
||||
msc2->SetLowEnergyLimit(highEnergyLimit);
|
||||
msc->SetEmModel(msc1);
|
||||
msc->SetEmModel(msc2);
|
||||
|
||||
msc1->SetHighEnergyLimit(mscEnergyLimit);
|
||||
msc2->SetLowEnergyLimit(mscEnergyLimit);
|
||||
G4EmBuilder::ConstructElectronMscProcess(msc1, msc2, particle);
|
||||
// (WVI is a mixed model, i.e. needs single scattering)
|
||||
ssm = new G4eCoulombScatteringModel();
|
||||
ss = new G4CoulombScattering();
|
||||
ss->SetEmModel(ssm);
|
||||
ss->SetMinKinEnergy(highEnergyLimit);
|
||||
ssm->SetLowEnergyLimit(highEnergyLimit);
|
||||
ssm->SetActivationLowEnergyLimit(highEnergyLimit);
|
||||
ss->SetMinKinEnergy(mscEnergyLimit);
|
||||
ssm->SetLowEnergyLimit(mscEnergyLimit);
|
||||
ssm->SetActivationLowEnergyLimit(mscEnergyLimit);
|
||||
|
||||
ph->RegisterProcess(msc, particle);
|
||||
ph->RegisterProcess(new G4eIonisation(), particle);
|
||||
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
|
||||
// ionisation: Penelope[:1.0 GeV] + Bhabha[1.0 GeV:]
|
||||
eioni = new G4eIonisation();
|
||||
eioni->SetFluctModel(G4EmStandUtil::ModelOfFluctuations());
|
||||
G4VEmModel* pen = new G4PenelopeIonisationModel();
|
||||
pen->SetHighEnergyLimit(1.0*CLHEP::GeV);
|
||||
eioni->AddEmModel(0, pen);
|
||||
|
||||
// bremsstrahlung: Seltzer-Berger[:1.0 GeV] + extended Bethe–Heitler[1.0 GeV:]
|
||||
brem = new G4eBremsstrahlung();
|
||||
br1 = new G4SeltzerBergerModel();
|
||||
br2 = new G4eBremsstrahlungRelModel();
|
||||
br1->SetAngularDistribution(new G4Generator2BS());
|
||||
br2->SetAngularDistribution(new G4Generator2BS());
|
||||
brem->SetEmModel(br1);
|
||||
brem->SetEmModel(br2);
|
||||
br1->SetHighEnergyLimit(1.0*CLHEP::GeV);
|
||||
|
||||
ph->RegisterProcess(eioni, particle);
|
||||
ph->RegisterProcess(brem, particle);
|
||||
ph->RegisterProcess(new G4eplusAnnihilation(), particle);
|
||||
ph->RegisterProcess(ss, particle);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "G4OpticalPhysics.hh"
|
||||
|
||||
#include "G4Cerenkov.hh"
|
||||
#include "G4GeneralCerenkov.hh"
|
||||
#include "G4EmSaturation.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4OpAbsorption.hh"
|
||||
@@ -50,6 +51,7 @@
|
||||
#include "G4OpWLS2.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4QuasiOpticalPhoton.hh"
|
||||
#include "G4Scintillation.hh"
|
||||
|
||||
// factory
|
||||
@@ -64,9 +66,6 @@ G4OpticalPhysics::G4OpticalPhysics(G4int verbose, const G4String& name)
|
||||
G4OpticalParameters::Instance()->SetVerboseLevel(verboseLevel);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
G4OpticalPhysics::~G4OpticalPhysics() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void G4OpticalPhysics::PrintStatistics() const
|
||||
{
|
||||
@@ -77,6 +76,8 @@ void G4OpticalPhysics::PrintStatistics() const
|
||||
void G4OpticalPhysics::ConstructParticle()
|
||||
{
|
||||
G4OpticalPhoton::OpticalPhotonDefinition();
|
||||
// Add G4QuasiOpticalPhoton to support offloading optical photon generation
|
||||
G4QuasiOpticalPhoton::QuasiOpticalPhotonDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -91,7 +92,7 @@ void G4OpticalPhysics::ConstructProcess()
|
||||
|
||||
G4ProcessManager* pManager =
|
||||
G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
|
||||
if(!pManager)
|
||||
if (nullptr == pManager)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Optical Photon without a Process Manager";
|
||||
@@ -99,71 +100,79 @@ void G4OpticalPhysics::ConstructProcess()
|
||||
return;
|
||||
}
|
||||
|
||||
G4OpAbsorption* absorption = new G4OpAbsorption();
|
||||
if(params->GetProcessActivation("OpAbsorption"))
|
||||
if (params->GetProcessActivation("OpAbsorption")) {
|
||||
auto absorption = new G4OpAbsorption();
|
||||
pManager->AddDiscreteProcess(absorption);
|
||||
}
|
||||
|
||||
G4OpRayleigh* rayleigh = new G4OpRayleigh();
|
||||
if(params->GetProcessActivation("OpRayleigh"))
|
||||
if (params->GetProcessActivation("OpRayleigh")) {
|
||||
auto rayleigh = new G4OpRayleigh();
|
||||
pManager->AddDiscreteProcess(rayleigh);
|
||||
}
|
||||
|
||||
G4OpMieHG* mie = new G4OpMieHG();
|
||||
if(params->GetProcessActivation("OpMieHG"))
|
||||
if (params->GetProcessActivation("OpMieHG")) {
|
||||
auto mie = new G4OpMieHG();
|
||||
pManager->AddDiscreteProcess(mie);
|
||||
}
|
||||
|
||||
G4OpBoundaryProcess* boundary = new G4OpBoundaryProcess();
|
||||
if(params->GetProcessActivation("OpBoundary"))
|
||||
if (params->GetProcessActivation("OpBoundary")) {
|
||||
auto boundary = new G4OpBoundaryProcess();
|
||||
pManager->AddDiscreteProcess(boundary);
|
||||
}
|
||||
|
||||
G4OpWLS* wls = new G4OpWLS();
|
||||
if(params->GetProcessActivation("OpWLS"))
|
||||
if (params->GetProcessActivation("OpWLS")) {
|
||||
auto wls = new G4OpWLS();
|
||||
pManager->AddDiscreteProcess(wls);
|
||||
}
|
||||
|
||||
G4OpWLS2* wls2 = new G4OpWLS2();
|
||||
if(params->GetProcessActivation("OpWLS2"))
|
||||
if (params->GetProcessActivation("OpWLS2")) {
|
||||
auto wls2 = new G4OpWLS2();
|
||||
pManager->AddDiscreteProcess(wls2);
|
||||
}
|
||||
|
||||
G4Scintillation* scint = new G4Scintillation();
|
||||
G4EmSaturation* emSaturation = G4LossTableManager::Instance()->EmSaturation();
|
||||
scint->AddSaturation(emSaturation);
|
||||
G4VProcess* theCerenkov{nullptr};
|
||||
if (params->CerenkovGeneral()) {
|
||||
auto ptr = new G4GeneralCerenkov();
|
||||
theCerenkov = ptr;
|
||||
}
|
||||
else if (params->GetProcessActivation("Cerenkov")) {
|
||||
auto ptr = new G4Cerenkov();
|
||||
theCerenkov = ptr;
|
||||
}
|
||||
|
||||
G4Cerenkov* cerenkov = new G4Cerenkov();
|
||||
G4VProcess* theScint{nullptr};
|
||||
if (params->GetProcessActivation("Scintillation")) {
|
||||
auto scint = new G4Scintillation();
|
||||
G4EmSaturation* emSaturation = G4LossTableManager::Instance()->EmSaturation();
|
||||
scint->AddSaturation(emSaturation);
|
||||
theScint = scint;
|
||||
}
|
||||
|
||||
auto myParticleIterator = GetParticleIterator();
|
||||
myParticleIterator->reset();
|
||||
|
||||
while((*myParticleIterator)())
|
||||
{
|
||||
G4ParticleDefinition* particle = myParticleIterator->value();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
auto particle = myParticleIterator->value();
|
||||
if (particle->IsShortLived()) { continue; }
|
||||
|
||||
pManager = particle->GetProcessManager();
|
||||
if(!pManager)
|
||||
{
|
||||
if (nullptr == pManager) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Particle " << particleName << "without a Process Manager";
|
||||
ed << "Particle " << particle->GetParticleName() << "without a Process Manager";
|
||||
G4Exception("G4OpticalPhysics::ConstructProcess()", "", FatalException,
|
||||
ed);
|
||||
return; // else coverity complains for pManager use below
|
||||
}
|
||||
|
||||
if(cerenkov->IsApplicable(*particle) &&
|
||||
params->GetProcessActivation("Cerenkov"))
|
||||
{
|
||||
pManager->AddProcess(cerenkov);
|
||||
pManager->SetProcessOrdering(cerenkov, idxPostStep);
|
||||
if (nullptr != theCerenkov && theCerenkov->IsApplicable(*particle)) {
|
||||
pManager->AddDiscreteProcess(theCerenkov);
|
||||
}
|
||||
if(scint->IsApplicable(*particle) &&
|
||||
params->GetProcessActivation("Scintillation"))
|
||||
{
|
||||
pManager->AddProcess(scint);
|
||||
pManager->SetProcessOrderingToLast(scint, idxAtRest);
|
||||
pManager->SetProcessOrderingToLast(scint, idxPostStep);
|
||||
}
|
||||
if(boundary->IsApplicable(*particle) &&
|
||||
params->GetProcessActivation("OpBoundary"))
|
||||
{
|
||||
pManager->SetProcessOrderingToLast(boundary, idxPostStep);
|
||||
|
||||
if (nullptr != theScint && theScint->IsApplicable(*particle)) {
|
||||
pManager->AddProcess(theScint);
|
||||
pManager->SetProcessOrderingToLast(theScint, idxAtRest);
|
||||
pManager->SetProcessOrderingToLast(theScint, idxPostStep);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user