Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -25,7 +25,7 @@
//
//
// $Id: G4PreCompoundFragmentVector.cc,v 1.5 2006/06/29 20:59:21 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// Hadronic Process: Nuclear Preequilibrium
// by V. Lara
@@ -43,15 +43,6 @@ ProbabilityDistributionFunction(const G4double eKin,
G4double H = aFragment.GetNumberOfHoles();
G4double N = P + H;
G4double A0 = (P*P+H*H+P-H)/4.0 - H/2.0;
G4double A1 = std::max(0.0,A0 + GetA()*(GetA()-2.0*P-1.0)/4.0);
G4double Aj = GetA()*(GetA()+1.0)/4.0;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
G4double E1 = std::max(0.0,GetMaximalKineticEnergy() + GetCoulombBarrier() - eKin - A1);
G4double Ej = std::max(0.0,U + GetBindingEnergy() - Aj);
// g = (6.0/pi2)*a*A
// G4EvaporationLevelDensityParameter theLDP;
G4double g0 = (6.0/pi2)*aFragment.GetA() *
@@ -60,19 +51,31 @@ ProbabilityDistributionFunction(const G4double eKin,
G4double g1 = (6.0/pi2)*GetRestA() *
G4PreCompoundParameters::GetAddress()->GetLevelDensity();
// theLDP.LevelDensityParameter(GetRestA(),GetRestZ(),U);
G4double gj = (6.0/pi2)*GetA() *
G4PreCompoundParameters::GetAddress()->GetLevelDensity();
//no longer used: G4double gj = (6.0/pi2)*GetA() *
// -----"----- G4PreCompoundParameters::GetAddress()->GetLevelDensity();
// theLDP.LevelDensityParameter(GetA(),GetZ(),U);
G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
G4double A1 = std::max(0.0,(A0*g0 + GetA()*(GetA()-2.0*P-1.0)/4.0)/g1);
G4double Aj = GetA()*(GetA()+1.0)/4.0;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
// G4double E1 = std::max(0.0,GetMaximalKineticEnergy() + GetCoulombBarrier() - eKin - A1);
G4double E1 = (std::max(0.0,GetMaximalKineticEnergy() - eKin - A1))/g1; //JMQ fix
// G4double Ej = std::max(0.0,U + GetBindingEnergy() - Aj);
G4double Ej = std::max(0.0,eKin + GetBindingEnergy() - Aj); //JMQ fix
G4double pA = (3.0/4.0) * std::sqrt(std::max(0.0, 2.0/(GetReducedMass()*(eKin+GetBindingEnergy()))))*
GetAlpha()*(eKin+GetBeta())/(r0*std::pow(GetRestA(),1.0/3.0)) *
CoalescenceFactor(aFragment.GetA()) * FactorialFactor(N,P);
G4double pB = std::pow((g1*E1)/(g0*E0),N-GetA()-1.0)*(g1/g0);
G4double pC = std::pow((gj*Ej)/(g0*E0),GetA()-1.0)*(gj/g0)/E0;
// G4double pC = std::pow((gj*Ej)/(g0*E0),GetA()-1.0)*(gj/g0)/E0;
G4double pC = std::pow((g1*Ej)/(g0*E0),GetA()-1.0)*(g1/g0)/E0; //JMQ fix
G4double Probability = pA * pB * pC;
G4double Probability = pA * pB * pC * GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged());
return Probability;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PreCompoundModel.cc,v 1.8 2006/06/29 20:59:25 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4PreCompoundModel.cc,v 1.11 2007/10/11 14:19:36 ahoward Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// by V. Lara
@@ -85,9 +85,16 @@ G4HadFinalState * G4PreCompoundModel::ApplyYourself(const G4HadProjectile & theP
anInitialState.SetNumberOfParticles(1+thePrimary.GetDefinition()->GetBaryonNumber());
// Number of Charged Excited Particles
anInitialState.SetNumberOfCharged(static_cast<G4int>(thePrimary.GetDefinition()->GetPDGCharge()+.01) +
static_cast<G4int>(0.5+G4UniformRand()));
// JMQ/AH modify number of charged particles with probability of the Z/A ratio of the nucleus:
// if(G4UniformRand() <= aZ/anA) BUG! - integer arithmetic
if(G4UniformRand() <= (static_cast<G4double>(aZ))/(static_cast<G4double>(anA)))
anInitialState.SetNumberOfCharged(static_cast<G4int>(thePrimary.GetDefinition()->GetPDGCharge()+.01) + 1);
else
anInitialState.SetNumberOfCharged(static_cast<G4int>(thePrimary.GetDefinition()->GetPDGCharge()+.01));
//AH anInitialState.SetNumberOfCharged(static_cast<G4int>(thePrimary.GetDefinition()->GetPDGCharge()+.01) +
//AH static_cast<G4int>(0.5+G4UniformRand()));
// Number of Holes
anInitialState.SetNumberOfHoles(1);
@@ -42,14 +42,6 @@ ProbabilityDistributionFunction(const G4double eKin,
G4double H = aFragment.GetNumberOfHoles();
G4double N = P + H;
G4double A0 = (P*P+H*H+P-H)/4.0 - H/2.0;
G4double A1 = A0 - P/2.0;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
G4double E1 = std::max(0.0,U - eKin - GetBindingEnergy() - A1);
if (E1 == 0.0) return 0.0;
// g = (6.0/pi2)*a*A
// G4EvaporationLevelDensityParameter theLDP;
G4double g0 = (6.0/pi2)*aFragment.GetA() *
@@ -59,9 +51,17 @@ ProbabilityDistributionFunction(const G4double eKin,
G4PreCompoundParameters::GetAddress()->GetLevelDensity();
// theLDP.LevelDensityParameter(static_cast<G4int>(GetRestA()),static_cast<G4int>(GetRestZ()),U);
G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
G4double A1 = (A0*g0 - P/2.0)/g1;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
G4double E1 = std::max(0.0,U - eKin - GetBindingEnergy() - A1);
if (E1 == 0.0) return 0.0;
G4double Probability = 2.0/(hbarc*hbarc*hbarc) * GetReducedMass() *
r0 * r0 * std::pow(GetRestA(),2.0/3.0) * GetAlpha() * (eKin + GetBeta()) *
GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged()) * r0 * r0 * std::pow(GetRestA(),2.0/3.0) * GetAlpha() * (eKin + GetBeta()) *
P*(N-1.0) * std::pow(g1*E1/(g0*E0),N-2.0)/E0 *
g1/(g0*g0);
@@ -25,7 +25,7 @@
//
//
// $Id: G4PreCompoundParameters.cc,v 1.3 2006/06/29 20:59:29 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// by V. Lara
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PreCompoundTransitions.cc,v 1.9 2007/05/04 14:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4PreCompoundTransitions.cc,v 1.13 2007/07/23 12:48:54 ahoward Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// by V. Lara
@@ -133,9 +133,10 @@ CalculateProbability(const G4Fragment & aFragment)
// F(p,h) = 0.25*(p^2 + h^2 + p - h) - 0.5*h
G4double Fph = (P*P+H*H+P-H)/4.0 - H/2.0;
G4double Fph = ((P*P+H*H+P-H)/4.0 - H/2.0);
G4bool NeverGoBack(false);
if (U-Fph < 0.0) NeverGoBack = true;
//AH if (U-Fph < 0.0) NeverGoBack = true;
if (GE-Fph < 0.0) NeverGoBack = true;
// F(p+1,h+1)
G4double Fph1 = Fph + N/2.0;
// (n+1)/n ((g*E - F(p,h))/(g*E - F(p+1,h+1)))^(n+1)
@@ -182,11 +183,20 @@ G4Fragment G4PreCompoundTransitions::PerformTransition(const G4Fragment & aFragm
// Number of excitons is increased on \Delta n = -2
deltaN = -2;
}
// AH/JMQ: Randomly decrease the number of charges if deltaN is -2 and in proportion to the number charges w.r.t. number of particles
if(deltaN < 0 && G4UniformRand() <= static_cast<G4double>(result.GetNumberOfCharged())/static_cast<G4double>(result.GetNumberOfParticles()) && (result.GetNumberOfCharged() >= 1))
result.SetNumberOfCharged(result.GetNumberOfCharged()+deltaN/2); // deltaN is negative!
// result.SetNumberOfParticles was here
// result.SetNumberOfHoles was here
// the following lines have to be before SetNumberOfCharged, otherwise the check on number of charged vs. number of particles fails
result.SetNumberOfParticles(result.GetNumberOfParticles()+deltaN/2);
result.SetNumberOfHoles(result.GetNumberOfHoles()+deltaN/2);
// With weight Z/A, number of charged particles is decreased on +1
if ((deltaN > 0 || result.GetNumberOfCharged() > 0) &&
// if ((deltaN > 0 || result.GetNumberOfCharged() > 0) && // AH/JMQ check is now in initialize within G4VPreCompoundFragment
if ( ( deltaN > 0 ) &&
(G4UniformRand() <= static_cast<G4double>(result.GetZ()-result.GetNumberOfCharged())/
std::max(static_cast<G4double>(result.GetA()-Nexcitons),1.)))
{
@@ -199,6 +209,10 @@ G4Fragment G4PreCompoundTransitions::PerformTransition(const G4Fragment & aFragm
result.SetNumberOfCharged(result.GetNumberOfParticles());
}
// moved from above to make code more readable
// result.SetNumberOfParticles(result.GetNumberOfParticles()+deltaN/2);
// result.SetNumberOfHoles(result.GetNumberOfHoles()+deltaN/2);
return result;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VPreCompoundFragment.cc,v 1.3 2006/06/29 20:59:35 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4VPreCompoundFragment.cc,v 1.4 2007/07/23 09:56:40 ahoward Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// by V. Lara
@@ -141,7 +141,8 @@ Initialize(const G4Fragment & aFragment)
if ((theRestNucleusA < theRestNucleusZ) ||
(theRestNucleusA < theA) ||
(theRestNucleusZ < theZ))
(theRestNucleusZ < theZ) ||
(aFragment.GetNumberOfCharged() < theZ)) // AH last argument from JMQ
{
// In order to be sure that emission probability will be 0.
theMaximalKineticEnergy = 0.0;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VPreCompoundIon.cc,v 1.4 2006/06/29 20:59:37 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4VPreCompoundIon.cc,v 1.5 2007/07/23 09:56:40 ahoward Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// by V. Lara
@@ -47,15 +47,6 @@ ProbabilityDistributionFunction(const G4double eKin,
G4double H = aFragment.GetNumberOfHoles();
G4double N = P + H;
G4double A0 = (P*P+H*H+P-H)/4.0 - H/2.0;
G4double A1 = std::max(0.0,A0 + GetA()*(GetA()-2.0*P-1.0)/4.0);
G4double Aj = GetA()*(GetA()+1.0)/4.0;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
G4double E1 = std::max(0.0,GetMaximalKineticEnergy() + GetCoulombBarrier() - eKin - A1);
G4double Ej = std::max(0.0,U + GetBindingEnergy() - Aj);
// g = (6.0/pi2)*a*A
// G4EvaporationLevelDensityParameter theLDP;
G4double g0 = (6.0/pi2)*aFragment.GetA() *
@@ -68,6 +59,15 @@ ProbabilityDistributionFunction(const G4double eKin,
G4PreCompoundParameters::GetAddress()->GetLevelDensity();
// theLDP.LevelDensityParameter(GetA(),GetZ(),U);
G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
G4double A1 = std::max(0.0,(A0*g0 + GetA()*(GetA()-2.0*P-1.0)/4.0)/g1);
G4double Aj = GetA()*(GetA()+1.0)/4.0;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
G4double E1 = std::max(0.0,GetMaximalKineticEnergy() + GetCoulombBarrier() - eKin - A1);
G4double Ej = std::max(0.0,U + GetBindingEnergy() - Aj);
G4double pA = (3.0/4.0) * std::sqrt(std::max(0.0, 2.0/(GetReducedMass()*(eKin+GetBindingEnergy()))))*
GetAlpha()*(eKin+GetBeta())/(r0*std::pow(GetRestA(),1.0/3.0)) *
CoalescenceFactor(aFragment.GetA()) * FactorialFactor(N,P);
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VPreCompoundNucleon.cc,v 1.4 2006/06/29 20:59:39 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4VPreCompoundNucleon.cc,v 1.5 2007/07/23 09:56:40 ahoward Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// by V. Lara
@@ -47,13 +47,6 @@ ProbabilityDistributionFunction(const G4double eKin,
G4double H = aFragment.GetNumberOfHoles();
G4double N = P + H;
G4double A0 = (P*P+H*H+P-H)/4.0 - H/2.0;
G4double A1 = A0 - P/2.0;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
G4double E1 = std::max(0.0,U - eKin - GetBindingEnergy() - A1);
// g = (6.0/pi2)*a*A
// G4EvaporationLevelDensityParameter theLDP;
G4double g0 = (6.0/pi2)*aFragment.GetA() *
@@ -64,8 +57,15 @@ ProbabilityDistributionFunction(const G4double eKin,
// theLDP.LevelDensityParameter(G4int(GetRestA()),G4int(GetRestZ()),U);
G4double A0 = ((P*P+H*H+P-H)/4.0 - H/2.0)/g0;
G4double A1 = (A0*g0 - P/2.0)/g1;
G4double E0 = std::max(0.0,U - A0);
if (E0 == 0.0) return 0.0;
G4double E1 = std::max(0.0,U - eKin - GetBindingEnergy() - A1);
G4double Probability = 2.0/(hbarc*hbarc*hbarc) * GetReducedMass() *
r0 * r0 * std::pow(GetRestA(),2.0/3.0) * GetAlpha() * (eKin + GetBeta()) *
GetRj(aFragment.GetNumberOfParticles(), aFragment.GetNumberOfCharged()) * r0 * r0 * std::pow(GetRestA(),2.0/3.0) * GetAlpha() * (eKin + GetBeta()) *
P*(N-1.0) * std::pow(g1*E1/(g0*E0),N-2.0)/E0 *
g1/(g0*g0);