Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -59,7 +59,7 @@ class G4FermiMomentum
|
||||
|
||||
private:
|
||||
|
||||
G4double cbrt(G4double x) { return pow(x,1./3.); }
|
||||
G4double cbrt(G4double x) { return std::pow(x,1./3.); }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ inline G4double G4Fragment::GetExcitationEnergy() const
|
||||
// a problem with rounding errors for on-shell lorentz-vectors in CLHEP.
|
||||
// HPW Apr 1999 @@@@@@@
|
||||
|
||||
if(abs(theExcitationEnergy)<10*eV) return 0;
|
||||
if(std::abs(theExcitationEnergy)<10*eV) return 0;
|
||||
return theExcitationEnergy;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ inline
|
||||
G4HadronicException(__FILE__, __LINE__, "G4GeneralPhaseSpaceDecay::Pmx energy in cms > mass1+mass2");
|
||||
}
|
||||
G4double ppp = (e+p1+p2)*(e+p1-p2)*(e-p1+p2)*(e-p1-p2)/(4.0*e*e);
|
||||
if (ppp>0) return sqrt(ppp);
|
||||
if (ppp>0) return std::sqrt(ppp);
|
||||
else return -1.;
|
||||
}
|
||||
|
||||
|
||||
@@ -271,10 +271,10 @@ inline void G4KineticTrack::Update4Momentum(G4double aEnergy)
|
||||
G4double mass2=theTotal4Momentum.mag2();
|
||||
if ( sqr(aEnergy) > mass2 )
|
||||
{
|
||||
newP = sqrt(sqr(aEnergy) - mass2 );
|
||||
newP = std::sqrt(sqr(aEnergy) - mass2 );
|
||||
} else
|
||||
{
|
||||
aEnergy=sqrt(mass2);
|
||||
aEnergy=std::sqrt(mass2);
|
||||
}
|
||||
Set4Momentum(G4LorentzVector(newP*the4Momentum.vect().unit(), aEnergy));
|
||||
}
|
||||
@@ -283,7 +283,7 @@ inline void G4KineticTrack::Update4Momentum(const G4ThreeVector & aMomentum)
|
||||
{
|
||||
// update the4Momentum with aMomentum at constant mass (the4Momentum.mag()
|
||||
// updates theTotal4Momentum as well.
|
||||
G4double newE=sqrt(theTotal4Momentum.mag2() + aMomentum.mag2());
|
||||
G4double newE=std::sqrt(theTotal4Momentum.mag2() + aMomentum.mag2());
|
||||
Set4Momentum(G4LorentzVector(aMomentum, newE));
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ inline void G4KineticTrack::SetTrackingMomentum(const G4LorentzVector& aMomentum
|
||||
// keep mass of aMomentum for the total momentum
|
||||
G4double m2 = aMomentum.mag2();
|
||||
G4double p2=theTotal4Momentum.vect().mag2();
|
||||
theTotal4Momentum.setE(sqrt(m2+p2));
|
||||
theTotal4Momentum.setE(std::sqrt(m2+p2));
|
||||
}
|
||||
|
||||
inline void G4KineticTrack::UpdateTrackingMomentum(G4double aEnergy)
|
||||
@@ -307,10 +307,10 @@ inline void G4KineticTrack::UpdateTrackingMomentum(G4double aEnergy)
|
||||
G4double mass2=theTotal4Momentum.mag2();
|
||||
if ( sqr(aEnergy) > mass2 )
|
||||
{
|
||||
newP = sqrt(sqr(aEnergy) - mass2 );
|
||||
newP = std::sqrt(sqr(aEnergy) - mass2 );
|
||||
} else
|
||||
{
|
||||
aEnergy=sqrt(mass2);
|
||||
aEnergy=std::sqrt(mass2);
|
||||
}
|
||||
SetTrackingMomentum(G4LorentzVector(newP*the4Momentum.vect().unit(), aEnergy));
|
||||
}
|
||||
@@ -319,7 +319,7 @@ inline void G4KineticTrack::UpdateTrackingMomentum(const G4ThreeVector & aMoment
|
||||
{
|
||||
// update the4Momentum with aMomentum at constant mass (the4Momentum.mag()
|
||||
// updates theTotal4Momentum as well.
|
||||
G4double newE=sqrt(theTotal4Momentum.mag2() + aMomentum.mag2());
|
||||
G4double newE=std::sqrt(theTotal4Momentum.mag2() + aMomentum.mag2());
|
||||
SetTrackingMomentum(G4LorentzVector(aMomentum, newE));
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ inline G4double G4KineticTrack::GetActualMass() const
|
||||
G4ThreeVector theMomentum = the4Momentum.vect();
|
||||
G4double theMomentum2 = theMomentum.mag2();
|
||||
G4double theTotalEnergy = the4Momentum.e();
|
||||
G4double theMass = sqrt(abs(theTotalEnergy * theTotalEnergy - theMomentum2));
|
||||
G4double theMass = std::sqrt(std::abs(theTotalEnergy * theTotalEnergy - theMomentum2));
|
||||
return theMass;
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ inline G4double G4KineticTrack::SampleResidualLifetime()
|
||||
{
|
||||
G4double theTotalActualWidth = this->EvaluateTotalActualWidth();
|
||||
G4double tau = hbar_Planck * (-1.0 / theTotalActualWidth);
|
||||
G4double theResidualLifetime = tau * log(G4UniformRand());
|
||||
G4double theResidualLifetime = tau * std::log(G4UniformRand());
|
||||
return theResidualLifetime*the4Momentum.gamma();
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ inline G4double G4KineticTrack::EvaluateCMMomentum(const G4double m,
|
||||
G4double theCMMomentum;
|
||||
if((m_ij[0]+m_ij[1])<m)
|
||||
theCMMomentum = 1 / (2 * m) *
|
||||
sqrt (((m * m) - (m_ij[0] + m_ij[1]) * (m_ij[0] + m_ij[1])) *
|
||||
std::sqrt (((m * m) - (m_ij[0] + m_ij[1]) * (m_ij[0] + m_ij[1])) *
|
||||
((m * m) - (m_ij[0] - m_ij[1]) * (m_ij[0] - m_ij[1])));
|
||||
else
|
||||
theCMMomentum=0.;
|
||||
|
||||
@@ -41,18 +41,18 @@ class G4NuclearFermiDensity : public G4VNuclearDensity
|
||||
|
||||
G4double GetRelativeDensity(const G4ThreeVector & aPosition) const
|
||||
{
|
||||
return 1./(1.+exp((aPosition.mag()-theR)/a));
|
||||
return 1./(1.+std::exp((aPosition.mag()-theR)/a));
|
||||
}
|
||||
|
||||
G4double GetRadius(const G4double maxRelativeDenisty) const
|
||||
{
|
||||
return (maxRelativeDenisty>0 && maxRelativeDenisty <= 1 ) ?
|
||||
(theR + a*log((1-maxRelativeDenisty+exp(-1*theR/a))/maxRelativeDenisty)) : DBL_MAX;
|
||||
(theR + a*std::log((1-maxRelativeDenisty+std::exp(-1*theR/a))/maxRelativeDenisty)) : DBL_MAX;
|
||||
}
|
||||
|
||||
G4double GetDeriv(const G4ThreeVector & aPosition) const
|
||||
{
|
||||
return -exp((aPosition.mag()-theR)/a) * sqr(GetDensity(aPosition)) / (a*Getrho0());
|
||||
return -std::exp((aPosition.mag()-theR)/a) * sqr(GetDensity(aPosition)) / (a*Getrho0());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -53,13 +53,13 @@ public:
|
||||
private:
|
||||
|
||||
G4double BrWigInt0(const G4double x, const G4double gamma, const G4double m0) const
|
||||
{ return 2.0*gamma*atan( 2.0 * (x-m0)/ gamma ); }
|
||||
{ return 2.0*gamma*std::atan( 2.0 * (x-m0)/ gamma ); }
|
||||
|
||||
G4double BrWigInt1(const G4double x, const G4double gamma, const G4double m0) const
|
||||
{ return 0.5*gamma*gamma*log( (x-m0)*(x-m0)+gamma*gamma/4.0 ) + m0*BrWigInt0(x,gamma,m0); }
|
||||
{ return 0.5*gamma*gamma*std::log( (x-m0)*(x-m0)+gamma*gamma/4.0 ) + m0*BrWigInt0(x,gamma,m0); }
|
||||
|
||||
G4double BrWigInv(const G4double x, const G4double gamma, const G4double m0) const
|
||||
{ return 0.5*gamma*tan( 0.5*x/gamma )+m0; }
|
||||
{ return 0.5*gamma*std::tan( 0.5*x/gamma )+m0; }
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user