Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
File diff suppressed because it is too large Load Diff
@@ -49,7 +49,7 @@
G4LowECapture::G4LowECapture(G4double ekinlim)
: G4VDiscreteProcess("Capture", fElectromagnetic),
kinEnergyThreshold(ekinlim),
kinEnergyThreshold(ekinlim), isIon(false),
nRegions(0)
{}
@@ -87,7 +87,7 @@ void G4LowECapture::AddRegion(const G4String& nam)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4LowECapture::BuildPhysicsTable(const G4ParticleDefinition&)
void G4LowECapture::BuildPhysicsTable(const G4ParticleDefinition& part)
{
G4RegionStore* store = G4RegionStore::GetInstance();
for(G4int i=0; i<nRegions; ++i) {
@@ -100,6 +100,15 @@ void G4LowECapture::BuildPhysicsTable(const G4ParticleDefinition&)
if(r) { region.push_back(r); }
}
nRegions = region.size();
// ions reusing G4GenericIon parameters
if(part.GetParticleType() == "nucleus") {
G4String pname = part.GetParticleName();
if(pname != "deuteron" && pname != "triton" &&
pname != "alpha" && pname != "He3" &&
pname != "alpha+" && pname != "helium" &&
pname != "hydrogen") { isIon = true; }
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -114,7 +123,11 @@ G4double G4LowECapture::PostStepGetPhysicalInteractionLength(
{
*condition = NotForced;
G4double limit = DBL_MAX;
if(aTrack.GetKineticEnergy() < kinEnergyThreshold) {
G4double eLimit = kinEnergyThreshold;
if(isIon) {
eLimit *= aTrack.GetDefinition()->GetPDGMass()/CLHEP::proton_mass_c2;
}
if(aTrack.GetKineticEnergy() < eLimit) {
for(G4int i=0; i<nRegions; ++i) {
if(aTrack.GetVolume()->GetLogicalVolume()->GetRegion() == region[i]) {
limit = 0.0;
@@ -1,4 +1,3 @@
//
// ********************************************************************
// * License and Disclaimer *
@@ -69,8 +69,8 @@ void G4MicroElecElastic::InitialiseProcess(const G4ParticleDefinition*)
{
isInitialised = true;
SetBuildTableFlag(false);
if(!EmModel(1)) SetEmModel(new G4DummyModel(), 1);
AddEmModel(2, EmModel(1));
if(!EmModel()) SetEmModel(new G4DummyModel());
AddEmModel(2, EmModel());
}
}
@@ -82,8 +82,8 @@ void G4MicroElecInelastic::InitialiseProcess(const G4ParticleDefinition* p)
SetBuildTableFlag(false);
G4String name = p->GetParticleName();
if(!EmModel(1)) SetEmModel(new G4DummyModel(), 1);
AddEmModel(2, EmModel(1));
if(!EmModel()) SetEmModel(new G4DummyModel());
AddEmModel(2, EmModel());
}
}
@@ -802,7 +802,6 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
if (verbosityLevel > 1)
G4cout << "Cutoff energy: " << cutEnergy/eV << " eV" << G4endl;
//
//Copy helper in the oscillatorTable for Ionisation
//
@@ -826,12 +825,14 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
size_t firstIndex = (isAConductor) ? 1 : 0; //for conductors, skip conduction oscillator
G4bool loopAgain = false;
G4int nLoops = 0;
G4int removedLevels = 0;
do
{
loopAgain = false;
nLoops++;
if (Nost>firstIndex+1)
{
{
removedLevels = 0;
for (size_t i=firstIndex;i<theTable->size()-1;i++)
{
@@ -899,6 +900,9 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
Rgroup = Rgroup*Rgroup;
loopAgain = true;
}
//Add protection against infinite loops here
if (nLoops > 100 && !removedLevels)
loopAgain = false;
}while(loopAgain);
if (verbosityLevel > 1)
@@ -952,6 +956,7 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
removedLevels = 0;
do
{
nLoops++;
loopAgain = false;
if (Nost>firstIndex+1)
{
@@ -1009,6 +1014,9 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
Rgroup = Rgroup*Rgroup;
loopAgain = true;
}
//Add protection against infinite loops here
if (nLoops > 100 && !removedLevels)
loopAgain = false;
}while(loopAgain);
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4RayleighScattering.cc 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4RayleighScattering.cc 107118 2017-11-02 15:10:19Z gcosmo $
//
//
// 19-12-2008, first implementation, Luciano Pandola
@@ -78,3 +78,11 @@ void G4RayleighScattering::PrintInfo()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4RayleighScattering::ProcessDescription(std::ostream& out) const
{
out << "<strong>Rayleigh scattering</strong>";
G4VEmProcess::ProcessDescription(out);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -176,7 +176,7 @@ G4double G4hICRU49He::StoppingPower(const G4Material* material,
G4Exp(-c[iMolecula][4]*std::pow(T0,-c[iMolecula][6])) +
c[iMolecula][3]/(T0*T0) ;
ionloss *= std::sqrt(T/T0) ;
ionloss = a1*a2*std::sqrt(T/T0) ;
// Main parametrisation
} else {
@@ -184,13 +184,14 @@ G4double G4hICRU49He::StoppingPower(const G4Material* material,
a2 = (c[iMolecula][0]*std::log(T)/T + c[iMolecula][2]/T) *
G4Exp(-c[iMolecula][4]*std::pow(T,-c[iMolecula][6])) +
c[iMolecula][3]/(T*T) ;
ionloss = a1*a2;
}
// He effective charge
G4double z = (material->GetTotNbOfElectPerVolume()) /
(material->GetTotNbOfAtomsPerVolume()) ;
ionloss = a1*a2 / HeEffChargeSquare(z, kineticEnergy*rateMass) ;
ionloss /= HeEffChargeSquare(z, kineticEnergy*rateMass) ;
if ( ionloss < 0.0) ionloss = 0.0 ;
}