Import Geant4 11.2.0.beta source tree
This commit is contained in:
@@ -1011,7 +1011,7 @@ G4bool G4EmCalculator::FindEmModel(const G4ParticleDefinition* p,
|
||||
if(nullptr != elproc) {
|
||||
currentModel = elproc->SelectModelForMaterial(scaledEnergy, idx);
|
||||
currentModel->InitialiseForMaterial(part, currentMaterial);
|
||||
currentModel->SetupForMaterial(part, currentMaterial, scaledEnergy);
|
||||
currentModel->SetupForMaterial(part, currentMaterial, kinEnergy);
|
||||
G4double eth = currentModel->LowEnergyLimit();
|
||||
if(eth > 0.0) {
|
||||
loweModel = elproc->SelectModelForMaterial(eth - CLHEP::eV, idx);
|
||||
|
||||
@@ -71,13 +71,14 @@
|
||||
#include "G4Log.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4Pow.hh"
|
||||
#include "G4Threading.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const G4double inveplus = 1.0/CLHEP::eplus;
|
||||
const G4double alpha2 = CLHEP::fine_structure_const*CLHEP::fine_structure_const;
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr G4double inveplus = 1.0/CLHEP::eplus;
|
||||
constexpr G4double alpha2 = CLHEP::fine_structure_const*CLHEP::fine_structure_const;
|
||||
}
|
||||
const G4double G4EmCorrections::ZD[11] =
|
||||
{0., 0., 0., 1.72, 2.09, 2.48, 2.82, 3.16, 3.53, 3.84, 4.15};
|
||||
const G4double G4EmCorrections::UK[20] = {1.9999, 2.0134, 2.0258, 2.0478, 2.0662,
|
||||
@@ -107,47 +108,25 @@ G4PhysicsFreeVector* G4EmCorrections::sBarkasCorr = nullptr;
|
||||
G4PhysicsFreeVector* G4EmCorrections::sThetaK = nullptr;
|
||||
G4PhysicsFreeVector* G4EmCorrections::sThetaL = nullptr;
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4EmCorrections::theCorrMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
G4EmCorrections::G4EmCorrections(G4int verb)
|
||||
G4EmCorrections::G4EmCorrections(G4int verb, G4bool master)
|
||||
: verbose(verb), isMaster(master)
|
||||
{
|
||||
verbose = verb;
|
||||
eth = 2.0*CLHEP::MeV;
|
||||
eth = 2.0*CLHEP::MeV;
|
||||
eCorrMin = 25.*CLHEP::keV;
|
||||
eCorrMax = 1.*CLHEP::GeV;
|
||||
|
||||
ionTable = G4ParticleTable::GetParticleTable()->GetIonTable();
|
||||
g4calc = G4Pow::GetInstance();
|
||||
|
||||
// G.S. Khandelwal Nucl. Phys. A116(1968)97 - 111.
|
||||
// "Shell corrections for K- and L- electrons
|
||||
nK = 20;
|
||||
nL = 26;
|
||||
nEtaK = 29;
|
||||
nEtaL = 28;
|
||||
|
||||
// fill vectors
|
||||
if(sBarkasCorr == nullptr) {
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&theCorrMutex);
|
||||
if (sBarkasCorr == nullptr) {
|
||||
#endif
|
||||
Initialise();
|
||||
isMaster = true;
|
||||
#ifdef G4MULTITHREADED
|
||||
}
|
||||
G4MUTEXUNLOCK(&theCorrMutex);
|
||||
#endif
|
||||
}
|
||||
if(isMaster) { Initialise(); }
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4EmCorrections::~G4EmCorrections()
|
||||
{
|
||||
for(G4int i=0; i<nIons; ++i) {delete stopData[i];}
|
||||
for(G4int i=0; i<nIons; ++i) { delete stopData[i]; }
|
||||
if(isMaster) {
|
||||
delete sBarkasCorr;
|
||||
delete sThetaK;
|
||||
@@ -924,6 +903,9 @@ void G4EmCorrections::Initialise()
|
||||
// Z^3 Barkas effect in the stopping power of matter for charged particles
|
||||
// J.C Ashley and R.H.Ritchie
|
||||
// Physical review B Vol.5 No.7 1 April 1972 pagg. 2393-2397
|
||||
// G.S. Khandelwal Nucl. Phys. A116(1968)97 - 111.
|
||||
// "Shell corrections for K- and L- electrons
|
||||
|
||||
G4int i, j;
|
||||
static const G4double fTable[47][2] = {
|
||||
{ 0.02, 21.5},
|
||||
|
||||
@@ -172,6 +172,8 @@ void G4EmParameters::Initialise()
|
||||
nucFormfactor = fExponentialNF;
|
||||
fSStype = fWVI;
|
||||
fFluct = fUniversalFluctuation;
|
||||
|
||||
fDirLEDATA = G4String(G4FindDataDir("G4LEDATA"));
|
||||
}
|
||||
|
||||
void G4EmParameters::SetLossFluctuations(G4bool val)
|
||||
@@ -1291,6 +1293,11 @@ void G4EmParameters::DefineRegParamForDeex(G4VAtomDeexcitation* ptr) const
|
||||
fCParameters->DefineRegParamForDeex(ptr);
|
||||
}
|
||||
|
||||
const G4String& G4EmParameters::GetDirLEDATA() const
|
||||
{
|
||||
return fDirLEDATA;
|
||||
}
|
||||
|
||||
void G4EmParameters::StreamInfo(std::ostream& os) const
|
||||
{
|
||||
G4long prec = os.precision(5);
|
||||
|
||||
@@ -201,9 +201,6 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
G4double ehigh = pv->Energy(npoints-1);
|
||||
G4double dedx1 = (*pv)[0];
|
||||
|
||||
//G4cout << "i= " << i << "npoints= " << npoints << " dedx1= "
|
||||
//<< dedx1 << G4endl;
|
||||
|
||||
// protection for specific cases dedx=0
|
||||
if(dedx1 == 0.0) {
|
||||
for (std::size_t k=1; k<npoints; ++k) {
|
||||
@@ -214,9 +211,6 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
}
|
||||
npoints -= bin0;
|
||||
}
|
||||
//G4cout<<"New Range vector" << G4endl;
|
||||
//G4cout<<"nbins= "<<npoints-1<<" elow= "<<elow<<" ehigh= "<<ehigh
|
||||
// <<" bin0= " << bin0 <<G4endl;
|
||||
|
||||
// initialisation of a new vector
|
||||
if(npoints < 3) { npoints = 3; }
|
||||
@@ -229,7 +223,12 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
// assumed dedx proportional to beta
|
||||
G4double energy1 = v->Energy(0);
|
||||
G4double range = 2.*energy1/dedx1;
|
||||
//G4cout << "range0= " << range << G4endl;
|
||||
/*
|
||||
G4cout << "New Range vector Npoints=" << v->GetVectorLength()
|
||||
<< " coupleIdx=" << i << " spline=" << v->GetSpline()
|
||||
<< " Elow=" << v->GetMinEnergy() <<" Ehigh=" << v->GetMinEnergy()
|
||||
<< " DEDX(Elow)=" << dedx1 << " R(Elow)=" << range << G4endl;
|
||||
*/
|
||||
v->PutValue(0,range);
|
||||
|
||||
for (std::size_t j=1; j<npoints; ++j) {
|
||||
@@ -239,14 +238,17 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
G4double energy = energy2 + de*0.5;
|
||||
G4double sum = 0.0;
|
||||
std::size_t idx = j - 1;
|
||||
//G4cout << "j= " << j << " e1= " << energy1 << " e2= " << energy2
|
||||
// << " n= " << n << G4endl;
|
||||
for (std::size_t k=0; k<n; ++k) {
|
||||
energy -= de;
|
||||
dedx1 = pv->Value(energy, idx);
|
||||
if(dedx1 > 0.0) { sum += de/dedx1; }
|
||||
}
|
||||
range += sum;
|
||||
/*
|
||||
if(energy < 10.)
|
||||
G4cout << "j= " << j << " e1= " << energy1 << " e2= " << energy2
|
||||
<< " n= " << n << " range=" << range<< G4endl;
|
||||
*/
|
||||
v->PutValue(j,range);
|
||||
energy1 = energy2;
|
||||
}
|
||||
|
||||
@@ -97,26 +97,14 @@ G4LossTableManager* G4LossTableManager::Instance()
|
||||
|
||||
G4LossTableManager::~G4LossTableManager()
|
||||
{
|
||||
for (G4int i=0; i<n_loss; ++i) {
|
||||
delete loss_vector[i];
|
||||
}
|
||||
std::size_t msc = msc_vector.size();
|
||||
for (std::size_t j=0; j<msc; ++j) {
|
||||
delete msc_vector[j];
|
||||
}
|
||||
std::size_t emp = emp_vector.size();
|
||||
for (std::size_t k=0; k<emp; ++k) {
|
||||
delete emp_vector[k];
|
||||
}
|
||||
emp = p_vector.size();
|
||||
for (std::size_t k=0; k<emp; ++k) {
|
||||
delete p_vector[k];
|
||||
}
|
||||
for (auto const & p : loss_vector) { delete p; }
|
||||
for (auto const & p : msc_vector) { delete p; }
|
||||
for (auto const & p : emp_vector) { delete p; }
|
||||
for (auto const & p : p_vector) { delete p; }
|
||||
|
||||
std::size_t mod = mod_vector.size();
|
||||
std::size_t fmod = fmod_vector.size();
|
||||
//G4cout << " Nmod" << mod << " Nfluc= " << fmod << G4endl;
|
||||
for (std::size_t a=0; a<mod; ++a) {
|
||||
//G4cout << "Delete model #" << a << " " << mod_vector[a] << G4endl;
|
||||
if( nullptr != mod_vector[a] ) {
|
||||
for (std::size_t b=0; b<fmod; ++b) {
|
||||
if((G4VEmModel*)(fmod_vector[b]) == mod_vector[a]) {
|
||||
@@ -127,9 +115,8 @@ G4LossTableManager::~G4LossTableManager()
|
||||
mod_vector[a] = nullptr;
|
||||
}
|
||||
}
|
||||
for (std::size_t b=0; b<fmod; ++b) {
|
||||
delete fmod_vector[b];
|
||||
}
|
||||
for (auto const & p : fmod_vector) { delete p; }
|
||||
|
||||
Clear();
|
||||
delete tableBuilder;
|
||||
delete emCorrections;
|
||||
@@ -145,30 +132,29 @@ G4LossTableManager::~G4LossTableManager()
|
||||
G4LossTableManager::G4LossTableManager()
|
||||
{
|
||||
theParameters = G4EmParameters::Instance();
|
||||
n_loss = 0;
|
||||
run = -1;
|
||||
startInitialisation = false;
|
||||
all_tables_are_built = false;
|
||||
currentLoss = nullptr;
|
||||
currentParticle = nullptr;
|
||||
firstParticle = nullptr;
|
||||
isMaster = true;
|
||||
verbose = theParameters->Verbose();
|
||||
theElectron = G4Electron::Electron();
|
||||
theElectron = G4Electron::Electron();
|
||||
theGenericIon= nullptr;
|
||||
if(G4Threading::IsWorkerThread()) {
|
||||
verbose = theParameters->WorkerVerbose();
|
||||
isMaster = false;
|
||||
}
|
||||
}
|
||||
tableBuilder = new G4LossTableBuilder(isMaster);
|
||||
emCorrections= new G4EmCorrections(verbose);
|
||||
emConfigurator = nullptr;
|
||||
emElectronIonPair = nullptr;
|
||||
atomDeexcitation = nullptr;
|
||||
subcutProducer = nullptr;
|
||||
nielCalculator = nullptr;
|
||||
gGeneral = nullptr;
|
||||
eGeneral = pGeneral = nullptr;
|
||||
emCorrections = new G4EmCorrections(verbose, isMaster);
|
||||
|
||||
std::size_t n = 70;
|
||||
loss_vector.reserve(n);
|
||||
part_vector.reserve(n);
|
||||
base_part_vector.reserve(n);
|
||||
dedx_vector.reserve(n);
|
||||
range_vector.reserve(n);
|
||||
inv_range_vector.reserve(n);
|
||||
tables_are_built.reserve(n);
|
||||
isActive.reserve(n);
|
||||
msc_vector.reserve(10);
|
||||
emp_vector.reserve(16);
|
||||
mod_vector.reserve(150);
|
||||
fmod_vector.reserve(60);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
@@ -436,8 +422,7 @@ G4LossTableManager::GetEnergyLossProcess(const G4ParticleDefinition *aParticle)
|
||||
|
||||
void
|
||||
G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
|
||||
G4VEnergyLossProcess* p,
|
||||
G4bool theMaster)
|
||||
G4VEnergyLossProcess* p)
|
||||
{
|
||||
if (1 < verbose) {
|
||||
G4cout << "G4LossTableManager::PreparePhysicsTable for "
|
||||
@@ -446,8 +431,6 @@ G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
|
||||
<< " loss_vector " << loss_vector.size() << G4endl;
|
||||
}
|
||||
|
||||
isMaster = theMaster;
|
||||
|
||||
if(!startInitialisation) {
|
||||
ResetParameters();
|
||||
if (1 < verbose) {
|
||||
@@ -477,14 +460,13 @@ G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
|
||||
|
||||
void
|
||||
G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
|
||||
G4VEmProcess* p, G4bool theMaster)
|
||||
G4VEmProcess* p)
|
||||
{
|
||||
if (1 < verbose) {
|
||||
G4cout << "G4LossTableManager::PreparePhysicsTable for "
|
||||
<< particle->GetParticleName()
|
||||
<< " and " << p->GetProcessName() << G4endl;
|
||||
}
|
||||
isMaster = theMaster;
|
||||
|
||||
if(!startInitialisation) {
|
||||
ResetParameters();
|
||||
@@ -505,8 +487,7 @@ G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
|
||||
|
||||
void
|
||||
G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
|
||||
G4VMultipleScattering* p,
|
||||
G4bool theMaster)
|
||||
G4VMultipleScattering* p)
|
||||
{
|
||||
if (1 < verbose) {
|
||||
G4cout << "G4LossTableManager::PreparePhysicsTable for "
|
||||
@@ -514,8 +495,6 @@ G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
|
||||
<< " and " << p->GetProcessName() << G4endl;
|
||||
}
|
||||
|
||||
isMaster = theMaster;
|
||||
|
||||
if(!startInitialisation) {
|
||||
ResetParameters();
|
||||
if (1 < verbose) {
|
||||
@@ -589,8 +568,6 @@ void G4LossTableManager::LocalPhysicsTables(
|
||||
inv_range_vector[i] = p->InverseRangeTable();
|
||||
if(0 == run && p->IsIonisationProcess()) {
|
||||
loss_map[part_vector[i]] = p;
|
||||
//G4cout << "G4LossTableManager::LocalPhysicsTable " << part_vector[i]->GetParticleName()
|
||||
// << " added to map " << p << G4endl;
|
||||
}
|
||||
|
||||
if(1 < verbose) {
|
||||
@@ -666,7 +643,7 @@ void G4LossTableManager::BuildPhysicsTable(
|
||||
isActive[i] = true;
|
||||
base_part_vector[i] = el->BaseParticle();
|
||||
tables_are_built[i] = false;
|
||||
all_tables_are_built= false;
|
||||
all_tables_are_built= false;
|
||||
if(1 < verbose) {
|
||||
G4cout << i <<". "<< el->GetProcessName();
|
||||
if(el->Particle()) {
|
||||
@@ -819,8 +796,8 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(
|
||||
if (!tables_are_built[i]) {
|
||||
val = true;
|
||||
dedx = p->BuildDEDXTable(fRestricted);
|
||||
//G4cout << "Build DEDX table for " << p->GetProcessName()
|
||||
// << " idx= " << i << dedx << " " << dedx->length() << G4endl;
|
||||
//G4cout << "===Build DEDX table for " << p->GetProcessName()
|
||||
// << " idx= " << i << " dedx:" << dedx << " " << dedx->length() << G4endl;
|
||||
p->SetDEDXTable(dedx,fRestricted);
|
||||
tables_are_built[i] = true;
|
||||
} else {
|
||||
@@ -913,7 +890,6 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(
|
||||
if(theParameters->BuildCSDARange()) {
|
||||
G4PhysicsTable* dedxCSDA = em->DEDXunRestrictedTable();
|
||||
if (1 < n_dedx) {
|
||||
dedxCSDA = nullptr;
|
||||
dedxCSDA = G4PhysicsTableHelper::PreparePhysicsTable(dedxCSDA);
|
||||
tableBuilder->BuildDEDXTable(dedxCSDA, listCSDA);
|
||||
em->SetDEDXTable(dedxCSDA,fTotal);
|
||||
|
||||
@@ -380,9 +380,11 @@ G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*, G4double)
|
||||
{}
|
||||
void G4VEmModel::SetupForMaterial(const G4ParticleDefinition* p,
|
||||
const G4Material* mat, G4double ekin)
|
||||
{
|
||||
GetChargeSquareRatio(p, mat, ekin);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -407,6 +409,18 @@ void G4VEmModel::SetCrossSectionTable(G4PhysicsTable* p, G4bool isLocal)
|
||||
localTable = isLocal;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
G4bool G4VEmModel::LPMFlag() const
|
||||
{
|
||||
return G4EmParameters::Instance()->LPM();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
void G4VEmModel::SetLPMFlag(G4bool val)
|
||||
{
|
||||
G4EmParameters::Instance()->SetLPM(val);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::ModelDescription(std::ostream& outFile) const
|
||||
|
||||
@@ -162,7 +162,7 @@ void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
}
|
||||
if(particle != &part) { return; }
|
||||
|
||||
lManager->PreparePhysicsTable(&part, this, isTheMaster);
|
||||
lManager->PreparePhysicsTable(&part, this);
|
||||
|
||||
// for new run
|
||||
currentCouple = nullptr;
|
||||
|
||||
@@ -210,8 +210,9 @@ G4VEnergyLossProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
if(!isIon) { lManager->RegisterExtraParticle(&part, this); }
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "### G4VEnergyLossProcess::PreparePhysicsTable()"
|
||||
<< " interrupted for "
|
||||
<< part.GetParticleName() << " isIon=" << isIon << G4endl;
|
||||
<< " interrupted for " << GetProcessName() << " and "
|
||||
<< part.GetParticleName() << " isIon=" << isIon
|
||||
<< " spline=" << spline << G4endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -219,14 +220,14 @@ G4VEnergyLossProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
tablesAreBuilt = false;
|
||||
|
||||
G4LossTableBuilder* bld = lManager->GetTableBuilder();
|
||||
lManager->PreparePhysicsTable(&part, this, isMaster);
|
||||
lManager->PreparePhysicsTable(&part, this);
|
||||
|
||||
// Base particle and set of models can be defined here
|
||||
InitialiseEnergyLossProcess(particle, baseParticle);
|
||||
|
||||
// parameters of the process
|
||||
if(!actLossFluc) { lossFluctuationFlag = theParameters->LossFluctuation(); }
|
||||
rndmStepFlag = theParameters->UseCutAsFinalRange();
|
||||
useCutAsFinalRange = theParameters->UseCutAsFinalRange();
|
||||
if(!actMinKinEnergy) { minKinEnergy = theParameters->MinKinEnergy(); }
|
||||
if(!actMaxKinEnergy) { maxKinEnergy = theParameters->MaxKinEnergy(); }
|
||||
if(!actBinning) { nBins = theParameters->NumberOfBins(); }
|
||||
@@ -318,11 +319,12 @@ G4VEnergyLossProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4VEnergyLossProcess::PrepearPhysicsTable() is done "
|
||||
<< " for local " << particle->GetParticleName()
|
||||
<< " isIon= " << isIon;
|
||||
<< " for " << GetProcessName() << " and " << particle->GetParticleName()
|
||||
<< " isIon= " << isIon << " spline=" << spline;
|
||||
if(baseParticle) {
|
||||
G4cout << "; base: " << baseParticle->GetParticleName();
|
||||
}
|
||||
G4cout << G4endl;
|
||||
G4cout << " chargeSqRatio= " << chargeSqRatio
|
||||
<< " massRatio= " << massRatio
|
||||
<< " reduceFactor= " << reduceFactor << G4endl;
|
||||
@@ -346,16 +348,16 @@ void G4VEnergyLossProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() for "
|
||||
<< GetProcessName()
|
||||
<< " and particle " << part.GetParticleName()
|
||||
<< "; local: " << particle->GetParticleName();
|
||||
<< "; the first particle " << particle->GetParticleName();
|
||||
if(baseParticle) {
|
||||
G4cout << "; base: " << baseParticle->GetParticleName();
|
||||
}
|
||||
G4cout << " TablesAreBuilt= " << tablesAreBuilt
|
||||
<< " isIon= " << isIon << " " << this << G4endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << " TablesAreBuilt= " << tablesAreBuilt << " isIon= " << isIon
|
||||
<< " spline=" << spline << " ptr: " << this << G4endl;
|
||||
}
|
||||
|
||||
if(&part == particle) {
|
||||
|
||||
if(isMaster) {
|
||||
lManager->BuildPhysicsTable(particle, this);
|
||||
|
||||
@@ -428,7 +430,8 @@ G4PhysicsTable* G4VEnergyLossProcess::BuildDEDXTable(G4EmTableType tType)
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4VEnergyLossProcess::BuildDEDXTable() of type " << tType
|
||||
<< " for " << GetProcessName()
|
||||
<< " and " << particle->GetParticleName() << G4endl;
|
||||
<< " and " << particle->GetParticleName()
|
||||
<< "spline=" << spline << G4endl;
|
||||
}
|
||||
if(nullptr == table) { return table; }
|
||||
|
||||
@@ -548,13 +551,9 @@ void G4VEnergyLossProcess::StartTracking(G4Track* track)
|
||||
// reset ion
|
||||
if(isIon) {
|
||||
const G4double newmass = track->GetDefinition()->GetPDGMass();
|
||||
if(nullptr != baseParticle) {
|
||||
massRatio = baseParticle->GetPDGMass()/newmass;
|
||||
logMassRatio = G4Log(massRatio);
|
||||
} else {
|
||||
massRatio = CLHEP::proton_mass_c2/newmass;
|
||||
logMassRatio = G4Log(massRatio);
|
||||
}
|
||||
massRatio = (nullptr == baseParticle) ? CLHEP::proton_mass_c2/newmass
|
||||
: baseParticle->GetPDGMass()/newmass;
|
||||
logMassRatio = G4Log(massRatio);
|
||||
}
|
||||
// forced biasing only for primary particles
|
||||
if(nullptr != biasManager) {
|
||||
@@ -575,13 +574,15 @@ G4double G4VEnergyLossProcess::AlongStepGetPhysicalInteractionLength(
|
||||
*selection = aGPILSelection;
|
||||
if(isIonisation && currentModel->IsActive(preStepScaledEnergy)) {
|
||||
GetScaledRangeForScaledEnergy(preStepScaledEnergy, preStepLogScaledEnergy);
|
||||
const G4double finR = (rndmStepFlag) ? std::min(finalRange,
|
||||
x = (useCutAsFinalRange) ? std::min(finalRange,
|
||||
currentCouple->GetProductionCuts()->GetProductionCut(1)) : finalRange;
|
||||
x = (fRange > finR) ?
|
||||
fRange*dRoverRange + finR*(1.0-dRoverRange)*(2.0-finR/fRange) : fRange;
|
||||
x = (fRange > x) ? fRange*dRoverRange + x*(1.0 - dRoverRange)*(2.0 - x/fRange)
|
||||
: fRange;
|
||||
/*
|
||||
G4cout<<"AlongStepGPIL: " << GetProcessName()<<": e="<<preStepKinEnergy
|
||||
<< " fRange=" << fRange << " finR=" << finR <<" stepLimit="<<x<<G4endl;
|
||||
*/
|
||||
}
|
||||
//G4cout<<"AlongStepGPIL: " << GetProcessName()<<": e= "<<preStepKinEnergy
|
||||
//<<" stepLimit= "<<x<<G4endl;
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -614,11 +615,9 @@ G4double G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength(
|
||||
// change effective charge of a charged particle on fly
|
||||
if(isIon) {
|
||||
const G4double q2 = currentModel->ChargeSquareRatio(track);
|
||||
if(q2 != chargeSqRatio) {
|
||||
fFactor *= q2/chargeSqRatio;
|
||||
reduceFactor = 1.0/(fFactor*massRatio);
|
||||
chargeSqRatio = q2;
|
||||
}
|
||||
fFactor = q2*biasFactor;
|
||||
if(baseMat) { fFactor *= (*theDensityFactor)[currentCoupleIndex]; }
|
||||
reduceFactor = 1.0/(fFactor*massRatio);
|
||||
if (lossFluctuationFlag) {
|
||||
auto fluc = currentModel->GetModelOfFluctuations();
|
||||
fluc->SetParticleAndCharge(track.GetDefinition(), q2);
|
||||
@@ -779,12 +778,10 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
// Get the actual (true) Step length
|
||||
G4double length = step.GetStepLength();
|
||||
if(length <= 0.0) { return &fParticleChange; }
|
||||
G4double eloss = 0.0;
|
||||
|
||||
/*
|
||||
/*
|
||||
if(-1 < verboseLevel) {
|
||||
const G4ParticleDefinition* d = track.GetParticleDefinition();
|
||||
G4cout << "AlongStepDoIt for "
|
||||
@@ -805,7 +802,7 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
fParticleChange.ProposeWeight(weight);
|
||||
}
|
||||
|
||||
// stopping
|
||||
// stopping, check actual range and kinetic energy
|
||||
if (length >= fRange || preStepKinEnergy <= lowestKinEnergy) {
|
||||
eloss = preStepKinEnergy;
|
||||
if (useDeexcitation) {
|
||||
@@ -818,27 +815,34 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
fParticleChange.ProposeLocalEnergyDeposit(eloss);
|
||||
return &fParticleChange;
|
||||
}
|
||||
// zero step length with non-zero range
|
||||
if(length <= 0.0) { return &fParticleChange; }
|
||||
|
||||
// Short step
|
||||
eloss = length*GetDEDXForScaledEnergy(preStepScaledEnergy,
|
||||
preStepLogScaledEnergy);
|
||||
//G4cout << "Short STEP: eloss= " << eloss << G4endl;
|
||||
|
||||
/*
|
||||
G4cout << "##### Short STEP: eloss= " << eloss
|
||||
<< " Escaled=" << preStepScaledEnergy
|
||||
<< " R=" << fRange
|
||||
<< " L=" << length
|
||||
<< " fFactor=" << fFactor << " minE=" << minKinEnergy
|
||||
<< " idxBase=" << basedCoupleIndex << G4endl;
|
||||
*/
|
||||
// Long step
|
||||
if(eloss > preStepKinEnergy*linLossLimit) {
|
||||
|
||||
G4double x = (fRange - length)/reduceFactor;
|
||||
//G4cout << "x= " << x << " " << theInverseRangeTable << G4endl;
|
||||
eloss = preStepKinEnergy - ScaledKinEnergyForLoss(x)/massRatio;
|
||||
|
||||
const G4double x = (fRange - length)/reduceFactor;
|
||||
const G4double de = preStepKinEnergy - ScaledKinEnergyForLoss(x)/massRatio;
|
||||
if(de > 0.0) { eloss = de; }
|
||||
/*
|
||||
if(-1 < verboseLevel)
|
||||
G4cout << "Long STEP: rPre(mm)= "
|
||||
G4cout << " Long STEP: rPre(mm)="
|
||||
<< GetScaledRangeForScaledEnergy(preStepScaledEnergy)/mm
|
||||
<< " rPost(mm)= " << x/mm
|
||||
<< " ePre(MeV)= " << preStepScaledEnergy/MeV
|
||||
<< " eloss(MeV)= " << eloss/MeV << " eloss0(MeV)= "
|
||||
<< GetDEDXForScaledEnergy(preStepScaledEnergy)*length/MeV
|
||||
<< " lim(MeV)= " << preStepKinEnergy*linLossLimit/MeV
|
||||
<< " x(mm)=" << x/mm
|
||||
<< " eloss(MeV)=" << eloss/MeV
|
||||
<< " rFactor=" << reduceFactor
|
||||
<< " massRatio=" << massRatio
|
||||
<< G4endl;
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ void G4VMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
G4double, G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VMscModel::GetDEDX(const G4ParticleDefinition* part, G4double kinEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
@@ -166,9 +166,9 @@ G4double G4VMscModel::GetDEDX(const G4ParticleDefinition* part, G4double kinEner
|
||||
x = dedx*q*q;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VMscModel::GetDEDX(const G4ParticleDefinition* part, G4double kinEnergy,
|
||||
const G4MaterialCutsCouple* couple, G4double logKinEnergy)
|
||||
@@ -198,9 +198,9 @@ G4double G4VMscModel::GetRange(const G4ParticleDefinition* part, G4double kinEne
|
||||
}
|
||||
//G4cout << "R(mm)= " << localrange << " " << ionisation << G4endl;
|
||||
return localrange;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VMscModel::GetRange(const G4ParticleDefinition* part,G4double kinEnergy,
|
||||
const G4MaterialCutsCouple* couple, G4double logKinEnergy)
|
||||
@@ -216,7 +216,7 @@ G4double G4VMscModel::GetRange(const G4ParticleDefinition* part,G4double kinEner
|
||||
}
|
||||
//G4cout << "R(mm)= " << localrange << " " << ionisation << G4endl;
|
||||
return localrange;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ G4VMultipleScattering::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
G4bool master = emManager->IsMaster();
|
||||
if(nullptr == firstParticle) { firstParticle = ∂ }
|
||||
|
||||
emManager->PreparePhysicsTable(&part, this, master);
|
||||
emManager->PreparePhysicsTable(&part, this);
|
||||
currParticle = nullptr;
|
||||
|
||||
if(firstParticle == &part) {
|
||||
|
||||
@@ -143,7 +143,7 @@ G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p,
|
||||
G4double eF = material->GetIonisation()->GetFermiEnergy();
|
||||
G4double v1sq = reducedEnergy/eF;
|
||||
G4double vFsq = eF/energyBohr;
|
||||
G4double vF = std::sqrt(eF/energyBohr);
|
||||
G4double vF = std::sqrt(vFsq);
|
||||
|
||||
G4double y = ( v1sq > 1.0 )
|
||||
// Faster than Fermi velocity
|
||||
|
||||
Reference in New Issue
Block a user