Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AtomicDeexcitation.cc,v 1.11
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-05 $
|
||||
//
|
||||
// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
// Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
|
||||
@@ -182,11 +182,11 @@ G4DynamicParticle* G4AtomicDeexcitation::GenerateFluorescence(G4int Z,
|
||||
|
||||
//isotropic angular distribution for the outcoming photon
|
||||
G4double newcosTh = 1.-2.*G4UniformRand();
|
||||
G4double newsinTh = sqrt(1.-newcosTh*newcosTh);
|
||||
G4double newsinTh = std::sqrt(1.-newcosTh*newcosTh);
|
||||
G4double newPhi = twopi*G4UniformRand();
|
||||
|
||||
G4double xDir = newsinTh*sin(newPhi);
|
||||
G4double yDir = newsinTh*cos(newPhi);
|
||||
G4double xDir = newsinTh*std::sin(newPhi);
|
||||
G4double yDir = newsinTh*std::cos(newPhi);
|
||||
G4double zDir = newcosTh;
|
||||
|
||||
G4ThreeVector newGammaDirection(xDir,yDir,zDir);
|
||||
@@ -273,13 +273,13 @@ G4DynamicParticle* G4AtomicDeexcitation::GenerateAuger(G4int Z, G4int shellId)
|
||||
if (shellId != pippo ) {
|
||||
do {
|
||||
shellNum++;
|
||||
if(shellNum == maxNumOfShells)
|
||||
{
|
||||
G4cout << "G4AtomicDeexcitation warning: No Auger transition found" << G4endl;
|
||||
G4cout << "Absorbed enrgy deposited locally" << G4endl;
|
||||
return 0;
|
||||
// G4Exception("G4AtomicDeexcitation: No Auger transition found");
|
||||
}
|
||||
// if(shellNum == maxNumOfShells)
|
||||
// {
|
||||
// G4cout << "G4AtomicDeexcitation warning: No Auger transition found" << G4endl;
|
||||
// G4cout << "Absorbed enrgy deposited locally" << G4endl;
|
||||
// return 0;
|
||||
// // G4Exception("G4AtomicDeexcitation: No Auger transition found");
|
||||
// }
|
||||
}
|
||||
while (shellId != (transitionManager->ReachableAugerShell(Z,shellNum)->FinalShellId()) ) ;
|
||||
}
|
||||
@@ -347,6 +347,9 @@ G4DynamicParticle* G4AtomicDeexcitation::GenerateAuger(G4int Z, G4int shellId)
|
||||
G4double partialProb = G4UniformRand();
|
||||
// G4int augerOriginatingShellId = 0;
|
||||
|
||||
G4int numberOfPossibleAuger =
|
||||
(anAugerTransition->AugerTransitionProbabilities(transitionRandomShellId))->size();
|
||||
|
||||
while (transitionRandomShellIndex < transitionSize) {
|
||||
|
||||
std::vector<G4int>::const_iterator pos =
|
||||
@@ -355,8 +358,7 @@ G4DynamicParticle* G4AtomicDeexcitation::GenerateAuger(G4int Z, G4int shellId)
|
||||
transitionRandomShellId = *(pos+transitionRandomShellIndex);
|
||||
|
||||
// G4int transitionRandomShellId = *(anAugerTransition->TransitionOriginatingShellIds())[transitionRandomShellIndex];
|
||||
G4int numberOfPossibleAuger =
|
||||
(anAugerTransition->AugerTransitionProbabilities(transitionRandomShellId))->size();
|
||||
|
||||
|
||||
augerIndex = 0;
|
||||
|
||||
@@ -373,48 +375,49 @@ G4DynamicParticle* G4AtomicDeexcitation::GenerateAuger(G4int Z, G4int shellId)
|
||||
if (partSum >= (partialProb/totalVacancyAugerProbability) ) {break;}
|
||||
transitionRandomShellIndex++;
|
||||
}
|
||||
|
||||
// Now we have the index of the shell from wich comes the auger electron (augerIndex),
|
||||
// and the id of the shell, from which the transition e- come (transitionRandomShellid)
|
||||
|
||||
|
||||
|
||||
// Isotropic angular distribution for the outcoming e-
|
||||
G4double newcosTh = 1.-2.*G4UniformRand();
|
||||
G4double newsinTh = sqrt(1.-newcosTh*newcosTh);
|
||||
G4double newPhi = twopi*G4UniformRand();
|
||||
|
||||
G4double xDir = newsinTh*sin(newPhi);
|
||||
G4double yDir = newsinTh*cos(newPhi);
|
||||
G4double zDir = newcosTh;
|
||||
|
||||
G4ThreeVector newElectronDirection(xDir,yDir,zDir);
|
||||
G4double newsinTh = std::sqrt(1.-newcosTh*newcosTh);
|
||||
G4double newPhi = twopi*G4UniformRand();
|
||||
|
||||
G4double xDir = newsinTh*std::sin(newPhi);
|
||||
G4double yDir = newsinTh*std::cos(newPhi);
|
||||
G4double zDir = newcosTh;
|
||||
|
||||
G4ThreeVector newElectronDirection(xDir,yDir,zDir);
|
||||
|
||||
// energy of the auger electron emitted
|
||||
|
||||
|
||||
G4double transitionEnergy = anAugerTransition->AugerTransitionEnergy(augerIndex, transitionRandomShellId);
|
||||
/*
|
||||
G4cout << "AUger TransitionId " << anAugerTransition->FinalShellId() << G4endl;
|
||||
G4cout << "augerIndex: " << augerIndex << G4endl;
|
||||
G4cout << "transitionShellId: " << transitionRandomShellId << G4endl;
|
||||
*/
|
||||
|
||||
// This is the shell where the new vacancy is: it is the same
|
||||
// shell where the electron came from
|
||||
newShellId = transitionRandomShellId;
|
||||
|
||||
|
||||
G4DynamicParticle* newPart = new G4DynamicParticle(G4Electron::Electron(),
|
||||
newElectronDirection,
|
||||
transitionEnergy);
|
||||
return newPart;
|
||||
|
||||
// energy of the auger electron emitted
|
||||
|
||||
|
||||
G4double transitionEnergy =
|
||||
anAugerTransition->AugerTransitionEnergy(augerIndex, transitionRandomShellId);
|
||||
/*
|
||||
G4cout << "AUger TransitionId " << anAugerTransition->FinalShellId() << G4endl;
|
||||
G4cout << "augerIndex: " << augerIndex << G4endl;
|
||||
G4cout << "transitionShellId: " << transitionRandomShellId << G4endl;
|
||||
*/
|
||||
|
||||
// This is the shell where the new vacancy is: it is the same
|
||||
// shell where the electron came from
|
||||
newShellId = transitionRandomShellId;
|
||||
|
||||
|
||||
G4DynamicParticle* newPart = new G4DynamicParticle(G4Electron::Electron(),
|
||||
newElectronDirection,
|
||||
transitionEnergy);
|
||||
return newPart;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//G4Exception("G4AtomicDeexcitation: no auger transition found");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void G4AtomicDeexcitation::SetCutForSecondaryPhotons(G4double cut)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AtomicShell.cc,v 1.2 ????
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
// Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AtomicTransitionManager.cc,v 1.2 ????
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
// Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
|
||||
@@ -221,7 +221,10 @@ const G4FluoTransition* G4AtomicTransitionManager::ReachableShell(G4int Z,size_t
|
||||
}
|
||||
}
|
||||
else{
|
||||
G4Exception("G4AtomicTransitionManager:Z not found");
|
||||
G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
|
||||
G4cout << "Absorbed enrgy deposited locally" << G4endl;
|
||||
|
||||
// G4Exception("G4AtomicTransitionManager:Z not found");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -250,7 +253,10 @@ std::map<G4int,std::vector<G4AtomicShell*>,std::less<G4int> >::const_iterator po
|
||||
}
|
||||
|
||||
else{
|
||||
G4Exception( "G4AtomicTransitionManager: Z not found" );
|
||||
G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
|
||||
G4cout << "Absorbed enrgy deposited locally" << G4endl;
|
||||
|
||||
// G4Exception("G4AtomicTransitionManager:Z not found");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -271,7 +277,10 @@ std::map<G4int,std::vector<G4FluoTransition*>,std::less<G4int> >::const_iterator
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception( "G4AtomicTransitionManager: Z not found" );
|
||||
G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
|
||||
G4cout << "Absorbed enrgy deposited locally" << G4endl;
|
||||
|
||||
// G4Exception("G4AtomicTransitionManager:Z not found");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -319,7 +328,11 @@ std::map<G4int,std::vector<G4FluoTransition*>,std::less<G4int> >::iterator pos;
|
||||
}
|
||||
}
|
||||
else{
|
||||
G4Exception( "G4AtomicTransitionManager: Z not found");
|
||||
G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
|
||||
G4cout << "Absorbed enrgy deposited locally" << G4endl;
|
||||
|
||||
// G4Exception("G4AtomicTransitionManager:Z not found");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -358,7 +371,10 @@ G4double G4AtomicTransitionManager::TotalNonRadiativeTransitionProbability(G4int
|
||||
}
|
||||
}
|
||||
else{
|
||||
G4Exception("Z not found");
|
||||
G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
|
||||
G4cout << "Absorbed enrgy deposited locally" << G4endl;
|
||||
|
||||
// G4Exception("G4AtomicTransitionManager:Z not found");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ G4int G4AugerData::StartShellId(G4int Z, G4int vacancyIndex, G4int transitionShe
|
||||
|
||||
G4double G4AugerData::StartShellEnergy(G4int Z, G4int vacancyIndex, G4int transitionId, G4int augerIndex) const
|
||||
{
|
||||
G4double n = 0;
|
||||
G4double energy = 0;
|
||||
|
||||
if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
|
||||
{G4Exception("G4AugerData::vacancyIndex outside boundaries");}
|
||||
@@ -203,16 +203,16 @@ G4double G4AugerData::StartShellEnergy(G4int Z, G4int vacancyIndex, G4int transi
|
||||
trans_Table::const_iterator element = augerTransitionTable.find(Z);
|
||||
if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");}
|
||||
std::vector<G4AugerTransition> dataSet = (*element).second;
|
||||
n = dataSet[vacancyIndex].AugerTransitionEnergy(augerIndex,transitionId);
|
||||
energy = dataSet[vacancyIndex].AugerTransitionEnergy(augerIndex,transitionId);
|
||||
|
||||
}
|
||||
return n;
|
||||
return energy;
|
||||
}
|
||||
|
||||
|
||||
G4double G4AugerData::StartShellProb(G4int Z, G4int vacancyIndex,G4int transitionId,G4int augerIndex) const
|
||||
{
|
||||
G4double n = 0;
|
||||
G4double prob = 0;
|
||||
|
||||
if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
|
||||
{G4Exception("G4AugerData::vacancyIndex outside boundaries");}
|
||||
@@ -220,12 +220,12 @@ G4double G4AugerData::StartShellProb(G4int Z, G4int vacancyIndex,G4int transitio
|
||||
trans_Table::const_iterator element = augerTransitionTable.find(Z);
|
||||
if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");}
|
||||
std::vector<G4AugerTransition> dataSet = (*element).second;
|
||||
n = dataSet[vacancyIndex].AugerTransitionProbability(augerIndex, transitionId);
|
||||
prob = dataSet[vacancyIndex].AugerTransitionProbability(augerIndex, transitionId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
return n;
|
||||
return prob;
|
||||
}
|
||||
|
||||
std::vector<G4AugerTransition> G4AugerData::LoadData(G4int Z)
|
||||
@@ -388,10 +388,11 @@ std::vector<G4AugerTransition> G4AugerData::LoadData(G4int Z)
|
||||
|
||||
if(initIds->size() == 0) {
|
||||
|
||||
// if this is the first data of the shell, alla the colums are equal
|
||||
// if this is the first data of the shell, all the colums are equal
|
||||
// to the shell Id; so we skip the next colums ang go to the next row
|
||||
|
||||
initIds->push_back((G4int)a);
|
||||
// first line of initIds is the original shell of the vacancy
|
||||
file >> a;
|
||||
file >> a;
|
||||
file >> a;
|
||||
@@ -409,8 +410,8 @@ std::vector<G4AugerTransition> G4AugerData::LoadData(G4int Z)
|
||||
else {
|
||||
|
||||
initIds->push_back((G4int)a);
|
||||
G4int augerShellId = *vectorIndex;
|
||||
|
||||
G4int augerShellId = 0;
|
||||
augerShellId = *vectorIndex;
|
||||
|
||||
(*newIdMap)[augerShellId] = *newIds;
|
||||
(*newEnergyMap)[augerShellId] = *transEnergies;
|
||||
|
||||
@@ -122,7 +122,8 @@ G4int G4AugerTransition::AugerOriginatingShellId(G4int index, G4int startShellId
|
||||
const std::vector<G4int>* ids = AugerOriginatingShellIds(startShellId);
|
||||
// G4int i =
|
||||
std::vector<G4int>::const_iterator pos = ids->begin();
|
||||
G4int n = *(pos+index);
|
||||
G4int n = 0;
|
||||
n = *(pos+index);
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -133,7 +134,8 @@ G4double G4AugerTransition::AugerTransitionEnergy(G4int index, G4int startShellI
|
||||
{
|
||||
const G4DataVector* energies = AugerTransitionEnergies(startShellId);
|
||||
G4DataVector::const_iterator pos = energies->begin();
|
||||
G4double energy = *(pos+index);
|
||||
G4double energy = 0;
|
||||
energy = *(pos+index);
|
||||
return energy;
|
||||
}
|
||||
|
||||
@@ -145,10 +147,12 @@ G4double G4AugerTransition::AugerTransitionProbability(G4int index, G4int startS
|
||||
|
||||
const G4DataVector *probabilities = AugerTransitionProbabilities(startShellId);
|
||||
G4DataVector::const_iterator pos = probabilities->begin();
|
||||
G4double probability; // = new G4double;
|
||||
|
||||
G4double probability = 0;
|
||||
probability = *(pos+index);
|
||||
|
||||
return probability;
|
||||
//delete probability;
|
||||
|
||||
}
|
||||
|
||||
G4int G4AugerTransition::TransitionOriginatingShellId(G4int index) const
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1.8 2003/06/16 17:00:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4BremsstrahlungParameters.cc,v 1.17 2003/06/16 17:00:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
// V.Ivanchenko (Vladimir.Ivantchenko@cern.ch)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4CompositeEMDataSet.cc,v 1.7 2003/06/16 17:00:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4CrossSectionHandler.cc,v 1.16 2003/06/16 17:00:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4EMDataSet.cc,v 1.9 2003/06/16 17:00:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FluoTransition.cc,v 1.2 ????
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
//
|
||||
|
||||
@@ -190,7 +190,7 @@ G4double G4Generator2BN::PolarAngle(const G4double initial_energy,
|
||||
G4double G4Generator2BN::CalculateFkt(G4double k, G4double theta, G4double A, G4double c) const
|
||||
{
|
||||
G4double Fkt_value = 0;
|
||||
Fkt_value = A*pow(k,-b)*theta/(1+c*theta*theta);
|
||||
Fkt_value = A*std::pow(k,-b)*theta/(1+c*theta*theta);
|
||||
return Fkt_value;
|
||||
}
|
||||
|
||||
@@ -220,25 +220,25 @@ G4double G4Generator2BN::Calculatedsdkdt(G4double kout, G4double theta, G4double
|
||||
}
|
||||
|
||||
|
||||
G4double p0 = sqrt(E0*E0-1);
|
||||
G4double p = sqrt(E*E-1);
|
||||
G4double L = log((E*E0-1+p*p0)/(E*E0-1-p*p0));
|
||||
G4double delta0 = E0 - p0*cos(theta);
|
||||
G4double epsilon = log((E+p)/(E-p));
|
||||
G4double p0 = std::sqrt(E0*E0-1);
|
||||
G4double p = std::sqrt(E*E-1);
|
||||
G4double L = std::log((E*E0-1+p*p0)/(E*E0-1-p*p0));
|
||||
G4double delta0 = E0 - p0*std::cos(theta);
|
||||
G4double epsilon = std::log((E+p)/(E-p));
|
||||
G4double Z2 = Z*Z;
|
||||
G4double sintheta2 = sin(theta)*sin(theta);
|
||||
G4double sintheta2 = std::sin(theta)*std::sin(theta);
|
||||
G4double E02 = E0*E0;
|
||||
G4double E2 = E*E;
|
||||
G4double p02 = E0*E0-1;
|
||||
G4double k2 = k*k;
|
||||
G4double delta02 = delta0*delta0;
|
||||
G4double delta04 = delta02* delta02;
|
||||
G4double Q = sqrt(p02+k2-2*k*p0*cos(theta));
|
||||
G4double Q = std::sqrt(p02+k2-2*k*p0*std::cos(theta));
|
||||
G4double Q2 = Q*Q;
|
||||
G4double epsilonQ = log((Q+p)/(Q-p));
|
||||
G4double epsilonQ = std::log((Q+p)/(Q-p));
|
||||
|
||||
|
||||
dsdkdt_value = Z2 * (r02/(8*M_PI*137)) * (1/k) * (p/p0) *
|
||||
dsdkdt_value = Z2 * (r02/(8*pi*137)) * (1/k) * (p/p0) *
|
||||
( (8 * (sintheta2*(2*E02+1))/(p02*delta04)) -
|
||||
((2*(5*E02+2*E*E0+3))/(p02 * delta02)) -
|
||||
((2*(p02-k2))/((Q2*delta02))) +
|
||||
@@ -256,7 +256,7 @@ G4double G4Generator2BN::Calculatedsdkdt(G4double kout, G4double theta, G4double
|
||||
|
||||
|
||||
|
||||
dsdkdt_value = dsdkdt_value*sin(theta);
|
||||
dsdkdt_value = dsdkdt_value*std::sin(theta);
|
||||
return dsdkdt_value;
|
||||
}
|
||||
|
||||
@@ -282,14 +282,14 @@ void G4Generator2BN::ConstructMajorantSurface()
|
||||
for(G4int index = index_min; index < index_max; index++){
|
||||
|
||||
G4double fraction = index/100.;
|
||||
Ek = pow(10.,fraction);
|
||||
Ek = std::pow(10.,fraction);
|
||||
Eel = Ek + electron_mass_c2;
|
||||
|
||||
// find x-section maximum at k=kmin
|
||||
dsmax = 0.;
|
||||
thetamax = 0.;
|
||||
|
||||
for(theta = 0.; theta < M_PI; theta = theta + dtheta){
|
||||
for(theta = 0.; theta < pi; theta = theta + dtheta){
|
||||
|
||||
ds = Calculatedsdkdt(kmin, theta, Eel);
|
||||
|
||||
@@ -305,7 +305,7 @@ void G4Generator2BN::ConstructMajorantSurface()
|
||||
A = 0;
|
||||
}else{
|
||||
c = 1/(thetamax*thetamax);
|
||||
A = 2*sqrt(c)*dsmax/(pow(kmin,-b));
|
||||
A = 2*std::sqrt(c)*dsmax/(std::pow(kmin,-b));
|
||||
}
|
||||
|
||||
// look for correction factor to normalization at kmin
|
||||
@@ -317,13 +317,13 @@ void G4Generator2BN::ConstructMajorantSurface()
|
||||
k0 = 0.;
|
||||
theta0 = 0.;
|
||||
|
||||
vmax = G4int(100.*log10(Ek/kmin));
|
||||
vmax = G4int(100.*std::log10(Ek/kmin));
|
||||
|
||||
for(G4int v = 0; v < vmax; v++){
|
||||
G4double fraction = (v/100.);
|
||||
k = pow(10.,fraction)*kmin;
|
||||
k = std::pow(10.,fraction)*kmin;
|
||||
|
||||
for(theta = 0.; theta < M_PI; theta = theta + dtheta){
|
||||
for(theta = 0.; theta < pi; theta = theta + dtheta){
|
||||
dk = k - k0;
|
||||
dt = theta - theta0;
|
||||
ds = Calculatedsdkdt(k,theta, Eel);
|
||||
@@ -369,7 +369,7 @@ G4double G4Generator2BN::Generate2BN(G4double Ek, G4double k) const
|
||||
G4int index;
|
||||
|
||||
// find table index
|
||||
index = G4int(log10(Ek)*100) - index_min;
|
||||
index = G4int(std::log10(Ek)*100) - index_min;
|
||||
Eel = Ek + electron_mass_c2;
|
||||
|
||||
kmax = Ek;
|
||||
@@ -383,24 +383,24 @@ G4double G4Generator2BN::Generate2BN(G4double Ek, G4double k) const
|
||||
}
|
||||
|
||||
do{
|
||||
// generate k accordimg to pow(k,-b)
|
||||
// generate k accordimg to std::pow(k,-b)
|
||||
trials++;
|
||||
|
||||
// normalization constant
|
||||
// cte1 = (1-b)/(pow(kmax,(1-b))-pow(kmin2,(1-b)));
|
||||
// cte1 = (1-b)/(std::pow(kmax,(1-b))-std::pow(kmin2,(1-b)));
|
||||
// y = G4UniformRand();
|
||||
// k = pow(((1-b)/cte1*y+pow(kmin2,(1-b))),(1/(1-b)));
|
||||
// k = std::pow(((1-b)/cte1*y+std::pow(kmin2,(1-b))),(1/(1-b)));
|
||||
|
||||
// generate theta accordimg to theta/(1+c*pow(theta,2)
|
||||
// generate theta accordimg to theta/(1+c*std::pow(theta,2)
|
||||
// Normalization constant
|
||||
cte2 = 2*c/log(1+c*M_PI*M_PI);
|
||||
cte2 = 2*c/std::log(1+c*pi2);
|
||||
|
||||
y = G4UniformRand();
|
||||
t = sqrt((exp(2*c*y/cte2)-1)/c);
|
||||
t = std::sqrt((std::exp(2*c*y/cte2)-1)/c);
|
||||
u = G4UniformRand();
|
||||
|
||||
// point acceptance algorithm
|
||||
fk = pow(k,-b);
|
||||
fk = std::pow(k,-b);
|
||||
ft = t/(1+c*t*t);
|
||||
ds = Calculatedsdkdt(k,t,Eel);
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ G4double G4Generator2BS::PolarAngle(const G4double initial_energy,
|
||||
G4double initialTotalEnergy = (initial_energy+electron_mass_c2)/electron_mass_c2;
|
||||
G4double finalTotalEnergy = (final_energy+electron_mass_c2)/electron_mass_c2;
|
||||
EnergyRatio = finalTotalEnergy/initialTotalEnergy;
|
||||
G4double gMaxEnergy = (M_PI*initialTotalEnergy)*(M_PI*initialTotalEnergy);
|
||||
G4double gMaxEnergy = (pi*initialTotalEnergy)*(pi*initialTotalEnergy);
|
||||
|
||||
G4double Zeff = sqrt(static_cast<G4double>(Z) * (static_cast<G4double>(Z) + 1.0));
|
||||
z = (0.00008116224*(pow(Zeff,0.3333333)));
|
||||
G4double Zeff = std::sqrt(static_cast<G4double>(Z) * (static_cast<G4double>(Z) + 1.0));
|
||||
z = (0.00008116224*(std::pow(Zeff,0.3333333)));
|
||||
|
||||
// Rejection arguments
|
||||
rejection_argument1 = (1.0+EnergyRatio*EnergyRatio);
|
||||
@@ -112,7 +112,7 @@ G4double G4Generator2BS::PolarAngle(const G4double initial_energy,
|
||||
|
||||
}while(randTest > (gfunctionTest/gMaximum));
|
||||
|
||||
theta = sqrt(rand)/initialTotalEnergy;
|
||||
theta = std::sqrt(rand)/initialTotalEnergy;
|
||||
|
||||
|
||||
return theta;
|
||||
@@ -124,7 +124,7 @@ G4double G4Generator2BS::RejectionFunction(G4double value) const
|
||||
|
||||
G4double argument = (1+value)*(1+value);
|
||||
|
||||
G4double gfunction = (4+log(rejection_argument3+(z/argument)))*
|
||||
G4double gfunction = (4+std::log(rejection_argument3+(z/argument)))*
|
||||
((4*EnergyRatio*value/argument)-rejection_argument1)+rejection_argument2;
|
||||
|
||||
return gfunction;
|
||||
|
||||
@@ -270,8 +270,8 @@ G4double G4IonChuFluctuationModel::ChuFluctuationModel(const G4Material* materia
|
||||
if( 0 > iz ) iz = 0 ;
|
||||
if(95 < iz ) iz = 95 ;
|
||||
|
||||
G4double q = 1.0 / (1.0 + a[iz][0]*pow(energy,a[iz][1])+
|
||||
+ a[iz][2]*pow(energy,a[iz][3])) ;
|
||||
G4double q = 1.0 / (1.0 + a[iz][0]*std::pow(energy,a[iz][1])+
|
||||
+ a[iz][2]*std::pow(energy,a[iz][3])) ;
|
||||
|
||||
return q ;
|
||||
}
|
||||
|
||||
@@ -179,10 +179,10 @@ G4double G4IonYangFluctuationModel::YangFluctuationModel(const G4Material* mater
|
||||
} else {
|
||||
G4double zeff = (material->GetElectronDensity())/
|
||||
(material->GetTotNbOfAtomsPerVolume()) ;
|
||||
factor = charge * pow(charge/zeff, 0.3333) ;
|
||||
factor = charge * std::pow(charge/zeff, 0.3333) ;
|
||||
|
||||
if( kStateGas == material->GetState() ) {
|
||||
energy /= (charge * sqrt(charge)) ;
|
||||
energy /= (charge * std::sqrt(charge)) ;
|
||||
|
||||
if(1 == (material->GetNumberOfElements())) {
|
||||
i = 2 ;
|
||||
@@ -191,12 +191,12 @@ G4double G4IonYangFluctuationModel::YangFluctuationModel(const G4Material* mater
|
||||
}
|
||||
|
||||
} else {
|
||||
energy /= (charge * sqrt(charge*zeff)) ;
|
||||
energy /= (charge * std::sqrt(charge*zeff)) ;
|
||||
i = 4 ;
|
||||
}
|
||||
}
|
||||
|
||||
G4double x = b[i][2] * (1.0 - exp( - energy * b[i][3] )) ;
|
||||
G4double x = b[i][2] * (1.0 - std::exp( - energy * b[i][3] )) ;
|
||||
|
||||
G4double q = factor * x * b[i][0] /
|
||||
((energy - b[i][1])*(energy - b[i][1]) + x*x) ;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LinInterpolation.cc,v 1.2 2002/05/28 09:20:19 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -58,9 +58,9 @@ G4double G4LinLogInterpolation::Calculate(G4double x, G4int bin,
|
||||
{
|
||||
G4double e1 = points[bin];
|
||||
G4double e2 = points[bin+1];
|
||||
G4double d1 = log(data[bin]);
|
||||
G4double d2 = log(data[bin+1]);
|
||||
value = exp(d1 + (d2 - d1)*(x - e1)/ (e2 - e1));
|
||||
G4double d1 = std::log(data[bin]);
|
||||
G4double d2 = std::log(data[bin+1]);
|
||||
value = std::exp(d1 + (d2 - d1)*(x - e1)/ (e2 - e1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -62,10 +62,10 @@ G4double G4LinLogLogInterpolation::Calculate(G4double x, G4int bin,
|
||||
G4double d1 = data[bin];
|
||||
G4double d2 = data[bin+1];
|
||||
if(d1 > 0.0 && d2 > 0.0) {
|
||||
value = (log10(d1)*log10(e2/x) + log10(d2)*log10(x/e1)) / log10(e2/e1);
|
||||
value = pow(10.,value);
|
||||
value = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
|
||||
value = std::pow(10.,value);
|
||||
} else {
|
||||
value = (d1*log10(e2/x) + d2*log10(x/e1)) / log10(e2/e1);
|
||||
value = (d1*std::log10(e2/x) + d2*std::log10(x/e1)) / std::log10(e2/e1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LogLogInterpolation.cc,v 1.5 2003/06/25 14:24:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4LogLogInterpolation.cc,v 1.6 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
@@ -64,8 +64,8 @@ G4double G4LogLogInterpolation::Calculate(G4double x, G4int bin,
|
||||
G4double e2 = points[bin+1];
|
||||
G4double d1 = data[bin];
|
||||
G4double d2 = data[bin+1];
|
||||
value = (log10(d1)*log10(e2/x) + log10(d2)*log10(x/e1)) / log10(e2/e1);
|
||||
value = pow(10.,value);
|
||||
value = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
|
||||
value = std::pow(10.,value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LowEnergyBremsstrahlung.cc,v 1.68 2004/01/08 17:04:52 silvarod Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4LowEnergyBremsstrahlung.cc,v 1.70 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
@@ -322,10 +322,10 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& track,
|
||||
}
|
||||
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
G4double dirZ = cos(theta);
|
||||
G4double sinTheta = sqrt(1. - dirZ*dirZ);
|
||||
G4double dirX = sinTheta*cos(phi);
|
||||
G4double dirY = sinTheta*sin(phi);
|
||||
G4double dirZ = std::cos(theta);
|
||||
G4double sinTheta = std::sqrt(1. - dirZ*dirZ);
|
||||
G4double dirX = sinTheta*std::cos(phi);
|
||||
G4double dirY = sinTheta*std::sin(phi);
|
||||
|
||||
G4ThreeVector gammaDirection (dirX, dirY, dirZ);
|
||||
G4ThreeVector electronDirection = track.GetMomentumDirection();
|
||||
@@ -341,16 +341,16 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& track,
|
||||
finalEnergy = 0.0;
|
||||
}
|
||||
|
||||
G4double momentum = sqrt((totalEnergy + electron_mass_c2)*kineticEnergy);
|
||||
G4double momentum = std::sqrt((totalEnergy + electron_mass_c2)*kineticEnergy);
|
||||
|
||||
G4double finalX = momentum*electronDirection.x() - tGamma*gammaDirection.x();
|
||||
G4double finalY = momentum*electronDirection.y() - tGamma*gammaDirection.y();
|
||||
G4double finalZ = momentum*electronDirection.z() - tGamma*gammaDirection.z();
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
G4double norm = 1./sqrt(finalX*finalX + finalY*finalY + finalZ*finalZ);
|
||||
aParticleChange.SetMomentumChange(finalX*norm, finalY*norm, finalZ*norm);
|
||||
aParticleChange.SetEnergyChange( finalEnergy );
|
||||
G4double norm = 1./std::sqrt(finalX*finalX + finalY*finalY + finalZ*finalZ);
|
||||
aParticleChange.ProposeMomentumDirection(finalX*norm, finalY*norm, finalZ*norm);
|
||||
aParticleChange.ProposeEnergy( finalEnergy );
|
||||
|
||||
// create G4DynamicParticle object for the gamma
|
||||
G4DynamicParticle* aGamma= new G4DynamicParticle (G4Gamma::Gamma(),
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LowEnergyCompton.cc,v 1.37 2003/05/20 20:16:13 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4LowEnergyCompton.cc,v 1.39 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Author: A. Forti
|
||||
// Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
@@ -141,9 +141,9 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
if (photonEnergy0 <= lowEnergyLimit)
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit(photonEnergy0);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(photonEnergy0);
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
G4double epsilon0 = 1. / (1. + 2. * e0m);
|
||||
G4double epsilon0Sq = epsilon0 * epsilon0;
|
||||
G4double alpha1 = -log(epsilon0);
|
||||
G4double alpha1 = -std::log(epsilon0);
|
||||
G4double alpha2 = 0.5 * (1. - epsilon0Sq);
|
||||
|
||||
G4double wlPhoton = h_Planck*c_light/photonEnergy0;
|
||||
@@ -171,45 +171,45 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
{
|
||||
if ( alpha1/(alpha1+alpha2) > G4UniformRand())
|
||||
{
|
||||
epsilon = exp(-alpha1 * G4UniformRand()); // pow(epsilon0,G4UniformRand())
|
||||
epsilon = std::exp(-alpha1 * G4UniformRand()); // std::pow(epsilon0,G4UniformRand())
|
||||
epsilonSq = epsilon * epsilon;
|
||||
}
|
||||
else
|
||||
{
|
||||
epsilonSq = epsilon0Sq + (1. - epsilon0Sq) * G4UniformRand();
|
||||
epsilon = sqrt(epsilonSq);
|
||||
epsilon = std::sqrt(epsilonSq);
|
||||
}
|
||||
|
||||
oneCosT = (1. - epsilon) / ( epsilon * e0m);
|
||||
sinT2 = oneCosT * (2. - oneCosT);
|
||||
G4double x = sqrt(oneCosT/2.) / (wlPhoton/cm);
|
||||
G4double x = std::sqrt(oneCosT/2.) / (wlPhoton/cm);
|
||||
G4double scatteringFunction = scatterFunctionData->FindValue(x,Z-1);
|
||||
gReject = (1. - epsilon * sinT2 / (1. + epsilonSq)) * scatteringFunction;
|
||||
|
||||
} while(gReject < G4UniformRand()*Z);
|
||||
|
||||
G4double cosTheta = 1. - oneCosT;
|
||||
G4double sinTheta = sqrt (sinT2);
|
||||
G4double sinTheta = std::sqrt (sinT2);
|
||||
G4double phi = twopi * G4UniformRand() ;
|
||||
G4double dirx = sinTheta * cos(phi);
|
||||
G4double diry = sinTheta * sin(phi);
|
||||
G4double dirx = sinTheta * std::cos(phi);
|
||||
G4double diry = sinTheta * std::sin(phi);
|
||||
G4double dirz = cosTheta ;
|
||||
|
||||
// Update G4VParticleChange for the scattered photon
|
||||
|
||||
G4ThreeVector photonDirection1(dirx,diry,dirz);
|
||||
photonDirection1.rotateUz(photonDirection0);
|
||||
aParticleChange.SetMomentumChange(photonDirection1) ;
|
||||
aParticleChange.ProposeMomentumDirection(photonDirection1) ;
|
||||
G4double photonEnergy1 = epsilon * photonEnergy0;
|
||||
|
||||
if (photonEnergy1 > 0.)
|
||||
{
|
||||
aParticleChange.SetEnergyChange(photonEnergy1) ;
|
||||
aParticleChange.ProposeEnergy(photonEnergy1) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetEnergyChange(0.) ;
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
|
||||
// Kinematics of the scattered electron
|
||||
@@ -221,19 +221,19 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety))
|
||||
{
|
||||
G4double eMomentum = sqrt(eKineticEnergy*(eKineticEnergy+2.*electron_mass_c2));
|
||||
G4double eMomentum = std::sqrt(eKineticEnergy*(eKineticEnergy+2.*electron_mass_c2));
|
||||
G4ThreeVector eDirection((photonEnergy0 * photonDirection0 -
|
||||
photonEnergy1 * photonDirection1) * (1./eMomentum));
|
||||
G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),
|
||||
eDirection,eKineticEnergy) ;
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
aParticleChange.AddSecondary(electron);
|
||||
aParticleChange.SetLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetNumberOfSecondaries(0);
|
||||
aParticleChange.SetLocalEnergyDeposit(eKineticEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(eKineticEnergy);
|
||||
}
|
||||
|
||||
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep);
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
///
|
||||
// $Id: G4LowEnergyGammaConversion.cc,v 1.32 2003/06/16 17:00:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4LowEnergyGammaConversion.cc,v 1.34 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -170,11 +170,11 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
|
||||
|
||||
// Limits of the screening variable
|
||||
G4double screenFactor = 136. * epsilon0 / (element->GetIonisation()->GetZ3()) ;
|
||||
G4double screenMax = exp ((42.24 - fZ)/8.368) - 0.952 ;
|
||||
G4double screenMax = std::exp ((42.24 - fZ)/8.368) - 0.952 ;
|
||||
G4double screenMin = std::min(4.*screenFactor,screenMax) ;
|
||||
|
||||
// Limits of the energy sampling
|
||||
G4double epsilon1 = 0.5 - 0.5 * sqrt(1. - screenMin / screenMax) ;
|
||||
G4double epsilon1 = 0.5 - 0.5 * std::sqrt(1. - screenMin / screenMax) ;
|
||||
G4double epsilonMin = std::max(epsilon0,epsilon1);
|
||||
G4double epsilonRange = 0.5 - epsilonMin ;
|
||||
|
||||
@@ -190,7 +190,7 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
|
||||
do {
|
||||
if (normF1 / (normF1 + normF2) > G4UniformRand() )
|
||||
{
|
||||
epsilon = 0.5 - epsilonRange * pow(G4UniformRand(), 0.3333) ;
|
||||
epsilon = 0.5 - epsilonRange * std::pow(G4UniformRand(), 0.3333) ;
|
||||
screen = screenFactor / (epsilon * (1. - epsilon));
|
||||
gReject = (ScreenFunction1(screen) - fZ) / f10 ;
|
||||
}
|
||||
@@ -232,19 +232,19 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
|
||||
// if (9. / (9. + d) > G4UniformRand())
|
||||
if (0.25 > G4UniformRand())
|
||||
{
|
||||
u = - log(G4UniformRand() * G4UniformRand()) / a1 ;
|
||||
u = - std::log(G4UniformRand() * G4UniformRand()) / a1 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
u = - log(G4UniformRand() * G4UniformRand()) / a2 ;
|
||||
u = - std::log(G4UniformRand() * G4UniformRand()) / a2 ;
|
||||
}
|
||||
|
||||
G4double thetaEle = u*electron_mass_c2/electronTotEnergy;
|
||||
G4double thetaPos = u*electron_mass_c2/positronTotEnergy;
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
|
||||
G4double dxEle= sin(thetaEle)*cos(phi),dyEle= sin(thetaEle)*sin(phi),dzEle=cos(thetaEle);
|
||||
G4double dxPos=-sin(thetaPos)*cos(phi),dyPos=-sin(thetaPos)*sin(phi),dzPos=cos(thetaPos);
|
||||
G4double dxEle= std::sin(thetaEle)*std::cos(phi),dyEle= std::sin(thetaEle)*std::sin(phi),dzEle=std::cos(thetaEle);
|
||||
G4double dxPos=-std::sin(thetaPos)*std::cos(phi),dyPos=-std::sin(thetaPos)*std::sin(phi),dzPos=std::cos(thetaPos);
|
||||
|
||||
|
||||
// Kinematics of the created pair:
|
||||
@@ -293,12 +293,12 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
|
||||
positronDirection, positronKineEnergy);
|
||||
aParticleChange.AddSecondary(particle2) ;
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(localEnergyDeposit) ;
|
||||
aParticleChange.ProposeLocalEnergyDeposit(localEnergyDeposit) ;
|
||||
|
||||
// Kill the incident photon
|
||||
aParticleChange.SetMomentumChange(0.,0.,0.) ;
|
||||
aParticleChange.SetEnergyChange(0.) ;
|
||||
aParticleChange.SetStatusChange(fStopAndKill) ;
|
||||
aParticleChange.ProposeMomentumDirection(0.,0.,0.) ;
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill) ;
|
||||
|
||||
// Reset NbOfInteractionLengthLeft and return aParticleChange
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
@@ -332,7 +332,7 @@ G4double G4LowEnergyGammaConversion::ScreenFunction1(G4double screenVariable)
|
||||
G4double value;
|
||||
|
||||
if (screenVariable > 1.)
|
||||
value = 42.24 - 8.368 * log(screenVariable + 0.952);
|
||||
value = 42.24 - 8.368 * std::log(screenVariable + 0.952);
|
||||
else
|
||||
value = 42.392 - screenVariable * (7.796 - 1.961 * screenVariable);
|
||||
|
||||
@@ -346,7 +346,7 @@ G4double G4LowEnergyGammaConversion::ScreenFunction2(G4double screenVariable)
|
||||
G4double value;
|
||||
|
||||
if (screenVariable > 1.)
|
||||
value = 42.24 - 8.368 * log(screenVariable + 0.952);
|
||||
value = 42.24 - 8.368 * std::log(screenVariable + 0.952);
|
||||
else
|
||||
value = 41.405 - screenVariable * (5.828 - 0.8945 * screenVariable);
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LowEnergyIonisation.cc,v 1.95 2003/06/16 17:00:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4LowEnergyIonisation.cc,v 1.101 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
@@ -95,6 +95,7 @@
|
||||
// 21.01.03 VI Cut per region
|
||||
// 12.02.03 VI Change signature for Deexcitation
|
||||
// 12.04.03 V.Ivanchenko Cut per region for fluo AlongStep
|
||||
// 31.08.04 V.Ivanchenko Add density correction
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -276,7 +277,6 @@ void G4LowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& )
|
||||
G4double tCut = (*(theCoupleTable->GetEnergyCutsVector(1)))[m];
|
||||
if(tCut > highKineticEnergy) tCut = highKineticEnergy;
|
||||
cutForDelta.push_back(tCut);
|
||||
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
size_t NumberOfElements = material->GetNumberOfElements() ;
|
||||
const G4double* theAtomicNumDensityVector =
|
||||
@@ -306,6 +306,7 @@ void G4LowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& )
|
||||
lowEdgeEnergy, n);
|
||||
G4double cs= crossSectionHandler->FindValue(Z, lowEdgeEnergy, n);
|
||||
ionloss += e * cs * theAtomicNumDensityVector[iel];
|
||||
|
||||
if(verboseLevel > 1 || (Z == 14 && lowEdgeEnergy>1. && lowEdgeEnergy<0.)) {
|
||||
G4cout << "Z= " << Z
|
||||
<< " shell= " << n
|
||||
@@ -319,6 +320,7 @@ void G4LowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& )
|
||||
}
|
||||
G4double esp = energySpectrum->Excitation(Z, lowEdgeEnergy);
|
||||
ionloss += esp * theAtomicNumDensityVector[iel];
|
||||
|
||||
}
|
||||
if(verboseLevel > 1 || (m == 0 && lowEdgeEnergy>=1. && lowEdgeEnergy<=0.)) {
|
||||
G4cout << "Sum: "
|
||||
@@ -434,17 +436,17 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt(const G4Track& track,
|
||||
G4double primaryKinE = kineticEnergy + 2.0*bindingEnergy;
|
||||
|
||||
// sampling of scattering angle neglecting atomic motion
|
||||
G4double deltaMom = sqrt(deltaKinE*(deltaKinE + 2.0*electron_mass_c2));
|
||||
G4double primaryMom = sqrt(primaryKinE*(primaryKinE + 2.0*electron_mass_c2));
|
||||
G4double deltaMom = std::sqrt(deltaKinE*(deltaKinE + 2.0*electron_mass_c2));
|
||||
G4double primaryMom = std::sqrt(primaryKinE*(primaryKinE + 2.0*electron_mass_c2));
|
||||
|
||||
G4double cost = deltaKinE * (primaryKinE + 2.0*electron_mass_c2)
|
||||
/ (deltaMom * primaryMom);
|
||||
|
||||
if (cost > 1.) cost = 1.;
|
||||
G4double sint = sqrt(1. - cost*cost);
|
||||
G4double sint = std::sqrt(1. - cost*cost);
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
G4double dirx = sint * cos(phi);
|
||||
G4double diry = sint * sin(phi);
|
||||
G4double dirx = sint * std::cos(phi);
|
||||
G4double diry = sint * std::sin(phi);
|
||||
G4double dirz = cost;
|
||||
|
||||
// Rotate to incident electron direction
|
||||
@@ -460,12 +462,12 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt(const G4Track& track,
|
||||
// kinetic energy of the motion == bindingEnergy in V.Ivanchenko model
|
||||
|
||||
cost = 2.0*G4UniformRand() - 1.0;
|
||||
sint = sqrt(1. - cost*cost);
|
||||
sint = std::sqrt(1. - cost*cost);
|
||||
phi = twopi * G4UniformRand();
|
||||
G4double del = sqrt(bindingEnergy *(bindingEnergy + 2.0*electron_mass_c2))
|
||||
G4double del = std::sqrt(bindingEnergy *(bindingEnergy + 2.0*electron_mass_c2))
|
||||
/ deltaMom;
|
||||
dirx += del* sint * cos(phi);
|
||||
diry += del* sint * sin(phi);
|
||||
dirx += del* sint * std::cos(phi);
|
||||
diry += del* sint * std::sin(phi);
|
||||
dirz += del* cost;
|
||||
|
||||
// Find out new primary electron direction
|
||||
@@ -476,7 +478,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt(const G4Track& track,
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* theDeltaRay = new G4DynamicParticle();
|
||||
theDeltaRay->SetKineticEnergy(tDelta);
|
||||
G4double norm = 1.0/sqrt(dirx*dirx + diry*diry + dirz*dirz);
|
||||
G4double norm = 1.0/std::sqrt(dirx*dirx + diry*diry + dirz*dirz);
|
||||
dirx *= norm;
|
||||
diry *= norm;
|
||||
dirz *= norm;
|
||||
@@ -492,18 +494,18 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt(const G4Track& track,
|
||||
if(finalKinEnergy < 0.0) {
|
||||
theEnergyDeposit += finalKinEnergy;
|
||||
finalKinEnergy = 0.0;
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
|
||||
} else {
|
||||
|
||||
G4double norm = 1.0/sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz);
|
||||
G4double norm = 1.0/std::sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz);
|
||||
finalPx *= norm;
|
||||
finalPy *= norm;
|
||||
finalPz *= norm;
|
||||
aParticleChange.SetMomentumChange(finalPx, finalPy, finalPz);
|
||||
aParticleChange.ProposeMomentumDirection(finalPx, finalPy, finalPz);
|
||||
}
|
||||
|
||||
aParticleChange.SetEnergyChange(finalKinEnergy);
|
||||
aParticleChange.ProposeEnergy(finalKinEnergy);
|
||||
|
||||
// Generation of Fluorescence and Auger
|
||||
size_t nSecondaries = 0;
|
||||
@@ -572,7 +574,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt(const G4Track& track,
|
||||
<< theEnergyDeposit/eV << " eV" << G4endl;
|
||||
theEnergyDeposit = 0.0;
|
||||
}
|
||||
aParticleChange.SetLocalEnergyDeposit(theEnergyDeposit);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(theEnergyDeposit);
|
||||
|
||||
return G4VContinuousDiscreteProcess::PostStepDoIt(track, step);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LowEnergyPhotoElectric.cc,v 1.51 2003/06/16 17:00:15 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4LowEnergyPhotoElectric.cc,v 1.53 2004/11/18 12:08:52 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: A. Forti
|
||||
// Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
@@ -56,11 +56,16 @@
|
||||
// 31.05.2002 V.Ivanchenko Add path of Fluo + Auger cuts to AtomicDeexcitation
|
||||
// 14.06.2002 V.Ivanchenko By default do not cheak range of e-
|
||||
// 21.01.2003 V.Ivanchenko Cut per region
|
||||
// 10.05.2004 P.Rodrigues Changes to accommodate new angular generators
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4LowEnergyPhotoElectric.hh"
|
||||
|
||||
#include "G4VPhotoElectricAngularDistribution.hh"
|
||||
#include "G4PhotoElectricAngularGenerator462.hh"
|
||||
#include "G4PhotoElectricAngularGeneratorStandard.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
@@ -99,6 +104,9 @@ G4LowEnergyPhotoElectric::G4LowEnergyPhotoElectric(const G4String& processName)
|
||||
shellCrossSectionHandler = new G4CrossSectionHandler();
|
||||
meanFreePathTable = 0;
|
||||
rangeTest = new G4RangeNoTest;
|
||||
generatorName = "geant4.6.2";
|
||||
ElectronAngularGenerator = new G4PhotoElectricAngularGenerator462("GEANT462Generator"); // default generator
|
||||
|
||||
|
||||
if (verboseLevel > 0)
|
||||
{
|
||||
@@ -116,6 +124,7 @@ G4LowEnergyPhotoElectric::~G4LowEnergyPhotoElectric()
|
||||
delete shellCrossSectionHandler;
|
||||
delete meanFreePathTable;
|
||||
delete rangeTest;
|
||||
delete ElectronAngularGenerator;
|
||||
}
|
||||
|
||||
void G4LowEnergyPhotoElectric::BuildPhysicsTable(const G4ParticleDefinition& )
|
||||
@@ -147,9 +156,9 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
|
||||
G4double photonEnergy = incidentPhoton->GetKineticEnergy();
|
||||
if (photonEnergy <= lowEnergyLimit)
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit(photonEnergy);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(photonEnergy);
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
}
|
||||
|
||||
@@ -187,9 +196,13 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety))
|
||||
{
|
||||
// The electron is created in the direction of the incident photon ...
|
||||
|
||||
// Calculate direction of the photoelectron
|
||||
G4ThreeVector electronDirection = ElectronAngularGenerator->GetPhotoElectronDirection(photonDirection,eKineticEnergy);
|
||||
|
||||
// The electron is created ...
|
||||
G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),
|
||||
photonDirection,
|
||||
electronDirection,
|
||||
eKineticEnergy);
|
||||
electronVector.push_back(electron);
|
||||
}
|
||||
@@ -284,11 +297,11 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
|
||||
}
|
||||
|
||||
// Kill the incident photon
|
||||
aParticleChange.SetMomentumChange( 0., 0., 0. );
|
||||
aParticleChange.SetEnergyChange( 0. );
|
||||
aParticleChange.ProposeMomentumDirection( 0., 0., 0. );
|
||||
aParticleChange.ProposeEnergy( 0. );
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(energyDeposit);
|
||||
aParticleChange.SetStatusChange( fStopAndKill );
|
||||
aParticleChange.ProposeLocalEnergyDeposit(energyDeposit);
|
||||
aParticleChange.ProposeTrackStatus( fStopAndKill );
|
||||
|
||||
// Reset NbOfInteractionLengthLeft and return aParticleChange
|
||||
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep );
|
||||
@@ -337,3 +350,31 @@ void G4LowEnergyPhotoElectric::ActivateAuger(G4bool val)
|
||||
{
|
||||
deexcitationManager.ActivateAugerElectronProduction(val);
|
||||
}
|
||||
|
||||
void G4LowEnergyPhotoElectric::SetAngularGenerator(G4VPhotoElectricAngularDistribution* distribution)
|
||||
{
|
||||
ElectronAngularGenerator = distribution;
|
||||
ElectronAngularGenerator->PrintGeneratorInformation();
|
||||
}
|
||||
|
||||
void G4LowEnergyPhotoElectric::SetAngularGenerator(const G4String& name)
|
||||
{
|
||||
if (name == "default")
|
||||
{
|
||||
delete ElectronAngularGenerator;
|
||||
ElectronAngularGenerator = new G4PhotoElectricAngularGenerator462("GEANT462Generator");
|
||||
generatorName = name;
|
||||
}
|
||||
else if (name == "standard")
|
||||
{
|
||||
delete ElectronAngularGenerator;
|
||||
ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorStandard("GEANT4StandardEMPhysics");
|
||||
generatorName = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("G4LowEnergyPhotoElectric::SetAngularGenerator - generator does not exist");
|
||||
}
|
||||
|
||||
ElectronAngularGenerator->PrintGeneratorInformation();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LowEnergyPolarizedCompton.cc,v 1.17 2003/11/18 16:39:21 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4LowEnergyPolarizedCompton.cc,v 1.19 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -185,9 +185,9 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
|
||||
if(gammaEnergy0 <= lowEnergyLimit)
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit(gammaEnergy0);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(gammaEnergy0);
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
|
||||
G4double epsilon0 = 1./(1. + 2*E0_m);
|
||||
G4double epsilon0Sq = epsilon0*epsilon0;
|
||||
G4double alpha1 = - log(epsilon0);
|
||||
G4double alpha1 = - std::log(epsilon0);
|
||||
G4double alpha2 = 0.5*(1.- epsilon0Sq);
|
||||
|
||||
G4double wlGamma = h_Planck*c_light/gammaEnergy0;
|
||||
@@ -214,13 +214,13 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
do {
|
||||
if ( alpha1/(alpha1+alpha2) > G4UniformRand() )
|
||||
{
|
||||
epsilon = exp(-alpha1*G4UniformRand());
|
||||
epsilon = std::exp(-alpha1*G4UniformRand());
|
||||
epsilonSq = epsilon*epsilon;
|
||||
}
|
||||
else
|
||||
{
|
||||
epsilonSq = epsilon0Sq + (1.- epsilon0Sq)*G4UniformRand();
|
||||
epsilon = sqrt(epsilonSq);
|
||||
epsilon = std::sqrt(epsilonSq);
|
||||
}
|
||||
|
||||
onecost = (1.- epsilon)/(epsilon*E0_m);
|
||||
@@ -249,7 +249,7 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
}
|
||||
// End protection
|
||||
|
||||
G4double x = sqrt(onecost/2.) / (wlGamma/cm);;
|
||||
G4double x = std::sqrt(onecost/2.) / (wlGamma/cm);;
|
||||
G4double scatteringFunction = scatterFunctionData->FindValue(x,Z-1);
|
||||
greject = (1. - epsilon*sinThetaSqr/(1.+ epsilonSq))*scatteringFunction;
|
||||
|
||||
@@ -293,7 +293,7 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
// End protection
|
||||
|
||||
|
||||
G4double sinTheta = sqrt (sinThetaSqr);
|
||||
G4double sinTheta = std::sqrt (sinThetaSqr);
|
||||
|
||||
// Protection
|
||||
if (sinTheta > 1.)
|
||||
@@ -319,8 +319,8 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
// End protection
|
||||
|
||||
|
||||
G4double dirx = sinTheta*cos(phi);
|
||||
G4double diry = sinTheta*sin(phi);
|
||||
G4double dirx = sinTheta*std::cos(phi);
|
||||
G4double diry = sinTheta*std::sin(phi);
|
||||
G4double dirz = cosTheta ;
|
||||
|
||||
//
|
||||
@@ -347,14 +347,14 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
|
||||
if (gammaEnergy1 > 0.)
|
||||
{
|
||||
aParticleChange.SetEnergyChange( gammaEnergy1 ) ;
|
||||
aParticleChange.SetMomentumChange( gammaDirection1 );
|
||||
aParticleChange.SetPolarizationChange( gammaPolarization1 );
|
||||
aParticleChange.ProposeEnergy( gammaEnergy1 ) ;
|
||||
aParticleChange.ProposeMomentumDirection( gammaDirection1 );
|
||||
aParticleChange.ProposePolarization( gammaPolarization1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetEnergyChange(0.) ;
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -369,18 +369,18 @@ G4VParticleChange* G4LowEnergyPolarizedCompton::PostStepDoIt(const G4Track& aTra
|
||||
|
||||
if (rangeTest->Escape(G4Electron::Electron(),couple,ElecKineEnergy,safety))
|
||||
{
|
||||
G4double ElecMomentum = sqrt(ElecKineEnergy*(ElecKineEnergy+2.*electron_mass_c2));
|
||||
G4double ElecMomentum = std::sqrt(ElecKineEnergy*(ElecKineEnergy+2.*electron_mass_c2));
|
||||
G4ThreeVector ElecDirection((gammaEnergy0 * gammaDirection0 -
|
||||
gammaEnergy1 * gammaDirection1) * (1./ElecMomentum));
|
||||
G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),ElecDirection.unit(),ElecKineEnergy) ;
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
aParticleChange.AddSecondary(electron);
|
||||
aParticleChange.SetLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetNumberOfSecondaries(0);
|
||||
aParticleChange.SetLocalEnergyDeposit(ElecKineEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(ElecKineEnergy);
|
||||
}
|
||||
|
||||
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep);
|
||||
@@ -407,7 +407,7 @@ G4double G4LowEnergyPolarizedCompton::SetPhi(G4double energyRate,
|
||||
a = 2*sinSqrTh;
|
||||
b = energyRate + 1/energyRate;
|
||||
|
||||
phiProbability = 1 - (a/b)*(cos(phi)*cos(phi));
|
||||
phiProbability = 1 - (a/b)*(std::cos(phi)*std::cos(phi));
|
||||
|
||||
|
||||
|
||||
@@ -445,9 +445,9 @@ G4ThreeVector G4LowEnergyPolarizedCompton::GetRandomPolarization(G4ThreeVector&
|
||||
|
||||
G4ThreeVector c;
|
||||
|
||||
c.setX(cos(angle)*(a0.x())+sin(angle)*b0.x());
|
||||
c.setY(cos(angle)*(a0.y())+sin(angle)*b0.y());
|
||||
c.setZ(cos(angle)*(a0.z())+sin(angle)*b0.z());
|
||||
c.setX(std::cos(angle)*(a0.x())+std::sin(angle)*b0.x());
|
||||
c.setY(std::cos(angle)*(a0.y())+std::sin(angle)*b0.y());
|
||||
c.setZ(std::cos(angle)*(a0.z())+std::sin(angle)*b0.z());
|
||||
|
||||
G4ThreeVector c0 = c.unit();
|
||||
|
||||
@@ -481,13 +481,13 @@ G4ThreeVector G4LowEnergyPolarizedCompton::SetNewPolarization(G4double epsilon,
|
||||
{
|
||||
G4double rand1;
|
||||
G4double rand2;
|
||||
G4double cosPhi = cos(phi);
|
||||
G4double sinPhi = sin(phi);
|
||||
G4double sinTheta = sqrt(sinSqrTh);
|
||||
G4double cosPhi = std::cos(phi);
|
||||
G4double sinPhi = std::sin(phi);
|
||||
G4double sinTheta = std::sqrt(sinSqrTh);
|
||||
G4double cosSqrPhi = cosPhi*cosPhi;
|
||||
// G4double cossqrth = 1.-sinSqrTh;
|
||||
// G4double sinsqrphi = sinPhi*sinPhi;
|
||||
G4double normalisation = sqrt(1. - cosSqrPhi*sinSqrTh);
|
||||
G4double normalisation = std::sqrt(1. - cosSqrPhi*sinSqrTh);
|
||||
|
||||
|
||||
// Determination of Theta
|
||||
@@ -505,13 +505,13 @@ G4ThreeVector G4LowEnergyPolarizedCompton::SetNewPolarization(G4double epsilon,
|
||||
theta = twopi*rand1;
|
||||
a = 4*normalisation*normalisation;
|
||||
b = (epsilon + 1/epsilon) - 2;
|
||||
thetaProbability = (b + a*cos(theta)*cos(theta))/(a+b);
|
||||
cosTheta = cos(theta);
|
||||
thetaProbability = (b + a*std::cos(theta)*std::cos(theta))/(a+b);
|
||||
cosTheta = std::cos(theta);
|
||||
}
|
||||
while ( rand2 > thetaProbability );
|
||||
|
||||
G4double cosBeta = cosTheta;
|
||||
G4double sinBeta = sqrt(1-cosBeta*cosBeta);
|
||||
G4double sinBeta = std::sqrt(1-cosBeta*cosBeta);
|
||||
|
||||
G4ThreeVector gammaPolarization1;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
//
|
||||
// $Id: G4LowEnergyRayleigh.cc,v 1.33 2003/05/20 20:16:13 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4LowEnergyRayleigh.cc,v 1.35 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Author: A. Forti
|
||||
// Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
@@ -125,9 +125,9 @@ G4VParticleChange* G4LowEnergyRayleigh::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
if (photonEnergy0 <= lowEnergyLimit)
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit(photonEnergy0);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(photonEnergy0);
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
}
|
||||
|
||||
@@ -156,30 +156,30 @@ G4VParticleChange* G4LowEnergyRayleigh::PostStepDoIt(const G4Track& aTrack,
|
||||
fcostheta = ( 1. + cosTheta*cosTheta)/2.;
|
||||
} while (fcostheta < G4UniformRand());
|
||||
|
||||
G4double sinThetaHalf = sqrt((1. - cosTheta) / 2.);
|
||||
G4double sinThetaHalf = std::sqrt((1. - cosTheta) / 2.);
|
||||
x = sinThetaHalf / (wlPhoton/cm);
|
||||
if (x > 1.e+005)
|
||||
dataFormFactor = formFactorData->FindValue(x,Z-1);
|
||||
else
|
||||
dataFormFactor = formFactorData->FindValue(0.,Z-1);
|
||||
randomFormFactor = G4UniformRand() * Z * Z;
|
||||
sinTheta = sqrt(1. - cosTheta*cosTheta);
|
||||
sinTheta = std::sqrt(1. - cosTheta*cosTheta);
|
||||
gReject = dataFormFactor * dataFormFactor;
|
||||
|
||||
} while( gReject < randomFormFactor);
|
||||
|
||||
// Scattered photon angles. ( Z - axis along the parent photon)
|
||||
G4double phi = twopi * G4UniformRand() ;
|
||||
G4double dirX = sinTheta*cos(phi);
|
||||
G4double dirY = sinTheta*sin(phi);
|
||||
G4double dirX = sinTheta*std::cos(phi);
|
||||
G4double dirY = sinTheta*std::sin(phi);
|
||||
G4double dirZ = cosTheta;
|
||||
|
||||
// Update G4VParticleChange for the scattered photon
|
||||
G4ThreeVector photonDirection1(dirX, dirY, dirZ);
|
||||
|
||||
photonDirection1.rotateUz(photonDirection0);
|
||||
aParticleChange.SetEnergyChange(photonEnergy0);
|
||||
aParticleChange.SetMomentumChange(photonDirection1);
|
||||
aParticleChange.ProposeEnergy(photonEnergy0);
|
||||
aParticleChange.ProposeMomentumDirection(photonDirection1);
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(0);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ G4double G4ModifiedTsai::PolarAngle(const G4double initial_energy,
|
||||
G4double u, theta = 0;
|
||||
|
||||
do{
|
||||
u = - log(G4UniformRand()*G4UniformRand());
|
||||
u = - std::log(G4UniformRand()*G4UniformRand());
|
||||
|
||||
if (9./(9.+d) > G4UniformRand()) u /= a1;
|
||||
else u /= a2;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
// History:
|
||||
// --------
|
||||
// 02 Jul 2003 L.Pandola First implementation
|
||||
// 16 Mar 2004 L.Pandola Removed unnecessary calls to pow(a,b)
|
||||
// 16 Mar 2004 L.Pandola Removed unnecessary calls to std::pow(a,b)
|
||||
|
||||
#include "G4PenelopeAnnihilation.hh"
|
||||
#include "Randomize.hh"
|
||||
@@ -129,9 +129,9 @@ G4double G4PenelopeAnnihilation::calculateCrossSectionPerElectron
|
||||
G4double gamma = 1.0+std::max(ene,1.0*eV)/electron_mass_c2;
|
||||
G4double gamma2 = gamma*gamma;
|
||||
G4double f2 = gamma2-1.0;
|
||||
G4double f1 = sqrt(f2);
|
||||
G4double f1 = std::sqrt(f2);
|
||||
G4double pielr2 = pi*classic_electr_radius*classic_electr_radius;
|
||||
crossSection = pielr2*((gamma2+4.0*gamma+1.0)*log(gamma+f1)/f2
|
||||
crossSection = pielr2*((gamma2+4.0*gamma+1.0)*std::log(gamma+f1)/f2
|
||||
- (gamma+3.0)/f1)/(gamma+1.0);
|
||||
return crossSection;
|
||||
}
|
||||
@@ -154,14 +154,14 @@ G4VParticleChange* G4PenelopeAnnihilation::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
//Annihilation in flight
|
||||
G4double gamma = 1.0 + std::max(kineticEnergy,1.0*eV)/electron_mass_c2;
|
||||
G4double gamma21 = sqrt(gamma*gamma-1);
|
||||
G4double gamma21 = std::sqrt(gamma*gamma-1);
|
||||
G4double ani = 1.0+gamma;
|
||||
G4double chimin = 1.0/(ani+gamma21);
|
||||
G4double rchi = (1.0-chimin)/chimin;
|
||||
G4double gt0 = ani*ani-2.0;
|
||||
G4double epsilon=0.0, reject=0.0, test=0.0;
|
||||
do{
|
||||
epsilon = chimin*pow(rchi,G4UniformRand());
|
||||
epsilon = chimin*std::pow(rchi,G4UniformRand());
|
||||
reject = ani*ani*(1.0-epsilon)+2.0*gamma-(1.0/epsilon);
|
||||
test = G4UniformRand()*gt0-reject;
|
||||
}while(test>0);
|
||||
@@ -175,16 +175,16 @@ G4VParticleChange* G4PenelopeAnnihilation::PostStepDoIt(const G4Track& aTrack,
|
||||
aParticleChange.SetNumberOfSecondaries(2);
|
||||
G4double localEnergyDeposit = 0.;
|
||||
|
||||
G4double sinTheta1 = sqrt(1.-cosTheta1*cosTheta1);
|
||||
G4double sinTheta1 = std::sqrt(1.-cosTheta1*cosTheta1);
|
||||
G4double phi1 = twopi * G4UniformRand();
|
||||
G4double dirx1 = sinTheta1 * cos(phi1);
|
||||
G4double diry1 = sinTheta1 * sin(phi1);
|
||||
G4double dirx1 = sinTheta1 * std::cos(phi1);
|
||||
G4double diry1 = sinTheta1 * std::sin(phi1);
|
||||
G4double dirz1 = cosTheta1;
|
||||
|
||||
G4double sinTheta2 = sqrt(1.-cosTheta2*cosTheta2);
|
||||
G4double sinTheta2 = std::sqrt(1.-cosTheta2*cosTheta2);
|
||||
G4double phi2 = phi1+pi;
|
||||
G4double dirx2 = sinTheta2 * cos(phi2);
|
||||
G4double diry2 = sinTheta2 * sin(phi2);
|
||||
G4double dirx2 = sinTheta2 * std::cos(phi2);
|
||||
G4double diry2 = sinTheta2 * std::sin(phi2);
|
||||
G4double dirz2 = cosTheta2;
|
||||
|
||||
if (photon1Energy > cutForLowEnergySecondaryPhotons) {
|
||||
@@ -209,11 +209,11 @@ G4VParticleChange* G4PenelopeAnnihilation::PostStepDoIt(const G4Track& aTrack,
|
||||
}
|
||||
else localEnergyDeposit += photon2Energy;
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(localEnergyDeposit);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(localEnergyDeposit);
|
||||
|
||||
aParticleChange.SetMomentumChange( 0., 0., 0. );
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeMomentumDirection( 0., 0., 0. );
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
|
||||
return &aParticleChange;
|
||||
}
|
||||
@@ -225,21 +225,21 @@ G4VParticleChange* G4PenelopeAnnihilation::AtRestDoIt(const G4Track& aTrack,
|
||||
aParticleChange.Initialize(aTrack);
|
||||
aParticleChange.SetNumberOfSecondaries(2);
|
||||
G4double cosTheta = -1.0+2.0*G4UniformRand();
|
||||
G4double sinTheta = sqrt(1.0-cosTheta*cosTheta);
|
||||
G4double sinTheta = std::sqrt(1.0-cosTheta*cosTheta);
|
||||
G4double phi = twopi*G4UniformRand();
|
||||
//G4cout << "cosTheta: " << cosTheta << " sinTheta: " << sinTheta << G4endl;
|
||||
//G4cout << "phi: " << phi << G4endl;
|
||||
G4ThreeVector direction (sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);
|
||||
G4ThreeVector direction (sinTheta*std::cos(phi),sinTheta*std::sin(phi),cosTheta);
|
||||
aParticleChange.AddSecondary(new G4DynamicParticle (G4Gamma::Gamma(),
|
||||
direction, electron_mass_c2) );
|
||||
aParticleChange.AddSecondary(new G4DynamicParticle (G4Gamma::Gamma(),
|
||||
-direction, electron_mass_c2) );
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
|
||||
// Kill the incident positron
|
||||
//
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PenelopeBremsstrahlung.cc,v 1.15 2004/06/01 15:07:10 pandola Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// $Id: G4PenelopeBremsstrahlung.cc,v 1.17 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
@@ -329,9 +329,9 @@ G4VParticleChange* G4PenelopeBremsstrahlung::PostStepDoIt(const G4Track& track,
|
||||
G4double dirZ = angularData->find(Z)->second->ExtractCosTheta(kineticEnergy,tGamma);
|
||||
G4double totalEnergy = kineticEnergy + electron_mass_c2;
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
G4double sinTheta = sqrt(1. - dirZ*dirZ);
|
||||
G4double dirX = sinTheta*cos(phi);
|
||||
G4double dirY = sinTheta*sin(phi);
|
||||
G4double sinTheta = std::sqrt(1. - dirZ*dirZ);
|
||||
G4double dirX = sinTheta*std::cos(phi);
|
||||
G4double dirY = sinTheta*std::sin(phi);
|
||||
|
||||
G4ThreeVector gammaDirection (dirX, dirY, dirZ);
|
||||
G4ThreeVector electronDirection = track.GetMomentumDirection();
|
||||
@@ -350,33 +350,33 @@ G4VParticleChange* G4PenelopeBremsstrahlung::PostStepDoIt(const G4Track& track,
|
||||
finalEnergy = 0.0;
|
||||
}
|
||||
|
||||
G4double momentum = sqrt((totalEnergy + electron_mass_c2)*kineticEnergy);
|
||||
G4double momentum = std::sqrt((totalEnergy + electron_mass_c2)*kineticEnergy);
|
||||
|
||||
G4double finalX = momentum*electronDirection.x() - tGamma*gammaDirection.x();
|
||||
G4double finalY = momentum*electronDirection.y() - tGamma*gammaDirection.y();
|
||||
G4double finalZ = momentum*electronDirection.z() - tGamma*gammaDirection.z();
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
G4double norm = 1./sqrt(finalX*finalX + finalY*finalY + finalZ*finalZ);
|
||||
aParticleChange.SetMomentumChange(finalX*norm, finalY*norm, finalZ*norm);
|
||||
G4double norm = 1./std::sqrt(finalX*finalX + finalY*finalY + finalZ*finalZ);
|
||||
aParticleChange.ProposeMomentumDirection(finalX*norm, finalY*norm, finalZ*norm);
|
||||
|
||||
const G4ParticleDefinition* particle = track.GetDefinition();
|
||||
|
||||
if (finalEnergy > 0.)
|
||||
{
|
||||
aParticleChange.SetEnergyChange(finalEnergy) ;
|
||||
aParticleChange.ProposeEnergy(finalEnergy) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetEnergyChange(0.) ;
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
if (particle->GetProcessManager()->GetAtRestProcessVector()->size())
|
||||
//In this case there is at least one AtRest process
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PenelopeBremsstrahlungAngular.cc,v 1.5 2003/11/07 12:25:35 pandola Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4PenelopeBremsstrahlungAngular.cc,v 1.6 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
@@ -101,11 +101,11 @@ void G4PenelopeBremsstrahlungAngular::InterpolationTableForZ()
|
||||
for (i=0;i<NumberofEPoints;i++){
|
||||
for (j=0;j<NumberofKPoints;j++){
|
||||
for (k=0;k<NumberofZPoints;k++){
|
||||
pX[k]=log(QQ1[k][i][j]);
|
||||
pX[k]=std::log(QQ1[k][i][j]);
|
||||
pY[k]=QQ2[k][i][j];
|
||||
}
|
||||
G4PenelopeInterpolator* interpolator1 = new G4PenelopeInterpolator(pZ,pX,NumberofZPoints);
|
||||
Q1[i][j]=exp(interpolator1->CubicSplineInterpolation((G4double) Zmat));
|
||||
Q1[i][j]=std::exp(interpolator1->CubicSplineInterpolation((G4double) Zmat));
|
||||
delete interpolator1;
|
||||
G4PenelopeInterpolator* interpolator2 = new G4PenelopeInterpolator(pZ,pY,NumberofZPoints);
|
||||
Q2[i][j]=interpolator2->CubicSplineInterpolation((G4double) Zmat);
|
||||
@@ -137,7 +137,7 @@ void G4PenelopeBremsstrahlungAngular::InterpolationForK()
|
||||
}
|
||||
|
||||
for(i=0;i<NumberofEPoints;i++){
|
||||
betas[i]=sqrt(pE[i]*(pE[i]+2*electron_mass_c2))/(pE[i]+electron_mass_c2);
|
||||
betas[i]=std::sqrt(pE[i]*(pE[i]+2*electron_mass_c2))/(pE[i]+electron_mass_c2);
|
||||
}
|
||||
|
||||
for (i=0;i<NumberofEPoints;i++){
|
||||
@@ -149,7 +149,7 @@ void G4PenelopeBremsstrahlungAngular::InterpolationForK()
|
||||
//Expanded table of distribution parameters
|
||||
for (i=0;i<NumberofEPoints;i++){
|
||||
for (j=0;j<NumberofKPoints;j++){
|
||||
pX[j]=log(Q1[i][j]); //logarithmic
|
||||
pX[j]=std::log(Q1[i][j]); //logarithmic
|
||||
}
|
||||
G4PenelopeInterpolator* interpolator = new G4PenelopeInterpolator(pK,pX,NumberofKPoints);
|
||||
for (j=0;j<reducedEnergyGrid;j++){
|
||||
@@ -172,7 +172,7 @@ G4double G4PenelopeBremsstrahlungAngular::ExtractCosTheta(G4double e1,G4double e
|
||||
//e1 = kinetic energy of the electron
|
||||
//e2 = energy of the bremsstrahlung photon
|
||||
|
||||
G4double beta = sqrt(e1*(e1+2*electron_mass_c2))/(e1+electron_mass_c2);
|
||||
G4double beta = std::sqrt(e1*(e1+2*electron_mass_c2))/(e1+electron_mass_c2);
|
||||
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ G4double G4PenelopeBremsstrahlungAngular::ExtractCosTheta(G4double e1,G4double e
|
||||
P2=P20+(RK-(G4double) ik)*(P21-P20);
|
||||
|
||||
//Sampling from the Lorenz-trasformed dipole distributions
|
||||
P1=std::min(exp(P1)/beta,1.0);
|
||||
P1=std::min(std::exp(P1)/beta,1.0);
|
||||
G4double betap = std::min(std::max(beta*(1.0+P2/beta),0.0),0.9999);
|
||||
|
||||
G4double cdt=0,testf=0;
|
||||
|
||||
+16
-16
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.6 2004/03/17 08:57:26 pandola Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.7 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
@@ -35,7 +35,7 @@
|
||||
// 20 Feb 2003 L. Pandola 1st implementation
|
||||
// 17 Mar 2003 L. Pandola Added the correction for positrons
|
||||
// 19 Mar 2003 L. Pandola Bugs fixed
|
||||
// 17 Mar 2004 L. Pandola Removed unnecessary calls to pow(a,b)
|
||||
// 17 Mar 2004 L. Pandola Removed unnecessary calls to std::pow(a,b)
|
||||
//----------------------------------------------------------------
|
||||
|
||||
#include "G4PenelopeBremsstrahlungContinuous.hh"
|
||||
@@ -56,8 +56,8 @@ G4PenelopeBremsstrahlungContinuous::G4PenelopeBremsstrahlungContinuous (G4int Ze
|
||||
//200 bins between MinE and MaxE (logarithmic)
|
||||
G4double EL=0.99999*MinE;
|
||||
G4double EU=1.00001*MaxE;
|
||||
DLFC=log(EU/EL)/((G4double) (NumberofExtendedEGrid-1));
|
||||
ExtendedLogEnergy[0]=log(EL);
|
||||
DLFC=std::log(EU/EL)/((G4double) (NumberofExtendedEGrid-1));
|
||||
ExtendedLogEnergy[0]=std::log(EL);
|
||||
for (size_t i=1;i<NumberofExtendedEGrid;i++){
|
||||
ExtendedLogEnergy[i]=ExtendedLogEnergy[i-1]+DLFC;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ void G4PenelopeBremsstrahlungContinuous::PrepareInterpolationTable()
|
||||
G4double Fact = (millibarn/cm2)*(Energies[i]+electron_mass_c2)*(1.0/fine_structure_const)/
|
||||
(classic_electr_radius*classic_electr_radius*(Energies[i]+2.0*electron_mass_c2));
|
||||
G4double Normalization = TotalCS[i]/(Rsum*Fact);
|
||||
G4double TST = abs(Normalization-100.0);
|
||||
G4double TST = std::abs(Normalization-100.0);
|
||||
if (TST > 1.0) {
|
||||
G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file";
|
||||
G4Exception(excep);
|
||||
@@ -155,24 +155,24 @@ void G4PenelopeBremsstrahlungContinuous::PrepareInterpolationTable()
|
||||
G4double pX[NumberofEPoints];
|
||||
G4double pYY[NumberofEPoints];
|
||||
for (i=0;i<NumberofEPoints;i++){
|
||||
pX[i] = log(Energies[i]);
|
||||
pX[i] = std::log(Energies[i]);
|
||||
}
|
||||
|
||||
for (j=0;j<NumberofKPoints;j++){
|
||||
for (i=0;i<NumberofEPoints;i++){
|
||||
pYY[i] = log(ReducedCS[i][j]);
|
||||
pYY[i] = std::log(ReducedCS[i][j]);
|
||||
}
|
||||
G4PenelopeInterpolator* interpolator2 = new G4PenelopeInterpolator(pX,pYY,NumberofEPoints);
|
||||
for (i=0;i<NumberofExtendedEGrid;i++){
|
||||
G4double ELL = ExtendedLogEnergy[i];
|
||||
if (ELL >= pX[0]) {
|
||||
p0[i][j] = exp(interpolator2->CubicSplineInterpolation(ELL));
|
||||
p0[i][j] = std::exp(interpolator2->CubicSplineInterpolation(ELL));
|
||||
}
|
||||
else
|
||||
{
|
||||
G4double F1=interpolator2->CubicSplineInterpolation(pX[0]);
|
||||
G4double FP1 = interpolator2->FirstDerivative(pX[0]);
|
||||
p0[i][j] = exp(F1+FP1*(ELL-pX[0]));
|
||||
p0[i][j] = std::exp(F1+FP1*(ELL-pX[0]));
|
||||
}
|
||||
}
|
||||
delete interpolator2;
|
||||
@@ -187,11 +187,11 @@ void G4PenelopeBremsstrahlungContinuous::PrepareInterpolationTable()
|
||||
// }
|
||||
// G4double Xc=0;
|
||||
// if (i<(NumberofExtendedEGrid-1)){
|
||||
// Xc=tCut/exp(ExtendedLogEnergy[i+1]);
|
||||
// Xc=tCut/std::exp(ExtendedLogEnergy[i+1]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Xc=tCut/exp(ExtendedLogEnergy[NumberofExtendedEGrid-1]);
|
||||
// Xc=tCut/std::exp(ExtendedLogEnergy[NumberofExtendedEGrid-1]);
|
||||
// }
|
||||
|
||||
// G4PenelopeInterpolator* interpolator3 = new G4PenelopeInterpolator(pK,PDF,NumberofKPoints);
|
||||
@@ -204,7 +204,7 @@ void G4PenelopeBremsstrahlungContinuous::PrepareInterpolationTable()
|
||||
G4double G4PenelopeBremsstrahlungContinuous::CalculateStopping(G4double e1)
|
||||
//Stopping power expressed in MeV/mm*2
|
||||
{
|
||||
G4double Xel=std::max(log(e1),ExtendedLogEnergy[0]);
|
||||
G4double Xel=std::max(std::log(e1),ExtendedLogEnergy[0]);
|
||||
G4double Xe=1.0+(Xel-ExtendedLogEnergy[0])*DLFC;
|
||||
G4int Ke = (G4int) Xe;
|
||||
G4double Xek = Xe-Ke;
|
||||
@@ -262,11 +262,11 @@ G4double G4PenelopeBremsstrahlungContinuous::PositronCorrection(G4double en)
|
||||
return 1.0; //no correction for electrons
|
||||
}
|
||||
else if (partName == "e+"){
|
||||
T=log(1+((1e6*en)/(Zmat*Zmat*electron_mass_c2)));
|
||||
T=std::log(1+((1e6*en)/(Zmat*Zmat*electron_mass_c2)));
|
||||
for (G4int i=0;i<7;i++){
|
||||
correct += Coeff[i]*pow(T,i+1);
|
||||
correct += Coeff[i]*std::pow(T,i+1);
|
||||
}
|
||||
correct = 1.0-exp(correct);
|
||||
correct = 1.0-std::exp(correct);
|
||||
return correct;
|
||||
}
|
||||
else //ne' elettroni ne' positroni...exception
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PenelopeCompton.cc,v 1.19 2004/03/23 12:44:22 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4PenelopeCompton.cc,v 1.25 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Author: Luciano Pandola
|
||||
//
|
||||
@@ -39,7 +39,8 @@
|
||||
// 24 May 2003 MGP Removed memory leak
|
||||
// 09 Mar 2004 L.Pandola Bug fixed in the generation of final state
|
||||
// (bug report # 585)
|
||||
// 17 Mar 2004 L.Pandola Removed unnecessary calls to pow(a,b)
|
||||
// 17 Mar 2004 L.Pandola Removed unnecessary calls to std::pow(a,b)
|
||||
// 18 Mar 2004 L.Pandola Use of std::map (code review)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
@@ -90,9 +91,10 @@ G4PenelopeCompton::G4PenelopeCompton(const G4String& processName)
|
||||
}
|
||||
|
||||
meanFreePathTable = 0;
|
||||
ionizationEnergy = new std::vector<G4DataVector*>;
|
||||
hartreeFunction = new std::vector<G4DataVector*>;
|
||||
occupationNumber = new std::vector<G4DataVector*>;
|
||||
ionizationEnergy = new std::map<G4int,G4DataVector*>;
|
||||
hartreeFunction = new std::map<G4int,G4DataVector*>;
|
||||
occupationNumber = new std::map<G4int,G4DataVector*>;
|
||||
|
||||
rangeTest = new G4RangeTest;
|
||||
|
||||
ReadData(); //Read data from file
|
||||
@@ -119,33 +121,25 @@ G4PenelopeCompton::~G4PenelopeCompton()
|
||||
|
||||
delete matCrossSections;
|
||||
|
||||
for (size_t i2=0; i2<ionizationEnergy->size(); i2++)
|
||||
for (G4int Z=1;Z<100;Z++)
|
||||
{
|
||||
delete (*ionizationEnergy)[i2];
|
||||
if (ionizationEnergy->count(Z)) delete (ionizationEnergy->find(Z)->second);
|
||||
if (hartreeFunction->count(Z)) delete (hartreeFunction->find(Z)->second);
|
||||
if (occupationNumber->count(Z)) delete (occupationNumber->find(Z)->second);
|
||||
}
|
||||
delete ionizationEnergy;
|
||||
|
||||
for (size_t j=0; j<hartreeFunction->size(); j++)
|
||||
{
|
||||
delete (*hartreeFunction)[j];
|
||||
}
|
||||
delete hartreeFunction;
|
||||
|
||||
for (size_t k=0; k<occupationNumber->size(); k++)
|
||||
{
|
||||
delete (*occupationNumber)[k];
|
||||
}
|
||||
delete occupationNumber;
|
||||
delete occupationNumber;
|
||||
}
|
||||
|
||||
void G4PenelopeCompton::BuildPhysicsTable(const G4ParticleDefinition& )
|
||||
{
|
||||
G4DataVector energyVector;
|
||||
G4double dBin = log10(highEnergyLimit/lowEnergyLimit)/nBins;
|
||||
G4double dBin = std::log10(highEnergyLimit/lowEnergyLimit)/nBins;
|
||||
G4int i;
|
||||
for (i=0;i<nBins;i++)
|
||||
{
|
||||
energyVector.push_back(pow(10.,log10(lowEnergyLimit)+i*dBin));
|
||||
energyVector.push_back(std::pow(10.,std::log10(lowEnergyLimit)+i*dBin));
|
||||
}
|
||||
|
||||
const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
|
||||
@@ -246,9 +240,9 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
if (photonEnergy0 <= lowEnergyLimit)
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit(photonEnergy0);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(photonEnergy0);
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
}
|
||||
|
||||
@@ -267,14 +261,14 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
G4double harFunc = 0.0;
|
||||
G4int occupNb= 0;
|
||||
G4double ionEnergy=0.0;
|
||||
G4int nosc = ((*occupationNumber)[Z-1])->size();
|
||||
G4int nosc = occupationNumber->find(Z)->second->size();
|
||||
G4int iosc = nosc;
|
||||
ki = photonEnergy0/electron_mass_c2;
|
||||
ki2 = 2*ki+1.0;
|
||||
ki3 = ki*ki;
|
||||
ki1 = ki3-ki2-1.0;
|
||||
taumin = 1.0/ki2;
|
||||
a1 = log(ki2);
|
||||
a1 = std::log(ki2);
|
||||
a2 = a1+2.0*ki*(1.0+ki)/(ki2*ki2);
|
||||
if (photonEnergy0 > 5*MeV)
|
||||
{
|
||||
@@ -282,11 +276,11 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
do{
|
||||
if ((a2*G4UniformRand()) < a1)
|
||||
{
|
||||
tau = pow(taumin,G4UniformRand());
|
||||
tau = std::pow(taumin,G4UniformRand());
|
||||
}
|
||||
else
|
||||
{
|
||||
tau = sqrt(1.0+G4UniformRand()*(taumin*taumin-1.0));
|
||||
tau = std::sqrt(1.0+G4UniformRand()*(taumin*taumin-1.0));
|
||||
}
|
||||
//rejection function
|
||||
TST = (1+tau*(ki1+tau*(ki2+tau*ki3)))/(ki3*tau*(1.0+tau*tau));
|
||||
@@ -299,12 +293,12 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
S=0.0;
|
||||
for (G4int j=0;j<nosc;j++)
|
||||
{
|
||||
occupNb = (G4int) (*((*occupationNumber)[Z-1]))[j];
|
||||
occupNb = (G4int) (*(occupationNumber->find(Z)->second))[j];
|
||||
S = S + occupNb;
|
||||
if (S > TST) iosc = j;
|
||||
if (S > TST) break;
|
||||
}
|
||||
ionEnergy = (*((*ionizationEnergy)[Z-1]))[iosc];
|
||||
ionEnergy = (*(ionizationEnergy->find(Z)->second))[iosc];
|
||||
}while((epsilon*photonEnergy0-photonEnergy0+ionEnergy) >0);
|
||||
}
|
||||
|
||||
@@ -315,21 +309,21 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
G4double pzomc=0.0,rni=0.0;
|
||||
G4double aux=0.0;
|
||||
for (G4int i=0;i<nosc;i++){
|
||||
ionEnergy = (*((*ionizationEnergy)[Z-1]))[i];
|
||||
ionEnergy = (*(ionizationEnergy->find(Z)->second))[i];
|
||||
if (photonEnergy0 > ionEnergy)
|
||||
{
|
||||
G4double aux = photonEnergy0*(photonEnergy0-ionEnergy)*2.0;
|
||||
harFunc = (*((*hartreeFunction)[Z-1]))[i]/fine_structure_const;
|
||||
occupNb = (G4int) (*((*occupationNumber)[Z-1]))[i];
|
||||
harFunc = (*(hartreeFunction->find(Z)->second))[i]/fine_structure_const;
|
||||
occupNb = (G4int) (*(occupationNumber->find(Z)->second))[i];
|
||||
pzomc = harFunc*(aux-electron_mass_c2*ionEnergy)/
|
||||
(electron_mass_c2*sqrt(2.0*aux+ionEnergy*ionEnergy));
|
||||
(electron_mass_c2*std::sqrt(2.0*aux+ionEnergy*ionEnergy));
|
||||
if (pzomc > 0)
|
||||
{
|
||||
rni = 1.0-0.5*exp(0.5-(sqrt(0.5)+sqrt(2.0)*pzomc)*(sqrt(0.5)+sqrt(2.0)*pzomc));
|
||||
rni = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)+std::sqrt(2.0)*pzomc));
|
||||
}
|
||||
else
|
||||
{
|
||||
rni = 0.5*exp(0.5-(sqrt(0.5)-sqrt(2.0)*pzomc)*(sqrt(0.5)-sqrt(2.0)*pzomc));
|
||||
rni = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)-std::sqrt(2.0)*pzomc));
|
||||
}
|
||||
s0 = s0 + occupNb*rni;
|
||||
}
|
||||
@@ -341,31 +335,31 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
{
|
||||
if ((G4UniformRand()*a2) < a1)
|
||||
{
|
||||
tau = pow(taumin,G4UniformRand());
|
||||
tau = std::pow(taumin,G4UniformRand());
|
||||
}
|
||||
else
|
||||
{
|
||||
tau = sqrt(1.0+G4UniformRand()*(taumin*taumin-1.0));
|
||||
tau = std::sqrt(1.0+G4UniformRand()*(taumin*taumin-1.0));
|
||||
}
|
||||
cdt1 = (1.0-tau)/(ki*tau);
|
||||
S=0.0;
|
||||
//Incoherent scattering function
|
||||
for (G4int i=0;i<nosc;i++){
|
||||
ionEnergy = (*((*ionizationEnergy)[Z-1]))[i];
|
||||
ionEnergy = (*(ionizationEnergy->find(Z)->second))[i];
|
||||
if (photonEnergy0 > ionEnergy) //sum only on excitable levels
|
||||
{
|
||||
aux = photonEnergy0*(photonEnergy0-ionEnergy)*cdt1;
|
||||
harFunc = (*((*hartreeFunction)[Z-1]))[i]/fine_structure_const;
|
||||
occupNb = (G4int) (*((*occupationNumber)[Z-1]))[i];
|
||||
harFunc = (*(hartreeFunction->find(Z)->second))[i]/fine_structure_const;
|
||||
occupNb = (G4int) (*(occupationNumber->find(Z)->second))[i];
|
||||
pzomc = harFunc*(aux-electron_mass_c2*ionEnergy)/
|
||||
(electron_mass_c2*sqrt(2.0*aux+ionEnergy*ionEnergy));
|
||||
(electron_mass_c2*std::sqrt(2.0*aux+ionEnergy*ionEnergy));
|
||||
if (pzomc > 0)
|
||||
{
|
||||
rn[i] = 1.0-0.5*exp(0.5-(sqrt(0.5)+sqrt(2.0)*pzomc)*(sqrt(0.5)+sqrt(2.0)*pzomc));
|
||||
rn[i] = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)+std::sqrt(2.0)*pzomc));
|
||||
}
|
||||
else
|
||||
{
|
||||
rn[i] = 0.5*exp(0.5-(sqrt(0.5)-sqrt(2.0)*pzomc)*(sqrt(0.5)-sqrt(2.0)*pzomc));
|
||||
rn[i] = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)-std::sqrt(2.0)*pzomc));
|
||||
}
|
||||
S = S + occupNb*rn[i];
|
||||
pac[i] = S;
|
||||
@@ -394,21 +388,21 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
if (pac[i]>TST) break;
|
||||
}
|
||||
A = G4UniformRand()*rn[iosc];
|
||||
harFunc = (*((*hartreeFunction)[Z-1]))[iosc]/fine_structure_const;
|
||||
occupNb = (G4int) (*((*occupationNumber)[Z-1]))[iosc];
|
||||
harFunc = (*(hartreeFunction->find(Z)->second))[iosc]/fine_structure_const;
|
||||
occupNb = (G4int) (*(occupationNumber->find(Z)->second))[iosc];
|
||||
if (A < 0.5) {
|
||||
pzomc = (sqrt(0.5)-sqrt(0.5-log(2.0*A)))/
|
||||
(sqrt(2.0)*harFunc);
|
||||
pzomc = (std::sqrt(0.5)-std::sqrt(0.5-std::log(2.0*A)))/
|
||||
(std::sqrt(2.0)*harFunc);
|
||||
}
|
||||
else
|
||||
{
|
||||
pzomc = (sqrt(0.5-log(2.0-2.0*A))-sqrt(0.5))/
|
||||
(sqrt(2.0)*harFunc);
|
||||
pzomc = (std::sqrt(0.5-std::log(2.0-2.0*A))-std::sqrt(0.5))/
|
||||
(std::sqrt(2.0)*harFunc);
|
||||
}
|
||||
} while (pzomc < -1);
|
||||
// F(EP) rejection
|
||||
G4double XQC = 1.0+tau*(tau-2.0*cosTheta);
|
||||
G4double AF = sqrt(XQC)*(1.0+tau*(tau-cosTheta)/XQC);
|
||||
G4double AF = std::sqrt(XQC)*(1.0+tau*(tau-cosTheta)/XQC);
|
||||
if (AF > 0) {
|
||||
fpzmax = 1.0+AF*0.2;
|
||||
}
|
||||
@@ -425,36 +419,36 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
G4double b2 = 1.0-T*tau*cosTheta;
|
||||
if (pzomc > 0.0)
|
||||
{
|
||||
epsilon = (tau/b1)*(b2+sqrt(abs(b2*b2-b1*(1.0-T))));
|
||||
epsilon = (tau/b1)*(b2+std::sqrt(std::abs(b2*b2-b1*(1.0-T))));
|
||||
}
|
||||
else
|
||||
{
|
||||
epsilon = (tau/b1)*(b2-sqrt(abs(b2*b2-b1*(1.0-T))));
|
||||
epsilon = (tau/b1)*(b2-std::sqrt(std::abs(b2*b2-b1*(1.0-T))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4double sinTheta = sqrt(1-cosTheta*cosTheta);
|
||||
G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
|
||||
G4double phi = twopi * G4UniformRand() ;
|
||||
G4double dirx = sinTheta * cos(phi);
|
||||
G4double diry = sinTheta * sin(phi);
|
||||
G4double dirx = sinTheta * std::cos(phi);
|
||||
G4double diry = sinTheta * std::sin(phi);
|
||||
G4double dirz = cosTheta ;
|
||||
|
||||
// Update G4VParticleChange for the scattered photon
|
||||
|
||||
G4ThreeVector photonDirection1(dirx,diry,dirz);
|
||||
photonDirection1.rotateUz(photonDirection0);
|
||||
aParticleChange.SetMomentumChange(photonDirection1) ;
|
||||
aParticleChange.ProposeMomentumDirection(photonDirection1) ;
|
||||
G4double photonEnergy1 = epsilon * photonEnergy0;
|
||||
|
||||
if (photonEnergy1 > 0.)
|
||||
{
|
||||
aParticleChange.SetEnergyChange(photonEnergy1) ;
|
||||
aParticleChange.ProposeEnergy(photonEnergy1) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetEnergyChange(0.) ;
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
|
||||
|
||||
@@ -462,19 +456,19 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
|
||||
G4double diffEnergy = photonEnergy0*(1-epsilon);
|
||||
ionEnergy = (*((*ionizationEnergy)[Z-1]))[iosc];
|
||||
ionEnergy = (*(ionizationEnergy->find(Z)->second))[iosc];
|
||||
//G4double eKineticEnergy = diffEnergy - ionEnergy;
|
||||
G4double Q2 = photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta);
|
||||
G4double cosThetaE; //scattering angle for the electron
|
||||
if (Q2 > 1.0e-12)
|
||||
{
|
||||
cosThetaE = (photonEnergy0-photonEnergy1*cosTheta)/sqrt(Q2);
|
||||
cosThetaE = (photonEnergy0-photonEnergy1*cosTheta)/std::sqrt(Q2);
|
||||
}
|
||||
else
|
||||
{
|
||||
cosThetaE = 1.0;
|
||||
}
|
||||
G4double sinThetaE = sqrt(1-cosThetaE*cosThetaE);
|
||||
G4double sinThetaE = std::sqrt(1-cosThetaE*cosThetaE);
|
||||
|
||||
|
||||
|
||||
@@ -534,8 +528,8 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
G4DynamicParticle* electron = 0;
|
||||
if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety))
|
||||
{
|
||||
G4double xEl = sinThetaE * cos(phi+pi);
|
||||
G4double yEl = sinThetaE * sin(phi+pi);
|
||||
G4double xEl = sinThetaE * std::cos(phi+pi);
|
||||
G4double yEl = sinThetaE * std::sin(phi+pi);
|
||||
G4double zEl = cosThetaE;
|
||||
G4ThreeVector eDirection(xEl,yEl,zEl); //electron direction
|
||||
eDirection.rotateUz(photonDirection0);
|
||||
@@ -564,7 +558,7 @@ G4VParticleChange* G4PenelopeCompton::PostStepDoIt(const G4Track& aTrack,
|
||||
<< G4endl;
|
||||
energyDeposit=0;
|
||||
}
|
||||
aParticleChange.SetLocalEnergyDeposit(energyDeposit);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(energyDeposit);
|
||||
|
||||
|
||||
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep);
|
||||
@@ -629,19 +623,16 @@ void G4PenelopeCompton::ReadData()
|
||||
u->push_back(a1);
|
||||
j->push_back(a2);
|
||||
}
|
||||
ionizationEnergy->push_back(u);
|
||||
hartreeFunction->push_back(j);
|
||||
occupationNumber->push_back(f);
|
||||
ionizationEnergy->insert(std::make_pair(Z,u));
|
||||
hartreeFunction->insert(std::make_pair(Z,j));
|
||||
occupationNumber->insert(std::make_pair(Z,f));
|
||||
file >> test >> test1; //-1 -1 close the data for each Z
|
||||
if (test > 0) {
|
||||
G4String excep = "G4PenelopeCompton - data file corrupted!";
|
||||
G4Exception(excep);
|
||||
}
|
||||
}while (test != -2); //the very last Z is closed with -2 instead of -1
|
||||
|
||||
//(*((*ionizationEnergy)[Z-1]))[i] contains the ionization energy of the i-th level of
|
||||
//the element Z
|
||||
};
|
||||
}
|
||||
|
||||
G4double G4PenelopeCompton::CrossSection(G4double energy,G4int Z)
|
||||
{
|
||||
@@ -660,16 +651,16 @@ G4double G4PenelopeCompton::CrossSection(G4double energy,G4int Z)
|
||||
G4double ki2=1.0+2*ki;
|
||||
G4double ki1=ki3-ki2-1.0;
|
||||
G4double t0=1.0/(ki2);
|
||||
G4double csl = 0.5*ki3*t0*t0+ki2*t0+ki1*log(t0)-(1.0/t0);
|
||||
G4int nosc = ((*occupationNumber)[Z-1])->size();
|
||||
G4double csl = 0.5*ki3*t0*t0+ki2*t0+ki1*std::log(t0)-(1.0/t0);
|
||||
G4int nosc = occupationNumber->find(Z)->second->size();
|
||||
for (G4int i=0;i<nosc;i++)
|
||||
{
|
||||
G4double ionEnergy = (*((*ionizationEnergy)[Z-1]))[i];
|
||||
G4double ionEnergy = (*(ionizationEnergy->find(Z)->second))[i];
|
||||
G4double tau=(energy-ionEnergy)/energy;
|
||||
if (tau > t0)
|
||||
{
|
||||
G4double csu = 0.5*ki3*tau*tau+ki2*tau+ki1*log(tau)-(1.0/tau);
|
||||
G4int f = (G4int) (*((*occupationNumber)[Z-1]))[i];
|
||||
G4double csu = 0.5*ki3*tau*tau+ki2*tau+ki1*std::log(tau)-(1.0/tau);
|
||||
G4int f = (G4int) (*(occupationNumber->find(Z)->second))[i];
|
||||
cs = cs + f*(csu-csl);
|
||||
}
|
||||
}
|
||||
@@ -681,8 +672,8 @@ G4double G4PenelopeCompton::CrossSection(G4double energy,G4int Z)
|
||||
|
||||
G4double G4PenelopeCompton::DifferentialCrossSection(G4double cosTheta)
|
||||
{
|
||||
const G4double k2 = sqrt(2.0);
|
||||
const G4double k1 = sqrt(0.5);
|
||||
const G4double k2 = std::sqrt(2.0);
|
||||
const G4double k1 = std::sqrt(0.5);
|
||||
const G4double k12 = 0.5;
|
||||
G4double cdt1 = 1.0-cosTheta;
|
||||
G4double energy = energyForIntegration;
|
||||
@@ -697,24 +688,24 @@ G4double G4PenelopeCompton::DifferentialCrossSection(G4double cosTheta)
|
||||
G4double ECOE = 1.0/EOEC;
|
||||
//Incoherent scattering function (analytical profile)
|
||||
G4double sia = 0.0;
|
||||
G4int nosc = ((*occupationNumber)[Z-1])->size();
|
||||
G4int nosc = occupationNumber->find(Z)->second->size();
|
||||
for (G4int i=0;i<nosc;i++){
|
||||
ionEnergy = (*((*ionizationEnergy)[Z-1]))[i];
|
||||
ionEnergy = (*(ionizationEnergy->find(Z)->second))[i];
|
||||
//Sum only of those shells for which E>Eion
|
||||
if (energy > ionEnergy)
|
||||
{
|
||||
G4double aux = energy * (energy-ionEnergy)*cdt1;
|
||||
Pzimax = (aux - electron_mass_c2*ionEnergy)/(electron_mass_c2*sqrt(2*aux+ionEnergy*ionEnergy));
|
||||
harFunc = (*((*hartreeFunction)[Z-1]))[i]/fine_structure_const;
|
||||
occupNb = (G4int) (*((*occupationNumber)[Z-1]))[i];
|
||||
Pzimax = (aux - electron_mass_c2*ionEnergy)/(electron_mass_c2*std::sqrt(2*aux+ionEnergy*ionEnergy));
|
||||
harFunc = (*(hartreeFunction->find(Z)->second))[i]/fine_structure_const;
|
||||
occupNb = (G4int) (*(occupationNumber->find(Z)->second))[i];
|
||||
x = harFunc*Pzimax;
|
||||
if (x > 0)
|
||||
{
|
||||
siap = 1.0-0.5*exp(k12-(k1+k2*x)*(k1+k2*x));
|
||||
siap = 1.0-0.5*std::exp(k12-(k1+k2*x)*(k1+k2*x));
|
||||
}
|
||||
else
|
||||
{
|
||||
siap = 0.5*exp(k12-(k1-k2*x)*(k1-k2*x));
|
||||
siap = 0.5*std::exp(k12-(k1-k2*x)*(k1-k2*x));
|
||||
}
|
||||
sia = sia + occupNb*siap; //sum of all contributions;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
// 13 Mar 2003 L.Pandola Code "cleaned"
|
||||
// 25 Mar 2003 L.Pandola Changed the name of the database file to read
|
||||
// 24 Apr 2003 V.Ivanchenko Cut per region mfpt
|
||||
// 17 Mar 2004 L.Pandola Removed unnecessary calls to pow(a,b)
|
||||
// 17 Mar 2004 L.Pandola Removed unnecessary calls to std::pow(a,b)
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4PenelopeGammaConversion.hh"
|
||||
@@ -152,7 +152,7 @@ G4VParticleChange* G4PenelopeGammaConversion::PostStepDoIt(const G4Track& aTrack
|
||||
G4double ScreenRadius = GetScreeningRadius(Z);
|
||||
G4double funct1=0,g0=0;
|
||||
G4double g1min=0,g2min=0;
|
||||
funct1 = 4.0*log(ScreenRadius);
|
||||
funct1 = 4.0*std::log(ScreenRadius);
|
||||
g0 = funct1-4*CoulombCorrection(ZAlpha)+LowEnergyCorrection(ZAlpha,eki);
|
||||
G4double bmin = 2*eki*ScreenRadius;
|
||||
g1min=g0+ScreenFunction(bmin,1);
|
||||
@@ -171,11 +171,11 @@ G4VParticleChange* G4PenelopeGammaConversion::PostStepDoIt(const G4Track& aTrack
|
||||
if (rand1 < p1) {
|
||||
rand2 = 2.0*G4UniformRand()-1.0;
|
||||
if (rand2 < 0) {
|
||||
eps = 0.5 - xr*pow(abs(rand2),(1./3.));
|
||||
eps = 0.5 - xr*std::pow(std::abs(rand2),(1./3.));
|
||||
}
|
||||
else
|
||||
{
|
||||
eps = 0.5 + xr*pow(rand2,(1./3.));
|
||||
eps = 0.5 + xr*std::pow(rand2,(1./3.));
|
||||
}
|
||||
b = (eki*ScreenRadius)/(2*eps*(1.0-eps));
|
||||
g1 = g0+ScreenFunction(b,1);
|
||||
@@ -206,21 +206,21 @@ G4VParticleChange* G4PenelopeGammaConversion::PostStepDoIt(const G4Track& aTrack
|
||||
G4double phi_el,phi_po;
|
||||
G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ;
|
||||
costheta_el = G4UniformRand()*2.0-1.0;
|
||||
G4double kk = sqrt(electronKineEnergy*(electronKineEnergy+2.*electron_mass_c2));
|
||||
G4double kk = std::sqrt(electronKineEnergy*(electronKineEnergy+2.*electron_mass_c2));
|
||||
costheta_el = (costheta_el*electronTotEnergy+kk)/(electronTotEnergy+costheta_el*kk);
|
||||
phi_el = twopi * G4UniformRand() ;
|
||||
G4double dirX_el = sqrt(1.-costheta_el*costheta_el) * cos(phi_el);
|
||||
G4double dirY_el = sqrt(1.-costheta_el*costheta_el) * sin(phi_el);
|
||||
G4double dirX_el = std::sqrt(1.-costheta_el*costheta_el) * std::cos(phi_el);
|
||||
G4double dirY_el = std::sqrt(1.-costheta_el*costheta_el) * std::sin(phi_el);
|
||||
G4double dirZ_el = costheta_el;
|
||||
|
||||
//positron kinematics
|
||||
G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ;
|
||||
costheta_po = G4UniformRand()*2.0-1.0;
|
||||
kk = sqrt(positronKineEnergy*(positronKineEnergy+2.*electron_mass_c2));
|
||||
kk = std::sqrt(positronKineEnergy*(positronKineEnergy+2.*electron_mass_c2));
|
||||
costheta_po = (costheta_po*positronTotEnergy+kk)/(positronTotEnergy+costheta_po*kk);
|
||||
phi_po = twopi * G4UniformRand() ;
|
||||
G4double dirX_po = sqrt(1.-costheta_po*costheta_po) * cos(phi_po);
|
||||
G4double dirY_po = sqrt(1.-costheta_po*costheta_po) * sin(phi_po);
|
||||
G4double dirX_po = std::sqrt(1.-costheta_po*costheta_po) * std::cos(phi_po);
|
||||
G4double dirY_po = std::sqrt(1.-costheta_po*costheta_po) * std::sin(phi_po);
|
||||
G4double dirZ_po = costheta_po;
|
||||
|
||||
// Kinematics of the created pair:
|
||||
@@ -264,12 +264,12 @@ G4VParticleChange* G4PenelopeGammaConversion::PostStepDoIt(const G4Track& aTrack
|
||||
positronDirection, positronKineEnergy);
|
||||
aParticleChange.AddSecondary(particle2) ;
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(localEnergyDeposit) ;
|
||||
aParticleChange.ProposeLocalEnergyDeposit(localEnergyDeposit) ;
|
||||
|
||||
// Kill the incident photon
|
||||
aParticleChange.SetMomentumChange(0.,0.,0.) ;
|
||||
aParticleChange.SetEnergyChange(0.) ;
|
||||
aParticleChange.SetStatusChange(fStopAndKill) ;
|
||||
aParticleChange.ProposeMomentumDirection(0.,0.,0.) ;
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill) ;
|
||||
|
||||
// Reset NbOfInteractionLengthLeft and return aParticleChange
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
@@ -300,7 +300,7 @@ G4double G4PenelopeGammaConversion::ScreenFunction(G4double b,G4int icase)
|
||||
{
|
||||
G4double bsquare=b*b;
|
||||
G4double a0,f1,f2,g1,g2;
|
||||
f1=2.0-2*log(1+bsquare);
|
||||
f1=2.0-2*std::log(1+bsquare);
|
||||
f2=f1-(2.0/3.0);
|
||||
if (b < 1.0e-10)
|
||||
{
|
||||
@@ -308,9 +308,9 @@ G4double G4PenelopeGammaConversion::ScreenFunction(G4double b,G4int icase)
|
||||
}
|
||||
else
|
||||
{
|
||||
a0 = 4*b*atan(1.0/b);
|
||||
a0 = 4*b*std::atan(1.0/b);
|
||||
f1 = f1 - a0;
|
||||
f2 = f2+2*bsquare*(4.0-a0-3*log((1+bsquare)/bsquare));
|
||||
f2 = f2+2*bsquare*(4.0-a0-3*std::log((1+bsquare)/bsquare));
|
||||
}
|
||||
g1=0.5*(3*f1-f2);
|
||||
g2=0.25*(3*f1+f2);
|
||||
@@ -341,7 +341,7 @@ G4double G4PenelopeGammaConversion::LowEnergyCorrection(G4double a,G4double eki)
|
||||
{
|
||||
G4double f0=0,t=0;
|
||||
G4double b[12] = {-1.744,-12.10,11.18,8.523,73.26,-41.41,-13.52,-121.1,94.41,8.946,62.05,-63.41};
|
||||
t=sqrt(2.0*eki);
|
||||
t=std::sqrt(2.0*eki);
|
||||
G4double tSq = t*t;
|
||||
f0=(b[0]+b[1]*a+b[2]*a*a)*t+(b[3]+b[4]*a+b[5]*a*a)*(tSq)+(b[6]+b[7]*a+b[8]*a*a)*(tSq*t)+
|
||||
(b[9]+b[10]*a+b[11]*a*a)*(tSq*tSq);
|
||||
@@ -378,9 +378,4 @@ G4double G4PenelopeGammaConversion::GetScreeningRadius(G4double Z)
|
||||
G4String excep = "G4PenelopeGammaConversion - Screening Radius for not found in the data file";
|
||||
G4Exception(excep);
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// -----------
|
||||
// 17 Feb 2003 LP Created
|
||||
// 17 Dec 2003 LP Removed memory leak
|
||||
// 17 Mar 2004 LP Removed unnecessary calls to pow(a,b)
|
||||
// 17 Mar 2004 LP Removed unnecessary calls to std::pow(a,b)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
@@ -200,23 +200,23 @@ G4double G4PenelopeInterpolator::CalculateMomentum(G4double UpperLimit,
|
||||
}
|
||||
dx=x2-x1;
|
||||
dy=y2-y1;
|
||||
if (abs(dx) > (1e-14*abs(dy)))
|
||||
if (std::abs(dx) > (1e-14*std::abs(dy)))
|
||||
{
|
||||
b1=dy/dx;
|
||||
a1=y1-b1*x1;
|
||||
if (MomentumOrder == -1)
|
||||
{
|
||||
ds=a1*log(xtc/x1)+b1*(xtc-x1);
|
||||
ds=a1*std::log(xtc/x1)+b1*(xtc-x1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ds=a1*(pow(xtc,MomentumOrder+1)-pow(x1,MomentumOrder+1))/ ((G4double) (MomentumOrder+1))+
|
||||
b1*(pow(xtc,MomentumOrder+2)-pow(x1,MomentumOrder+2))/((G4double) (MomentumOrder+2));
|
||||
ds=a1*(std::pow(xtc,MomentumOrder+1)-std::pow(x1,MomentumOrder+1))/ ((G4double) (MomentumOrder+1))+
|
||||
b1*(std::pow(xtc,MomentumOrder+2)-std::pow(x1,MomentumOrder+2))/((G4double) (MomentumOrder+2));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ds=0.5*(y1+y2)*pow((xtc-x1),MomentumOrder);
|
||||
ds=0.5*(y1+y2)*std::pow((xtc-x1),MomentumOrder);
|
||||
}
|
||||
RMom += ds;
|
||||
if (iend != 0) return RMom;
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PenelopeIonisation.cc,v 1.13 2004/06/01 15:09:12 pandola Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// $Id: G4PenelopeIonisation.cc,v 1.16 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
@@ -44,7 +44,7 @@
|
||||
// 20.01.04 L.Pandola Changed returns in CalculateDiscreteForPositrons()
|
||||
// to eliminate the same bug
|
||||
// 10.03.04 L.Pandola Bug fixed with reference system of delta rays
|
||||
// 17.03.04 L.Pandola Removed unnecessary calls to pow(a,b)
|
||||
// 17.03.04 L.Pandola Removed unnecessary calls to std::pow(a,b)
|
||||
// 18.03.04 L.Pandola Bug fixed in the destructor
|
||||
// 01.06.04 L.Pandola StopButAlive for positrons on PostStepDoIt
|
||||
// --------------------------------------------------------------
|
||||
@@ -304,9 +304,9 @@ G4VParticleChange* G4PenelopeIonisation::PostStepDoIt(const G4Track& track,
|
||||
}
|
||||
// the method CalculateDiscrete() sets the private variables:
|
||||
// kineticEnergy1 = energy of the primary electron after the interaction
|
||||
// cosThetaPrimary = cos(theta) of the primary after the interaction
|
||||
// cosThetaPrimary = std::cos(theta) of the primary after the interaction
|
||||
// energySecondary = energy of the secondary electron
|
||||
// cosThetaSecondary = cos(theta) of the secondary
|
||||
// cosThetaSecondary = std::cos(theta) of the secondary
|
||||
|
||||
if(energySecondary == 0.0)
|
||||
{
|
||||
@@ -314,31 +314,31 @@ G4VParticleChange* G4PenelopeIonisation::PostStepDoIt(const G4Track& track,
|
||||
}
|
||||
|
||||
//Update the primary particle
|
||||
G4double sint = sqrt(1. - cosThetaPrimary*cosThetaPrimary);
|
||||
G4double sint = std::sqrt(1. - cosThetaPrimary*cosThetaPrimary);
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
G4double dirx = sint * cos(phi);
|
||||
G4double diry = sint * sin(phi);
|
||||
G4double dirx = sint * std::cos(phi);
|
||||
G4double diry = sint * std::sin(phi);
|
||||
G4double dirz = cosThetaPrimary;
|
||||
|
||||
G4ThreeVector electronDirection1(dirx,diry,dirz);
|
||||
electronDirection1.rotateUz(electronDirection0);
|
||||
aParticleChange.SetMomentumDirectionChange(electronDirection1) ;
|
||||
aParticleChange.ProposeMomentumDirection(electronDirection1) ;
|
||||
|
||||
if (kineticEnergy1 > 0.)
|
||||
{
|
||||
aParticleChange.SetEnergyChange(kineticEnergy1) ;
|
||||
aParticleChange.ProposeEnergy(kineticEnergy1) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetEnergyChange(0.) ;
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
if (aParticleType->GetProcessManager()->GetAtRestProcessVector()->size())
|
||||
//In this case there is at least one AtRest process
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,12 +403,12 @@ G4VParticleChange* G4PenelopeIonisation::PostStepDoIt(const G4Track& track,
|
||||
G4int nbOfSecondaries=nPhotons;
|
||||
|
||||
// Generate the delta ray
|
||||
G4double sin2 = sqrt(1. - cosThetaSecondary*cosThetaSecondary);
|
||||
G4double sin2 = std::sqrt(1. - cosThetaSecondary*cosThetaSecondary);
|
||||
G4double phi2 = twopi * G4UniformRand();
|
||||
G4DynamicParticle* electron = 0;
|
||||
|
||||
G4double xEl = sin2 * cos(phi2);
|
||||
G4double yEl = sin2 * sin(phi2);
|
||||
G4double xEl = sin2 * std::cos(phi2);
|
||||
G4double yEl = sin2 * std::sin(phi2);
|
||||
G4double zEl = cosThetaSecondary;
|
||||
G4ThreeVector eDirection(xEl,yEl,zEl); //electron direction
|
||||
eDirection.rotateUz(electronDirection0);
|
||||
@@ -431,7 +431,7 @@ G4VParticleChange* G4PenelopeIonisation::PostStepDoIt(const G4Track& track,
|
||||
<< G4endl;
|
||||
energyDeposit=0;
|
||||
}
|
||||
aParticleChange.SetLocalEnergyDeposit(energyDeposit);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(energyDeposit);
|
||||
return G4VContinuousDiscreteProcess::PostStepDoIt(track, step);
|
||||
}
|
||||
|
||||
@@ -498,10 +498,10 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
G4double beta2 = (gamma2-1.0)/gamma2;
|
||||
G4double amol = (gamma-1.0)*(gamma-1.0)/gamma2;
|
||||
G4double cps = ene*rb;
|
||||
G4double cp = sqrt(cps);
|
||||
G4double cp = std::sqrt(cps);
|
||||
|
||||
G4double delta = CalculateDeltaFermi(ene,Z,electronVolumeDensity);
|
||||
G4double distantTransvCS0 = std::max(log(gamma2)-beta2-delta,0.0);
|
||||
G4double distantTransvCS0 = std::max(std::log(gamma2)-beta2-delta,0.0);
|
||||
|
||||
G4double rl,rl1;
|
||||
|
||||
@@ -521,7 +521,7 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
rl=cutoff/ene;
|
||||
rl1=1.0-rl;
|
||||
if (rl < 0.5)
|
||||
closeCS0 = (amol*(0.5-rl)+(1.0/rl)-(1.0/rl1)+(1.0-amol)*log(rl/rl1))/ene;
|
||||
closeCS0 = (amol*(0.5-rl)+(1.0/rl)-(1.0/rl1)+(1.0-amol)*std::log(rl/rl1))/ene;
|
||||
}
|
||||
|
||||
// Cross sections for the different oscillators
|
||||
@@ -557,8 +557,8 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
if (wi>cutoff && wi<ene)
|
||||
{
|
||||
if (wi>(1e-6*ene)){
|
||||
G4double cpp=sqrt((ene-wi)*(ene-wi+2.0*electron_mass_c2));
|
||||
qm->push_back(sqrt((cp-cpp)*(cp-cpp)+electron_mass_c2*electron_mass_c2)-electron_mass_c2);
|
||||
G4double cpp=std::sqrt((ene-wi)*(ene-wi+2.0*electron_mass_c2));
|
||||
qm->push_back(std::sqrt((cp-cpp)*(cp-cpp)+electron_mass_c2*electron_mass_c2)-electron_mass_c2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -568,7 +568,7 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
if ((*qm)[i] < wi)
|
||||
{
|
||||
|
||||
G4double distantLongitCS = occupNb*log(wi*((*qm)[i]+2.0*electron_mass_c2)/
|
||||
G4double distantLongitCS = occupNb*std::log(wi*((*qm)[i]+2.0*electron_mass_c2)/
|
||||
((*qm)[i]*(wi+2.0*electron_mass_c2)))/wi;
|
||||
cumulHardCS->push_back(totalHardCS);
|
||||
typeOfInteraction->push_back(1.0); //distant longitudinal
|
||||
@@ -596,7 +596,7 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
{
|
||||
rl=wi/ene;
|
||||
rl1=1.0-rl;
|
||||
closeCS = occupNb*(amol*(0.5-rl)+(1.0/rl)-(1.0/rl1)+(1.0-amol)*log(rl/rl1))/ene;
|
||||
closeCS = occupNb*(amol*(0.5-rl)+(1.0/rl)-(1.0/rl1)+(1.0-amol)*std::log(rl/rl1))/ene;
|
||||
cumulHardCS->push_back(totalHardCS);
|
||||
typeOfInteraction->push_back(3.0); //close
|
||||
nbOfLevel->push_back((G4double) i);
|
||||
@@ -651,10 +651,10 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
dde= (*(resonanceEnergy->find(Z)->second))[iOsc];
|
||||
kineticEnergy1=ene-dde;
|
||||
G4double qs=(*qm)[iOsc]/(1.0+((*qm)[iOsc]/(2.0*electron_mass_c2)));
|
||||
G4double q=qs/(pow((qs/dde)*(1.0+(0.5*dde/electron_mass_c2)),G4UniformRand())-(0.5*qs/electron_mass_c2));
|
||||
G4double q=qs/(std::pow((qs/dde)*(1.0+(0.5*dde/electron_mass_c2)),G4UniformRand())-(0.5*qs/electron_mass_c2));
|
||||
G4double qtrev = q*(q+2.0*electron_mass_c2);
|
||||
G4double cpps = kineticEnergy1*(kineticEnergy1+2.0*electron_mass_c2);
|
||||
cosThetaPrimary = (cpps+cps-qtrev)/(2.0*cp*sqrt(cpps));
|
||||
cosThetaPrimary = (cpps+cps-qtrev)/(2.0*cp*std::sqrt(cpps));
|
||||
if (cosThetaPrimary>1.0) cosThetaPrimary=1.0;
|
||||
//Energy and emission angle of the delta ray
|
||||
kks = (G4int) (*(shellFlag->find(Z)->second))[iOsc];
|
||||
@@ -666,7 +666,7 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
{
|
||||
energySecondary=dde-(*(ionizationEnergy->find(Z)->second))[iOsc];
|
||||
}
|
||||
cosThetaSecondary = 0.5*(dde*(ene+rb-dde)+qtrev)/sqrt(cps*qtrev);
|
||||
cosThetaSecondary = 0.5*(dde*(ene+rb-dde)+qtrev)/std::sqrt(cps*qtrev);
|
||||
if (cosThetaSecondary>1.0) cosThetaSecondary=1.0;
|
||||
}
|
||||
|
||||
@@ -726,10 +726,10 @@ void G4PenelopeIonisation::CalculateDiscreteForElectrons(G4double ene,G4double c
|
||||
}while ((G4UniformRand()*(1.0+A*rk2)) > phi);
|
||||
//Energy and scattering angle (primary electron);
|
||||
kineticEnergy1 = ene*(1.0-rk);
|
||||
cosThetaPrimary = sqrt(kineticEnergy1*rb/(ene*(rb-(rk*ene))));
|
||||
cosThetaPrimary = std::sqrt(kineticEnergy1*rb/(ene*(rb-(rk*ene))));
|
||||
//Energy and scattering angle of the delta ray
|
||||
energySecondary = ene-kineticEnergy1-UII;
|
||||
cosThetaSecondary = sqrt(rk*ene*rb/(ene*(rk*ene+2.0*electron_mass_c2)));
|
||||
cosThetaSecondary = std::sqrt(rk*ene*rb/(ene*(rk*ene+2.0*electron_mass_c2)));
|
||||
}
|
||||
|
||||
else
|
||||
@@ -798,7 +798,7 @@ void G4PenelopeIonisation::ReadData()
|
||||
G4Exception(excep);
|
||||
}
|
||||
}while (test != -2); //the very last Z is closed with -2 instead of -1
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
G4double G4PenelopeIonisation::CalculateDeltaFermi(G4double ene,G4int Z,
|
||||
@@ -806,7 +806,7 @@ G4double G4PenelopeIonisation::CalculateDeltaFermi(G4double ene,G4int Z,
|
||||
{
|
||||
G4double plasmaEnergyCoefficient = 1.377e-39; //(e*hbar)^2/(epsilon0*electron_mass)
|
||||
G4double plasmaEnergySquared = plasmaEnergyCoefficient*(electronVolumeDensity*m3);
|
||||
// sqrt(plasmaEnergySquared) is the plasma energy of the solid (MeV)
|
||||
// std::sqrt(plasmaEnergySquared) is the plasma energy of the solid (MeV)
|
||||
G4double gam = 1.0+ene/electron_mass_c2;
|
||||
G4double gam2=gam*gam;
|
||||
G4double delta = 0.0;
|
||||
@@ -863,7 +863,7 @@ G4double G4PenelopeIonisation::CalculateDeltaFermi(G4double ene,G4int Z,
|
||||
for (size_t kk=0;kk<nbOsc;kk++){
|
||||
G4int occupNb = (G4int) (*(occupationNumber->find(Z)->second))[kk];
|
||||
wr = (*(resonanceEnergy->find(Z)->second))[kk];
|
||||
delta += occupNb*log(1.0+wl2/(wr*wr));
|
||||
delta += occupNb*std::log(1.0+wl2/(wr*wr));
|
||||
}
|
||||
delta = (delta/((G4double) Z))-wl2/(gam2*plasmaEnergySquared);
|
||||
return delta;
|
||||
@@ -916,8 +916,8 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForElectrons(G4double ene,G
|
||||
|
||||
//Distant interactions
|
||||
G4double cp1s = (ene-resEne)*(ene-resEne+2.0*electron_mass_c2);
|
||||
G4double cp1 = sqrt(cp1s);
|
||||
G4double cp = sqrt(cps);
|
||||
G4double cp1 = std::sqrt(cp1s);
|
||||
G4double cp = std::sqrt(cps);
|
||||
G4double sdLong=0.0, sdTrans = 0.0, sdDist=0.0;
|
||||
|
||||
//Distant longitudinal interactions
|
||||
@@ -925,7 +925,7 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForElectrons(G4double ene,G
|
||||
|
||||
if (resEne > ene*(1e-6))
|
||||
{
|
||||
qm = sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
qm = std::sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -935,7 +935,7 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForElectrons(G4double ene,G
|
||||
|
||||
if (qm < resEne)
|
||||
{
|
||||
sdLong = log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
sdLong = std::log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -943,7 +943,7 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForElectrons(G4double ene,G
|
||||
}
|
||||
|
||||
if (sdLong > 0) {
|
||||
sdTrans = std::max(log(gamma2)-beta2-delta,0.0);
|
||||
sdTrans = std::max(std::log(gamma2)-beta2-delta,0.0);
|
||||
sdDist = sdTrans + sdLong;
|
||||
if (cutoff > resEne) sPower = sdDist;
|
||||
}
|
||||
@@ -956,8 +956,8 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForElectrons(G4double ene,G
|
||||
if (wl < (wu-1*eV)) wu=wl;
|
||||
wl = resEne;
|
||||
if (wl > (wu-1*eV)) return sPower;
|
||||
sPower += log(wu/wl)+(ene/(ene-wu))-(ene/(ene-wl))
|
||||
+ (2.0 - amol)*log((ene-wu)/(ene-wl))
|
||||
sPower += std::log(wu/wl)+(ene/(ene-wu))-(ene/(ene-wl))
|
||||
+ (2.0 - amol)*std::log((ene-wu)/(ene-wl))
|
||||
+ amol*((wu*wu)-(wl*wl))/(2.0*ene*ene);
|
||||
|
||||
return sPower;
|
||||
@@ -983,8 +983,8 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForPositrons(G4double ene,G
|
||||
|
||||
//Distant interactions
|
||||
G4double cp1s = (ene-resEne)*(ene-resEne+2.0*electron_mass_c2);
|
||||
G4double cp1 = sqrt(cp1s);
|
||||
G4double cp = sqrt(cps);
|
||||
G4double cp1 = std::sqrt(cp1s);
|
||||
G4double cp = std::sqrt(cps);
|
||||
G4double sdLong=0.0, sdTrans = 0.0, sdDist=0.0;
|
||||
|
||||
//Distant longitudinal interactions
|
||||
@@ -992,7 +992,7 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForPositrons(G4double ene,G
|
||||
|
||||
if (resEne > ene*(1e-6))
|
||||
{
|
||||
qm = sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
qm = std::sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1002,7 +1002,7 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForPositrons(G4double ene,G
|
||||
|
||||
if (qm < resEne)
|
||||
{
|
||||
sdLong = log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
sdLong = std::log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1010,7 +1010,7 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForPositrons(G4double ene,G
|
||||
}
|
||||
|
||||
if (sdLong > 0) {
|
||||
sdTrans = std::max(log(gamma2)-beta2-delta,0.0);
|
||||
sdTrans = std::max(std::log(gamma2)-beta2-delta,0.0);
|
||||
sdDist = sdTrans + sdLong;
|
||||
if (cutoff > resEne) sPower = sdDist;
|
||||
}
|
||||
@@ -1023,7 +1023,7 @@ G4double G4PenelopeIonisation::CalculateStoppingPowerForPositrons(G4double ene,G
|
||||
if (wl < (wu-1*eV)) wu=wl;
|
||||
wl = resEne;
|
||||
if (wl > (wu-1*eV)) return sPower;
|
||||
sPower += log(wu/wl)-bha1*(wu-wl)/ene
|
||||
sPower += std::log(wu/wl)-bha1*(wu-wl)/ene
|
||||
+ bha2*((wu*wu)-(wl*wl))/(2.0*ene*ene)
|
||||
- bha3*((wu*wu*wu)-(wl*wl*wl))/(3.0*ene*ene*ene)
|
||||
+ bha4*((wu*wu*wu*wu)-(wl*wl*wl*wl))/(4.0*ene*ene*ene*ene);
|
||||
@@ -1047,7 +1047,7 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
G4double beta2 = (gamma2-1.0)/gamma2;
|
||||
G4double amol = (gamma-1.0)*(gamma-1.0)/gamma2;
|
||||
G4double cps = ene*rb;
|
||||
G4double cp = sqrt(cps);
|
||||
G4double cp = std::sqrt(cps);
|
||||
G4double help = (gamma+1.0)*(gamma+1.0);
|
||||
G4double bha1 = amol*(2.0*help-1.0)/(gamma2-1.0);
|
||||
G4double bha2 = amol*(3.0+1.0/help);
|
||||
@@ -1055,7 +1055,7 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
G4double bha4 = amol*(gamma-1.0)*(gamma-1.0)/help;
|
||||
|
||||
G4double delta = CalculateDeltaFermi(ene,Z,electronVolumeDensity);
|
||||
G4double distantTransvCS0 = std::max(log(gamma2)-beta2-delta,0.0);
|
||||
G4double distantTransvCS0 = std::max(std::log(gamma2)-beta2-delta,0.0);
|
||||
|
||||
G4double rl,rl1;
|
||||
|
||||
@@ -1076,7 +1076,7 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
rl=cutoff/ene;
|
||||
rl1=1.0-rl;
|
||||
if (rl < 1.0)
|
||||
closeCS0 = (((1.0/rl)-1.0) + bha1*log(rl) + bha2*rl1
|
||||
closeCS0 = (((1.0/rl)-1.0) + bha1*std::log(rl) + bha2*rl1
|
||||
+ (bha3/2.0)*((rl*rl)-1.0)
|
||||
+ (bha4/3.0)*(1.0-(rl*rl*rl)))/ene;
|
||||
}
|
||||
@@ -1114,8 +1114,8 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
if (wi>cutoff && wi<ene)
|
||||
{
|
||||
if (wi>(1e-6*ene)){
|
||||
G4double cpp=sqrt((ene-wi)*(ene-wi+2.0*electron_mass_c2));
|
||||
qm->push_back(sqrt((cp-cpp)*(cp-cpp)+ electron_mass_c2 * electron_mass_c2)-electron_mass_c2);
|
||||
G4double cpp=std::sqrt((ene-wi)*(ene-wi+2.0*electron_mass_c2));
|
||||
qm->push_back(std::sqrt((cp-cpp)*(cp-cpp)+ electron_mass_c2 * electron_mass_c2)-electron_mass_c2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1125,7 +1125,7 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
if ((*qm)[i] < wi)
|
||||
{
|
||||
|
||||
G4double distantLongitCS = occupNb*log(wi*((*qm)[i]+2.0*electron_mass_c2)/
|
||||
G4double distantLongitCS = occupNb*std::log(wi*((*qm)[i]+2.0*electron_mass_c2)/
|
||||
((*qm)[i]*(wi+2.0*electron_mass_c2)))/wi;
|
||||
cumulHardCS->push_back(totalHardCS);
|
||||
typeOfInteraction->push_back(1.0); //distant longitudinal
|
||||
@@ -1153,7 +1153,7 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
{
|
||||
rl=wi/ene;
|
||||
rl1=1.0-rl;
|
||||
closeCS = occupNb*(((1.0/rl)-1.0)+bha1*log(rl)+bha2*rl1
|
||||
closeCS = occupNb*(((1.0/rl)-1.0)+bha1*std::log(rl)+bha2*rl1
|
||||
+ (bha3/2.0)*((rl*rl)-1.0)
|
||||
+ (bha4/3.0)*(1.0-(rl*rl*rl)))/ene;
|
||||
cumulHardCS->push_back(totalHardCS);
|
||||
@@ -1210,10 +1210,10 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
dde= (*(resonanceEnergy->find(Z)->second))[iOsc];
|
||||
kineticEnergy1=ene-dde;
|
||||
G4double qs=(*qm)[iOsc]/(1.0+((*qm)[iOsc]/(2.0*electron_mass_c2)));
|
||||
G4double q=qs/(pow((qs/dde)*(1.0+(0.5*dde/electron_mass_c2)),G4UniformRand())-(0.5*qs/electron_mass_c2));
|
||||
G4double q=qs/(std::pow((qs/dde)*(1.0+(0.5*dde/electron_mass_c2)),G4UniformRand())-(0.5*qs/electron_mass_c2));
|
||||
G4double qtrev = q*(q+2.0*electron_mass_c2);
|
||||
G4double cpps = kineticEnergy1*(kineticEnergy1+2.0*electron_mass_c2);
|
||||
cosThetaPrimary = (cpps+cps-qtrev)/(2.0*cp*sqrt(cpps));
|
||||
cosThetaPrimary = (cpps+cps-qtrev)/(2.0*cp*std::sqrt(cpps));
|
||||
if (cosThetaPrimary>1.0) cosThetaPrimary=1.0;
|
||||
//Energy and emission angle of the delta ray
|
||||
kks = (G4int) (*(shellFlag->find(Z)->second))[iOsc];
|
||||
@@ -1225,7 +1225,7 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
{
|
||||
energySecondary=dde-(*(ionizationEnergy->find(Z)->second))[iOsc];
|
||||
}
|
||||
cosThetaSecondary = 0.5*(dde*(ene+rb-dde)+qtrev)/sqrt(cps*qtrev);
|
||||
cosThetaSecondary = 0.5*(dde*(ene+rb-dde)+qtrev)/std::sqrt(cps*qtrev);
|
||||
if (cosThetaSecondary>1.0) cosThetaSecondary=1.0;
|
||||
}
|
||||
|
||||
@@ -1274,10 +1274,10 @@ void G4PenelopeIonisation::CalculateDiscreteForPositrons(G4double ene,G4double c
|
||||
}while ( G4UniformRand() > phi);
|
||||
//Energy and scattering angle (primary electron);
|
||||
kineticEnergy1 = ene*(1.0-rk);
|
||||
cosThetaPrimary = sqrt(kineticEnergy1*rb/(ene*(rb-(rk*ene))));
|
||||
cosThetaPrimary = std::sqrt(kineticEnergy1*rb/(ene*(rb-(rk*ene))));
|
||||
//Energy and scattering angle of the delta ray
|
||||
energySecondary = ene-kineticEnergy1-UII;
|
||||
cosThetaSecondary = sqrt(rk*ene*rb/(ene*(rk*ene+2.0*electron_mass_c2)));
|
||||
cosThetaSecondary = std::sqrt(rk*ene*rb/(ene*(rk*ene+2.0*electron_mass_c2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1347,8 +1347,8 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForElectrons(G4double ene,G4dou
|
||||
|
||||
//Distant interactions
|
||||
G4double cp1s = (ene-resEne)*(ene-resEne+2.0*electron_mass_c2);
|
||||
G4double cp1 = sqrt(cp1s);
|
||||
G4double cp = sqrt(cps);
|
||||
G4double cp1 = std::sqrt(cp1s);
|
||||
G4double cp = std::sqrt(cps);
|
||||
G4double sdLong=0.0, sdTrans = 0.0, sdDist=0.0;
|
||||
|
||||
//Distant longitudinal interactions
|
||||
@@ -1356,7 +1356,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForElectrons(G4double ene,G4dou
|
||||
|
||||
if (resEne > ene*(1e-6))
|
||||
{
|
||||
qm = sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
qm = std::sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1366,7 +1366,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForElectrons(G4double ene,G4dou
|
||||
|
||||
if (qm < resEne)
|
||||
{
|
||||
sdLong = log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
sdLong = std::log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1374,7 +1374,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForElectrons(G4double ene,G4dou
|
||||
}
|
||||
|
||||
if (sdLong > 0) {
|
||||
sdTrans = std::max(log(gamma2)-beta2-delta,0.0);
|
||||
sdTrans = std::max(std::log(gamma2)-beta2-delta,0.0);
|
||||
sdDist = sdTrans + sdLong;
|
||||
if (cutoff > resEne)
|
||||
{
|
||||
@@ -1395,7 +1395,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForElectrons(G4double ene,G4dou
|
||||
{
|
||||
hardCont += (1.0/(ene-wu))-(1.0/(ene-wl))
|
||||
- (1.0/wu)+(1.0/wl)
|
||||
+ (1.0-amol)*log(((ene-wu)*wl)/((ene-wl)*wu))/ene
|
||||
+ (1.0-amol)*std::log(((ene-wu)*wl)/((ene-wl)*wu))/ene
|
||||
+ amol*(wu-wl)/(ene*ene);
|
||||
wu=wl;
|
||||
}
|
||||
@@ -1407,7 +1407,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForElectrons(G4double ene,G4dou
|
||||
}
|
||||
softCont += (1.0/(ene-wu))-(1.0/(ene-wl))
|
||||
- (1.0/wu)+(1.0/wl)
|
||||
+ (1.0-amol)*log(((ene-wu)*wl)/((ene-wl)*wu))/ene
|
||||
+ (1.0-amol)*std::log(((ene-wu)*wl)/((ene-wl)*wu))/ene
|
||||
+ amol*(wu-wl)/(ene*ene);
|
||||
if (index == 1) return softCont;
|
||||
return hardCont;
|
||||
@@ -1434,8 +1434,8 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForPositrons(G4double ene,G4dou
|
||||
|
||||
//Distant interactions
|
||||
G4double cp1s = (ene-resEne)*(ene-resEne+2.0*electron_mass_c2);
|
||||
G4double cp1 = sqrt(cp1s);
|
||||
G4double cp = sqrt(cps);
|
||||
G4double cp1 = std::sqrt(cp1s);
|
||||
G4double cp = std::sqrt(cps);
|
||||
G4double sdLong=0.0, sdTrans = 0.0, sdDist=0.0;
|
||||
|
||||
//Distant longitudinal interactions
|
||||
@@ -1443,7 +1443,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForPositrons(G4double ene,G4dou
|
||||
|
||||
if (resEne > ene*(1e-6))
|
||||
{
|
||||
qm = sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
qm = std::sqrt((cp-cp1)*(cp-cp1)+(electron_mass_c2*electron_mass_c2))-electron_mass_c2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1453,7 +1453,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForPositrons(G4double ene,G4dou
|
||||
|
||||
if (qm < resEne)
|
||||
{
|
||||
sdLong = log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
sdLong = std::log(resEne*(qm+2.0*electron_mass_c2)/(qm*(resEne+2.0*electron_mass_c2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1461,7 +1461,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForPositrons(G4double ene,G4dou
|
||||
}
|
||||
|
||||
if (sdLong > 0) {
|
||||
sdTrans = std::max(log(gamma2)-beta2-delta,0.0);
|
||||
sdTrans = std::max(std::log(gamma2)-beta2-delta,0.0);
|
||||
sdDist = sdTrans + sdLong;
|
||||
if (cutoff > resEne)
|
||||
{
|
||||
@@ -1479,7 +1479,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForPositrons(G4double ene,G4dou
|
||||
G4double wu = ene;
|
||||
|
||||
if (wl < (wu-1*eV)) {
|
||||
hardCont += (1.0/wl)-(1.0/wu)-bha1*log(wu/wl)/ene
|
||||
hardCont += (1.0/wl)-(1.0/wu)-bha1*std::log(wu/wl)/ene
|
||||
+ bha2*(wu-wl)/(ene*ene) -bha3*((wu*wu)-(wl*wl))/(2.0*ene*ene*ene)
|
||||
+ bha4*((wu*wu*wu)-(wl*wl*wl))/(3.0*ene*ene*ene*ene);
|
||||
wu=wl;
|
||||
@@ -1490,7 +1490,7 @@ G4double G4PenelopeIonisation::CrossSectionsRatioForPositrons(G4double ene,G4dou
|
||||
if (index == 1) return softCont;
|
||||
if (index == 2) return hardCont;
|
||||
}
|
||||
softCont += (1.0/wl)-(1.0/wu)-bha1*log(wu/wl)/ene
|
||||
softCont += (1.0/wl)-(1.0/wu)-bha1*std::log(wu/wl)/ene
|
||||
+ bha2*(wu-wl)/(ene*ene) -bha3*((wu*wu)-(wl*wl))/(2.0*ene*ene*ene)
|
||||
+ bha4*((wu*wu*wu)-(wl*wl*wl))/(3.0*ene*ene*ene*ene);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PenelopePhotoElectric.cc,v 1.7 2003/06/16 17:00:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4PenelopePhotoElectric.cc,v 1.8 2004/11/18 12:09:14 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: L. Pandola
|
||||
//
|
||||
@@ -122,9 +122,9 @@ G4VParticleChange* G4PenelopePhotoElectric::PostStepDoIt(const G4Track& aTrack,
|
||||
G4double photonEnergy = incidentPhoton->GetKineticEnergy();
|
||||
if (photonEnergy <= lowEnergyLimit)
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit(photonEnergy);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(photonEnergy);
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
}
|
||||
|
||||
@@ -261,11 +261,11 @@ G4VParticleChange* G4PenelopePhotoElectric::PostStepDoIt(const G4Track& aTrack,
|
||||
}
|
||||
|
||||
// Kill the incident photon
|
||||
aParticleChange.SetMomentumChange( 0., 0., 0. );
|
||||
aParticleChange.SetEnergyChange( 0. );
|
||||
aParticleChange.ProposeMomentumDirection( 0., 0., 0. );
|
||||
aParticleChange.ProposeEnergy( 0. );
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(energyDeposit);
|
||||
aParticleChange.SetStatusChange( fStopAndKill );
|
||||
aParticleChange.ProposeLocalEnergyDeposit(energyDeposit);
|
||||
aParticleChange.ProposeTrackStatus( fStopAndKill );
|
||||
|
||||
// Reset NbOfInteractionLengthLeft and return aParticleChange
|
||||
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep );
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
//
|
||||
// $Id: G4PenelopeRayleigh.cc,v 1.11 2004/03/18 13:40:36 pandola Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4PenelopeRayleigh.cc,v 1.13 2004/12/02 14:01:35 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Author: L. Pandola (luciano.pandola@cern.ch)
|
||||
//
|
||||
@@ -33,7 +33,7 @@
|
||||
// from SUN
|
||||
// 10 Mar 2003 V.Ivanchenko Remove CutPerMaterial warning
|
||||
// 12 Mar 2003 L.Pandola Code "cleaned" - Cuts per region
|
||||
// 17 Mar 2004 L.Pandola Removed unnecessary calls to pow(a,b)
|
||||
// 17 Mar 2004 L.Pandola Removed unnecessary calls to std::pow(a,b)
|
||||
// 18 Mar 2004 M.Mendenhall Introduced SamplingTable (performance improvement)
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -105,10 +105,10 @@ void G4PenelopeRayleigh::BuildPhysicsTable(const G4ParticleDefinition& )
|
||||
{
|
||||
|
||||
G4DataVector energyVector;
|
||||
G4double dBin = log10(highEnergyLimit/lowEnergyLimit)/nBins;
|
||||
G4double dBin = std::log10(highEnergyLimit/lowEnergyLimit)/nBins;
|
||||
for (G4int i=0;i<nBins;i++)
|
||||
{
|
||||
energyVector.push_back(pow(10.,log10(lowEnergyLimit)+i*dBin));
|
||||
energyVector.push_back(std::pow(10.,std::log10(lowEnergyLimit)+i*dBin));
|
||||
}
|
||||
|
||||
const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
|
||||
@@ -208,9 +208,9 @@ G4VParticleChange* G4PenelopeRayleigh::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
if (photonEnergy0 <= lowEnergyLimit)
|
||||
{
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit(photonEnergy0);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(photonEnergy0);
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ G4VParticleChange* G4PenelopeRayleigh::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
// Sample the angle of the scattered photon
|
||||
const G4double xpar=41.2148;
|
||||
G4double x2max = 2.0*log(xpar*photonEnergy0/electron_mass_c2);
|
||||
G4double x2max = 2.0*std::log(xpar*photonEnergy0/electron_mass_c2);
|
||||
G4int jm;
|
||||
G4int asize = samplingFunction_x->size();
|
||||
if (x2max<(*samplingFunction_x)[1])
|
||||
@@ -246,7 +246,7 @@ G4VParticleChange* G4PenelopeRayleigh::PostStepDoIt(const G4Track& aTrack,
|
||||
G4double ru,denomin,x2rat;
|
||||
G4double CDT,G,rand;
|
||||
do{
|
||||
ru = rumax + log(G4UniformRand());
|
||||
ru = rumax + std::log(G4UniformRand());
|
||||
j=0;
|
||||
ju=jm+1;
|
||||
do{
|
||||
@@ -270,29 +270,29 @@ G4VParticleChange* G4PenelopeRayleigh::PostStepDoIt(const G4Track& aTrack,
|
||||
{
|
||||
x2rat = (*samplingFunction_x)[j]-x2max;
|
||||
}
|
||||
CDT = 1.0-2.0*exp(x2rat);
|
||||
CDT = 1.0-2.0*std::exp(x2rat);
|
||||
G = 0.5*(1.0+CDT*CDT);
|
||||
rand = G4UniformRand();
|
||||
}while (rand>G);
|
||||
|
||||
G4double cosTheta = CDT;
|
||||
G4double sinTheta = sqrt(1-cosTheta*cosTheta);
|
||||
G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
|
||||
|
||||
|
||||
|
||||
|
||||
// Scattered photon angles. ( Z - axis along the parent photon)
|
||||
G4double phi = twopi * G4UniformRand() ;
|
||||
G4double dirX = sinTheta*cos(phi);
|
||||
G4double dirY = sinTheta*sin(phi);
|
||||
G4double dirX = sinTheta*std::cos(phi);
|
||||
G4double dirY = sinTheta*std::sin(phi);
|
||||
G4double dirZ = cosTheta;
|
||||
|
||||
// Update G4VParticleChange for the scattered photon
|
||||
G4ThreeVector photonDirection1(dirX, dirY, dirZ);
|
||||
|
||||
photonDirection1.rotateUz(photonDirection0);
|
||||
aParticleChange.SetEnergyChange(photonEnergy0);
|
||||
aParticleChange.SetMomentumChange(photonDirection1);
|
||||
aParticleChange.ProposeEnergy(photonEnergy0);
|
||||
aParticleChange.ProposeMomentumDirection(photonDirection1);
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(0);
|
||||
|
||||
@@ -329,8 +329,8 @@ void G4PenelopeRayleigh::InizialiseSampling()
|
||||
const G4int points=241;
|
||||
G4double Xlow = 0.;
|
||||
G4double Xhigh=1e-04;
|
||||
G4double fact = pow((1e06/Xhigh),(1/240.0));
|
||||
samplingConstant=log(fact);
|
||||
G4double fact = std::pow((1e06/Xhigh),(1/240.0));
|
||||
samplingConstant=std::log(fact);
|
||||
|
||||
if (theTable==SamplingTables.end()) { //material not inizialized yet
|
||||
samplingFunction_x = new G4DataVector();
|
||||
@@ -352,8 +352,8 @@ void G4PenelopeRayleigh::InizialiseSampling()
|
||||
samplingFunction_y->push_back(sum+(*samplingFunction_y)[i-1]);
|
||||
}
|
||||
for (i=0;i<points;i++){
|
||||
(*samplingFunction_x)[i]=log((*samplingFunction_x)[i]);
|
||||
(*samplingFunction_y)[i]=log((*samplingFunction_y)[i]);
|
||||
(*samplingFunction_x)[i]=std::log((*samplingFunction_x)[i]);
|
||||
(*samplingFunction_y)[i]=std::log((*samplingFunction_y)[i]);
|
||||
}
|
||||
SamplingTables[material] = std::pair<G4DataVector*,G4DataVector*> (samplingFunction_x,samplingFunction_y);
|
||||
}
|
||||
@@ -468,7 +468,7 @@ G4double G4PenelopeRayleigh::MolecularFormFactor(G4double y)
|
||||
1.7166e-2, 1.9954e-2, 2.2497e-2, 2.1942e-2, 2.1965e-2,
|
||||
2.0005e-2, 1.8927e-2, 1.8167e-2, 1.6314e-2, 1.5522e-2};
|
||||
|
||||
G4double x=sqrt(y);
|
||||
G4double x=std::sqrt(y);
|
||||
G4double gradx1=0.0;
|
||||
G4double fa=0.0;
|
||||
|
||||
@@ -489,9 +489,9 @@ G4double G4PenelopeRayleigh::MolecularFormFactor(G4double y)
|
||||
G4double k1=0.3125;
|
||||
G4double k2=2.426311e-02;
|
||||
Pa=(Z-k1)*fine_structure_const;
|
||||
Pg=sqrt(1-(Pa*Pa));
|
||||
Pg=std::sqrt(1-(Pa*Pa));
|
||||
Pq=k2*x/Pa;
|
||||
fb=sin(2*Pg*atan(Pq))/(Pg*Pq*pow((1+Pq*Pq),Pg));
|
||||
fb=std::sin(2*Pg*std::atan(Pq))/(Pg*Pq*std::pow((1+Pq*Pq),Pg));
|
||||
fa=std::max(fa,fb);
|
||||
}
|
||||
if (stechiometric)
|
||||
|
||||
+4
-4
@@ -69,8 +69,8 @@ G4ThreeVector G4PhotoElectricAngularGeneratorStandard::GetPhotoElectronDirection
|
||||
|
||||
G4double costeta = 1.;
|
||||
G4double Phi = twopi * G4UniformRand();
|
||||
G4double cosphi = cos(Phi);
|
||||
G4double sinphi = sin(Phi);
|
||||
G4double cosphi = std::cos(Phi);
|
||||
G4double sinphi = std::sin(Phi);
|
||||
G4double sinteta = 0;
|
||||
G4double gamma = 1. + eKineticEnergy/electron_mass_c2;
|
||||
|
||||
@@ -79,7 +79,7 @@ G4ThreeVector G4PhotoElectricAngularGeneratorStandard::GetPhotoElectronDirection
|
||||
return costeta;
|
||||
}
|
||||
|
||||
G4double beta = sqrt(gamma*gamma-1.)/gamma;
|
||||
G4double beta = std::sqrt(gamma*gamma-1.)/gamma;
|
||||
G4double b = 0.5*gamma*(gamma-1.)*(gamma-2);
|
||||
|
||||
G4double rndm,term,greject,grejsup;
|
||||
@@ -93,7 +93,7 @@ G4ThreeVector G4PhotoElectricAngularGeneratorStandard::GetPhotoElectronDirection
|
||||
} while(greject < G4UniformRand()*grejsup);
|
||||
|
||||
|
||||
sinteta = sqrt(1.-costeta*costeta);
|
||||
sinteta = std::sqrt(1.-costeta*costeta);
|
||||
G4ThreeVector photoelectrondirection (sinteta*cosphi, sinteta*sinphi, costeta);
|
||||
photoelectrondirection.rotateUz(direction);
|
||||
return photoelectrondirection;
|
||||
|
||||
@@ -183,7 +183,7 @@ G4double G4QAOLowEnergyLoss::EnergyLoss(const G4Material* material,
|
||||
*/
|
||||
G4double dedx=0;
|
||||
|
||||
G4double v = c_light * sqrt( 2.0 * kineticEnergy / proton_mass_c2 );
|
||||
G4double v = c_light * std::sqrt( 2.0 * kineticEnergy / proton_mass_c2 );
|
||||
G4double coeff = twopi * proton_mass_c2 *
|
||||
(material-> GetTotNbOfElectPerVolume()) /
|
||||
electron_mass_c2 ;
|
||||
@@ -191,8 +191,8 @@ G4double G4QAOLowEnergyLoss::EnergyLoss(const G4Material* material,
|
||||
coeff *= fine_structure_const * fine_structure_const * hbarc_squared /
|
||||
kineticEnergy ;
|
||||
|
||||
//G4double beta = sqrt( 2.0 * kineticEnergy / proton_mass_c2 );
|
||||
//G4double fBetheVelocity = sqrt( 2.0 * 25.0 * keV / proton_mass_c2 )/beta;
|
||||
//G4double beta = std::sqrt( 2.0 * kineticEnergy / proton_mass_c2 );
|
||||
//G4double fBetheVelocity = std::sqrt( 2.0 * 25.0 * keV / proton_mass_c2 )/beta;
|
||||
//G4double coeff= twopi_mc2_rcl2*(material->GetElectronDensity())/(beta*beta);
|
||||
|
||||
|
||||
@@ -306,11 +306,11 @@ G4double squaredPlasmonEnergy = 28.816 * 28.816 * 1e-6
|
||||
G4double plasmonTerm = 0.66667 * GetOccupationNumber(Z,nbOfTheShell)
|
||||
* squaredPlasmonEnergy / (Z*Z) ;
|
||||
|
||||
G4double ionTerm = exp(0.5) * (element->GetAtomicShell(nbOfTheShell)) ;
|
||||
G4double ionTerm = std::exp(0.5) * (element->GetAtomicShell(nbOfTheShell)) ;
|
||||
|
||||
ionTerm = ionTerm*ionTerm ;
|
||||
|
||||
G4double oscShellEnergy = sqrt( ionTerm + plasmonTerm );
|
||||
G4double oscShellEnergy = std::sqrt( ionTerm + plasmonTerm );
|
||||
|
||||
/* if(material->GetName()=="Graphite"){
|
||||
G4cout << "\t" << Z
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4RangeTest.cc,v 1.7 2003/06/16 17:00:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SemiLogInterpolation.cc,v 1.4 2002/05/28 09:20:21 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4SemiLogInterpolation.cc,v 1.5 2004/12/02 14:01:36 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
@@ -65,7 +65,7 @@ G4double G4SemiLogInterpolation::Calculate(G4double x, G4int bin,
|
||||
G4double e2 = points[bin+1];
|
||||
G4double d1 = data[bin];
|
||||
G4double d2 = data[bin+1];
|
||||
value = (d1*log10(e2/x) + d2*log10(x/e1)) / log10(e2/e1);
|
||||
value = (d1*std::log10(e2/x) + d2*std::log10(x/e1)) / std::log10(e2/e1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ShellData.cc,v 1.6 2003/06/16 17:00:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ShellEMDataSet.cc,v 1.10 2003/06/16 17:00:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VCrossSectionHandler.cc,v 1.13 2003/06/16 17:00:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4VCrossSectionHandler.cc,v 1.14 2004/12/02 14:01:36 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
@@ -413,11 +413,11 @@ G4VEMDataSet* G4VCrossSectionHandler::BuildMeanFreePathForMaterials(const G4Data
|
||||
// in the material table
|
||||
|
||||
G4DataVector energyVector;
|
||||
G4double dBin = log10(eMax/eMin) / nBins;
|
||||
G4double dBin = std::log10(eMax/eMin) / nBins;
|
||||
|
||||
for (G4int i=0; i<nBins+1; i++)
|
||||
{
|
||||
energyVector.push_back(pow(10., log10(eMin)+i*dBin));
|
||||
energyVector.push_back(std::pow(10., std::log10(eMin)+i*dBin));
|
||||
}
|
||||
|
||||
// Factory method to build cross sections in derived classes,
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VeLowEnergyLoss.cc,v 1.23 2003/06/16 17:00:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4VeLowEnergyLoss.cc,v 1.24 2004/12/02 14:01:36 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -232,7 +232,7 @@ G4double G4VeLowEnergyLoss::RangeIntLog(G4PhysicsVector* physicsVector,
|
||||
for (G4int i=0; i<=nbin; i++)
|
||||
{
|
||||
ui = ltaulow+dltau*i;
|
||||
taui = exp(ui);
|
||||
taui = std::exp(ui);
|
||||
ti = ParticleMass*taui;
|
||||
lossi = physicsVector->GetValue(ti,isOut);
|
||||
if(i==0)
|
||||
@@ -337,9 +337,9 @@ void G4VeLowEnergyLoss::BuildLabTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
// low energy part first...
|
||||
losslim = physicsVector->GetValue(tlim,isOut);
|
||||
taulim=tlim/ParticleMass ;
|
||||
clim=sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = log(taulim);
|
||||
ltaumax = log(highestKineticEnergy/ParticleMass) ;
|
||||
clim=std::sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = std::log(taulim);
|
||||
ltaumax = std::log(highestKineticEnergy/ParticleMass) ;
|
||||
|
||||
G4int i=-1;
|
||||
G4double oldValue = 0. ;
|
||||
@@ -351,13 +351,13 @@ void G4VeLowEnergyLoss::BuildLabTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
if ( tau <= taulim )
|
||||
{
|
||||
Value = clim*exp(ppar*log(tau/taulim)) ;
|
||||
Value = clim*std::exp(ppar*std::log(tau/taulim)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
timelim=clim ;
|
||||
ltaulow = log(taulim);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(taulim);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = timelim+LabTimeIntLog(physicsVector,nbin);
|
||||
}
|
||||
timeVector->PutValue(i,Value);
|
||||
@@ -369,8 +369,8 @@ void G4VeLowEnergyLoss::BuildLabTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
{
|
||||
LowEdgeEnergy = timeVector->GetLowEdgeEnergy(j);
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
ltaulow = log(tauold);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(tauold);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = oldValue+LabTimeIntLog(physicsVector,nbin);
|
||||
timeVector->PutValue(j,Value);
|
||||
oldValue = Value ;
|
||||
@@ -398,9 +398,9 @@ void G4VeLowEnergyLoss::BuildProperTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
// low energy part first...
|
||||
losslim = physicsVector->GetValue(tlim,isOut);
|
||||
taulim=tlim/ParticleMass ;
|
||||
clim=sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = log(taulim);
|
||||
ltaumax = log(highestKineticEnergy/ParticleMass) ;
|
||||
clim=std::sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = std::log(taulim);
|
||||
ltaumax = std::log(highestKineticEnergy/ParticleMass) ;
|
||||
|
||||
G4int i=-1;
|
||||
G4double oldValue = 0. ;
|
||||
@@ -412,13 +412,13 @@ void G4VeLowEnergyLoss::BuildProperTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
if ( tau <= taulim )
|
||||
{
|
||||
Value = clim*exp(ppar*log(tau/taulim)) ;
|
||||
Value = clim*std::exp(ppar*std::log(tau/taulim)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
timelim=clim ;
|
||||
ltaulow = log(taulim);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(taulim);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = timelim+ProperTimeIntLog(physicsVector,nbin);
|
||||
}
|
||||
timeVector->PutValue(i,Value);
|
||||
@@ -430,8 +430,8 @@ void G4VeLowEnergyLoss::BuildProperTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
{
|
||||
LowEdgeEnergy = timeVector->GetLowEdgeEnergy(j);
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
ltaulow = log(tauold);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(tauold);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = oldValue+ProperTimeIntLog(physicsVector,nbin);
|
||||
timeVector->PutValue(j,Value);
|
||||
oldValue = Value ;
|
||||
@@ -454,7 +454,7 @@ G4double G4VeLowEnergyLoss::LabTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
for (G4int i=0; i<=nbin; i++)
|
||||
{
|
||||
ui = ltaulow+dltau*i;
|
||||
taui = exp(ui);
|
||||
taui = std::exp(ui);
|
||||
ti = ParticleMass*taui;
|
||||
lossi = physicsVector->GetValue(ti,isOut);
|
||||
if(i==0)
|
||||
@@ -466,7 +466,7 @@ G4double G4VeLowEnergyLoss::LabTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
else
|
||||
ci=0.5;
|
||||
}
|
||||
Value += ci*taui*(ti+ParticleMass)/(sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
Value += ci*taui*(ti+ParticleMass)/(std::sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
}
|
||||
Value *= ParticleMass*dltau/c_light;
|
||||
return Value;
|
||||
@@ -487,7 +487,7 @@ G4double G4VeLowEnergyLoss::ProperTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
for (G4int i=0; i<=nbin; i++)
|
||||
{
|
||||
ui = ltaulow+dltau*i;
|
||||
taui = exp(ui);
|
||||
taui = std::exp(ui);
|
||||
ti = ParticleMass*taui;
|
||||
lossi = physicsVector->GetValue(ti,isOut);
|
||||
if(i==0)
|
||||
@@ -499,7 +499,7 @@ G4double G4VeLowEnergyLoss::ProperTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
else
|
||||
ci=0.5;
|
||||
}
|
||||
Value += ci*taui*ParticleMass/(sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
Value += ci*taui*ParticleMass/(std::sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
}
|
||||
Value *= ParticleMass*dltau/c_light;
|
||||
return Value;
|
||||
@@ -537,7 +537,7 @@ G4PhysicsTable* G4VeLowEnergyLoss::BuildInverseRangeTable(G4PhysicsTable* theRan
|
||||
G4double rlow = pv->GetValue(elow, b);
|
||||
G4double rhigh = pv->GetValue(ehigh, b);
|
||||
|
||||
rhigh *= exp(log(rhigh/rlow)/((G4double)(nbins-1)));
|
||||
rhigh *= std::exp(std::log(rhigh/rlow)/((G4double)(nbins-1)));
|
||||
|
||||
G4PhysicsLogVector* v = new G4PhysicsLogVector(rlow, rhigh, nbins);
|
||||
|
||||
@@ -564,9 +564,9 @@ G4PhysicsTable* G4VeLowEnergyLoss::BuildInverseRangeTable(G4PhysicsTable* theRan
|
||||
}
|
||||
}
|
||||
|
||||
G4double e = log(energy1) + log(energy2/energy1)*log(range/range1)/log(range2/range1);
|
||||
G4double e = std::log(energy1) + std::log(energy2/energy1)*std::log(range/range1)/std::log(range2/range1);
|
||||
|
||||
v->PutValue(j,exp(e));
|
||||
v->PutValue(j,std::exp(e));
|
||||
}
|
||||
theInverseRangeTable->insert(v);
|
||||
|
||||
@@ -586,7 +586,7 @@ void G4VeLowEnergyLoss::InvertRangeVector(G4PhysicsTable* theRangeTable,
|
||||
// invert range vector for a material
|
||||
{
|
||||
G4double LowEdgeRange,A,B,C,discr,KineticEnergy ;
|
||||
G4double RTable = exp(log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double RTable = std::exp(std::log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double Tbin = lowestKineticEnergy/RTable ;
|
||||
G4double rangebin = 0.0 ;
|
||||
G4int binnumber = -1 ;
|
||||
@@ -621,7 +621,7 @@ void G4VeLowEnergyLoss::InvertRangeVector(G4PhysicsTable* theRangeTable,
|
||||
else
|
||||
{
|
||||
discr = B*B - 4.*A*(C-LowEdgeRange);
|
||||
discr = discr>0. ? sqrt(discr) : 0.;
|
||||
discr = discr>0. ? std::sqrt(discr) : 0.;
|
||||
KineticEnergy = 0.5*(discr-B)/A ;
|
||||
}
|
||||
}
|
||||
@@ -647,7 +647,7 @@ G4PhysicsTable* G4VeLowEnergyLoss::BuildRangeCoeffATable(G4PhysicsTable* theRang
|
||||
delete theRangeCoeffATable; }
|
||||
theRangeCoeffATable = new G4PhysicsTable(numOfCouples);
|
||||
|
||||
G4double RTable = exp(log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double RTable = std::exp(std::log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
@@ -709,7 +709,7 @@ G4PhysicsTable* G4VeLowEnergyLoss::BuildRangeCoeffBTable(G4PhysicsTable* theRang
|
||||
delete theRangeCoeffBTable; }
|
||||
theRangeCoeffBTable = new G4PhysicsTable(numOfCouples);
|
||||
|
||||
G4double RTable = exp(log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double RTable = std::exp(std::log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
@@ -770,7 +770,7 @@ G4PhysicsTable* G4VeLowEnergyLoss::BuildRangeCoeffCTable(G4PhysicsTable* theRang
|
||||
delete theRangeCoeffCTable; }
|
||||
theRangeCoeffCTable = new G4PhysicsTable(numOfCouples);
|
||||
|
||||
G4double RTable = exp(log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double RTable = std::exp(std::log(highestKineticEnergy/lowestKineticEnergy)/TotBin) ;
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
@@ -825,7 +825,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
{
|
||||
static const G4double minLoss = 1.*eV ;
|
||||
static const G4double probLim = 0.01 ;
|
||||
static const G4double sumaLim = -log(probLim) ;
|
||||
static const G4double sumaLim = -std::log(probLim) ;
|
||||
static const G4double alim=10.;
|
||||
static const G4double kappa = 10. ;
|
||||
static const G4double factor = twopi_mc2_rcl2 ;
|
||||
@@ -880,7 +880,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
if(MeanLoss >= kappa*Tm || MeanLoss <= kappa*ipotFluct)
|
||||
{
|
||||
G4double electronDensity = aMaterial->GetElectronDensity() ;
|
||||
siga = sqrt(Tm*(1.0-0.5*beta2)*step*
|
||||
siga = std::sqrt(Tm*(1.0-0.5*beta2)*step*
|
||||
factor*electronDensity/beta2) ;
|
||||
do {
|
||||
loss = G4RandGauss::shoot(MeanLoss,siga) ;
|
||||
@@ -889,13 +889,13 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
}
|
||||
|
||||
w1 = Tm/ipotFluct;
|
||||
w2 = log(2.*electron_mass_c2*tau2);
|
||||
w2 = std::log(2.*electron_mass_c2*tau2);
|
||||
|
||||
C = MeanLoss*(1.-rateFluct)/(w2-ipotLogFluct-beta2);
|
||||
|
||||
a1 = C*f1Fluct*(w2-e1LogFluct-beta2)/e1Fluct;
|
||||
a2 = C*f2Fluct*(w2-e2LogFluct-beta2)/e2Fluct;
|
||||
a3 = rateFluct*MeanLoss*(Tm-ipotFluct)/(ipotFluct*Tm*log(w1));
|
||||
a3 = rateFluct*MeanLoss*(Tm-ipotFluct)/(ipotFluct*Tm*std::log(w1));
|
||||
|
||||
suma = a1+a2+a3;
|
||||
|
||||
@@ -912,7 +912,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
siga=std::sqrt(a3) ;
|
||||
p3 = std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else p3 = G4Poisson(a3);
|
||||
@@ -936,13 +936,13 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
}
|
||||
else
|
||||
{
|
||||
a3 = MeanLoss*(Tm-e0)/(Tm*e0*log(Tm/e0));
|
||||
a3 = MeanLoss*(Tm-e0)/(Tm*e0*std::log(Tm/e0));
|
||||
|
||||
// G4cout << "MGP new Tm = " << Tm << " " << ipotFluct << " " << e0 << " a3= " << a3 << G4endl;
|
||||
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
siga=std::sqrt(a3) ;
|
||||
p3 = std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -976,7 +976,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
// excitation type 1
|
||||
if(a1>alim)
|
||||
{
|
||||
siga=sqrt(a1) ;
|
||||
siga=std::sqrt(a1) ;
|
||||
p1 = std::max(0,int(G4RandGauss::shoot(a1,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -985,7 +985,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
// excitation type 2
|
||||
if(a2>alim)
|
||||
{
|
||||
siga=sqrt(a2) ;
|
||||
siga=std::sqrt(a2) ;
|
||||
p2 = std::max(0,int(G4RandGauss::shoot(a2,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -1004,7 +1004,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
{
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
siga=std::sqrt(a3) ;
|
||||
p3 = std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -1025,9 +1025,9 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
if (na > 0.)
|
||||
{
|
||||
alfa = w1*G4double(nmaxCont2+p3)/(w1*G4double(nmaxCont2)+G4double(p3));
|
||||
alfa1 = alfa*log(alfa)/(alfa-1.);
|
||||
alfa1 = alfa*std::log(alfa)/(alfa-1.);
|
||||
ea = na*ipotFluct*alfa1;
|
||||
sea = ipotFluct*sqrt(na*(alfa-alfa1*alfa1));
|
||||
sea = ipotFluct*std::sqrt(na*(alfa-alfa1*alfa1));
|
||||
lossc += G4RandGauss::shoot(ea,sea);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ G4double G4VhElectronicStoppingPower::HeEffChargeSquare(
|
||||
static G4double c[6] = {0.2865, 0.1266, -0.001429,
|
||||
0.02402,-0.01135, 0.001475} ;
|
||||
|
||||
G4double e = log( std::max( 1.0, kineticEnergyHe/(keV*GetHeMassAMU()))) ;
|
||||
G4double e = std::log( std::max( 1.0, kineticEnergyHe/(keV*GetHeMassAMU()))) ;
|
||||
G4double x = c[0] ;
|
||||
G4double y = 1.0 ;
|
||||
for (G4int i=1; i<6; i++) {
|
||||
@@ -82,8 +82,7 @@ G4double G4VhElectronicStoppingPower::HeEffChargeSquare(
|
||||
}
|
||||
|
||||
G4double w = 7.6 - e ;
|
||||
w = 1.0 + (0.007 + 0.00005*z) * exp( -w*w ) ;
|
||||
w = 4.0 * (1.0 - exp(-x)) * w * w ;
|
||||
|
||||
w = 1.0 + (0.007 + 0.00005*z) * std::exp( -w*w ) ;
|
||||
w = 4.0 * (1.0 - std::exp(-x)) * w * w ;
|
||||
return w;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,10 @@ G4VhShellCrossSection::G4VhShellCrossSection()
|
||||
G4VhShellCrossSection::~G4VhShellCrossSection()
|
||||
{ }
|
||||
|
||||
void G4VhShellCrossSection :: SetTotalCS(G4double)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
G4int G4VhShellCrossSection::SelectRandomShell(G4int Z,
|
||||
G4double incidentEnergy,
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4eBremsstrahlungSpectrum.cc,v 1.11 2003/06/16 17:00:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4eBremsstrahlungSpectrum.cc,v 1.14 2004/12/02 14:01:36 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -81,7 +81,7 @@ G4double G4eBremsstrahlungSpectrum::Probability(G4int Z,
|
||||
t0 /= e;
|
||||
tm /= e;
|
||||
|
||||
G4double z = lowestE/e;
|
||||
G4double z0 = lowestE/e;
|
||||
G4DataVector p;
|
||||
|
||||
// Access parameters
|
||||
@@ -90,7 +90,7 @@ G4double G4eBremsstrahlungSpectrum::Probability(G4int Z,
|
||||
}
|
||||
|
||||
G4double x = IntSpectrum(t0, tm, p);
|
||||
G4double y = IntSpectrum(z, 1.0, p);
|
||||
G4double y = IntSpectrum(z0, 1.0, p);
|
||||
|
||||
|
||||
if(1 < verbose) {
|
||||
@@ -99,7 +99,7 @@ G4double G4eBremsstrahlungSpectrum::Probability(G4int Z,
|
||||
<< "; t0= " << t0
|
||||
<< "; tm= " << tm
|
||||
<< "; xp[0]= " << xp[0]
|
||||
<< "; z= " << z
|
||||
<< "; z= " << z0
|
||||
<< "; val= " << x
|
||||
<< "; nor= " << y
|
||||
<< G4endl;
|
||||
@@ -141,11 +141,11 @@ G4double G4eBremsstrahlungSpectrum::AverageEnergy(G4int Z,
|
||||
G4double y = IntSpectrum(z0, 1.0, p);
|
||||
|
||||
// Add integrant over lowest energies
|
||||
|
||||
G4double c = sqrt(theBRparam->ParameterC(Z));
|
||||
G4double f = Function(z0, p);
|
||||
x += 0.5*f*z0*(z0 - c*atan(z0/c));
|
||||
|
||||
G4double zmin = tmin/e;
|
||||
if(zmin < t0) {
|
||||
G4double c = std::sqrt(theBRparam->ParameterC(Z));
|
||||
x += p[0]*(t0 - zmin - c*(std::atan(t0/c) - std::atan(zmin/c)));
|
||||
}
|
||||
x *= e;
|
||||
|
||||
if(1 < verbose) {
|
||||
@@ -189,13 +189,13 @@ G4double G4eBremsstrahlungSpectrum::SampleEnergy(G4int Z,
|
||||
}
|
||||
G4double amaj = std::max(p[length], 1. - (p[1] - p[0])*xp[0]/(xp[1] - xp[0]) );
|
||||
|
||||
G4double amax = log(tm);
|
||||
G4double amin = log(t0);
|
||||
G4double amax = std::log(tm);
|
||||
G4double amin = std::log(t0);
|
||||
G4double tgam, q, fun;
|
||||
|
||||
do {
|
||||
G4double x = amin + G4UniformRand()*(amax - amin);
|
||||
tgam = exp(x);
|
||||
tgam = std::exp(x);
|
||||
fun = Function(tgam, p);
|
||||
|
||||
if(fun > amaj) {
|
||||
@@ -225,7 +225,7 @@ G4double G4eBremsstrahlungSpectrum::IntSpectrum(G4double xMin,
|
||||
|
||||
if(x1 < x2) {
|
||||
G4double k = (p[1] - p[0])/(xp[1] - xp[0]);
|
||||
sum += (1. - k*xp[0])*log(x2/x1) + k*(x2 - x1);
|
||||
sum += (1. - k*xp[0])*std::log(x2/x1) + k*(x2 - x1);
|
||||
}
|
||||
|
||||
for (size_t i=0; i<length-1; i++) {
|
||||
@@ -234,7 +234,7 @@ G4double G4eBremsstrahlungSpectrum::IntSpectrum(G4double xMin,
|
||||
if(x1 < x2) {
|
||||
G4double z1 = p[i];
|
||||
G4double z2 = p[i+1];
|
||||
sum += z2 - z1 + log(x2/x1)*(z1*x2 - z2*x1)/(x2 - x1);
|
||||
sum += z2 - z1 + std::log(x2/x1)*(z1*x2 - z2*x1)/(x2 - x1);
|
||||
}
|
||||
}
|
||||
if(sum < 0.0) sum = 0.0;
|
||||
@@ -278,7 +278,7 @@ G4double G4eBremsstrahlungSpectrum::Function(G4double x,
|
||||
G4double f = 0.0;
|
||||
|
||||
if(x <= xp[0]) {
|
||||
f = 1. + (p[1] - p[0])*(x - xp[0])/(xp[1] - xp[0]);
|
||||
f = p[0] + (p[1] - p[0])*(x - xp[0])/(xp[1] - xp[0]);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4eIonisationCrossSectionHandler.cc,v 1.10 2003/06/16 17:00:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4eIonisationParameters.cc,v 1.21 2004/02/17 11:17:31 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
|
||||
//
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4eIonisationSpectrum.cc,v 1.22 2003/06/16 17:00:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4eIonisationSpectrum.cc,v 1.24 2004/12/02 14:01:36 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -317,7 +317,7 @@ G4double G4eIonisationSpectrum::SampleEnergy(G4int Z,
|
||||
z1 = p[1];
|
||||
z2 = p[3];
|
||||
dx = (p[2] - p[1]) / 3.0;
|
||||
dx1= exp(log(p[3]/p[2]) / 16.0);
|
||||
dx1= std::exp(std::log(p[3]/p[2]) / 16.0);
|
||||
for (i=4; i<iMax-1; i++) {
|
||||
|
||||
if (i < 7) {
|
||||
@@ -412,7 +412,7 @@ G4double G4eIonisationSpectrum::IntSpectrum(G4double xMin,
|
||||
y1 = p[4];
|
||||
|
||||
G4double dx = (p[2] - p[1]) / 3.0;
|
||||
G4double dx1= exp(log(p[3]/p[2]) / 16.0);
|
||||
G4double dx1= std::exp(std::log(p[3]/p[2]) / 16.0);
|
||||
|
||||
for (size_t i=0; i<19; i++) {
|
||||
|
||||
@@ -447,7 +447,7 @@ G4double G4eIonisationSpectrum::IntSpectrum(G4double xMin,
|
||||
}
|
||||
if (xs2 > xs1) {
|
||||
q = (ys1*xs2 - ys2*xs1)/(xs1*xs2)
|
||||
+ log(xs2/xs1)*(ys2 - ys1)/(xs2 - xs1);
|
||||
+ std::log(xs2/xs1)*(ys2 - ys1)/(xs2 - xs1);
|
||||
sum += q;
|
||||
if(p.size() == 26) G4cout << "i= " << i << " q= " << q << " sum= " << sum << G4endl;
|
||||
}
|
||||
@@ -467,10 +467,10 @@ G4double G4eIonisationSpectrum::IntSpectrum(G4double xMin,
|
||||
xs1 = 1./x1;
|
||||
xs2 = 1./x2;
|
||||
q = (xs1 - xs2)*(1.0 - p[0])
|
||||
- p[iMax]*log(x2/x1)
|
||||
- p[iMax]*std::log(x2/x1)
|
||||
+ (1. - p[iMax])*(x2 - x1)
|
||||
+ 1./(1. - x2) - 1./(1. - x1)
|
||||
+ p[iMax]*log((1. - x2)/(1. - x1))
|
||||
+ p[iMax]*std::log((1. - x2)/(1. - x1))
|
||||
+ 0.25*p[0]*(xs1*xs1 - xs2*xs2);
|
||||
sum += q;
|
||||
if(p.size() == 26) G4cout << "param... q= " << q << " sum= " << sum << G4endl;
|
||||
@@ -495,7 +495,7 @@ G4double G4eIonisationSpectrum::AverageValue(G4double xMin,
|
||||
y1 = p[4];
|
||||
|
||||
G4double dx = (p[2] - p[1]) / 3.0;
|
||||
G4double dx1= exp(log(p[3]/p[2]) / 16.0);
|
||||
G4double dx1= std::exp(std::log(p[3]/p[2]) / 16.0);
|
||||
|
||||
for (size_t i=0; i<19; i++) {
|
||||
|
||||
@@ -528,7 +528,7 @@ G4double G4eIonisationSpectrum::AverageValue(G4double xMin,
|
||||
ys2 += (xs2 - x2)*(y1 - y2)/(x1 - x2);
|
||||
}
|
||||
if (xs2 > xs1) {
|
||||
sum += log(xs2/xs1)*(ys1*xs2 - ys2*xs1)/(xs2 - xs1)
|
||||
sum += std::log(xs2/xs1)*(ys1*xs2 - ys2*xs1)/(xs2 - xs1)
|
||||
+ ys2 - ys1;
|
||||
}
|
||||
}
|
||||
@@ -548,10 +548,10 @@ G4double G4eIonisationSpectrum::AverageValue(G4double xMin,
|
||||
xs1 = 1./x1;
|
||||
xs2 = 1./x2;
|
||||
|
||||
sum += log(x2/x1)*(1.0 - p[0])
|
||||
sum += std::log(x2/x1)*(1.0 - p[0])
|
||||
+ 0.5*(1. - p[iMax])*(x2*x2 - x1*x1)
|
||||
+ 1./(1. - x2) - 1./(1. - x1)
|
||||
+ (1. + p[iMax])*log((1. - x2)/(1. - x1))
|
||||
+ (1. + p[iMax])*std::log((1. - x2)/(1. - x1))
|
||||
+ 0.5*p[0]*(xs1 - xs2);
|
||||
|
||||
return sum;
|
||||
@@ -566,8 +566,6 @@ void G4eIonisationSpectrum::PrintData() const
|
||||
G4double G4eIonisationSpectrum::MaxEnergyOfSecondaries(G4double kineticEnergy,
|
||||
G4int, // Z = 0,
|
||||
const G4ParticleDefinition* ) const
|
||||
{ return 0.5 * kineticEnergy; };
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
return 0.5 * kineticEnergy;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4eLowEnergyLoss.cc,v 1.32 2004/06/01 14:03:55 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// $Id: G4eLowEnergyLoss.cc,v 1.34 2004/12/02 14:01:36 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -----------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -209,9 +209,9 @@ void G4eLowEnergyLoss::BuildDEDXTable(
|
||||
|
||||
// calculate data members LOGRTable,RTable first
|
||||
|
||||
G4double lrate = log(UpperBoundEloss/LowerBoundEloss);
|
||||
G4double lrate = std::log(UpperBoundEloss/LowerBoundEloss);
|
||||
LOGRTable=lrate/NbinEloss;
|
||||
RTable =exp(LOGRTable);
|
||||
RTable =std::exp(LOGRTable);
|
||||
// Build energy loss table as a sum of the energy loss due to the
|
||||
// different processes.
|
||||
//
|
||||
@@ -418,7 +418,7 @@ G4VParticleChange* G4eLowEnergyLoss::AlongStepDoIt( const G4Track& trackData,
|
||||
{
|
||||
if (Step >= fRangeNow) finalT = 0.;
|
||||
// else finalT = E*(1.-Step/fRangeNow) ;
|
||||
else finalT = E*(1.-sqrt(Step/fRangeNow)) ;
|
||||
else finalT = E*(1.-std::sqrt(Step/fRangeNow)) ;
|
||||
}
|
||||
|
||||
else if (E>=UpperBoundEloss) finalT = E - Step*fdEdx;
|
||||
@@ -452,13 +452,13 @@ G4VParticleChange* G4eLowEnergyLoss::AlongStepDoIt( const G4Track& trackData,
|
||||
if (finalT <= 0. )
|
||||
{
|
||||
finalT = 0.;
|
||||
if(Charge > 0.0) aParticleChange.SetStatusChange(fStopButAlive);
|
||||
else aParticleChange.SetStatusChange(fStopAndKill);
|
||||
if(Charge > 0.0) aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
else aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
|
||||
G4double edep = E - finalT;
|
||||
|
||||
aParticleChange.SetEnergyChange(finalT);
|
||||
aParticleChange.ProposeEnergy(finalT);
|
||||
|
||||
// Deexcitation of ionised atoms
|
||||
std::vector<G4DynamicParticle*>* deexcitationProducts = 0;
|
||||
@@ -507,7 +507,7 @@ G4VParticleChange* G4eLowEnergyLoss::AlongStepDoIt( const G4Track& trackData,
|
||||
}
|
||||
delete deexcitationProducts;
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(edep);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(edep);
|
||||
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ G4hBetheBlochModel::G4hBetheBlochModel(const G4String& name)
|
||||
: G4VLowEnergyModel(name),
|
||||
lowEnergyLimit(1.*MeV),
|
||||
highEnergyLimit(100.*GeV),
|
||||
twoln10(2.*log(10.)),
|
||||
twoln10(2.*std::log(10.)),
|
||||
bg2lim(0.0169),
|
||||
taulim(8.4146e-3)
|
||||
{;}
|
||||
@@ -183,16 +183,16 @@ G4double G4hBetheBlochModel::BetheBlochFormula(
|
||||
beta2 = bg2/(gamma*gamma) ;
|
||||
tmax = 2.*electron_mass_c2*bg2/(1.+2.*gamma*rateMass+rateMass*rateMass) ;
|
||||
|
||||
ionloss = log(2.0*electron_mass_c2*bg2*tmax/eexc2)-2.0*beta2 ;
|
||||
ionloss = std::log(2.0*electron_mass_c2*bg2*tmax/eexc2)-2.0*beta2 ;
|
||||
|
||||
// density correction
|
||||
x = log(bg2)/twoln10 ;
|
||||
x = std::log(bg2)/twoln10 ;
|
||||
if ( x < x0den ) {
|
||||
delta = 0.0 ;
|
||||
|
||||
} else {
|
||||
delta = twoln10*x - cden ;
|
||||
if ( x < x1den ) delta += aden*pow((x1den-x),mden) ;
|
||||
if ( x < x1den ) delta += aden*std::pow((x1den-x),mden) ;
|
||||
}
|
||||
|
||||
// shell correction
|
||||
@@ -210,7 +210,7 @@ G4double G4hBetheBlochModel::BetheBlochFormula(
|
||||
x *= bg2lim ;
|
||||
sh += shellCorrectionVector[k]/x;
|
||||
}
|
||||
sh *= log(tau/taul)/log(taulim/taul) ;
|
||||
sh *= std::log(tau/taul)/std::log(taulim/taul) ;
|
||||
}
|
||||
|
||||
// now compute the total ionization loss
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
// 18/09/2000 V.Ivanchenko clean up - all variable are the same as in ICRU
|
||||
// 03/10/2000 V.Ivanchenko clean up accoding to CodeWizard
|
||||
// 10/05/2001 V.Ivanchenko Clean up againist Linux compilation with -Wall
|
||||
// 26/08/2004 V.Ivanchenko Fix a problem of effective charge
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -163,18 +164,18 @@ G4double G4hICRU49He::StoppingPower(const G4Material* material,
|
||||
// Free electron gas model
|
||||
if ( T < 0.001 ) {
|
||||
G4double T0 = 0.001 ;
|
||||
a1 = 1.0 - exp(-c[iMolecula][1]*pow(T0,-2.0+c[iMolecula][5])) ;
|
||||
a2 = (c[iMolecula][0]*log(T0)/T0 + c[iMolecula][2]/T0) *
|
||||
exp(-c[iMolecula][4]*pow(T0,-c[iMolecula][6])) +
|
||||
a1 = 1.0 - std::exp(-c[iMolecula][1]*std::pow(T0,-2.0+c[iMolecula][5])) ;
|
||||
a2 = (c[iMolecula][0]*std::log(T0)/T0 + c[iMolecula][2]/T0) *
|
||||
std::exp(-c[iMolecula][4]*std::pow(T0,-c[iMolecula][6])) +
|
||||
c[iMolecula][3]/(T0*T0) ;
|
||||
|
||||
ionloss *= sqrt(T/T0) ;
|
||||
ionloss *= std::sqrt(T/T0) ;
|
||||
|
||||
// Main parametrisation
|
||||
} else {
|
||||
a1 = 1.0 - exp(-c[iMolecula][1]*pow(T,-2.0+c[iMolecula][5])) ;
|
||||
a2 = (c[iMolecula][0]*log(T)/T + c[iMolecula][2]/T) *
|
||||
exp(-c[iMolecula][4]*pow(T,-c[iMolecula][6])) +
|
||||
a1 = 1.0 - std::exp(-c[iMolecula][1]*std::pow(T,-2.0+c[iMolecula][5])) ;
|
||||
a2 = (c[iMolecula][0]*std::log(T)/T + c[iMolecula][2]/T) *
|
||||
std::exp(-c[iMolecula][4]*std::pow(T,-c[iMolecula][6])) +
|
||||
c[iMolecula][3]/(T*T) ;
|
||||
}
|
||||
|
||||
@@ -182,7 +183,7 @@ G4double G4hICRU49He::StoppingPower(const G4Material* material,
|
||||
G4double z = (material->GetTotNbOfElectPerVolume()) /
|
||||
(material->GetTotNbOfAtomsPerVolume()) ;
|
||||
|
||||
ionloss = a1*a2 / HeEffChargeSquare(z, T*keV) ;
|
||||
ionloss = a1*a2 / HeEffChargeSquare(z, kineticEnergy*rateMass) ;
|
||||
|
||||
if ( ionloss < 0.0) ionloss = 0.0 ;
|
||||
}
|
||||
@@ -305,22 +306,22 @@ G4double G4hICRU49He::ElectronicStoppingPower(G4double z,
|
||||
// Free electron gas model
|
||||
if ( T < 0.001 ) {
|
||||
G4double slow = a[i][0] ;
|
||||
G4double shigh = log( 1.0 + a[i][3]*1000.0 + a[i][4]*0.001 )
|
||||
G4double shigh = std::log( 1.0 + a[i][3]*1000.0 + a[i][4]*0.001 )
|
||||
* a[i][2]*1000.0 ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
ionloss *= sqrt(T*1000.0) ;
|
||||
ionloss *= std::sqrt(T*1000.0) ;
|
||||
|
||||
// Main parametrisation
|
||||
} else {
|
||||
G4double slow = a[i][0] * pow((T*1000.0), a[i][1]) ;
|
||||
G4double shigh = log( 1.0 + a[i][3]/T + a[i][4]*T ) * a[i][2]/T ;
|
||||
G4double slow = a[i][0] * std::pow((T*1000.0), a[i][1]) ;
|
||||
G4double shigh = std::log( 1.0 + a[i][3]/T + a[i][4]*T ) * a[i][2]/T ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
|
||||
}
|
||||
if ( ionloss < 0.0) ionloss = 0.0 ;
|
||||
|
||||
// He effective charge
|
||||
ionloss /= HeEffChargeSquare(z, T*MeV) ;
|
||||
ionloss /= HeEffChargeSquare(z, kineticEnergy*rateMass) ;
|
||||
|
||||
return ionloss;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ G4double G4hICRU49Nuclear::NuclearStoppingPower(G4double kineticEnergy,
|
||||
G4double energy = kineticEnergy/keV ; // energy in keV
|
||||
G4double ionloss = 0.0;
|
||||
|
||||
G4double rm = (m1 + m2) * sqrt( pow(z1, .23) + pow(z2, .23) ) ;
|
||||
G4double rm = (m1 + m2) * std::sqrt( std::pow(z1, .23) + std::pow(z2, .23) ) ;
|
||||
|
||||
G4double er = 32.536 * m2 * energy / ( z1 * z2 * rm ) ; // reduced energy
|
||||
|
||||
@@ -209,7 +209,7 @@ G4double G4hICRU49Nuclear::NuclearStoppingPower(G4double kineticEnergy,
|
||||
// Stragling
|
||||
if(lossFlucFlag) {
|
||||
G4double sig = 4.0 * m1 * m2 / ((m1 + m2)*(m1 + m2)*
|
||||
(4.0 + 0.197*pow(er,-1.6991)+6.584*pow(er,-1.0494))) ;
|
||||
(4.0 + 0.197*std::pow(er,-1.6991)+6.584*std::pow(er,-1.0494))) ;
|
||||
|
||||
ionloss *= G4RandGauss::shoot(1.0,sig) ;
|
||||
}
|
||||
|
||||
@@ -139,11 +139,11 @@ G4double G4hICRU49p::StoppingPower(const G4Material* material,
|
||||
|
||||
|
||||
if ( T < 10.0 ) {
|
||||
ionloss = a[iMolecula][0] * sqrt(T) ;
|
||||
ionloss = a[iMolecula][0] * std::sqrt(T) ;
|
||||
|
||||
} else if ( T < 10000.0 ) {
|
||||
G4double slow = a[iMolecula][1] * pow(T, 0.45) ;
|
||||
G4double shigh = log( 1.0 + a[iMolecula][3]/T
|
||||
G4double slow = a[iMolecula][1] * std::pow(T, 0.45) ;
|
||||
G4double shigh = std::log( 1.0 + a[iMolecula][3]/T
|
||||
+ a[iMolecula][4]*T ) * a[iMolecula][2]/T ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
}
|
||||
@@ -152,20 +152,20 @@ G4double G4hICRU49p::StoppingPower(const G4Material* material,
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Graphite may be implemented in a very approximate way (scaling
|
||||
// amorphous results according to rough fits to ICRU tables of results:
|
||||
// 1-100 keV: *(1+0.023+0.0066*log10(E))
|
||||
// 100-700 keV: *(1+0.089-0.0248*log10(E-99.))
|
||||
// 700-10000 keV: *(1+0.089-0.0248*log10(700.-99.))
|
||||
// 1-100 keV: *(1+0.023+0.0066*std::log10(E))
|
||||
// 100-700 keV: *(1+0.089-0.0248*std::log10(E-99.))
|
||||
// 700-10000 keV: *(1+0.089-0.0248*std::log10(700.-99.))
|
||||
// continuity is (should!) be garanteed, but not continuity of the
|
||||
// first derivative. A better fit is in order!
|
||||
if ( 10 == iMolecula ) {
|
||||
if (T < 100.0) {
|
||||
ionloss *= (1.0+0.023+0.0066*log10(T));
|
||||
ionloss *= (1.0+0.023+0.0066*std::log10(T));
|
||||
}
|
||||
else if (T < 700.0) {
|
||||
ionloss *=(1.0+0.089-0.0248*log10(T-99.));
|
||||
ionloss *=(1.0+0.089-0.0248*std::log10(T-99.));
|
||||
}
|
||||
else if (T < 10000.0) {
|
||||
ionloss *=(1.0+0.089-0.0248*log10(700.-99.));
|
||||
ionloss *=(1.0+0.089-0.0248*std::log10(700.-99.));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,18 +288,18 @@ G4double G4hICRU49p::ElectronicStoppingPower(G4double z,
|
||||
|
||||
// Carbon specific case for E < 40 keV
|
||||
if ( T < 40.0 && 5 == i) {
|
||||
fac = sqrt(T/40.0) ;
|
||||
fac = std::sqrt(T/40.0) ;
|
||||
T = 40.0 ;
|
||||
|
||||
// Free electron gas model
|
||||
} else if ( T < 10.0 ) {
|
||||
fac = sqrt(T*0.1) ;
|
||||
fac = std::sqrt(T*0.1) ;
|
||||
T =10.0 ;
|
||||
}
|
||||
|
||||
// Main parametrisation
|
||||
G4double slow = a[i][1] * pow(T, 0.45) ;
|
||||
G4double shigh = log( 1.0 + a[i][3]/T + a[i][4]*T ) * a[i][2]/T ;
|
||||
G4double slow = a[i][1] * std::pow(T, 0.45) ;
|
||||
G4double shigh = std::log( 1.0 + a[i][3]/T + a[i][4]*T ) * a[i][2]/T ;
|
||||
ionloss = slow*shigh*fac / (slow + shigh) ;
|
||||
|
||||
if ( ionloss < 0.0) ionloss = 0.0 ;
|
||||
|
||||
@@ -162,6 +162,7 @@ G4double G4hIonEffChargeSquare::IonEffChargeSquare(
|
||||
|
||||
// Fast ions or hadrons
|
||||
G4double reducedEnergy = kineticEnergy * proton_mass_c2/particleMass ;
|
||||
if(reducedEnergy < 1.0*keV) reducedEnergy = 1.0*keV;
|
||||
if( (reducedEnergy > ionCharge * 10.0 * MeV) ||
|
||||
(ionCharge < 1.5) ) return ionCharge*ionCharge ;
|
||||
|
||||
@@ -232,7 +233,7 @@ G4double G4hIonEffChargeSquare::IonEffChargeSquare(
|
||||
// Helium ion case
|
||||
if( ionCharge < 2.5 ) {
|
||||
|
||||
G4double e = log(std::max(1.0, kineticEnergy / (keV*theHeMassAMU) )) ;
|
||||
G4double e = std::log(std::max(1.0, kineticEnergy / (keV*theHeMassAMU) )) ;
|
||||
G4double x = c[0] ;
|
||||
G4double y = 1.0 ;
|
||||
for (G4int i=1; i<6; i++) {
|
||||
@@ -240,16 +241,16 @@ G4double G4hIonEffChargeSquare::IonEffChargeSquare(
|
||||
x += y * c[i] ;
|
||||
}
|
||||
G4double q = 7.6 - e ;
|
||||
q = 1.0 + ( 0.007 + 0.00005 * z ) * exp( -q*q ) ;
|
||||
return 4.0 * q * q * (1.0 - exp(-x)) ;
|
||||
q = 1.0 + ( 0.007 + 0.00005 * z ) * std::exp( -q*q ) ;
|
||||
return 4.0 * q * q * (1.0 - std::exp(-x)) ;
|
||||
|
||||
// Heavy ion case
|
||||
} else {
|
||||
|
||||
// v1 is ion velocity in vF unit
|
||||
G4double v1 = sqrt( reducedEnergy / (25.0 * keV) )/ vF ;
|
||||
G4double v1 = std::sqrt( reducedEnergy / (25.0 * keV) )/ vF ;
|
||||
G4double y ;
|
||||
G4double z13 = pow(ionCharge, 0.3333) ;
|
||||
G4double z13 = std::pow(ionCharge, 0.3333) ;
|
||||
|
||||
// Faster than Fermi velocity
|
||||
if ( v1 > 1.0 ) {
|
||||
@@ -260,22 +261,22 @@ G4double G4hIonEffChargeSquare::IonEffChargeSquare(
|
||||
y = 0.6923 * vF * (1.0 + 2.0*v1*v1/3.0 + v1*v1*v1*v1/15.0) / (z13*z13) ;
|
||||
}
|
||||
|
||||
G4double y3 = pow(y, 0.3) ;
|
||||
G4double q = 1.0 - exp( 0.803*y3 - 1.3167*y3*y3 -
|
||||
G4double y3 = std::pow(y, 0.3) ;
|
||||
G4double q = 1.0 - std::exp( 0.803*y3 - 1.3167*y3*y3 -
|
||||
0.38157*y - 0.008983*y*y ) ;
|
||||
if( q < 0.0 ) q = 0.0 ;
|
||||
|
||||
G4double s = 7.6 - log(std::max(1.0, reducedEnergy/keV)) ;
|
||||
s = 1.0 + ( 0.18 + 0.0015 * z ) * exp( -s*s )/ (ionCharge*ionCharge) ;
|
||||
G4double s = 7.6 - std::log(std::max(1.0, reducedEnergy/keV)) ;
|
||||
s = 1.0 + ( 0.18 + 0.0015 * z ) * std::exp( -s*s )/ (ionCharge*ionCharge) ;
|
||||
|
||||
// Screen length according to
|
||||
// J.F.Ziegler and J.M.Manoyan, The stopping of ions in compaunds,
|
||||
// Nucl. Inst. & Meth. in Phys. Res. B35 (1988) 215-228.
|
||||
|
||||
G4double lambda = 10.0 * vF * pow(1.0-q, 0.6667) / (z13 * (6.0 + q)) ;
|
||||
G4double lambda = 10.0 * vF * std::pow(1.0-q, 0.6667) / (z13 * (6.0 + q)) ;
|
||||
G4double qeff = ionCharge * s *
|
||||
( q + 0.5*(1.0-q) * log(1.0 + lambda*lambda) / (vF*vF) ) ;
|
||||
if( 1.0 > qeff ) qeff = 1.0 ;
|
||||
( q + 0.5*(1.0-q) * std::log(1.0 + lambda*lambda) / (vF*vF) ) ;
|
||||
if( 0.1 > qeff ) qeff = 0.1 ;
|
||||
return qeff*qeff ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,11 @@
|
||||
// 12 Apr 2003 V.Ivanchenko Cut per region for fluo AlongStep
|
||||
// 18 Apr 2003 V.Ivanchenko finalRange redefinition
|
||||
// 26 Apr 2003 V.Ivanchenko fix for stepLimit
|
||||
// 30 Mar 2004 S.Saliceti add shellCS data member and expFlag variable,
|
||||
// atom total cross section for the Empiric Model
|
||||
// 28 May 2004 V.Ivanchenko fix for ionisation of antiprotons in complex materials
|
||||
// 30 Aug 2004 V.Ivanchenko use energy limit for parameterisation from model
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@@ -109,7 +113,10 @@
|
||||
#include "G4AtomicDeexcitation.hh"
|
||||
#include "G4AtomicTransitionManager.hh"
|
||||
#include "G4ShellVacancy.hh"
|
||||
#include "G4VhShellCrossSection.hh"
|
||||
#include "G4hShellCrossSection.hh"
|
||||
#include "G4hShellCrossSectionExp.hh"
|
||||
#include "G4hShellCrossSectionDoubleExp.hh"
|
||||
#include "G4VEMDataSet.hh"
|
||||
#include "G4EMDataSet.hh"
|
||||
#include "G4CompositeEMDataSet.hh"
|
||||
@@ -139,7 +146,8 @@ G4hLowEnergyIonisation::G4hLowEnergyIonisation(const G4String& processName)
|
||||
paramStepLimit (0.005),
|
||||
shellVacancy(0),
|
||||
shellCS(0),
|
||||
theFluo(false)
|
||||
theFluo(false),
|
||||
expFlag(false)
|
||||
{
|
||||
InitializeMe();
|
||||
}
|
||||
@@ -159,7 +167,19 @@ void G4hLowEnergyIonisation::InitializeMe()
|
||||
minGammaEnergy = 25.*keV;
|
||||
minElectronEnergy = 25.*keV;
|
||||
verboseLevel = 0;
|
||||
shellCS = new G4hShellCrossSection();
|
||||
|
||||
//****************************************************************************
|
||||
// By default the method of cross section's calculation is swiched on an
|
||||
// 2nd implementation empirical model (G4hShellCrossSectionDoubleExp),
|
||||
// if you want to use Gryzinski's model (G4hShellCrossSection()) or the
|
||||
// 1st empiric one (G4hShellCrossSectionExp), you must change the
|
||||
// selection below and switching expFlag to FALSE
|
||||
//****************************************************************************
|
||||
|
||||
//shellCS = new G4hShellCrossSection();
|
||||
//shellCS = new G4hShellCrossSectionExp();
|
||||
shellCS = new G4hShellCrossSectionDoubleExp();
|
||||
expFlag=true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -211,6 +231,7 @@ void G4hLowEnergyIonisation::InitializeParametrisation()
|
||||
// Define models for parametrisation of electronic energy losses
|
||||
theBetheBlochModel = new G4hBetheBlochModel("Bethe-Bloch") ;
|
||||
theProtonModel = new G4hParametrisedLossModel(theProtonTable) ;
|
||||
protonHighEnergy = theProtonModel->HighEnergyLimit(0, 0);
|
||||
theAntiProtonModel = new G4QAOLowEnergyLoss(theAntiProtonTable) ;
|
||||
theNuclearStoppingModel = new G4hNuclearStoppingModel(theNuclearTable) ;
|
||||
theIonEffChargeModel = new G4hIonEffChargeSquare("Ziegler1988") ;
|
||||
@@ -546,12 +567,12 @@ void G4hLowEnergyIonisation::BuildDataForFluorescence(
|
||||
|
||||
bindingEnergy = transitionManager->Shell(Z, n)->BindingEnergy();
|
||||
if (tmin > bindingEnergy) {
|
||||
rel = log(tmin/bindingEnergy);
|
||||
rel = std::log(tmin/bindingEnergy);
|
||||
eAverage += rel - beta2*(tmin - bindingEnergy)/tmax;
|
||||
cross += 1.0/bindingEnergy - 1.0/tmin - beta2*rel/tmax;
|
||||
}
|
||||
if (tmax > tmin) {
|
||||
cross1 += 1.0/tmin - 1.0/tmax - beta2*log(tmax/tmin)/tmax;
|
||||
cross1 += 1.0/tmin - 1.0/tmax - beta2*std::log(tmax/tmin)/tmax;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,13 +668,21 @@ void G4hLowEnergyIonisation::BuildLambdaTable(
|
||||
for ( G4int i = 0 ; i < TotBin ; i++ ) {
|
||||
lowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
|
||||
G4double sigma = 0.0 ;
|
||||
G4int Z;
|
||||
|
||||
for (G4int iel=0; iel<NumberOfElements; iel++ ) {
|
||||
sigma += theAtomicNumDensityVector[iel]*
|
||||
ComputeMicroscopicCrossSection(
|
||||
aParticleType,
|
||||
lowEdgeEnergy,
|
||||
(*theElementVector)[iel]->GetZ(),
|
||||
deltaCut ) ;
|
||||
Z = (G4int) (*theElementVector)[iel]->GetZ();
|
||||
totalCrossSectionMap [Z] = ComputeMicroscopicCrossSection(
|
||||
aParticleType,
|
||||
lowEdgeEnergy,
|
||||
Z,
|
||||
deltaCut ) ;
|
||||
sigma += theAtomicNumDensityVector[iel]*ComputeMicroscopicCrossSection(
|
||||
aParticleType,
|
||||
lowEdgeEnergy,
|
||||
Z,
|
||||
deltaCut ) ;
|
||||
|
||||
}
|
||||
|
||||
// mean free path = 1./macroscopic cross section
|
||||
@@ -705,7 +734,7 @@ G4double G4hLowEnergyIonisation::ComputeMicroscopicCrossSection(
|
||||
if( tmax > deltaCutInEnergy ) {
|
||||
|
||||
var=deltaCutInEnergy/tmax;
|
||||
totalCrossSection = (1.0 - var*(1.0 - beta2*log(var))) / deltaCutInEnergy ;
|
||||
totalCrossSection = (1.0 - var*(1.0 - beta2*std::log(var))) / deltaCutInEnergy ;
|
||||
G4double spin = aParticleType.GetPDGSpin() ;
|
||||
|
||||
// +term for spin=1/2 particle
|
||||
@@ -714,7 +743,7 @@ G4double G4hLowEnergyIonisation::ComputeMicroscopicCrossSection(
|
||||
|
||||
// +term for spin=1 particle
|
||||
else if( 0.9 < spin )
|
||||
totalCrossSection += -log(var)/(3.0*deltaCutInEnergy) +
|
||||
totalCrossSection += -std::log(var)/(3.0*deltaCutInEnergy) +
|
||||
(tmax - deltaCutInEnergy) * ( (5.0+ 1.0/var)*0.25 / (energy*energy) -
|
||||
beta2 / (tmax * deltaCutInEnergy) ) / 3.0 ;
|
||||
|
||||
@@ -739,7 +768,7 @@ G4double G4hLowEnergyIonisation::GetMeanFreePath(const G4Track& trackData,
|
||||
*condition = NotForced ;
|
||||
|
||||
G4double kineticEnergy = (aParticle->GetKineticEnergy())*initialMass/(aParticle->GetMass());
|
||||
charge = aParticle->GetCharge();
|
||||
charge = aParticle->GetCharge()/eplus;
|
||||
chargeSquare = theIonEffChargeModel->TheValue(aParticle, material);
|
||||
|
||||
if(kineticEnergy < LowestKineticEnergy) meanFreePath = DBL_MAX;
|
||||
@@ -777,6 +806,7 @@ G4double G4hLowEnergyIonisation::GetConstraints(
|
||||
// Scale the kinetic energy
|
||||
|
||||
G4double tscaled = kineticEnergy*massRatio ;
|
||||
fBarkas = 0.0;
|
||||
|
||||
if(charge > 0.0) {
|
||||
|
||||
@@ -787,14 +817,11 @@ G4double G4hLowEnergyIonisation::GetConstraints(
|
||||
fdEdx = G4EnergyLossTables::GetDEDX(theProton, tscaled, couple)
|
||||
* chargeSquare ;
|
||||
|
||||
if(tscaled > highEnergy) {
|
||||
// Correction for positive ions
|
||||
if(theBarkas) {
|
||||
fdEdx += BarkasTerm(material,tscaled)*sqrt(chargeSquare)*chargeSquare;
|
||||
fdEdx += BlochTerm(material,tscaled,chargeSquare);
|
||||
}
|
||||
if(theBarkas && tscaled > highEnergy) {
|
||||
fBarkas = BarkasTerm(material,tscaled)*std::sqrt(chargeSquare)*chargeSquare
|
||||
+ BlochTerm(material,tscaled,chargeSquare);
|
||||
}
|
||||
|
||||
// Antiprotons and negative hadrons
|
||||
} else {
|
||||
|
||||
@@ -804,16 +831,22 @@ G4double G4hLowEnergyIonisation::GetConstraints(
|
||||
fdEdx = G4EnergyLossTables::GetDEDX(theAntiProton, tscaled, couple)
|
||||
* chargeSquare ;
|
||||
|
||||
if(tscaled > highEnergy) {
|
||||
|
||||
// Correction for positive ions
|
||||
if(theBarkas) {
|
||||
fdEdx -= BarkasTerm(material,tscaled)*sqrt(chargeSquare)*chargeSquare;
|
||||
fdEdx += BlochTerm(material,tscaled,chargeSquare);
|
||||
}
|
||||
if(theBarkas && tscaled > highEnergy) {
|
||||
fBarkas = -BarkasTerm(material,tscaled)*std::sqrt(chargeSquare)*chargeSquare;
|
||||
+ BlochTerm(material,tscaled,chargeSquare);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
const G4Material* mat = couple->GetMaterial();
|
||||
G4double fac = gram/(MeV*cm2*mat->GetDensity());
|
||||
G4cout << particle->GetDefinition()->GetParticleName()
|
||||
<< " in " << mat->GetName()
|
||||
<< " E(MeV)= " << kineticEnergy/MeV
|
||||
<< " dedx(MeV*cm^2/g)= " << fdEdx*fac
|
||||
<< " barcas(MeV*cm^2/gram)= " << fBarkas*fac
|
||||
<< " Q^2= " << chargeSquare
|
||||
<< G4endl;
|
||||
*/
|
||||
// scaling back
|
||||
fRangeNow /= (chargeSquare*massRatio) ;
|
||||
dx /= (chargeSquare*massRatio) ;
|
||||
@@ -824,12 +857,14 @@ G4double G4hLowEnergyIonisation::GetConstraints(
|
||||
|
||||
if (fRangeNow > r) {
|
||||
stepLimit = dRoverRange*fRangeNow + r*(1.0 - dRoverRange)*(2.0 - r/fRangeNow);
|
||||
if(rndmStepFlag) stepLimit = r + (stepLimit-r)*G4UniformRand() ;
|
||||
if (stepLimit > fRangeNow) stepLimit = fRangeNow;
|
||||
}
|
||||
// compute the (random) Step limit in standard energy range
|
||||
if(tscaled > highEnergy ) {
|
||||
|
||||
// add Barkas correction directly to dedx
|
||||
fdEdx += fBarkas;
|
||||
|
||||
if(stepLimit > fRangeNow - dx*0.9) stepLimit = fRangeNow - dx*0.9 ;
|
||||
|
||||
// Step limit in low energy range
|
||||
@@ -904,17 +939,13 @@ G4VParticleChange* G4hLowEnergyIonisation::AlongStepDoIt(
|
||||
}
|
||||
eloss /= massRatio ;
|
||||
|
||||
// Barkas correction at big step
|
||||
eloss += fBarkas*step;
|
||||
|
||||
// step shorter than linear step limit
|
||||
} else {
|
||||
eloss = step*fdEdx ;
|
||||
}
|
||||
// Correction for positive ions
|
||||
if(theBarkas && 1.0 < charge) {
|
||||
G4double ts = tscaled - eloss*0.5*massRatio;
|
||||
if(ts < protonHighEnergy) ts = protonHighEnergy;
|
||||
eloss += BarkasTerm(material,ts)*charge*chargeSquare*step;
|
||||
eloss += BlochTerm(material,ts,chargeSquare)*step;
|
||||
}
|
||||
if(nStopping && tscaled < protonHighEnergy) {
|
||||
nloss = (theNuclearStoppingModel->TheValue(particle, material))*step;
|
||||
}
|
||||
@@ -938,17 +969,15 @@ G4VParticleChange* G4hLowEnergyIonisation::AlongStepDoIt(
|
||||
finalT = 0.0;
|
||||
if(!particle->GetDefinition()->GetProcessManager()->
|
||||
GetAtRestProcessVector()->size())
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
else
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
|
||||
aParticleChange.SetEnergyChange( finalT );
|
||||
G4double edep = kineticEnergy-finalT;
|
||||
aParticleChange.ProposeEnergy( finalT );
|
||||
eloss = kineticEnergy-finalT;
|
||||
|
||||
// Deexcitation only of ionised atoms
|
||||
eloss = std::min(edep, eloss);
|
||||
|
||||
G4double hMass = particle->GetMass();
|
||||
std::vector<G4DynamicParticle*>* newpart = 0;
|
||||
G4DynamicParticle* part = 0;
|
||||
@@ -977,9 +1006,9 @@ G4VParticleChange* G4hLowEnergyIonisation::AlongStepDoIt(
|
||||
if(part) {
|
||||
|
||||
e = part->GetKineticEnergy();
|
||||
if(e <= edep) {
|
||||
if(e <= eloss) {
|
||||
|
||||
edep -= e;
|
||||
eloss -= e;
|
||||
q = G4UniformRand();
|
||||
time = deltaT*q + t;
|
||||
position = deltaR*q;
|
||||
@@ -997,7 +1026,7 @@ G4VParticleChange* G4hLowEnergyIonisation::AlongStepDoIt(
|
||||
delete newpart;
|
||||
}
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(edep);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(eloss);
|
||||
return &aParticleChange ;
|
||||
}
|
||||
|
||||
@@ -1014,7 +1043,7 @@ G4double G4hLowEnergyIonisation::ProtonParametrisedDEDX(
|
||||
// Free Electron Gas Model
|
||||
if(kineticEnergy < protonLowEnergy) {
|
||||
eloss = (theProtonModel->TheValue(theProton, material, protonLowEnergy))
|
||||
* sqrt(kineticEnergy/protonLowEnergy) ;
|
||||
* std::sqrt(kineticEnergy/protonLowEnergy) ;
|
||||
|
||||
// Parametrisation
|
||||
} else {
|
||||
@@ -1050,7 +1079,7 @@ G4double G4hLowEnergyIonisation::AntiProtonParametrisedDEDX(
|
||||
if(theAntiProtonModel->IsInCharge(theAntiProton,material)) {
|
||||
if(kineticEnergy < antiProtonLowEnergy) {
|
||||
eloss = theAntiProtonModel->TheValue(theAntiProton,material,antiProtonLowEnergy)
|
||||
* sqrt(kineticEnergy/antiProtonLowEnergy) ;
|
||||
* std::sqrt(kineticEnergy/antiProtonLowEnergy) ;
|
||||
|
||||
// Parametrisation
|
||||
} else {
|
||||
@@ -1062,7 +1091,7 @@ G4double G4hLowEnergyIonisation::AntiProtonParametrisedDEDX(
|
||||
} else {
|
||||
if(kineticEnergy < protonLowEnergy) {
|
||||
eloss = theProtonModel->TheValue(G4Proton::Proton(),material,protonLowEnergy)
|
||||
* sqrt(kineticEnergy/protonLowEnergy) ;
|
||||
* std::sqrt(kineticEnergy/protonLowEnergy) ;
|
||||
|
||||
// Parametrisation
|
||||
} else {
|
||||
@@ -1118,7 +1147,7 @@ G4double G4hLowEnergyIonisation::DeltaRaysEnergy(
|
||||
|
||||
if ( deltaCut < tmax) {
|
||||
x = deltaCut / tmax ;
|
||||
dloss = ( beta2 * (x - 1.0) - log(x) ) * twopi_mc2_rcl2
|
||||
dloss = ( beta2 * (x - 1.0) - std::log(x) ) * twopi_mc2_rcl2
|
||||
* electronDensity / beta2 ;
|
||||
}
|
||||
return dloss ;
|
||||
@@ -1189,9 +1218,9 @@ G4VParticleChange* G4hLowEnergyIonisation::PostStepDoIt(
|
||||
|
||||
DeltaKineticEnergy = x * tmax;
|
||||
|
||||
DeltaTotalMomentum = sqrt(DeltaKineticEnergy * (DeltaKineticEnergy +
|
||||
DeltaTotalMomentum = std::sqrt(DeltaKineticEnergy * (DeltaKineticEnergy +
|
||||
2. * electron_mass_c2 )) ;
|
||||
TotalMomentum = sqrt(Psquare) ;
|
||||
TotalMomentum = std::sqrt(Psquare) ;
|
||||
costheta = DeltaKineticEnergy * (TotalEnergy + electron_mass_c2)
|
||||
/(DeltaTotalMomentum * TotalMomentum) ;
|
||||
|
||||
@@ -1203,9 +1232,9 @@ G4VParticleChange* G4hLowEnergyIonisation::PostStepDoIt(
|
||||
|
||||
// direction of the delta electron ........
|
||||
phi = twopi * G4UniformRand() ;
|
||||
sintheta = sqrt(1. - costheta*costheta);
|
||||
dirx = sintheta * cos(phi) ;
|
||||
diry = sintheta * sin(phi) ;
|
||||
sintheta = std::sqrt(1. - costheta*costheta);
|
||||
dirx = sintheta * std::cos(phi) ;
|
||||
diry = sintheta * std::sin(phi) ;
|
||||
dirz = costheta ;
|
||||
|
||||
G4ThreeVector DeltaDirection(dirx,diry,dirz) ;
|
||||
@@ -1232,9 +1261,21 @@ G4VParticleChange* G4hLowEnergyIonisation::PostStepDoIt(
|
||||
// Select atom and shell
|
||||
G4int Z = SelectRandomAtom(couple, KineticEnergy);
|
||||
|
||||
// G4cout << "Fluorescence is switched :" << theFluo << G4endl;
|
||||
|
||||
if(theFluo && Z > 5) {
|
||||
|
||||
G4int shell = shellCS->SelectRandomShell(Z, KineticEnergy,
|
||||
ParticleMass,DeltaKineticEnergy);
|
||||
if (expFlag) {
|
||||
// Atom total cross section for the Empiric Model
|
||||
shellCS->SetTotalCS(totalCrossSectionMap[Z]);
|
||||
if (shell==1) {
|
||||
aParticleChange.ProposeLocalEnergyDeposit (KineticEnergy);
|
||||
aParticleChange.ProposeEnergy(0);
|
||||
}
|
||||
}
|
||||
|
||||
const G4AtomicShell* atomicShell =
|
||||
(G4AtomicTransitionManager::Instance())->Shell(Z, shell);
|
||||
G4double bindingEnergy = atomicShell->BindingEnergy();
|
||||
@@ -1296,28 +1337,28 @@ G4VParticleChange* G4hLowEnergyIonisation::PostStepDoIt(
|
||||
finalPz = TotalMomentum*ParticleDirection.z()
|
||||
- DeltaTotalMomentum*DeltaDirection.z();
|
||||
finalMomentum =
|
||||
sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz) ;
|
||||
std::sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz) ;
|
||||
finalPx /= finalMomentum ;
|
||||
finalPy /= finalMomentum ;
|
||||
finalPz /= finalMomentum ;
|
||||
|
||||
aParticleChange.SetMomentumChange( finalPx,finalPy,finalPz );
|
||||
aParticleChange.ProposeMomentumDirection( finalPx,finalPy,finalPz );
|
||||
}
|
||||
else
|
||||
{
|
||||
edep = finalKineticEnergy;
|
||||
finalKineticEnergy = 0.;
|
||||
aParticleChange.SetMomentumChange(ParticleDirection.x(),
|
||||
aParticleChange.ProposeMomentumDirection(ParticleDirection.x(),
|
||||
ParticleDirection.y(),ParticleDirection.z());
|
||||
if(!aParticle->GetDefinition()->GetProcessManager()->
|
||||
GetAtRestProcessVector()->size())
|
||||
aParticleChange.SetStatusChange(fStopAndKill);
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
else
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
|
||||
aParticleChange.SetEnergyChange( finalKineticEnergy );
|
||||
aParticleChange.SetLocalEnergyDeposit (edep);
|
||||
aParticleChange.ProposeEnergy( finalKineticEnergy );
|
||||
aParticleChange.ProposeLocalEnergyDeposit (edep);
|
||||
aParticleChange.SetNumberOfSecondaries(totalNumber);
|
||||
aParticleChange.AddSecondary(theDeltaRay);
|
||||
|
||||
@@ -1354,6 +1395,8 @@ G4hLowEnergyIonisation::DeexciteAtom(const G4MaterialCutsCouple* couple,
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(eLoss < minGammaEnergy && eLoss < minElectronEnergy) return 0;
|
||||
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
@@ -1625,8 +1668,8 @@ G4double G4hLowEnergyIonisation::BarkasTerm(const G4Material* material,
|
||||
|
||||
// Variables to compute L_1
|
||||
G4double Eta0Chi = 0.8;
|
||||
G4double EtaChi = Eta0Chi * ( 1.0 + 6.02*pow( ZMaterial,-1.19 ) );
|
||||
G4double W = ( EtaChi * pow( ZMaterial,1.0/6.0 ) ) / sqrt(X);
|
||||
G4double EtaChi = Eta0Chi * ( 1.0 + 6.02*std::pow( ZMaterial,-1.19 ) );
|
||||
G4double W = ( EtaChi * std::pow( ZMaterial,1.0/6.0 ) ) / std::sqrt(X);
|
||||
G4double FunctionOfW = FTable[46][1]*FTable[46][0]/W ;
|
||||
|
||||
for(G4int j=0; j<47; j++) {
|
||||
@@ -1647,7 +1690,7 @@ G4double G4hLowEnergyIonisation::BarkasTerm(const G4Material* material,
|
||||
|
||||
}
|
||||
|
||||
BarkasTerm += FunctionOfW /( sqrt(ZMaterial * X) * X);
|
||||
BarkasTerm += FunctionOfW /( std::sqrt(ZMaterial * X) * X);
|
||||
}
|
||||
|
||||
BarkasTerm *= twopi_mc2_rcl2 * (material->GetElectronDensity()) / beta2 ;
|
||||
@@ -1746,14 +1789,14 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
|
||||
// High velocity or negatively charged particle
|
||||
if( beta2 > 3.0*theBohrBeta2*zeff || charge < 0.0) {
|
||||
siga = sqrt( siga * chargeSquare ) ;
|
||||
siga = std::sqrt( siga * chargeSquare ) ;
|
||||
|
||||
// Low velocity - additional ion charge fluctuations according to
|
||||
// Q.Yang et al., NIM B61(1991)149-155.
|
||||
} else {
|
||||
G4double chu = theIonChuFluctuationModel->TheValue(particle, material);
|
||||
G4double yang = theIonYangFluctuationModel->TheValue(particle, material);
|
||||
siga = sqrt( siga * (chargeSquare * chu + yang)) ;
|
||||
siga = std::sqrt( siga * (chargeSquare * chu + yang)) ;
|
||||
}
|
||||
|
||||
do {
|
||||
@@ -1764,7 +1807,7 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
|
||||
// Non Gaussian fluctuation
|
||||
static const G4double probLim = 0.01 ;
|
||||
static const G4double sumaLim = -log(probLim) ;
|
||||
static const G4double sumaLim = -std::log(probLim) ;
|
||||
static const G4double alim = 10.;
|
||||
|
||||
G4double suma,w1,w2,C,e0,lossc,w;
|
||||
@@ -1784,13 +1827,13 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
G4double ipotLogFluct= material->GetIonisation()->GetLogMeanExcEnergy();
|
||||
|
||||
w1 = tmax/ipotFluct;
|
||||
w2 = log(2.*electron_mass_c2*tau2);
|
||||
w2 = std::log(2.*electron_mass_c2*tau2);
|
||||
|
||||
C = meanLoss*(1.-rateFluct)/(w2-ipotLogFluct-beta2);
|
||||
|
||||
a1 = C*f1Fluct*(w2-e1LogFluct-beta2)/e1Fluct;
|
||||
a2 = C*f2Fluct*(w2-e2LogFluct-beta2)/e2Fluct;
|
||||
a3 = rateFluct*meanLoss*(tmax-ipotFluct)/(ipotFluct*tmax*log(w1));
|
||||
a3 = rateFluct*meanLoss*(tmax-ipotFluct)/(ipotFluct*tmax*std::log(w1));
|
||||
if(a1 < 0.0) a1 = 0.0;
|
||||
if(a2 < 0.0) a2 = 0.0;
|
||||
if(a3 < 0.0) a3 = 0.0;
|
||||
@@ -1810,7 +1853,7 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
siga=std::sqrt(a3) ;
|
||||
p3 = std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -1825,11 +1868,11 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
else
|
||||
{
|
||||
tmax = tmax-ipotFluct+e0 ;
|
||||
a3 = meanLoss*(tmax-e0)/(tmax*e0*log(tmax/e0));
|
||||
a3 = meanLoss*(tmax-e0)/(tmax*e0*std::log(tmax/e0));
|
||||
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
siga=std::sqrt(a3) ;
|
||||
p3 = std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -1858,7 +1901,7 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
// excitation type 1
|
||||
if(a1>alim)
|
||||
{
|
||||
siga=sqrt(a1) ;
|
||||
siga=std::sqrt(a1) ;
|
||||
p1 = std::max(0,G4int(G4RandGauss::shoot(a1,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -1867,7 +1910,7 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
// excitation type 2
|
||||
if(a2>alim)
|
||||
{
|
||||
siga=sqrt(a2) ;
|
||||
siga=std::sqrt(a2) ;
|
||||
p2 = std::max(0,G4int(G4RandGauss::shoot(a2,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -1886,7 +1929,7 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
{
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
siga=std::sqrt(a3) ;
|
||||
p3 = std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
@@ -1908,9 +1951,9 @@ G4double G4hLowEnergyIonisation::ElectronicLossFluctuation(
|
||||
{
|
||||
alfa = w1*G4float(nmaxCont2+p3)/
|
||||
(w1*G4float(nmaxCont2)+G4float(p3));
|
||||
alfa1 = alfa*log(alfa)/(alfa-1.);
|
||||
alfa1 = alfa*std::log(alfa)/(alfa-1.);
|
||||
ea = na*ipotFluct*alfa1;
|
||||
sea = ipotFluct*sqrt(na*(alfa-alfa1*alfa1));
|
||||
sea = ipotFluct*std::sqrt(na*(alfa-alfa1*alfa1));
|
||||
lossc += G4RandGauss::shoot(ea,sea);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4hLowEnergyLoss.cc,v 1.20 2003/05/20 20:16:14 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4hLowEnergyLoss.cc,v 1.21 2004/12/02 14:01:36 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -----------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -506,9 +506,9 @@ void G4hLowEnergyLoss::BuildLabTimeVector(G4int materialIndex,
|
||||
// low energy part first...
|
||||
losslim = physicsVector->GetValue(tlim,isOut);
|
||||
taulim=tlim/ParticleMass ;
|
||||
clim=sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = log(taulim);
|
||||
ltaumax = log(HighestKineticEnergy/ParticleMass) ;
|
||||
clim=std::sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = std::log(taulim);
|
||||
ltaumax = std::log(HighestKineticEnergy/ParticleMass) ;
|
||||
|
||||
G4int i=-1;
|
||||
G4double oldValue = 0. ;
|
||||
@@ -520,13 +520,13 @@ void G4hLowEnergyLoss::BuildLabTimeVector(G4int materialIndex,
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
if ( tau <= taulim )
|
||||
{
|
||||
Value = clim*exp(ppar*log(tau/taulim)) ;
|
||||
Value = clim*std::exp(ppar*std::log(tau/taulim)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
timelim=clim ;
|
||||
ltaulow = log(taulim);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(taulim);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = timelim+LabTimeIntLog(physicsVector,nbin);
|
||||
}
|
||||
timeVector->PutValue(i,Value);
|
||||
@@ -539,8 +539,8 @@ void G4hLowEnergyLoss::BuildLabTimeVector(G4int materialIndex,
|
||||
{
|
||||
LowEdgeEnergy = timeVector->GetLowEdgeEnergy(j);
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
ltaulow = log(tauold);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(tauold);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = oldValue+LabTimeIntLog(physicsVector,nbin);
|
||||
timeVector->PutValue(j,Value);
|
||||
oldValue = Value ;
|
||||
@@ -565,9 +565,9 @@ void G4hLowEnergyLoss::BuildProperTimeVector(G4int materialIndex,
|
||||
// low energy part first...
|
||||
losslim = physicsVector->GetValue(tlim,isOut);
|
||||
taulim=tlim/ParticleMass ;
|
||||
clim=sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = log(taulim);
|
||||
ltaumax = log(HighestKineticEnergy/ParticleMass) ;
|
||||
clim=std::sqrt(ParticleMass*tlim/2.)/(c_light*losslim*ppar) ;
|
||||
ltaulim = std::log(taulim);
|
||||
ltaumax = std::log(HighestKineticEnergy/ParticleMass) ;
|
||||
|
||||
G4int i=-1;
|
||||
G4double oldValue = 0. ;
|
||||
@@ -579,13 +579,13 @@ void G4hLowEnergyLoss::BuildProperTimeVector(G4int materialIndex,
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
if ( tau <= taulim )
|
||||
{
|
||||
Value = clim*exp(ppar*log(tau/taulim)) ;
|
||||
Value = clim*std::exp(ppar*std::log(tau/taulim)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
timelim=clim ;
|
||||
ltaulow = log(taulim);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(taulim);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = timelim+ProperTimeIntLog(physicsVector,nbin);
|
||||
}
|
||||
timeVector->PutValue(i,Value);
|
||||
@@ -598,8 +598,8 @@ void G4hLowEnergyLoss::BuildProperTimeVector(G4int materialIndex,
|
||||
{
|
||||
LowEdgeEnergy = timeVector->GetLowEdgeEnergy(j);
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
ltaulow = log(tauold);
|
||||
ltauhigh = log(tau);
|
||||
ltaulow = std::log(tauold);
|
||||
ltauhigh = std::log(tau);
|
||||
Value = oldValue+ProperTimeIntLog(physicsVector,nbin);
|
||||
timeVector->PutValue(j,Value);
|
||||
oldValue = Value ;
|
||||
@@ -653,7 +653,7 @@ G4double G4hLowEnergyLoss::RangeIntLog(G4PhysicsVector* physicsVector,
|
||||
for (G4int i=0; i<=nbin; i++)
|
||||
{
|
||||
ui = ltaulow+dltau*i;
|
||||
taui = exp(ui);
|
||||
taui = std::exp(ui);
|
||||
ti = Mass*taui;
|
||||
lossi = physicsVector->GetValue(ti,isOut);
|
||||
if(i==0)
|
||||
@@ -686,7 +686,7 @@ G4double G4hLowEnergyLoss::LabTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
for (G4int i=0; i<=nbin; i++)
|
||||
{
|
||||
ui = ltaulow+dltau*i;
|
||||
taui = exp(ui);
|
||||
taui = std::exp(ui);
|
||||
ti = ParticleMass*taui;
|
||||
lossi = physicsVector->GetValue(ti,isOut);
|
||||
if(i==0)
|
||||
@@ -698,7 +698,7 @@ G4double G4hLowEnergyLoss::LabTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
else
|
||||
ci=0.5;
|
||||
}
|
||||
Value += ci*taui*(ti+ParticleMass)/(sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
Value += ci*taui*(ti+ParticleMass)/(std::sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
}
|
||||
Value *= ParticleMass*dltau/c_light;
|
||||
return Value;
|
||||
@@ -719,7 +719,7 @@ G4double G4hLowEnergyLoss::ProperTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
for (G4int i=0; i<=nbin; i++)
|
||||
{
|
||||
ui = ltaulow+dltau*i;
|
||||
taui = exp(ui);
|
||||
taui = std::exp(ui);
|
||||
ti = ParticleMass*taui;
|
||||
lossi = physicsVector->GetValue(ti,isOut);
|
||||
if(i==0)
|
||||
@@ -731,7 +731,7 @@ G4double G4hLowEnergyLoss::ProperTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
else
|
||||
ci=0.5;
|
||||
}
|
||||
Value += ci*taui*ParticleMass/(sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
Value += ci*taui*ParticleMass/(std::sqrt(ti*(ti+2.*ParticleMass))*lossi);
|
||||
}
|
||||
Value *= ParticleMass*dltau/c_light;
|
||||
return Value;
|
||||
@@ -1002,7 +1002,7 @@ void G4hLowEnergyLoss::BuildInverseRangeTable(
|
||||
G4double rlow = pv->GetValue(elow, b);
|
||||
G4double rhigh = pv->GetValue(ehigh, b);
|
||||
|
||||
rhigh *= exp(log(rhigh/rlow)/((G4double)(nbins-1)));
|
||||
rhigh *= std::exp(std::log(rhigh/rlow)/((G4double)(nbins-1)));
|
||||
|
||||
G4PhysicsLogVector* v = new G4PhysicsLogVector(rlow, rhigh, nbins);
|
||||
|
||||
@@ -1029,9 +1029,9 @@ void G4hLowEnergyLoss::BuildInverseRangeTable(
|
||||
}
|
||||
}
|
||||
|
||||
G4double e = log(energy1) + log(energy2/energy1)*log(range/range1)/log(range2/range1);
|
||||
G4double e = std::log(energy1) + std::log(energy2/energy1)*std::log(range/range1)/std::log(range2/range1);
|
||||
|
||||
v->PutValue(j,exp(e));
|
||||
v->PutValue(j,std::exp(e));
|
||||
}
|
||||
theInverseRangeTable->insert(v);
|
||||
|
||||
@@ -1081,7 +1081,7 @@ void G4hLowEnergyLoss::InvertRangeVector(G4int materialIndex,
|
||||
else
|
||||
{
|
||||
discr = B*B - 4.*A*(C-LowEdgeRange);
|
||||
discr = discr>0. ? sqrt(discr) : 0.;
|
||||
discr = discr>0. ? std::sqrt(discr) : 0.;
|
||||
KineticEnergy = 0.5*(discr-B)/A ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ G4double G4hNuclearStoppingModel::TheValue(
|
||||
{
|
||||
// Projectile nucleus
|
||||
G4double energy = particle->GetKineticEnergy() ;
|
||||
G4double z1 = abs((particle->GetCharge())/eplus) ;
|
||||
G4double z1 = std::abs((particle->GetCharge())/eplus) ;
|
||||
G4double m1 = (particle->GetMass())*factorPDG2AMU ;
|
||||
|
||||
G4double nloss = StoppingPower(material, energy, z1, m1) * theZieglerFactor;
|
||||
@@ -136,7 +136,7 @@ G4double G4hNuclearStoppingModel::TheValue(
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
// Projectile nucleus
|
||||
G4double z1 = abs((aParticle->GetPDGCharge())/eplus) ;
|
||||
G4double z1 = std::abs((aParticle->GetPDGCharge())/eplus) ;
|
||||
G4double m1 = (aParticle->GetPDGMass())*factorPDG2AMU ;
|
||||
|
||||
G4double nloss = StoppingPower(material, kineticEnergy, z1, m1)
|
||||
|
||||
@@ -38,26 +38,27 @@
|
||||
// 03/10/2000 V.Ivanchenko CodeWizard clean up
|
||||
// 10/05/2001 V.Ivanchenko Clean up againist Linux compilation with -Wall
|
||||
// 30/12/2003 V.Ivanchenko SRIM2003 model is added
|
||||
// 07/05/2004 V.Ivanchenko Fix Graphite problem, add QAO model
|
||||
//
|
||||
// Class Description:
|
||||
// Class Description:
|
||||
//
|
||||
// Low energy protons/ions electronic stopping power parametrisation
|
||||
//
|
||||
// Class Description: End
|
||||
// Class Description: End
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4hParametrisedLossModel.hh"
|
||||
#include "G4hParametrisedLossModel.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4hZiegler1977p.hh"
|
||||
#include "G4hZiegler1977He.hh"
|
||||
#include "G4hZiegler1985p.hh"
|
||||
#include "G4hSRIM2000p.hh"
|
||||
//#include "G4hSRIM2003p.hh"
|
||||
//#include "G4hQAOModel.hh"
|
||||
#include "G4hICRU49p.hh"
|
||||
#include "G4hICRU49He.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
@@ -87,6 +88,7 @@ void G4hParametrisedLossModel::InitializeMe()
|
||||
G4String ir49He = G4String("ICRU_R49He") ;
|
||||
G4String zi85p = G4String("Ziegler1985p") ;
|
||||
G4String zi00p = G4String("SRIM2000p") ;
|
||||
G4String qao = G4String("QAO") ;
|
||||
if(zi77p == modelName) {
|
||||
eStopingPowerTable = new G4hZiegler1977p();
|
||||
highEnergyLimit = 100.0*MeV;
|
||||
@@ -102,7 +104,7 @@ void G4hParametrisedLossModel::InitializeMe()
|
||||
highEnergyLimit = 100.0*MeV;
|
||||
lowEnergyLimit = 1.0*keV;
|
||||
|
||||
} else if(zi00p == modelName) {
|
||||
} else if(zi00p == modelName ) {
|
||||
eStopingPowerTable = new G4hSRIM2000p();
|
||||
highEnergyLimit = 100.0*MeV;
|
||||
lowEnergyLimit = 1.0*keV;
|
||||
@@ -116,104 +118,104 @@ void G4hParametrisedLossModel::InitializeMe()
|
||||
eStopingPowerTable = new G4hICRU49He();
|
||||
highEnergyLimit = 10.0*MeV/4.0;
|
||||
lowEnergyLimit = 1.0*keV/4.0;
|
||||
|
||||
/*
|
||||
} else if(qao == modelName) {
|
||||
eStopingPowerTable = new G4hQAOModel();
|
||||
highEnergyLimit = 2.0*MeV;
|
||||
lowEnergyLimit = 5.0*keV;
|
||||
*/
|
||||
} else {
|
||||
G4cout <<
|
||||
"G4hLowEnergyIonisation warning: There is no table with the modelName <"
|
||||
<< modelName << ">" << "for electronic stopping, <ICRU_R49p> is applied"
|
||||
<< G4endl;
|
||||
eStopingPowerTable = new G4hICRU49p();
|
||||
highEnergyLimit = 1.0*MeV;
|
||||
lowEnergyLimit = 1.0*keV;
|
||||
}
|
||||
//G4cout << "G4hParametrisedLossModel: the model <" << modelName
|
||||
// << "> is accepted" << G4endl;
|
||||
eStopingPowerTable = new G4hICRU49p();
|
||||
highEnergyLimit = 2.0*MeV;
|
||||
lowEnergyLimit = 1.0*keV;
|
||||
G4cout << "G4hParametrisedLossModel Warning: <" << modelName
|
||||
<< "> is unknown - default <"
|
||||
<< ir49p << ">" << " is used for Electronic Stopping"
|
||||
<< G4endl;
|
||||
modelName = ir49p;
|
||||
}
|
||||
/*
|
||||
G4cout << "G4hParametrisedLossModel: the model <"
|
||||
<< modelName << ">" << " is used for Electronic Stopping"
|
||||
<< G4endl;
|
||||
*/
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4hParametrisedLossModel::~G4hParametrisedLossModel()
|
||||
G4hParametrisedLossModel::~G4hParametrisedLossModel()
|
||||
{
|
||||
delete eStopingPowerTable;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::TheValue(
|
||||
const G4DynamicParticle* particle,
|
||||
const G4Material* material)
|
||||
G4double G4hParametrisedLossModel::TheValue(const G4DynamicParticle* particle,
|
||||
const G4Material* material)
|
||||
{
|
||||
G4double scaledEnergy = (particle->GetKineticEnergy())
|
||||
* proton_mass_c2/(particle->GetMass());
|
||||
|
||||
G4double eloss = StoppingPower(material,scaledEnergy) * theZieglerFactor;
|
||||
G4double factor = theZieglerFactor;
|
||||
if (scaledEnergy < lowEnergyLimit) {
|
||||
if (modelName != "QAO") factor *= std::sqrt(scaledEnergy/lowEnergyLimit);
|
||||
scaledEnergy = lowEnergyLimit;
|
||||
}
|
||||
G4double eloss = StoppingPower(material,scaledEnergy) * factor;
|
||||
|
||||
return eloss;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::TheValue(
|
||||
const G4ParticleDefinition* aParticle,
|
||||
G4double G4hParametrisedLossModel::TheValue(const G4ParticleDefinition* aParticle,
|
||||
const G4Material* material,
|
||||
G4double kineticEnergy)
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
G4double scaledEnergy = kineticEnergy
|
||||
* proton_mass_c2/(aParticle->GetPDGMass());
|
||||
|
||||
G4double eloss = StoppingPower(material,scaledEnergy) * theZieglerFactor;
|
||||
|
||||
// G4cout << "G4hParametrisedLossModel: the model <" << modelName
|
||||
// << "> return " << eloss*mm/MeV << G4endl;
|
||||
G4double factor = theZieglerFactor;
|
||||
if (scaledEnergy < lowEnergyLimit) {
|
||||
if (modelName != "QAO") factor *= std::sqrt(scaledEnergy/lowEnergyLimit);
|
||||
scaledEnergy = lowEnergyLimit;
|
||||
}
|
||||
G4double eloss = StoppingPower(material,scaledEnergy) * factor;
|
||||
|
||||
return eloss;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::LowEnergyLimit(
|
||||
const G4ParticleDefinition* ,
|
||||
|
||||
G4double G4hParametrisedLossModel::LowEnergyLimit(const G4ParticleDefinition* ,
|
||||
const G4Material*) const
|
||||
{
|
||||
return lowEnergyLimit;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::HighEnergyLimit(
|
||||
const G4ParticleDefinition* ,
|
||||
|
||||
G4double G4hParametrisedLossModel::HighEnergyLimit(const G4ParticleDefinition* ,
|
||||
const G4Material*) const
|
||||
{
|
||||
return highEnergyLimit;
|
||||
}
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::LowEnergyLimit(
|
||||
const G4ParticleDefinition* ) const
|
||||
|
||||
G4double G4hParametrisedLossModel::LowEnergyLimit(const G4ParticleDefinition* ) const
|
||||
{
|
||||
return lowEnergyLimit;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::HighEnergyLimit(
|
||||
const G4ParticleDefinition* ) const
|
||||
|
||||
G4double G4hParametrisedLossModel::HighEnergyLimit(const G4ParticleDefinition* ) const
|
||||
{
|
||||
return highEnergyLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool G4hParametrisedLossModel::IsInCharge(
|
||||
const G4DynamicParticle* ,
|
||||
const G4Material*) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool G4hParametrisedLossModel::IsInCharge(
|
||||
const G4ParticleDefinition* ,
|
||||
|
||||
G4bool G4hParametrisedLossModel::IsInCharge(const G4DynamicParticle* ,
|
||||
const G4Material*) const
|
||||
{
|
||||
return true;
|
||||
@@ -221,43 +223,57 @@ G4bool G4hParametrisedLossModel::IsInCharge(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::StoppingPower(
|
||||
const G4Material* material,
|
||||
G4double kineticEnergy)
|
||||
G4bool G4hParametrisedLossModel::IsInCharge(const G4ParticleDefinition* ,
|
||||
const G4Material*) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4hParametrisedLossModel::StoppingPower(const G4Material* material,
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
G4double eloss = 0.0;
|
||||
|
||||
const G4int numberOfElements = material->GetNumberOfElements() ;
|
||||
const G4double* theAtomicNumDensityVector =
|
||||
material->GetAtomicNumDensityVector() ;
|
||||
|
||||
|
||||
|
||||
// compound material with parametrisation
|
||||
if( (eStopingPowerTable->HasMaterial(material)) ) {
|
||||
|
||||
eloss = eStopingPowerTable->StoppingPower(material, kineticEnergy);
|
||||
if ("QAO" != modelName) {
|
||||
eloss *= material->GetTotNbOfAtomsPerVolume();
|
||||
if(1 < numberOfElements) {
|
||||
G4int nAtoms = 0;
|
||||
|
||||
const G4int* theAtomsVector = material->GetAtomsVector();
|
||||
for (G4int iel=0; iel<numberOfElements; iel++) {
|
||||
nAtoms += theAtomsVector[iel];
|
||||
}
|
||||
eloss /= nAtoms;
|
||||
}
|
||||
}
|
||||
|
||||
// pure material
|
||||
if(1 == numberOfElements) {
|
||||
} else if(1 == numberOfElements) {
|
||||
|
||||
G4double z = material->GetZ();
|
||||
eloss = (eStopingPowerTable->ElectronicStoppingPower(z, kineticEnergy))
|
||||
* (material->GetTotNbOfAtomsPerVolume()) ;
|
||||
|
||||
// compaund material with parametrisation
|
||||
} else if( (eStopingPowerTable->HasMaterial(material)) ) {
|
||||
|
||||
eloss = eStopingPowerTable->StoppingPower(material, kineticEnergy)
|
||||
* (material->GetTotNbOfAtomsPerVolume()) ;
|
||||
G4int nAtoms = 0;
|
||||
|
||||
const G4int* theAtomsVector = material->GetAtomsVector() ;
|
||||
for (G4int iel=0; iel<numberOfElements; iel++) {
|
||||
nAtoms += theAtomsVector[iel];
|
||||
}
|
||||
eloss /= nAtoms;
|
||||
|
||||
// Experimental data exist only for kinetic energy 125 keV
|
||||
} else if( MolecIsInZiegler1988(material) ) {
|
||||
} else if( MolecIsInZiegler1988(material)) {
|
||||
|
||||
// Cycle over elements - calculation based on Bragg's rule
|
||||
// Cycle over elements - calculation based on Bragg's rule
|
||||
G4double eloss125 = 0.0 ;
|
||||
const G4ElementVector* theElementVector =
|
||||
material->GetElementVector() ;
|
||||
|
||||
|
||||
|
||||
// loop for the elements in the material
|
||||
for (G4int i=0; i<numberOfElements; i++) {
|
||||
const G4Element* element = (*theElementVector)[i] ;
|
||||
@@ -266,16 +282,16 @@ G4double G4hParametrisedLossModel::StoppingPower(
|
||||
* theAtomicNumDensityVector[i] ;
|
||||
eloss125 +=(eStopingPowerTable->ElectronicStoppingPower(z,125.0*keV))
|
||||
* theAtomicNumDensityVector[i] ;
|
||||
}
|
||||
}
|
||||
|
||||
// Chemical factor is taken into account
|
||||
eloss *= ChemicalFactor(kineticEnergy, eloss125) ;
|
||||
|
||||
|
||||
// Brugg's rule calculation
|
||||
} else {
|
||||
const G4ElementVector* theElementVector =
|
||||
material->GetElementVector() ;
|
||||
|
||||
|
||||
// loop for the elements in the material
|
||||
for (G4int i=0; i<numberOfElements; i++)
|
||||
{
|
||||
@@ -283,7 +299,7 @@ G4double G4hParametrisedLossModel::StoppingPower(
|
||||
G4double z = element->GetZ() ;
|
||||
eloss += (eStopingPowerTable->ElectronicStoppingPower(z,kineticEnergy))
|
||||
* theAtomicNumDensityVector[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return eloss;
|
||||
}
|
||||
@@ -291,12 +307,12 @@ G4double G4hParametrisedLossModel::StoppingPower(
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool G4hParametrisedLossModel::MolecIsInZiegler1988(
|
||||
const G4Material* material)
|
||||
const G4Material* material)
|
||||
{
|
||||
// The list of molecules from
|
||||
// J.F.Ziegler and J.M.Manoyan, The stopping of ions in compaunds,
|
||||
// Nucl. Inst. & Meth. in Phys. Res. B35 (1988) 215-228.
|
||||
|
||||
|
||||
G4String myFormula = G4String(" ") ;
|
||||
const G4String chFormula = material->GetChemicalFormula() ;
|
||||
if (myFormula == chFormula ) return false ;
|
||||
@@ -399,13 +415,13 @@ G4double G4hParametrisedLossModel::ChemicalFactor(
|
||||
G4double gamma = 1.0 + kineticEnergy/proton_mass_c2 ;
|
||||
G4double gamma25 = 1.0 + 25.0*keV /proton_mass_c2 ;
|
||||
G4double gamma125 = 1.0 + 125.0*keV/proton_mass_c2 ;
|
||||
G4double beta = sqrt(1.0 - 1.0/(gamma*gamma)) ;
|
||||
G4double beta25 = sqrt(1.0 - 1.0/(gamma25*gamma25)) ;
|
||||
G4double beta125 = sqrt(1.0 - 1.0/(gamma125*gamma125)) ;
|
||||
G4double beta = std::sqrt(1.0 - 1.0/(gamma*gamma)) ;
|
||||
G4double beta25 = std::sqrt(1.0 - 1.0/(gamma25*gamma25)) ;
|
||||
G4double beta125 = std::sqrt(1.0 - 1.0/(gamma125*gamma125)) ;
|
||||
|
||||
G4double factor = 1.0 + (expStopPower125/eloss125 - 1.0) *
|
||||
(1.0 + exp( 1.48 * ( beta125/beta25 - 7.0 ) ) ) /
|
||||
(1.0 + exp( 1.48 * ( beta/beta25 - 7.0 ) ) ) ;
|
||||
(1.0 + std::exp( 1.48 * ( beta125/beta25 - 7.0 ) ) ) /
|
||||
(1.0 + std::exp( 1.48 * ( beta/beta25 - 7.0 ) ) ) ;
|
||||
|
||||
return factor ;
|
||||
}
|
||||
|
||||
@@ -201,8 +201,8 @@ G4double G4hSRIM2000p::ElectronicStoppingPower(G4double z,
|
||||
if ( T < 25.0 ) e = 25.0 ;
|
||||
|
||||
// universal approximation
|
||||
G4double slow = a[i][0] * pow(e, a[i][1]) + a[i][2] * pow(e, a[i][3]) ;
|
||||
G4double shigh = log( a[i][6]/e + a[i][7]*e ) * a[i][4] / pow(e, a[i][5]) ;
|
||||
G4double slow = a[i][0] * std::pow(e, a[i][1]) + a[i][2] * std::pow(e, a[i][3]) ;
|
||||
G4double shigh = std::log( a[i][6]/e + a[i][7]*e ) * a[i][4] / std::pow(e, a[i][5]) ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
|
||||
// low energy region
|
||||
@@ -214,7 +214,7 @@ G4double G4hSRIM2000p::ElectronicStoppingPower(G4double z,
|
||||
// semiconductors
|
||||
if(5 == i || 13 == i || 31 == i) s = 0.375 ;
|
||||
|
||||
ionloss *= pow(T/25.0, s) ;
|
||||
ionloss *= std::pow(T/25.0, s) ;
|
||||
}
|
||||
|
||||
if ( ionloss < 0.0) ionloss = 0.0 ;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
@@ -35,13 +35,15 @@
|
||||
// 24 Oct 2001 MGP Cleaned up
|
||||
// 30 Oct 2001 V.Ivanchenko Include formula (53)
|
||||
// 07 Oct 2002 V.Ivanchenko Fix in formula (53)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// 22 Apr 2004 S.Saliceti Add testFlag variable and GetCrossSection method
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4hShellCrossSection.hh"
|
||||
#include "G4AtomicTransitionManager.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
G4hShellCrossSection::G4hShellCrossSection()
|
||||
{ }
|
||||
@@ -51,6 +53,7 @@ G4hShellCrossSection::~G4hShellCrossSection()
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
std::vector<G4double> G4hShellCrossSection::GetCrossSection(G4int Z,
|
||||
G4double incidentEnergy,
|
||||
G4double mass,
|
||||
@@ -61,58 +64,85 @@ std::vector<G4double> G4hShellCrossSection::GetCrossSection(G4int Z,
|
||||
}
|
||||
|
||||
|
||||
//std::vector<G4double> G4hShellCrossSection::Probabilities(
|
||||
// G4int Z,
|
||||
// G4double incidentEnergy,
|
||||
// G4double hMass,
|
||||
// G4double deltaEnergy,
|
||||
// G4bool testFlag) const
|
||||
//{
|
||||
// // Cross-sections for proton ionization calculated as in
|
||||
// // "M. Gryzinski, Two-Particle Collisions. I. General Relations for
|
||||
// // Collisions in the Laboratory system, Phys.Rev. 138 A305"
|
||||
// // Other reference papers are Gryzinski's "Paper I" and "Paper II"
|
||||
// // V.Ivanchenko add only implementation of the formula (53)
|
||||
// // last factor neglected because it is 1 with a good accuracy
|
||||
//
|
||||
// const G4AtomicTransitionManager* transitionManager =
|
||||
// G4AtomicTransitionManager::Instance();
|
||||
//
|
||||
// size_t nShells = transitionManager->NumberOfShells(Z);
|
||||
//
|
||||
// // Vector that stores the calculated cross-sections for each shell:
|
||||
// std::vector<G4double> crossSections;
|
||||
//
|
||||
// // In this loop we calculate cross-section for every shell in the atom
|
||||
// for (size_t k=0; k<nShells; k++)
|
||||
// {
|
||||
// G4double bindingEnergy = transitionManager->Shell(Z,k)->BindingEnergy();
|
||||
// G4double xEnergy = 0.5*bindingEnergy;
|
||||
// G4double y = incidentEnergy*electron_mass_c2/(xEnergy*hMass);
|
||||
// G4double dele = deltaEnergy + xEnergy;
|
||||
// G4double x = electron_mass_c2/dele;
|
||||
//
|
||||
// G4double aCrossSection = (dele/(xEnergy*(1. + 1./y))
|
||||
// + 4.*std::log(2.7 + std::sqrt(y))/3.) * x*x*x;
|
||||
//
|
||||
// // Fill the vector of cross sections with the value just calculated
|
||||
// crossSections.push_back(aCrossSection);
|
||||
//
|
||||
// if (testFlag)
|
||||
// {
|
||||
// G4cout <<"Element: " <<Z<<" Shell: "<<k<<" Particle Energy(MeV): "<<incidentEnergy/MeV<<G4endl;
|
||||
// G4cout <<"Delta Ray Energy(MeV): "<< deltaEnergy/MeV<<" Binding Energy(MeV): "<<bindingEnergy/MeV<<G4endl;
|
||||
// G4cout <<"Cross Section: "<<aCrossSection/barn<<" barns"<< G4endl;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return crossSections;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
// Normalization of relative cross-sections to 1
|
||||
|
||||
std::vector<G4double> G4hShellCrossSection::Probabilities(
|
||||
G4int Z,
|
||||
G4double incidentEnergy,
|
||||
G4double hMass,
|
||||
G4double deltaEnergy) const
|
||||
{
|
||||
// Cross-sections for proton ionization calculated as in
|
||||
// "M. Gryzinski, Two-Particle Collisions. I. General Relations for
|
||||
// Collisions in the Laboratory system, Phys.Rev. 138 A305"
|
||||
// Other reference papers are Gryzinski's "Paper I" and "Paper II"
|
||||
|
||||
// V.Ivanchenko add only implementation of the formula (53)
|
||||
// last factor neglected because it is 1 with a good accuracy
|
||||
|
||||
const G4AtomicTransitionManager* transitionManager =
|
||||
G4AtomicTransitionManager::Instance();
|
||||
|
||||
size_t nShells = transitionManager->NumberOfShells(Z);
|
||||
|
||||
// Vector that stores the calculated cross-sections for each shell:
|
||||
std::vector<G4double> crossSections;
|
||||
G4double deltaEnergy
|
||||
) const
|
||||
{
|
||||
std::vector<G4double> crossSection = GetCrossSection(Z, incidentEnergy, hMass, deltaEnergy,true);
|
||||
G4double nShells = crossSection.size();
|
||||
|
||||
// Partial and total cross-section used for normalization of crossSections:
|
||||
G4double totalCrossSection = 0.;
|
||||
|
||||
// In this loop we calculate cross-section for every shell in the atom
|
||||
for (size_t k=0; k<nShells; k++)
|
||||
{
|
||||
G4double bindingEnergy = transitionManager->Shell(Z,k)->BindingEnergy();
|
||||
G4double xEnergy = 0.5*bindingEnergy;
|
||||
G4double y = incidentEnergy*electron_mass_c2/(xEnergy*hMass);
|
||||
G4double dele = deltaEnergy + xEnergy;
|
||||
G4double x = electron_mass_c2/dele;
|
||||
|
||||
G4double aCrossSection = (dele/(xEnergy*(1. + 1./y))
|
||||
+ 4.*log(2.7 + sqrt(y))/3.) * x*x*x;
|
||||
|
||||
// Calculation of total cross-section
|
||||
totalCrossSection += aCrossSection;
|
||||
|
||||
// Fill the vector of cross sections with the value just calculated
|
||||
crossSections.push_back(aCrossSection);
|
||||
}
|
||||
|
||||
// Normalization of relative cross-sections to 1
|
||||
for (size_t j=0; j<nShells; j++)
|
||||
{
|
||||
crossSections[j] = crossSections[j] / totalCrossSection;
|
||||
}
|
||||
|
||||
// Returns the normalized vector
|
||||
return crossSections;
|
||||
// Calculation of total cross-section
|
||||
for (size_t j=0; j<nShells; j++)
|
||||
{
|
||||
totalCrossSection += crossSection[j]; // equivalent to totalCrossSection = totalCrossSection + aCrossSection
|
||||
}
|
||||
|
||||
// Calculation of normal cross section
|
||||
for(size_t i=0; i<nShells; i++)
|
||||
{
|
||||
crossSection[i] = crossSection[i] / totalCrossSection;
|
||||
}
|
||||
// Returns the normalized vector
|
||||
return crossSection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
//
|
||||
// File name: G4hShellCrossSectionDoubleExp.cc
|
||||
//
|
||||
// Author: Simona Saliceti (simona.saliceti@ge.infn.it)
|
||||
//
|
||||
// History:
|
||||
// -----------
|
||||
// From 23 Oct 2001 A. Mantero G4hShellCrossSection
|
||||
// 30/03/2004 Simona Saliceti 1st implementation
|
||||
// -------------------------------------------------------------------
|
||||
// Class Description:
|
||||
// Empiric Model for shell cross sections in proton ionisation
|
||||
// -------------------------------------------------------------------
|
||||
// $Id: G4hShellCrossSectionDoubleExp.cc,v 1.6 2004/12/02 14:01:37 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
#include "G4hShellCrossSectionDoubleExp.hh"
|
||||
#include "G4AtomicTransitionManager.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4hShellCrossSectionDoubleExpData.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
G4hShellCrossSectionDoubleExp::G4hShellCrossSectionDoubleExp()
|
||||
{
|
||||
kShellData = new G4hShellCrossSectionDoubleExpData();
|
||||
}
|
||||
|
||||
G4hShellCrossSectionDoubleExp::~G4hShellCrossSectionDoubleExp()
|
||||
{ }
|
||||
|
||||
std::vector<G4double> G4hShellCrossSectionDoubleExp::GetCrossSection(G4int Z,
|
||||
G4double incidentEnergy,
|
||||
G4double mass,
|
||||
G4double deltaEnergy,
|
||||
G4bool testFlag) const
|
||||
{
|
||||
mass = 0.0;
|
||||
deltaEnergy = 0.0;
|
||||
|
||||
std::vector<G4double> aCrossSection;
|
||||
|
||||
// Fill the vector of cross sections with the value just calculated
|
||||
aCrossSection.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy));
|
||||
|
||||
if (testFlag)
|
||||
{
|
||||
G4cout <<"Element: " <<Z<<" Particle Energy: "<<incidentEnergy/MeV<<" MeV" <<G4endl;
|
||||
G4cout <<"Cross Section: "<<aCrossSection[0]/barn<<" barns"<< G4endl;
|
||||
}
|
||||
return aCrossSection;
|
||||
}
|
||||
|
||||
//This function calculated the cross section with the Empiric model
|
||||
G4double G4hShellCrossSectionDoubleExp::GetCrossSectionDoubleExp(G4int Z,
|
||||
G4double incidentEnergy) const
|
||||
{
|
||||
// Vector that stores the calculated cross-sections for each shell:
|
||||
G4double crossSectionsInBarn = 0.0;
|
||||
G4double crossSections = 0.0;
|
||||
|
||||
std::vector<std::vector<G4double>*> parVec = kShellData->GetParam(Z);
|
||||
std::vector<G4double>* energyVec = parVec[0];
|
||||
std::vector<G4double>* par1Vec = parVec[1];
|
||||
std::vector<G4double>* par2Vec = parVec[2];
|
||||
|
||||
std::vector<G4double>::iterator i = (*par1Vec).begin();
|
||||
|
||||
G4double a1 = *i;
|
||||
G4double b1 = *(i+1);
|
||||
G4double c1 = *(i+2);
|
||||
|
||||
std::vector<G4double>::iterator j = (*par2Vec).begin();
|
||||
|
||||
G4double a2 = *j;
|
||||
G4double b2 = *(j+1);
|
||||
G4double c2 = *(j+2);
|
||||
G4double d2 = *(j+3);
|
||||
G4double e2 = *(j+4);
|
||||
|
||||
G4double incidentEnergyInMeV = incidentEnergy/MeV;
|
||||
|
||||
// energy is the energy to split the file in low and high energy
|
||||
std::vector<G4double>::iterator l = (*energyVec).begin();
|
||||
G4double energy = *l;
|
||||
energy = energy/MeV;
|
||||
|
||||
if(incidentEnergyInMeV <= energy)
|
||||
{
|
||||
if(Z<26)
|
||||
{
|
||||
crossSectionsInBarn = (std::pow(incidentEnergyInMeV,(a1)))*std::exp((b1)-((c1)*(incidentEnergyInMeV)));
|
||||
}
|
||||
else if(Z>=26)
|
||||
{
|
||||
crossSectionsInBarn = a1*(std::pow(b1,(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,c1));
|
||||
}
|
||||
}
|
||||
else if(incidentEnergyInMeV > energy)
|
||||
{
|
||||
if(Z<26 || (Z>=36 && Z<=65))
|
||||
{
|
||||
crossSectionsInBarn = (a2)*(std::pow((b2),(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,(c2)));
|
||||
}
|
||||
else if(Z>=26 && Z<36)
|
||||
{
|
||||
crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3));
|
||||
}
|
||||
else if(Z>65 && Z<=92)
|
||||
{
|
||||
crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3))+e2*(std::pow(std::log(incidentEnergyInMeV),4));
|
||||
}
|
||||
}
|
||||
|
||||
// if(Z<26 && incidentEnergyInMeV <= energy)
|
||||
// {
|
||||
// crossSectionsInBarn = (std::pow(incidentEnergyInMeV,(a1)))*std::exp((b1)-((c1)*incidentEnergyInMeV));
|
||||
// }
|
||||
// else if(Z>=26 && incidentEnergyInMeV <= energy)
|
||||
// {
|
||||
// crossSectionsInBarn = a1*(std::pow(b1,(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,c1));
|
||||
// }
|
||||
// else if((Z<26 || (36<=Z && Z<=65)) && incidentEnergyInMeV > energy)
|
||||
// {
|
||||
// crossSectionsInBarn = (a2)*(std::pow((b2),(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,(c2)));
|
||||
// }
|
||||
// else if(Z>=26 && Z<=35 && incidentEnergyInMeV > energy)
|
||||
// {
|
||||
// crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3));
|
||||
// }
|
||||
// else if(Z>=67 && Z<=92 && incidentEnergyInMeV > energy)
|
||||
// {
|
||||
// crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3))+e2*(std::pow(std::log(incidentEnergyInMeV),4));
|
||||
// }
|
||||
|
||||
crossSections = crossSectionsInBarn*barn;
|
||||
return crossSections;
|
||||
}
|
||||
|
||||
// This function gives the atomic cross section of k shell only
|
||||
void G4hShellCrossSectionDoubleExp::SetTotalCS(G4double value)
|
||||
{
|
||||
atomTotalCrossSection = value;
|
||||
}
|
||||
|
||||
//A new implementation of Probability to calculate the cross section probability for k shell only
|
||||
std::vector<G4double> G4hShellCrossSectionDoubleExp::Probabilities(
|
||||
G4int Z,
|
||||
G4double incidentEnergy,
|
||||
G4double hMass,
|
||||
G4double deltaEnergy
|
||||
) const
|
||||
{
|
||||
hMass = 0.0;
|
||||
deltaEnergy = 0.0;
|
||||
|
||||
std::vector<G4double> kProbability(0);
|
||||
kProbability.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy)/atomTotalCrossSection);
|
||||
// ---- MGP ---- Next line corrected to kProbability[0] instead of [1], which is not initialized!
|
||||
kProbability.push_back(1 - kProbability[0]);
|
||||
|
||||
return kProbability;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,663 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// Author: Simona Saliceti (simona.saliceti@ge.infn.it)
|
||||
//
|
||||
// History:
|
||||
// -----------
|
||||
// 22 Apr 2004 First committed to cvs
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// $Id: G4hShellCrossSectionDoubleExpData.cc,v 1.2 2004/11/26 08:51:05 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
|
||||
#include "G4hShellCrossSectionDoubleExpData.hh"
|
||||
#include <fstream>
|
||||
#include <strstream>
|
||||
|
||||
G4hShellCrossSectionDoubleExpData::G4hShellCrossSectionDoubleExpData()
|
||||
{
|
||||
|
||||
FillVectorValuesEnergy();
|
||||
FillVectorValuesPar1();
|
||||
FillVectorValuesPar2();
|
||||
FillParameterMapEnergy();
|
||||
FillParameterMapPar1();
|
||||
FillParameterMapPar2();
|
||||
|
||||
}
|
||||
|
||||
G4hShellCrossSectionDoubleExpData::~G4hShellCrossSectionDoubleExpData()
|
||||
{
|
||||
|
||||
std::map< G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos1;
|
||||
for (pos1 = parameterMapEnergy.begin(); pos1 != parameterMapEnergy.end(); ++pos1)
|
||||
{
|
||||
std::vector<G4double>* dataSet1 = (*pos1).second;
|
||||
delete dataSet1;
|
||||
}
|
||||
|
||||
std::map< G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos2;
|
||||
for (pos2 = parameterMapPar1.begin(); pos2 != parameterMapPar1.end(); ++pos2)
|
||||
{
|
||||
std::vector<G4double>* dataSet2 = (*pos2).second;
|
||||
delete dataSet2;
|
||||
}
|
||||
|
||||
std::map< G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos3;
|
||||
for (pos3 = parameterMapPar2.begin(); pos3 != parameterMapPar2.end(); ++pos3)
|
||||
{
|
||||
std::vector<G4double>* dataSet3 = (*pos3).second;
|
||||
delete dataSet3;
|
||||
}
|
||||
}
|
||||
|
||||
inline void G4hShellCrossSectionDoubleExpData::InitializeVectorEnergy(std::vector<G4double> &vectEnergy, G4double value) const
|
||||
{
|
||||
vectEnergy.push_back(value);
|
||||
}
|
||||
|
||||
void G4hShellCrossSectionDoubleExpData::FillVectorValuesEnergy()
|
||||
{
|
||||
InitializeVectorEnergy(energy6C, 0.35);
|
||||
InitializeVectorEnergy(energy7N, 0.6);
|
||||
InitializeVectorEnergy(energy8O, 0.7);
|
||||
InitializeVectorEnergy(energy9F, 1.0);
|
||||
InitializeVectorEnergy(energy10Ne,1.0);
|
||||
InitializeVectorEnergy(energy11Na,1.0);
|
||||
InitializeVectorEnergy(energy12Mg,2.0);
|
||||
InitializeVectorEnergy(energy13Al,2.0);
|
||||
InitializeVectorEnergy(energy14Si,3.0);
|
||||
InitializeVectorEnergy(energy15P, 3.0);
|
||||
InitializeVectorEnergy(energy16S, 5.0);
|
||||
InitializeVectorEnergy(energy17Cl,5.0);
|
||||
InitializeVectorEnergy(energy18Ar,5.0);
|
||||
InitializeVectorEnergy(energy19K, 5.0);
|
||||
InitializeVectorEnergy(energy20Ca,5.0);
|
||||
InitializeVectorEnergy(energy21Sc,5.0);
|
||||
InitializeVectorEnergy(energy22Ti,6.0);
|
||||
InitializeVectorEnergy(energy23V, 6.0);
|
||||
InitializeVectorEnergy(energy24Cr,6.0);
|
||||
InitializeVectorEnergy(energy25Mn,6.0);
|
||||
InitializeVectorEnergy(energy26Fe,3.0);
|
||||
InitializeVectorEnergy(energy27Co,3.5);
|
||||
InitializeVectorEnergy(energy28Ni,3.5);
|
||||
InitializeVectorEnergy(energy29Cu,4.0);
|
||||
InitializeVectorEnergy(energy30Zn,4.0);
|
||||
InitializeVectorEnergy(energy31Ga,4.5);
|
||||
InitializeVectorEnergy(energy32Ge,5.0);
|
||||
InitializeVectorEnergy(energy33As,5.0);
|
||||
InitializeVectorEnergy(energy34Se,5.5);
|
||||
InitializeVectorEnergy(energy35Br,6.0);
|
||||
InitializeVectorEnergy(energy36Kr,6.0);
|
||||
InitializeVectorEnergy(energy37Rb,6.0);
|
||||
InitializeVectorEnergy(energy38Sr,7.0);
|
||||
InitializeVectorEnergy(energy39Y, 7.0);
|
||||
InitializeVectorEnergy(energy40Zr,8.0);
|
||||
InitializeVectorEnergy(energy41Nb,8.0);
|
||||
InitializeVectorEnergy(energy42Mo,8.0);
|
||||
InitializeVectorEnergy(energy43Tc,9.0);
|
||||
InitializeVectorEnergy(energy44Ru,9.0);
|
||||
InitializeVectorEnergy(energy45Rh,9.0);
|
||||
InitializeVectorEnergy(energy46Pd,9.0);
|
||||
InitializeVectorEnergy(energy47Ag,10.);
|
||||
InitializeVectorEnergy(energy48Cd,10.);
|
||||
InitializeVectorEnergy(energy49In,11.);
|
||||
InitializeVectorEnergy(energy50Sn,12.);
|
||||
InitializeVectorEnergy(energy51Sb,12.);
|
||||
InitializeVectorEnergy(energy52Te,12.);
|
||||
InitializeVectorEnergy(energy53I, 14.);
|
||||
InitializeVectorEnergy(energy54Xe,14.);
|
||||
InitializeVectorEnergy(energy55Cs,16.);
|
||||
InitializeVectorEnergy(energy56Ba,16.);
|
||||
InitializeVectorEnergy(energy57La,16.);
|
||||
InitializeVectorEnergy(energy58Ce,18.);
|
||||
InitializeVectorEnergy(energy59Pr,18.);
|
||||
InitializeVectorEnergy(energy60Nd,20.);
|
||||
InitializeVectorEnergy(energy61Pm,20.);
|
||||
InitializeVectorEnergy(energy62Sm,20.);
|
||||
InitializeVectorEnergy(energy63Eu,23.);
|
||||
InitializeVectorEnergy(energy64Gd,23.);
|
||||
InitializeVectorEnergy(energy65Tb,23.);
|
||||
InitializeVectorEnergy(energy66Dy,23.);
|
||||
InitializeVectorEnergy(energy67Ho,23.);
|
||||
InitializeVectorEnergy(energy68Er,23.);
|
||||
InitializeVectorEnergy(energy69Tm,26.);
|
||||
InitializeVectorEnergy(energy70Yb,30.);
|
||||
InitializeVectorEnergy(energy71Lu,30.);
|
||||
InitializeVectorEnergy(energy72Hf,30.);
|
||||
InitializeVectorEnergy(energy73Ta,26.);
|
||||
InitializeVectorEnergy(energy74W, 30.);
|
||||
InitializeVectorEnergy(energy75Re,30.);
|
||||
InitializeVectorEnergy(energy76Os,30.);
|
||||
InitializeVectorEnergy(energy77Ir,30.);
|
||||
InitializeVectorEnergy(energy78Pt,35.);
|
||||
InitializeVectorEnergy(energy79Au,35.);
|
||||
InitializeVectorEnergy(energy80Hg,35.);
|
||||
InitializeVectorEnergy(energy81Tl,35.);
|
||||
InitializeVectorEnergy(energy82Pb,40.);
|
||||
InitializeVectorEnergy(energy83Bi,45.);
|
||||
InitializeVectorEnergy(energy84Po,45.);
|
||||
InitializeVectorEnergy(energy85At,45.);
|
||||
InitializeVectorEnergy(energy86Rn,45.);
|
||||
InitializeVectorEnergy(energy87Fr,45.);
|
||||
InitializeVectorEnergy(energy88Ra,45.);
|
||||
InitializeVectorEnergy(energy89Ac,50.);
|
||||
InitializeVectorEnergy(energy90Th,50.);
|
||||
InitializeVectorEnergy(energy91Pa,50.);
|
||||
InitializeVectorEnergy(energy92U, 55.);
|
||||
}
|
||||
|
||||
inline void G4hShellCrossSectionDoubleExpData::InitializeVectorPar1(std::vector<G4double> &vect, G4double value1, G4double value2, G4double value3) const
|
||||
{
|
||||
vect.push_back(value1);
|
||||
vect.push_back(value2);
|
||||
vect.push_back(value3);
|
||||
}
|
||||
|
||||
// First parameters
|
||||
|
||||
void G4hShellCrossSectionDoubleExpData::FillVectorValuesPar1()
|
||||
{
|
||||
InitializeVectorPar1(parlow6C, 6.028754 , 22.76324 , 8.217967 );
|
||||
InitializeVectorPar1(parlow7N, 5.477011 , 18.81141 , 4.858727 );
|
||||
InitializeVectorPar1(parlow8O, 5.425050 , 16.80088 , 3.910342 );
|
||||
InitializeVectorPar1(parlow9F, 5.017089 , 14.56733 , 2.689939 );
|
||||
InitializeVectorPar1(parlow10Ne,4.668802 , 12.75720 , 1.897390 );
|
||||
InitializeVectorPar1(parlow11Na,4.705349 , 11.54904 , 1.700995 );
|
||||
InitializeVectorPar1(parlow12Mg,4.263983 , 10.00729 , 1.117699 );
|
||||
InitializeVectorPar1(parlow13Al,4.324701 , 9.009748 , 1.013421 );
|
||||
InitializeVectorPar1(parlow14Si,4.090029 , 7.939616 , 0.7610449 );
|
||||
InitializeVectorPar1(parlow15P, 4.098163 , 7.072802 , 0.6808610 );
|
||||
InitializeVectorPar1(parlow16S, 3.632073 , 6.268209 , 0.4380426 );
|
||||
InitializeVectorPar1(parlow17Cl,3.769954 , 5.545212 , 0.4345047 );
|
||||
InitializeVectorPar1(parlow18Ar,3.803460 , 4.852357 , 0.4018530 );
|
||||
InitializeVectorPar1(parlow19K, 3.818340 , 4.215003 , 0.3707851 );
|
||||
InitializeVectorPar1(parlow20Ca,3.767600 , 3.621560 , 0.3257078 );
|
||||
InitializeVectorPar1(parlow21Sc,3.851859 , 3.047405 , 0.3256020 );
|
||||
InitializeVectorPar1(parlow22Ti,3.739032 , 2.540971 , 0.2726244 );
|
||||
InitializeVectorPar1(parlow23V, 3.762692 , 2.028288 , 0.2595049 );
|
||||
InitializeVectorPar1(parlow24Cr,3.830856 , 1.517501 , 0.2585256 );
|
||||
InitializeVectorPar1(parlow25Mn,3.889344 , 1.032337 , 0.2568166 );
|
||||
InitializeVectorPar1(parlow26Fe,4.610710686 , 0.275389472 , 2.764554447 );
|
||||
InitializeVectorPar1(parlow27Co,3.55117935 , 0.228178229 , 2.702047259 );
|
||||
InitializeVectorPar1(parlow28Ni,2.334937582 , 0.232156421 , 2.738149196 );
|
||||
InitializeVectorPar1(parlow29Cu,1.915920665 , 0.182589984 , 2.664081065 );
|
||||
InitializeVectorPar1(parlow30Zn,1.258082776 , 0.190338228 , 2.710680405 );
|
||||
InitializeVectorPar1(parlow31Ga,1.090692834 , 0.140413681 , 2.624294005 );
|
||||
InitializeVectorPar1(parlow32Ge,0.868211657 , 0.115779844 , 2.587823968 );
|
||||
InitializeVectorPar1(parlow33As,0.588895163 , 0.121427557 , 2.630013394 );
|
||||
InitializeVectorPar1(parlow34Se,0.464947416 , 0.103777355 , 2.60655728 );
|
||||
InitializeVectorPar1(parlow35Br,0.372685678 , 0.087649176 , 2.580702817 );
|
||||
InitializeVectorPar1(parlow36Kr,0.261618542 , 0.071657004 , 2.628062571 );
|
||||
InitializeVectorPar1(parlow37Rb,0.203966062 , 0.063471976 , 2.621118231 );
|
||||
InitializeVectorPar1(parlow38Sr,0.151309868 , 0.062650983 , 2.635670955 );
|
||||
InitializeVectorPar1(parlow39Y, 0.130831069 , 0.046546373 , 2.596438847 );
|
||||
InitializeVectorPar1(parlow40Zr,0.113465174 , 0.034961204 , 2.557081599 );
|
||||
InitializeVectorPar1(parlow41Nb,0.089305327 , 0.031631918 , 2.560378036 );
|
||||
InitializeVectorPar1(parlow42Mo,0.066940214 , 0.032387014 , 2.580578224 );
|
||||
InitializeVectorPar1(parlow43Tc,0.054005087 , 0.028625811 , 2.578181335 );
|
||||
InitializeVectorPar1(parlow44Ru,0.047435043 , 0.021858688 , 2.544955569 );
|
||||
InitializeVectorPar1(parlow45Rh,0.037036289 , 0.021226071 , 2.557147432 );
|
||||
InitializeVectorPar1(parlow46Pd,0.031108855 , 0.017082016 , 2.560638611 );
|
||||
InitializeVectorPar1(parlow47Ag,0.030039299 , 0.010687233 , 2.501552766 );
|
||||
InitializeVectorPar1(parlow48Cd,0.025896549 , 0.008577291 , 2.485085985 );
|
||||
InitializeVectorPar1(parlow49In,0.021622343 , 0.007503402 , 2.479363645 );
|
||||
InitializeVectorPar1(parlow50Sn,0.019658368 , 0.005372974 , 2.448647025 );
|
||||
InitializeVectorPar1(parlow51Sb,0.016726542 , 0.004540107 , 2.440841502 );
|
||||
InitializeVectorPar1(parlow52Te,0.01210377 , 0.005793226 , 2.487112403 );
|
||||
InitializeVectorPar1(parlow53I, 0.012068341 , 0.003340949 , 2.430469903 );
|
||||
InitializeVectorPar1(parlow54Xe,0.011309929 , 0.002247705 , 2.39653105 );
|
||||
InitializeVectorPar1(parlow55Cs,0.010322464 , 0.001584264 , 2.372751551 );
|
||||
InitializeVectorPar1(parlow56Ba,0.00891645 , 0.001663984 , 2.365104652 );
|
||||
InitializeVectorPar1(parlow57La,0.008600326 , 0.000973706 , 2.330302922 );
|
||||
InitializeVectorPar1(parlow58Ce,0.00852455 , 0.000554424 , 2.286062759 );
|
||||
InitializeVectorPar1(parlow59Pr,0.006464573 , 0.000751099 , 2.320217715 );
|
||||
InitializeVectorPar1(parlow60Nd,0.005772215 , 0.000604636 , 2.308998547 );
|
||||
InitializeVectorPar1(parlow61Pm,0.005439364 , 0.000395253 , 2.284991617 );
|
||||
InitializeVectorPar1(parlow62Sm,0.004140155 , 0.000572248 , 2.319931149 );
|
||||
InitializeVectorPar1(parlow63Eu,0.004391028 , 0.00026105 , 2.263027478 );
|
||||
InitializeVectorPar1(parlow64Gd,0.004108655 , 0.00018564 , 2.242594759 );
|
||||
InitializeVectorPar1(parlow65Tb,0.003335626 , 0.000214331 , 2.262351386 );
|
||||
InitializeVectorPar1(parlow66Dy,0.003772419844 , 1.491354113E-4, 2.182513765 );
|
||||
InitializeVectorPar1(parlow67Ho,0.003171261268 , 1.610171391E-4, 2.19445375 );
|
||||
InitializeVectorPar1(parlow68Er,0.003511231198 , 6.431951513E-5, 2.131309482 );
|
||||
InitializeVectorPar1(parlow69Tm,0.002951671258 , 7.185528546E-5, 2.14407165 );
|
||||
InitializeVectorPar1(parlow70Yb,0.003090003974 , 3.232352598E-5, 2.10040042 );
|
||||
InitializeVectorPar1(parlow71Lu,0.002504560425 , 4.55286561E-5 , 2.122593025 );
|
||||
InitializeVectorPar1(parlow72Hf,0.002634273859 , 2.025018154E-5, 2.078762159 );
|
||||
InitializeVectorPar1(parlow73Ta,0.002246920523 , 2.530957413E-5, 2.087036821 );
|
||||
InitializeVectorPar1(parlow74W, 0.002138140746 , 1.685058881E-5, 2.071640226 );
|
||||
InitializeVectorPar1(parlow75Re,0.002053720518 , 1.1699924E-5 , 2.052411395 );
|
||||
InitializeVectorPar1(parlow76Os,0.001609160281 , 1.98304501E-5 , 2.07932865 );
|
||||
InitializeVectorPar1(parlow77Ir,0.001451780286 , 1.89647459E-5 , 2.077028977 );
|
||||
InitializeVectorPar1(parlow78Pt,0.1484928E-2 , 0.1015788E-4 , 2.043982 );
|
||||
InitializeVectorPar1(parlow79Au,0.1401423E-2 , 0.7618721E-5 , 2.031677 );
|
||||
InitializeVectorPar1(parlow80Hg,0.1279221E-2 , 0.7684558E-5 , 2.026922 );
|
||||
InitializeVectorPar1(parlow81Tl,0.001116529691 , 8.665290032E-6, 2.035250841 );
|
||||
InitializeVectorPar1(parlow82Pb,0.00123546161 , 3.264194012E-6, 1.984513455 );
|
||||
InitializeVectorPar1(parlow83Bi,0.1168456E-2 , 0.2565728E-5 , 1.974040 );
|
||||
InitializeVectorPar1(parlow84Po,0.001161495281 , 1.517549601E-6, 1.951280331 );
|
||||
InitializeVectorPar1(parlow85At,0.9574954E-3 , 0.2619334E-5 , 1.974164 );
|
||||
InitializeVectorPar1(parlow86Rn,0.9172934E-3 , 0.9124897E-6 , 1.966786 );
|
||||
InitializeVectorPar1(parlow87Fr,0.7900983E-3 , 0.1254855E-5 , 1.978866 );
|
||||
InitializeVectorPar1(parlow88Ra,0.7093558E-3 , 0.1436426E-5 , 1.981631 );
|
||||
InitializeVectorPar1(parlow89Ac,0.0007906194724, 4.455647522E-7, 1.934485393 );
|
||||
InitializeVectorPar1(parlow90Th,0.0007280666063, 4.668165706E-7, 1.931837161 );
|
||||
InitializeVectorPar1(parlow91Pa,0.0006494787919, 5.572898409E-7, 1.937018718 );
|
||||
InitializeVectorPar1(parlow92U, 0.0006712361299, 2.734932326E-7, 1.908976604 );
|
||||
}
|
||||
|
||||
inline void G4hShellCrossSectionDoubleExpData::InitializeVectorPar2(std::vector<G4double> &vect, G4double value1, G4double value2, G4double value3, G4double value4, G4double value5) const
|
||||
{
|
||||
vect.push_back(value1);
|
||||
vect.push_back(value2);
|
||||
vect.push_back(value3);
|
||||
vect.push_back(value4);
|
||||
vect.push_back(value5);
|
||||
}
|
||||
|
||||
// Second parameters
|
||||
|
||||
void G4hShellCrossSectionDoubleExpData::FillVectorValuesPar2()
|
||||
{
|
||||
InitializeVectorPar2(parhigh6C, 0.2614505E+08, 0.1960089 , -0.9781201, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh7N, 0.1469968E+08, 0.9198590E-01, -0.9035943, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh8O, 9015526.0 , 0.4561001E-01, -0.8435532, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh9F, 5878802.0 , 0.2042609E-01, -0.8003597, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh10Ne,3951196.0 , 0.8858837E-02, -0.7637176, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh11Na,2838478.0 , 0.3098775E-02, -0.7451933, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh12Mg,2322929.0 , 0.6889491E-03, -0.7595924, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh13Al,1739866.0 , 0.1930171E-03, -0.7445110, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh14Si,1433611.0 , 0.3515504E-04, -0.7487031, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh15P, 1116443.0 , 0.7842201E-05, -0.7376342, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh16S, 1032940.0 , 0.7188930E-06, -0.7601197, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh17Cl,804101.7 , 0.1521286E-06, -0.7416714, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh18Ar,637702.8 , 0.2779553E-07, -0.7268317, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh19K, 519937.5 , 0.4463855E-08, -0.7158139, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh20Ca,436219.8 , 0.5878926E-09, -0.7102222, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh21Sc,368703.6 , 0.7282178E-10, -0.7046522, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh22Ti,397138.5 , 0.1330592E-11, -0.7196041, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh23V, 274427.9 , 0.6204048E-12, -0.6963667, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh24Cr,228919.3 , 0.7995359E-13, -0.6851181, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh25Mn,199919.3 , 0.4059536E-14, -0.6801181, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh26Fe,5888.956103 , -9427.905394 , 4519.130051 , -537.9587092, 0.0);
|
||||
InitializeVectorPar2(parhigh27Co,5320.748659 , -8223.484184 , 3805.325189 , -441.4870379, 0.0);
|
||||
InitializeVectorPar2(parhigh28Ni,4781.319646 , -7174.783041 , 3219.076628 , -364.8043497, 0.0);
|
||||
InitializeVectorPar2(parhigh29Cu,5036.391497 , -7072.396111 , 2999.984178 , -330.4071107, 0.0);
|
||||
InitializeVectorPar2(parhigh30Zn,4379.092796 , -6046.707901 , 2513.270363 , -271.5536118, 0.0);
|
||||
InitializeVectorPar2(parhigh31Ga,4517.118137 , -5908.263246 , 2344.263972 , -247.0690309, 0.0);
|
||||
InitializeVectorPar2(parhigh32Ge,3842.848695 , -4981.810605 , 1950.19123 , -202.2213944, 0.0);
|
||||
InitializeVectorPar2(parhigh33As,3936.923647 , -4860.36463 , 1825.209324 , -184.9650549, 0.0);
|
||||
InitializeVectorPar2(parhigh34Se,3405.652981 , -4159.784027 , 1540.917232 , -153.778945 , 0.0);
|
||||
InitializeVectorPar2(parhigh35Br,3482.563108 , -4065.531877 , 1450.303751 , -141.6935145, 0.0);
|
||||
InitializeVectorPar2(parhigh36Kr,27792.4379 , 2.49277E-26 , -0.500883086, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh37Rb,15982.48534 , 3.73258E-25 , -0.416741096, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh38Sr,17889.43232 , 1.13451E-27 , -0.454847146, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh39Y, 12451.29445 , 1.53532E-27 , -0.404893344, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh40Zr,10206.19067 , 1.77653E-28 , -0.383987982, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh41Nb,11017.03479 , 8.86594E-31 , -0.414463124, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh42Mo,8535.867912 , 3.16226E-31 , -0.383744046, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh43Tc,9820.134131 , 3.36129E-34 , -0.423630175, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh44Ru,7669.947859 , 1.20762E-34 , -0.39423283 , 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh45Rh,8187.067923 , 3.36422E-37 , -0.420048481, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh46Pd,6449.690254 , 1.07461E-37 , -0.388615201, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh47Ag,7131.825038 , 1.13958E-40 , -0.419291952, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh48Cd,5622.898379 , 3.91721E-41 , -0.39138804 , 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh49In,6154.018663 , 3.57242E-44 , -0.419285141, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh50Sn,5308.904577 , 1.83756E-45 , -0.405840662, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh51Sb,4205.562408 , 7.25156E-46 , -0.378710249, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh52Te,4590.865265 , 4.9712E-49 , -0.405349183, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh53I, 3930.781204 , 4.05142E-50 , -0.390685876, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh54Xe,3130.401154 , 1.74282E-50 , -0.364347309, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh55Cs,3744.705387 , 5.90267E-55 , -0.404336908, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh56Ba,677.6831684 , 1.8374E-42 , -0.129113534, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh57La,717.0531832 , 9.51565E-45 , -0.15227809 , 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh58Ce,641.4062303 , 3.69483E-46 , -0.144632417, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh59Pr,507.1392883 , 3.50854E-46 , -0.117584038, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh60Nd,590.0643943 , 1.09726E-49 , -0.15428397 , 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh61Pm,487.3334007 , 2.75498E-50 , -0.133698368, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh62Sm,358.3518729 , 2.70531E-49 , -0.095301068, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh63Eu,329.3455874 , 5.55138E-51 , -0.091729198, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh64Gd,413.9439156 , 1.23792E-55 , -0.139710531, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh65Tb,336.3177626 , 1.01038E-55 , -0.116827533, 0.0, 0.0);
|
||||
InitializeVectorPar2(parhigh66Dy,-1424.412332 , 1495.300993 , -579.4404515, 97.27901953, -5.836831374 );
|
||||
InitializeVectorPar2(parhigh67Ho,-1517.735661 , 1565.770524 , -596.9215188, 98.77020094, -5.861740123 );
|
||||
InitializeVectorPar2(parhigh68Er,-1474.139215 , 1509.677298 , -571.276182 , 93.84192307, -5.533405798 );
|
||||
InitializeVectorPar2(parhigh69Tm,-1468.335 , 1486.750 , -556.4769 , 90.48160 , -5.288727 );
|
||||
InitializeVectorPar2(parhigh70Yb,-1224.051265 , 1244.798125 , -467.4078327, 76.09587249, -4.438193762 );
|
||||
InitializeVectorPar2(parhigh71Lu,-1297.779 , 1295.939 , -478.6122 , 76.80235 , -4.430208 );
|
||||
InitializeVectorPar2(parhigh72Hf,-1343.224 , 1320.527 , -480.7212 , 76.16011 , -4.348449 );
|
||||
InitializeVectorPar2(parhigh73Ta,-1121.596 , 1113.986 , -408.6746 , 65.06258 , -3.719345 );
|
||||
InitializeVectorPar2(parhigh74W, -1132.138 , 1109.449 , -402.0285 , 63.30364 , -3.586027 );
|
||||
InitializeVectorPar2(parhigh75Re,-1099.159467 , 1069.010051 , -384.5257059, 60.12188988, -3.384193421 );
|
||||
InitializeVectorPar2(parhigh76Os,-1190.387975 , 1140.34171 , -404.1551887, 62.32091335, -3.468141645 );
|
||||
InitializeVectorPar2(parhigh77Ir,-1094.70162 , 1044.989734 , -368.8959923, 56.62618718, -3.134201442 );
|
||||
InitializeVectorPar2(parhigh78Pt,-1163.104391 , 1092.439757 , -379.9958732, 57.58306885, -3.155663589 );
|
||||
InitializeVectorPar2(parhigh79Au,-1144.500 , 1068.235 , -369.2752 , 55.62967 , -3.033460 );
|
||||
InitializeVectorPar2(parhigh80Hg,-1003.592 , 937.0178 , -323.7748 , 48.69880 , -2.646195 );
|
||||
InitializeVectorPar2(parhigh81Tl,-907.5804 , 850.2096 , -294.3571 , 44.29993 , -2.405155 );
|
||||
InitializeVectorPar2(parhigh82Pb,-1015.548 , 929.8707 , -315.4740 , 46.66766 , -2.501258 );
|
||||
InitializeVectorPar2(parhigh83Bi,-1076.950 , 971.7385 , -325.2844 , 47.55627 , -2.525684 );
|
||||
InitializeVectorPar2(parhigh84Po,-1021.285 , 917.5267 , -305.7521 , 44.49191 , -2.351658 );
|
||||
InitializeVectorPar2(parhigh85At,-967.7470 , 866.0588 , -287.4283 , 41.64792 , -2.191694 );
|
||||
InitializeVectorPar2(parhigh86Rn,-338.6518 , 311.5210 , -105.8054 , 15.52788 , -0.8066356 );
|
||||
InitializeVectorPar2(parhigh87Fr,-295.5938 , 271.6075 , -92.01641 , 13.43905 , -0.6914321 );
|
||||
InitializeVectorPar2(parhigh88Ra,-348.9885768 , 317.6478799 , -106.8672925, 15.57672306, -0.8090625926);
|
||||
InitializeVectorPar2(parhigh89Ac,-141.772905 , 134.4449818 , -46.38678324, 6.754305544, -0.3309070686);
|
||||
InitializeVectorPar2(parhigh90Th,-265.8311235 , 240.8739384 , -80.49877194, 11.60745927, -0.5910321851);
|
||||
InitializeVectorPar2(parhigh91Pa,-170.928272 , 157.4297802 , -53.12415098, 7.648148663, -0.379425533 );
|
||||
InitializeVectorPar2(parhigh92U, -344.2548753 , 304.5108607 , -99.78215019, 14.21641181, -0.7269520491);
|
||||
}
|
||||
|
||||
void G4hShellCrossSectionDoubleExpData::FillParameterMapEnergy()
|
||||
{
|
||||
parameterMapEnergy [6] = &energy6C ;
|
||||
parameterMapEnergy [7] = &energy7N ;
|
||||
parameterMapEnergy [8] = &energy8O ;
|
||||
parameterMapEnergy [9] = &energy9F ;
|
||||
parameterMapEnergy [10] = &energy10Ne;
|
||||
parameterMapEnergy [11] = &energy11Na;
|
||||
parameterMapEnergy [12] = &energy12Mg;
|
||||
parameterMapEnergy [13] = &energy13Al;
|
||||
parameterMapEnergy [14] = &energy14Si;
|
||||
parameterMapEnergy [15] = &energy15P ;
|
||||
parameterMapEnergy [16] = &energy16S ;
|
||||
parameterMapEnergy [17] = &energy17Cl;
|
||||
parameterMapEnergy [18] = &energy18Ar;
|
||||
parameterMapEnergy [19] = &energy19K ;
|
||||
parameterMapEnergy [20] = &energy20Ca;
|
||||
parameterMapEnergy [21] = &energy21Sc;
|
||||
parameterMapEnergy [22] = &energy22Ti;
|
||||
parameterMapEnergy [23] = &energy23V ;
|
||||
parameterMapEnergy [24] = &energy24Cr;
|
||||
parameterMapEnergy [25] = &energy25Mn;
|
||||
parameterMapEnergy [26] = &energy26Fe;
|
||||
parameterMapEnergy [27] = &energy27Co;
|
||||
parameterMapEnergy [28] = &energy28Ni;
|
||||
parameterMapEnergy [29] = &energy29Cu;
|
||||
parameterMapEnergy [30] = &energy30Zn;
|
||||
parameterMapEnergy [31] = &energy31Ga;
|
||||
parameterMapEnergy [32] = &energy32Ge;
|
||||
parameterMapEnergy [33] = &energy33As;
|
||||
parameterMapEnergy [34] = &energy34Se;
|
||||
parameterMapEnergy [35] = &energy35Br;
|
||||
parameterMapEnergy [36] = &energy36Kr;
|
||||
parameterMapEnergy [37] = &energy37Rb;
|
||||
parameterMapEnergy [38] = &energy38Sr;
|
||||
parameterMapEnergy [39] = &energy39Y ;
|
||||
parameterMapEnergy [40] = &energy40Zr;
|
||||
parameterMapEnergy [41] = &energy41Nb;
|
||||
parameterMapEnergy [42] = &energy42Mo;
|
||||
parameterMapEnergy [43] = &energy43Tc;
|
||||
parameterMapEnergy [44] = &energy44Ru;
|
||||
parameterMapEnergy [45] = &energy45Rh;
|
||||
parameterMapEnergy [46] = &energy46Pd;
|
||||
parameterMapEnergy [47] = &energy47Ag;
|
||||
parameterMapEnergy [48] = &energy48Cd;
|
||||
parameterMapEnergy [49] = &energy49In;
|
||||
parameterMapEnergy [50] = &energy50Sn;
|
||||
parameterMapEnergy [51] = &energy51Sb;
|
||||
parameterMapEnergy [52] = &energy52Te;
|
||||
parameterMapEnergy [53] = &energy53I ;
|
||||
parameterMapEnergy [54] = &energy54Xe;
|
||||
parameterMapEnergy [55] = &energy55Cs;
|
||||
parameterMapEnergy [56] = &energy56Ba;
|
||||
parameterMapEnergy [57] = &energy57La;
|
||||
parameterMapEnergy [58] = &energy58Ce;
|
||||
parameterMapEnergy [59] = &energy59Pr;
|
||||
parameterMapEnergy [60] = &energy60Nd;
|
||||
parameterMapEnergy [61] = &energy61Pm;
|
||||
parameterMapEnergy [62] = &energy62Sm;
|
||||
parameterMapEnergy [63] = &energy63Eu;
|
||||
parameterMapEnergy [64] = &energy64Gd;
|
||||
parameterMapEnergy [65] = &energy65Tb;
|
||||
parameterMapEnergy [66] = &energy66Dy;
|
||||
parameterMapEnergy [67] = &energy67Ho;
|
||||
parameterMapEnergy [68] = &energy68Er;
|
||||
parameterMapEnergy [69] = &energy69Tm;
|
||||
parameterMapEnergy [70] = &energy70Yb;
|
||||
parameterMapEnergy [71] = &energy71Lu;
|
||||
parameterMapEnergy [72] = &energy72Hf;
|
||||
parameterMapEnergy [73] = &energy73Ta;
|
||||
parameterMapEnergy [74] = &energy74W ;
|
||||
parameterMapEnergy [75] = &energy75Re;
|
||||
parameterMapEnergy [76] = &energy76Os;
|
||||
parameterMapEnergy [77] = &energy77Ir;
|
||||
parameterMapEnergy [78] = &energy78Pt;
|
||||
parameterMapEnergy [79] = &energy79Au;
|
||||
parameterMapEnergy [80] = &energy80Hg;
|
||||
parameterMapEnergy [81] = &energy81Tl;
|
||||
parameterMapEnergy [82] = &energy82Pb;
|
||||
parameterMapEnergy [83] = &energy83Bi;
|
||||
parameterMapEnergy [84] = &energy84Po;
|
||||
parameterMapEnergy [85] = &energy85At;
|
||||
parameterMapEnergy [86] = &energy86Rn;
|
||||
parameterMapEnergy [87] = &energy87Fr;
|
||||
parameterMapEnergy [88] = &energy88Ra;
|
||||
parameterMapEnergy [89] = &energy89Ac;
|
||||
parameterMapEnergy [90] = &energy90Th;
|
||||
parameterMapEnergy [91] = &energy91Pa;
|
||||
parameterMapEnergy [92] = &energy92U ;
|
||||
}
|
||||
|
||||
void G4hShellCrossSectionDoubleExpData::FillParameterMapPar1()
|
||||
{
|
||||
parameterMapPar1 [6] = &parlow6C ;
|
||||
parameterMapPar1 [7] = &parlow7N ;
|
||||
parameterMapPar1 [8] = &parlow8O ;
|
||||
parameterMapPar1 [9] = &parlow9F ;
|
||||
parameterMapPar1 [10] = &parlow10Ne;
|
||||
parameterMapPar1 [11] = &parlow11Na;
|
||||
parameterMapPar1 [12] = &parlow12Mg;
|
||||
parameterMapPar1 [13] = &parlow13Al;
|
||||
parameterMapPar1 [14] = &parlow14Si;
|
||||
parameterMapPar1 [15] = &parlow15P ;
|
||||
parameterMapPar1 [16] = &parlow16S ;
|
||||
parameterMapPar1 [17] = &parlow17Cl;
|
||||
parameterMapPar1 [18] = &parlow18Ar;
|
||||
parameterMapPar1 [19] = &parlow19K ;
|
||||
parameterMapPar1 [20] = &parlow20Ca;
|
||||
parameterMapPar1 [21] = &parlow21Sc;
|
||||
parameterMapPar1 [22] = &parlow22Ti;
|
||||
parameterMapPar1 [23] = &parlow23V ;
|
||||
parameterMapPar1 [24] = &parlow24Cr;
|
||||
parameterMapPar1 [25] = &parlow25Mn;
|
||||
parameterMapPar1 [26] = &parlow26Fe;
|
||||
parameterMapPar1 [27] = &parlow27Co;
|
||||
parameterMapPar1 [28] = &parlow28Ni;
|
||||
parameterMapPar1 [29] = &parlow29Cu;
|
||||
parameterMapPar1 [30] = &parlow30Zn;
|
||||
parameterMapPar1 [31] = &parlow31Ga;
|
||||
parameterMapPar1 [32] = &parlow32Ge;
|
||||
parameterMapPar1 [33] = &parlow33As;
|
||||
parameterMapPar1 [34] = &parlow34Se;
|
||||
parameterMapPar1 [35] = &parlow35Br;
|
||||
parameterMapPar1 [36] = &parlow36Kr;
|
||||
parameterMapPar1 [37] = &parlow37Rb;
|
||||
parameterMapPar1 [38] = &parlow38Sr;
|
||||
parameterMapPar1 [39] = &parlow39Y ;
|
||||
parameterMapPar1 [40] = &parlow40Zr;
|
||||
parameterMapPar1 [41] = &parlow41Nb;
|
||||
parameterMapPar1 [42] = &parlow42Mo;
|
||||
parameterMapPar1 [43] = &parlow43Tc;
|
||||
parameterMapPar1 [44] = &parlow44Ru;
|
||||
parameterMapPar1 [45] = &parlow45Rh;
|
||||
parameterMapPar1 [46] = &parlow46Pd;
|
||||
parameterMapPar1 [47] = &parlow47Ag;
|
||||
parameterMapPar1 [48] = &parlow48Cd;
|
||||
parameterMapPar1 [49] = &parlow49In;
|
||||
parameterMapPar1 [50] = &parlow50Sn;
|
||||
parameterMapPar1 [51] = &parlow51Sb;
|
||||
parameterMapPar1 [52] = &parlow52Te;
|
||||
parameterMapPar1 [53] = &parlow53I ;
|
||||
parameterMapPar1 [54] = &parlow54Xe;
|
||||
parameterMapPar1 [55] = &parlow55Cs;
|
||||
parameterMapPar1 [56] = &parlow56Ba;
|
||||
parameterMapPar1 [57] = &parlow57La;
|
||||
parameterMapPar1 [58] = &parlow58Ce;
|
||||
parameterMapPar1 [59] = &parlow59Pr;
|
||||
parameterMapPar1 [60] = &parlow60Nd;
|
||||
parameterMapPar1 [61] = &parlow61Pm;
|
||||
parameterMapPar1 [62] = &parlow62Sm;
|
||||
parameterMapPar1 [63] = &parlow63Eu;
|
||||
parameterMapPar1 [64] = &parlow64Gd;
|
||||
parameterMapPar1 [65] = &parlow65Tb;
|
||||
parameterMapPar1 [66] = &parlow66Dy;
|
||||
parameterMapPar1 [67] = &parlow67Ho;
|
||||
parameterMapPar1 [68] = &parlow68Er;
|
||||
parameterMapPar1 [69] = &parlow69Tm;
|
||||
parameterMapPar1 [70] = &parlow70Yb;
|
||||
parameterMapPar1 [71] = &parlow71Lu;
|
||||
parameterMapPar1 [72] = &parlow72Hf;
|
||||
parameterMapPar1 [73] = &parlow73Ta;
|
||||
parameterMapPar1 [74] = &parlow74W ;
|
||||
parameterMapPar1 [75] = &parlow75Re;
|
||||
parameterMapPar1 [76] = &parlow76Os;
|
||||
parameterMapPar1 [77] = &parlow77Ir;
|
||||
parameterMapPar1 [78] = &parlow78Pt;
|
||||
parameterMapPar1 [79] = &parlow79Au;
|
||||
parameterMapPar1 [80] = &parlow80Hg;
|
||||
parameterMapPar1 [81] = &parlow81Tl;
|
||||
parameterMapPar1 [82] = &parlow82Pb;
|
||||
parameterMapPar1 [83] = &parlow83Bi;
|
||||
parameterMapPar1 [84] = &parlow84Po;
|
||||
parameterMapPar1 [85] = &parlow85At;
|
||||
parameterMapPar1 [86] = &parlow86Rn;
|
||||
parameterMapPar1 [87] = &parlow87Fr;
|
||||
parameterMapPar1 [88] = &parlow88Ra;
|
||||
parameterMapPar1 [89] = &parlow89Ac;
|
||||
parameterMapPar1 [90] = &parlow90Th;
|
||||
parameterMapPar1 [91] = &parlow91Pa;
|
||||
parameterMapPar1 [92] = &parlow92U ;
|
||||
}
|
||||
|
||||
void G4hShellCrossSectionDoubleExpData::FillParameterMapPar2()
|
||||
{
|
||||
parameterMapPar2 [6] = &parhigh6C ;
|
||||
parameterMapPar2 [7] = &parhigh7N ;
|
||||
parameterMapPar2 [8] = &parhigh8O ;
|
||||
parameterMapPar2 [9] = &parhigh9F ;
|
||||
parameterMapPar2 [10] = &parhigh10Ne;
|
||||
parameterMapPar2 [11] = &parhigh11Na;
|
||||
parameterMapPar2 [12] = &parhigh12Mg;
|
||||
parameterMapPar2 [13] = &parhigh13Al;
|
||||
parameterMapPar2 [14] = &parhigh14Si;
|
||||
parameterMapPar2 [15] = &parhigh15P ;
|
||||
parameterMapPar2 [16] = &parhigh16S ;
|
||||
parameterMapPar2 [17] = &parhigh17Cl;
|
||||
parameterMapPar2 [18] = &parhigh18Ar;
|
||||
parameterMapPar2 [19] = &parhigh19K ;
|
||||
parameterMapPar2 [20] = &parhigh20Ca;
|
||||
parameterMapPar2 [21] = &parhigh21Sc;
|
||||
parameterMapPar2 [22] = &parhigh22Ti;
|
||||
parameterMapPar2 [23] = &parhigh23V ;
|
||||
parameterMapPar2 [24] = &parhigh24Cr;
|
||||
parameterMapPar2 [25] = &parhigh25Mn;
|
||||
parameterMapPar2 [26] = &parhigh26Fe;
|
||||
parameterMapPar2 [27] = &parhigh27Co;
|
||||
parameterMapPar2 [28] = &parhigh28Ni;
|
||||
parameterMapPar2 [29] = &parhigh29Cu;
|
||||
parameterMapPar2 [30] = &parhigh30Zn;
|
||||
parameterMapPar2 [31] = &parhigh31Ga;
|
||||
parameterMapPar2 [32] = &parhigh32Ge;
|
||||
parameterMapPar2 [33] = &parhigh33As;
|
||||
parameterMapPar2 [34] = &parhigh34Se;
|
||||
parameterMapPar2 [35] = &parhigh35Br;
|
||||
parameterMapPar2 [36] = &parhigh36Kr;
|
||||
parameterMapPar2 [37] = &parhigh37Rb;
|
||||
parameterMapPar2 [38] = &parhigh38Sr;
|
||||
parameterMapPar2 [39] = &parhigh39Y ;
|
||||
parameterMapPar2 [40] = &parhigh40Zr;
|
||||
parameterMapPar2 [41] = &parhigh41Nb;
|
||||
parameterMapPar2 [42] = &parhigh42Mo;
|
||||
parameterMapPar2 [43] = &parhigh43Tc;
|
||||
parameterMapPar2 [44] = &parhigh44Ru;
|
||||
parameterMapPar2 [45] = &parhigh45Rh;
|
||||
parameterMapPar2 [46] = &parhigh46Pd;
|
||||
parameterMapPar2 [47] = &parhigh47Ag;
|
||||
parameterMapPar2 [48] = &parhigh48Cd;
|
||||
parameterMapPar2 [49] = &parhigh49In;
|
||||
parameterMapPar2 [50] = &parhigh50Sn;
|
||||
parameterMapPar2 [51] = &parhigh51Sb;
|
||||
parameterMapPar2 [52] = &parhigh52Te;
|
||||
parameterMapPar2 [53] = &parhigh53I ;
|
||||
parameterMapPar2 [54] = &parhigh54Xe;
|
||||
parameterMapPar2 [55] = &parhigh55Cs;
|
||||
parameterMapPar2 [56] = &parhigh56Ba;
|
||||
parameterMapPar2 [57] = &parhigh57La;
|
||||
parameterMapPar2 [58] = &parhigh58Ce;
|
||||
parameterMapPar2 [59] = &parhigh59Pr;
|
||||
parameterMapPar2 [60] = &parhigh60Nd;
|
||||
parameterMapPar2 [61] = &parhigh61Pm;
|
||||
parameterMapPar2 [62] = &parhigh62Sm;
|
||||
parameterMapPar2 [63] = &parhigh63Eu;
|
||||
parameterMapPar2 [64] = &parhigh64Gd;
|
||||
parameterMapPar2 [65] = &parhigh65Tb;
|
||||
parameterMapPar2 [66] = &parhigh66Dy;
|
||||
parameterMapPar2 [67] = &parhigh67Ho;
|
||||
parameterMapPar2 [68] = &parhigh68Er;
|
||||
parameterMapPar2 [69] = &parhigh69Tm;
|
||||
parameterMapPar2 [70] = &parhigh70Yb;
|
||||
parameterMapPar2 [71] = &parhigh71Lu;
|
||||
parameterMapPar2 [72] = &parhigh72Hf;
|
||||
parameterMapPar2 [73] = &parhigh73Ta;
|
||||
parameterMapPar2 [74] = &parhigh74W ;
|
||||
parameterMapPar2 [75] = &parhigh75Re;
|
||||
parameterMapPar2 [76] = &parhigh76Os;
|
||||
parameterMapPar2 [77] = &parhigh77Ir;
|
||||
parameterMapPar2 [78] = &parhigh78Pt;
|
||||
parameterMapPar2 [79] = &parhigh79Au;
|
||||
parameterMapPar2 [80] = &parhigh80Hg;
|
||||
parameterMapPar2 [81] = &parhigh81Tl;
|
||||
parameterMapPar2 [82] = &parhigh82Pb;
|
||||
parameterMapPar2 [83] = &parhigh83Bi;
|
||||
parameterMapPar2 [84] = &parhigh84Po;
|
||||
parameterMapPar2 [85] = &parhigh85At;
|
||||
parameterMapPar2 [86] = &parhigh86Rn;
|
||||
parameterMapPar2 [87] = &parhigh87Fr;
|
||||
parameterMapPar2 [88] = &parhigh88Ra;
|
||||
parameterMapPar2 [89] = &parhigh89Ac;
|
||||
parameterMapPar2 [90] = &parhigh90Th;
|
||||
parameterMapPar2 [91] = &parhigh91Pa;
|
||||
parameterMapPar2 [92] = &parhigh92U ;
|
||||
}
|
||||
|
||||
std::vector<std::vector<G4double>*> G4hShellCrossSectionDoubleExpData::GetParam(G4int Z)
|
||||
{
|
||||
|
||||
std::vector<std::vector<G4double>*> energyPar1Par2;
|
||||
|
||||
// if (energyPar1Par2.size() != 0) {
|
||||
// for (size_t i=1; i==energyPar1Par2.size(); i++)
|
||||
// {
|
||||
// energyPar1Par2.erase(energyPar1Par2.begin());
|
||||
// }
|
||||
// }
|
||||
|
||||
energyPar1Par2.push_back(parameterMapEnergy[Z]);
|
||||
energyPar1Par2.push_back(parameterMapPar1[Z]);
|
||||
energyPar1Par2.push_back(parameterMapPar2[Z]);
|
||||
return energyPar1Par2;
|
||||
}
|
||||
@@ -37,8 +37,8 @@
|
||||
// Class Description:
|
||||
// Empiric Model for shell cross sections in proton ionisation
|
||||
// -------------------------------------------------------------------
|
||||
// $Id: G4hShellCrossSectionExp.cc,v 1.2 2004/06/07 07:42:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// $Id: G4hShellCrossSectionExp.cc,v 1.4 2004/12/02 14:01:37 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
@@ -98,15 +98,15 @@ G4double G4hShellCrossSectionExp::GetCrossSectionExp(G4int Z,
|
||||
|
||||
if(Z<26 && Z>=6 && Z!=17)
|
||||
{
|
||||
crossSectionsInBarn = a*(pow(b,(1./incidentEnergyInMeV)))*(pow(incidentEnergyInMeV,c));
|
||||
crossSectionsInBarn = a*(std::pow(b,(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,c));
|
||||
}
|
||||
else if(Z<66 && Z>=26 || Z==17)
|
||||
{
|
||||
crossSectionsInBarn = exp(a+(b/incidentEnergyInMeV)+(c*log(incidentEnergyInMeV)));
|
||||
crossSectionsInBarn = std::exp(a+(b/incidentEnergyInMeV)+(c*std::log(incidentEnergyInMeV)));
|
||||
}
|
||||
else if(Z<=92 && Z>=66)
|
||||
{
|
||||
crossSectionsInBarn = (pow(incidentEnergyInMeV,a))*exp(b-(c*incidentEnergyInMeV));
|
||||
crossSectionsInBarn = (std::pow(incidentEnergyInMeV,a))*std::exp(b-(c*incidentEnergyInMeV));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -136,7 +136,8 @@ void G4hShellCrossSectionExp::SetTotalCS(G4double value)
|
||||
|
||||
std::vector<G4double> kProbability;
|
||||
kProbability.push_back(GetCrossSectionExp(Z,incidentEnergy)/atomTotalCrossSection);
|
||||
kProbability.push_back(1 - kProbability[1]);
|
||||
// ---- MGP ---- Next line corrected to kProbability[0] instead of [1], which is not initialized!
|
||||
kProbability.push_back(1 - kProbability[0]);
|
||||
|
||||
return kProbability;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// $Id: G4hShellCrossSectionExpData.cc,v 1.1 2004/04/27 09:45:49 saliceti Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
|
||||
#include "G4hShellCrossSectionExpData.hh"
|
||||
#include <fstream>
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
// Modifications:
|
||||
// 20/07/2000 V.Ivanchenko First implementation
|
||||
// 10/05/2001 V.Ivanchenko Clean up againist Linux compilation with -Wall
|
||||
// 26/08/2004 V.Ivanchenko Fix a problem of effective charge
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -207,25 +208,25 @@ G4double G4hZiegler1977He::ElectronicStoppingPower(G4double z,
|
||||
|
||||
if ( energy < 1.0 ) {
|
||||
G4double slow = a[i][0] ;
|
||||
G4double shigh = log( 1.0 + a[i][3]*1000.0 + a[i][4]*0.001 )
|
||||
G4double shigh = std::log( 1.0 + a[i][3]*1000.0 + a[i][4]*0.001 )
|
||||
* a[i][2]*1000.0 ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
ionloss *= sqrt(energy) ;
|
||||
ionloss *= std::sqrt(energy) ;
|
||||
|
||||
} else if ( energy < 10000.0 ) {
|
||||
G4double slow = a[i][0] * pow(energy, a[i][1]) ;
|
||||
G4double slow = a[i][0] * std::pow(energy, a[i][1]) ;
|
||||
G4double e = energy/1000.0 ;
|
||||
G4double shigh = log( 1.0 + a[i][3]/e + a[i][4]*e ) * a[i][2]/e ;
|
||||
G4double shigh = std::log( 1.0 + a[i][3]/e + a[i][4]*e ) * a[i][2]/e ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
|
||||
} else {
|
||||
G4double le = log(1000.0/energy) ;
|
||||
ionloss = exp( a[i][5] + a[i][6]*le + a[i][7]*le*le + a[i][8]*le*le*le) ;
|
||||
G4double le = std::log(1000.0/energy) ;
|
||||
ionloss = std::exp( a[i][5] + a[i][6]*le + a[i][7]*le*le + a[i][8]*le*le*le) ;
|
||||
}
|
||||
|
||||
if ( ionloss < 0.0) ionloss = 0.0 ;
|
||||
|
||||
ionloss /= HeEffChargeSquare(z, energy*keV) ;
|
||||
ionloss /= HeEffChargeSquare(z, kineticEnergy*rateMass);
|
||||
|
||||
return ionloss;
|
||||
}
|
||||
|
||||
@@ -71,27 +71,27 @@ G4double G4hZiegler1977Nuclear::NuclearStoppingPower(G4double kineticEnergy,
|
||||
G4double energy = kineticEnergy/keV ; // energy in keV
|
||||
G4double ionloss ;
|
||||
|
||||
G4double rm = (m1 + m2) * sqrt( pow(z1, 0.667) + pow(z2, 0.667) ) ;
|
||||
G4double rm = (m1 + m2) * std::sqrt( std::pow(z1, 0.667) + std::pow(z2, 0.667) ) ;
|
||||
|
||||
G4double er = 32.53 * m2 * energy / ( z1 * z2 * rm ) ; // reduced energy
|
||||
|
||||
if ( er < 0.01 ) {
|
||||
ionloss = sqrt(er) * 1.593 ;
|
||||
ionloss = std::sqrt(er) * 1.593 ;
|
||||
|
||||
} else if ( er < 10.0 ) {
|
||||
ionloss = 1.7 * sqrt(er) * log(er + exp(1.0)) /
|
||||
(1.0 + 6.8 * er + 3.4 * pow(er, 1.5)) ;
|
||||
ionloss = 1.7 * std::sqrt(er) * std::log(er + std::exp(1.0)) /
|
||||
(1.0 + 6.8 * er + 3.4 * std::pow(er, 1.5)) ;
|
||||
|
||||
} else {
|
||||
ionloss = log(0.47 * er) * 0.5 / er ;
|
||||
ionloss = std::log(0.47 * er) * 0.5 / er ;
|
||||
}
|
||||
|
||||
// Stragling
|
||||
if(lossFlucFlag) {
|
||||
G4double sig = 4.0 * m1 * m2 * sqrt( (pow(z1, 0.23) + pow(z2, 0.23)) /
|
||||
(pow(z1, 0.667) + pow(z2, 0.667)) )
|
||||
G4double sig = 4.0 * m1 * m2 * std::sqrt( (std::pow(z1, 0.23) + std::pow(z2, 0.23)) /
|
||||
(std::pow(z1, 0.667) + std::pow(z2, 0.667)) )
|
||||
/ ((m1 +m2)*(m1 + m2)*
|
||||
(4.0 + 0.197*pow(er,-1.6991)+6.584*pow(er,-1.0494))) ;
|
||||
(4.0 + 0.197*std::pow(er,-1.6991)+6.584*std::pow(er,-1.0494))) ;
|
||||
|
||||
ionloss *= G4RandGauss::shoot(1.0,sig) ;
|
||||
}
|
||||
|
||||
@@ -202,18 +202,18 @@ G4double G4hZiegler1977p::ElectronicStoppingPower(G4double z,
|
||||
};
|
||||
|
||||
if ( T < 10.0 ) {
|
||||
ionloss = a[i][0] * sqrt(T) ;
|
||||
ionloss = a[i][0] * std::sqrt(T) ;
|
||||
|
||||
} else if ( T < 1000.0 ) {
|
||||
G4double slow = a[i][1] * pow(T, 0.45) ;
|
||||
G4double shigh = log( 1.0 + a[i][3]/T + a[i][4]*T ) * a[i][2]/T ;
|
||||
G4double slow = a[i][1] * std::pow(T, 0.45) ;
|
||||
G4double shigh = std::log( 1.0 + a[i][3]/T + a[i][4]*T ) * a[i][2]/T ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
|
||||
} else {
|
||||
G4double le = log(T) ;
|
||||
G4double le = std::log(T) ;
|
||||
G4double gam = 1.0 + kineticEnergy / proton_mass_c2 ;
|
||||
G4double beta2 = 1.0 - 1.0/ (gam*gam) ;
|
||||
ionloss = ( log(a[i][6]*beta2/(1.0 - beta2)) - beta2 -
|
||||
ionloss = ( std::log(a[i][6]*beta2/(1.0 - beta2)) - beta2 -
|
||||
a[i][7] - a[i][8]*le - a[i][9]*le*le - a[i][10]*le*le*le -
|
||||
a[i][11]*le*le*le*le ) * a[i][5]/beta2 ;
|
||||
}
|
||||
|
||||
@@ -72,22 +72,22 @@ G4double G4hZiegler1985Nuclear::NuclearStoppingPower(G4double kineticEnergy,
|
||||
G4double energy = kineticEnergy/keV ; // energy in keV
|
||||
G4double ionloss ;
|
||||
|
||||
G4double rm = (m1 + m2) * sqrt( pow(z1, .23) + pow(z2, .23) ) ;
|
||||
G4double rm = (m1 + m2) * std::sqrt( std::pow(z1, .23) + std::pow(z2, .23) ) ;
|
||||
|
||||
G4double er = 32.536 * m2 * energy / ( z1 * z2 * rm ) ; // reduced energy
|
||||
|
||||
if ( er <= 30 ) {
|
||||
ionloss = 0.5*log(1+1.1383*er)/
|
||||
(er+0.01312*pow(er,0.21226)+0.19593*sqrt(er)) ;
|
||||
ionloss = 0.5*std::log(1+1.1383*er)/
|
||||
(er+0.01312*std::pow(er,0.21226)+0.19593*std::sqrt(er)) ;
|
||||
|
||||
} else {
|
||||
ionloss = 0.5*log(er)/er ;
|
||||
ionloss = 0.5*std::log(er)/er ;
|
||||
}
|
||||
|
||||
// Stragling
|
||||
if(lossFlucFlag) {
|
||||
G4double sig = 4.0 * m1 * m2 / ((m1 + m2)*(m1 + m2)*
|
||||
(4.0 + 0.197*pow(er,-1.6991)+6.584*pow(er,-1.0494))) ;
|
||||
(4.0 + 0.197*std::pow(er,-1.6991)+6.584*std::pow(er,-1.0494))) ;
|
||||
|
||||
|
||||
ionloss *= G4RandGauss::shoot(1.0,sig) ;
|
||||
|
||||
@@ -216,8 +216,8 @@ G4double G4hZiegler1985p::ElectronicStoppingPower(G4double z,
|
||||
if ( T < 25.0 ) e = 25.0 ;
|
||||
|
||||
// universal approximation
|
||||
G4double slow = a[i][0] * pow(e, a[i][1]) + a[i][2] * pow(e, a[i][3]) ;
|
||||
G4double shigh = log( a[i][6]/e + a[i][7]*e ) * a[i][4] / pow(e, a[i][5]) ;
|
||||
G4double slow = a[i][0] * std::pow(e, a[i][1]) + a[i][2] * std::pow(e, a[i][3]) ;
|
||||
G4double shigh = std::log( a[i][6]/e + a[i][7]*e ) * a[i][4] / std::pow(e, a[i][5]) ;
|
||||
ionloss = slow*shigh / (slow + shigh) ;
|
||||
|
||||
// low energy region
|
||||
@@ -229,7 +229,7 @@ G4double G4hZiegler1985p::ElectronicStoppingPower(G4double z,
|
||||
// semiconductors
|
||||
if(5 == i || 13 == i || 31 == i) s = 0.375 ;
|
||||
|
||||
ionloss *= pow(T/25.0, s) ;
|
||||
ionloss *= std::pow(T/25.0, s) ;
|
||||
}
|
||||
|
||||
if ( ionloss < 0.0) ionloss = 0.0 ;
|
||||
|
||||
Reference in New Issue
Block a user