Import Geant4 7.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 11:11:55 +02:00
parent e083ffb441
commit 516dbf1a58
5914 changed files with 202605 additions and 71141 deletions
@@ -90,11 +90,11 @@ void G4NeutronHPAngular::SampleAndUpdate(G4ReactionProduct & aHadron)
// G4cout << "Angular result "<<aHadron.GetTotalMomentum()<<" ";
// @@@ add code for isotropic emission in CMS.
G4double costheta = 2.*G4UniformRand()-1;
G4double theta = acos(costheta);
G4double theta = std::acos(costheta);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = aHadron.GetTotalMomentum();
G4ThreeVector temp(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
aHadron.SetMomentum( temp );
aHadron.Lorentz(aHadron, -1.*theTarget);
}
@@ -107,10 +107,10 @@ void G4NeutronHPAngular::SampleAndUpdate(G4ReactionProduct & aHadron)
boosted.Lorentz(theNeutron, theTarget);
G4double kineticEnergy = boosted.GetKineticEnergy();
G4double cosTh = theCoefficients->SampleMax(kineticEnergy);
G4double theta = acos(cosTh);
G4double theta = std::acos(cosTh);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4ThreeVector temp(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4double sinth = std::sin(theta);
G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
aHadron.SetMomentum( temp );
}
else if(theAngularDistributionType == 2) // costh in CMS
@@ -119,11 +119,11 @@ void G4NeutronHPAngular::SampleAndUpdate(G4ReactionProduct & aHadron)
boostedN.Lorentz(theNeutron, theTarget);
G4double kineticEnergy = boostedN.GetKineticEnergy();
G4double cosTh = theProbArray->Sample(kineticEnergy);
G4double theta = acos(cosTh);
G4double theta = std::acos(cosTh);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4ThreeVector temp(sinth*cos(phi), sinth*sin(phi), cos(theta) ); //CMS
G4ThreeVector temp(sinth*std::cos(phi), sinth*std::sin(phi), std::cos(theta) ); //CMS
G4double en = aHadron.GetTotalEnergy(); // Target rest
// get trafo from Target rest frame to CMS
@@ -138,8 +138,8 @@ void G4NeutronHPAngular::SampleAndUpdate(G4ReactionProduct & aHadron)
G4ThreeVector the3trafo = -the3Target-the3Neutron;
G4ReactionProduct trafo; // for transformation from CMS to target rest frame
trafo.SetMomentum(the3trafo);
G4double cmsMom = sqrt(the3trafo*the3trafo);
G4double sqrts = sqrt((totE-cmsMom)*(totE+cmsMom));
G4double cmsMom = std::sqrt(the3trafo*the3trafo);
G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
trafo.SetMass(sqrts);
trafo.SetTotalEnergy(totE);
@@ -149,7 +149,7 @@ void G4NeutronHPAngular::SampleAndUpdate(G4ReactionProduct & aHadron)
fac*=gamma;
G4double mom;
mom = sqrt( en*fac*en*fac -
mom = std::sqrt( en*fac*en*fac -
(fac*fac - gamma*gamma)*
(en*en - gamma*gamma*aHadron.GetMass()*aHadron.GetMass())
);
@@ -158,7 +158,7 @@ void G4NeutronHPAngular::SampleAndUpdate(G4ReactionProduct & aHadron)
temp = mom*temp;
aHadron.SetMomentum( temp ); // now all in CMS
aHadron.SetTotalEnergy( sqrt( mom*mom + aHadron.GetMass()*aHadron.GetMass() ) );
aHadron.SetTotalEnergy( std::sqrt( mom*mom + aHadron.GetMass()*aHadron.GetMass() ) );
aHadron.Lorentz(aHadron, trafo); // now in target rest frame
}
else
@@ -111,7 +111,7 @@ GetCrossSection(const G4DynamicParticle* aP, const G4Element*anE, G4double aT)
G4int size = G4int(std::max(10., aT/60*kelvin));
G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
G4double neutronVMag = neutronVelocity.mag();
while(counter == 0 || abs(buffer-result/counter) > 0.03*buffer)
while(counter == 0 || std::abs(buffer-result/counter) > 0.03*buffer)
{
if(counter) buffer = result/counter;
while (counter<size)
@@ -122,7 +122,7 @@
+theTarget.GetKineticEnergy(); // gammas come from Q-value
G4double theResMass = aRecoil->GetPDGMass();
G4double theResE = aRecoil->GetPDGMass()+aKinEnergy;
G4double theAbsMom = sqrt(theResE*theResE - theResMass*theResMass);
G4double theAbsMom = std::sqrt(theResE*theResE - theResMass*theResMass);
G4ThreeVector theMomentum = theAbsMom*theMomUnit;
theOne->SetMomentum(theMomentum);
theResult.AddSecondary(theOne);
@@ -152,7 +152,7 @@
G4String filename = aFile.GetName();
theBaseA = A;
theBaseZ = G4int(Z+.5);
if(!dbool || ( Z<2.5 && ( abs(theBaseZ - Z)>0.0001 || abs(theBaseA - A)>0.0001)))
if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001)))
{
hasAnyData = false;
hasFSData = false;
@@ -154,7 +154,7 @@
m++;
a++;
G4double xp = aPassive->GetEnergy(p);
if( abs(abs(xp-xa)/xa)<0.001 )
if( std::abs(std::abs(xp-xa)/xa)<0.001 )
{
p++;
}
@@ -171,7 +171,7 @@
}
while (p!=aPassive->GetVectorLength())
{
if(abs(theMerge->GetEnergy(std::max(0,m-1))-aPassive->GetEnergy(p))/aPassive->GetEnergy(p)>0.001)
if(std::abs(theMerge->GetEnergy(std::max(0,m-1))-aPassive->GetEnergy(p))/aPassive->GetEnergy(p)>0.001)
theMerge->SetData(m++, aPassive->GetEnergy(p), aPassive->GetXsec(p));
p++;
}
@@ -365,10 +365,10 @@
}
result->SetKineticEnergy(fsEnergy);
G4double phi = twopi*G4UniformRand();
G4double theta = acos(cosTh);
G4double sinth = sin(theta);
G4double theta = std::acos(cosTh);
G4double sinth = std::sin(theta);
G4double mtot = result->GetTotalMomentum();
G4ThreeVector tempVector(mtot*sinth*cos(phi), mtot*sinth*sin(phi), mtot*cos(theta) );
G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
result->SetMomentum(tempVector);
// return the result.
return result;
@@ -64,7 +64,7 @@ void G4NeutronHPDeExGammas::Init(std::ifstream & aDataFile)
for(i=0; i<nGammas; i++)
{
nextE = theGammas[i]->GetLevelEnergy();
if(abs(currentE-nextE)>epsilon) nLevels++;
if(std::abs(currentE-nextE)>epsilon) nLevels++;
currentE = nextE;
}
@@ -82,7 +82,7 @@ void G4NeutronHPDeExGammas::Init(std::ifstream & aDataFile)
for(i=0; i<nGammas; i++)
{
nextE = theGammas[i]->GetLevelEnergy();
if(abs(currentE-nextE)>epsilon)
if(std::abs(currentE-nextE)>epsilon)
{
levelCounter++;
levelStart[levelCounter] = i;
@@ -113,9 +113,9 @@ void G4NeutronHPDeExGammas::Init(std::ifstream & aDataFile)
for(G4int ii=0; ii<nLevels; ii++)
{
levelE = theLevels[ii].GetLevelEnergy();
if(abs(currentLevelE-(levelE+gammaE))<min)
if(std::abs(currentLevelE-(levelE+gammaE))<min)
{
min = abs(currentLevelE-(levelE+gammaE));
min = std::abs(currentLevelE-(levelE+gammaE));
it = ii;
}
}
@@ -271,10 +271,10 @@ G4ReactionProduct * G4NeutronHPDiscreteTwoBody::Sample(G4double anEnergy, G4doub
G4double kinE = restEnergy/(1+result->GetMass()/residualMass); // non relativistic @@
result->SetKineticEnergy(kinE); // non relativistic @@
G4double phi = twopi*G4UniformRand();
G4double theta = acos(cosTh);
G4double sinth = sin(theta);
G4double theta = std::acos(cosTh);
G4double sinth = std::sin(theta);
G4double mtot = result->GetTotalMomentum();
G4ThreeVector tempVector(mtot*sinth*cos(phi), mtot*sinth*sin(phi), mtot*cos(theta) );
G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
result->SetMomentum(tempVector);
// some garbage collection
@@ -108,7 +108,7 @@ GetCrossSection(const G4DynamicParticle* aP, const G4Element*anE, G4double aT)
G4int size = G4int(std::max(10., aT/60*kelvin));
G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
G4double neutronVMag = neutronVelocity.mag();
while(counter == 0 || abs(buffer-result/counter) > 0.03*buffer)
while(counter == 0 || std::abs(buffer-result/counter) > 0.03*buffer)
{
if(counter) buffer = result/counter;
while (counter<size)
@@ -147,8 +147,8 @@
G4double totE = nEnergy+tEnergy;
G4ThreeVector the3CMS = the3Target+the3Neutron;
theCMS.SetMomentum(the3CMS);
G4double cmsMom = sqrt(the3CMS*the3CMS);
G4double sqrts = sqrt((totE-cmsMom)*(totE+cmsMom));
G4double cmsMom = std::sqrt(the3CMS*the3CMS);
G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
theCMS.SetMass(sqrts);
theCMS.SetTotalEnergy(totE);
@@ -177,8 +177,8 @@
}
if(cosTh<-1.1) return NULL;
G4double phi = twopi*G4UniformRand();
G4double theta = acos(cosTh);
G4double sinth = sin(theta);
G4double theta = std::acos(cosTh);
G4double sinth = std::sin(theta);
if (frameFlag == 1) // final state data given in target rest frame.
{
// we have the scattering angle, now we need the energy, then do the
@@ -194,10 +194,10 @@
G4double a = 4*(eE+p0*cosTh)*(eE-p0*cosTh);
G4double b = 4*ap*p0*cosTh;
G4double c = (2.*eE*mN-ap)*(2.*eE*mN+ap);
G4double en = (-b+sqrt(b*b - 4*a*c) )/(2*a);
G4ThreeVector tempVector(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4double en = (-b+std::sqrt(b*b - 4*a*c) )/(2*a);
G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
theNeutron.SetMomentum(tempVector);
theNeutron.SetTotalEnergy(sqrt(en*en+theNeutron.GetMass()*theNeutron.GetMass()));
theNeutron.SetTotalEnergy(std::sqrt(en*en+theNeutron.GetMass()*theNeutron.GetMass()));
// first to lab
theNeutron.Lorentz(theNeutron, -1.*theTarget);
// now to CMS
@@ -217,20 +217,20 @@
G4double cms_theta=cmsMom.theta();
G4double cms_phi=cmsMom.phi();
G4ThreeVector tempVector;
tempVector.setX(cos(theta)*sin(cms_theta)*cos(cms_phi)
+sin(theta)*cos(phi)*cos(cms_theta)*cos(cms_phi)
-sin(theta)*sin(phi)*sin(cms_phi) );
tempVector.setY(cos(theta)*sin(cms_theta)*sin(cms_phi)
+sin(theta)*cos(phi)*cos(cms_theta)*sin(cms_phi)
+sin(theta)*sin(phi)*cos(cms_phi) );
tempVector.setZ(cos(theta)*cos(cms_theta)
-sin(theta)*cos(phi)*sin(cms_theta) );
tempVector.setX(std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
+std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
-std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
tempVector.setY(std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
+std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
+std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
tempVector.setZ(std::cos(theta)*std::cos(cms_theta)
-std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
tempVector *= en;
theNeutron.SetMomentum(tempVector);
theTarget.SetMomentum(-tempVector);
G4double tP = theTarget.GetTotalMomentum();
G4double tM = theTarget.GetMass();
theTarget.SetTotalEnergy(sqrt((tP+tM)*(tP+tM)-2.*tP*tM));
theTarget.SetTotalEnergy(std::sqrt((tP+tM)*(tP+tM)-2.*tP*tM));
theNeutron.Lorentz(theNeutron, -1.*theCMS);
theTarget.Lorentz(theTarget, -1.*theCMS);
}
@@ -70,8 +70,8 @@ G4ReactionProductVector * G4NeutronHPEnAngCorrelation::Sample(G4double anEnergy)
G4double totE = nEnergy+tEnergy;
G4ThreeVector the3CMS = the3Target+the3Neutron;
theCMS.SetMomentum(the3CMS);
G4double cmsMom = sqrt(the3CMS*the3CMS);
G4double sqrts = sqrt((totE-cmsMom)*(totE+cmsMom));
G4double cmsMom = std::sqrt(the3CMS*the3CMS);
G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
theCMS.SetMass(sqrts);
theCMS.SetTotalEnergy(totE);
G4ReactionProduct aNeutron;
@@ -43,7 +43,7 @@
G4String filename = aFile.GetName();
theBaseA = aFile.GetA();
theBaseZ = aFile.GetZ();
if(!dbool || ( Z<2.5 && ( abs(theBaseZ - Z)>0.0001 || abs(theBaseA - A)>0.0001) ) )
if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001) ) )
{
hasAnyData = false;
hasFSData = false;
@@ -107,7 +107,7 @@ GetCrossSection(const G4DynamicParticle* aP, const G4Element*anE, G4double aT)
G4int size = G4int(std::max(10., aT/60*kelvin));
G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
G4double neutronVMag = neutronVelocity.mag();
while(counter == 0 || abs(buffer-result/counter) > 0.01*buffer)
while(counter == 0 || std::abs(buffer-result/counter) > 0.01*buffer)
{
if(counter) buffer = result/counter;
while (counter<size)
@@ -149,7 +149,7 @@
theDelayed = theFS.ApplyYourself(0, delayed, theDecayConstants);
for(i=0; i<theDelayed->size(); i++)
{
G4double time = -log(G4UniformRand())/theDecayConstants[i];
G4double time = -std::log(G4UniformRand())/theDecayConstants[i];
time += theTrack.GetGlobalTime();
G4HadSecondary * track = new G4HadSecondary(theDelayed->operator[](i));
track->SetTime(time);
@@ -173,7 +173,7 @@
}
for(i0=Prompt; i0<Prompt+delayed; i0++)
{
G4double time = -log(G4UniformRand())/theDecayConstants[i0-Prompt];
G4double time = -std::log(G4UniformRand())/theDecayConstants[i0-Prompt];
time += theTrack.GetGlobalTime();
G4HadSecondary * track = new G4HadSecondary(theNeutrons->operator[](i));
track->SetTime(time);
@@ -30,7 +30,7 @@
// and all its terms.
//
// $Id: G4NeutronHPInelastic.cc,v 1.18 2003/11/20 13:02:28 hpw Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "G4NeutronHPInelastic.hh"
@@ -63,7 +63,7 @@ void G4NeutronHPInelasticBaseFS::Init (G4double A, G4double Z, G4String & dirNam
G4String filename = aFile.GetName();
theBaseA = aFile.GetA();
theBaseZ = aFile.GetZ();
if(!dbool || ( Z<2.5 && ( abs(theBaseZ - Z)>0.0001 || abs(theBaseA - A)>0.0001)))
if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001)))
{
if(getenv("NeutronHPNamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
hasAnyData = false;
@@ -191,7 +191,7 @@ void G4NeutronHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
thePhaseSpaceDistribution.SetTarget(&theTarget);
for(ii=0; ii<nDef; ii++)
{
G4double massCode = 1000.*abs(theDefs[ii]->GetPDGCharge());
G4double massCode = 1000.*std::abs(theDefs[ii]->GetPDGCharge());
massCode += theDefs[ii]->GetBaryonNumber();
G4double dummy = 0;
G4ReactionProduct * aSec = thePhaseSpaceDistribution.Sample(eKinetic, massCode, dummy);
@@ -283,8 +283,8 @@ void G4NeutronHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
G4double concreteMass = G4NucleiPropertiesTable::GetNuclearMass(z1, a1);
G4double availableEnergy = eKinetic+mn+localMass-m1-m2-concreteMass;
// available kinetic energy in CMS (non relativistic)
G4double emin = availableEnergy+m1+m2 - sqrt((m1+m2)*(m1+m2)+orgMomentum*orgMomentum);
G4double p1=sqrt(2.*m2*emin);
G4double emin = availableEnergy+m1+m2 - std::sqrt((m1+m2)*(m1+m2)+orgMomentum*orgMomentum);
G4double p1=std::sqrt(2.*m2*emin);
bufferedDirection = p1*aHadron->GetMomentum().unit();
if(getenv("HTOKEN")) // @@@@@ verify the nucleon counting...
{
@@ -301,7 +301,7 @@ void G4NeutronHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
{
G4cout << " HTOKEN "<<bufferedDirection.mag2()<<G4endl;
}
aHadron->SetTotalEnergy( sqrt(aHadron->GetMass()*aHadron->GetMass()
aHadron->SetTotalEnergy( std::sqrt(aHadron->GetMass()*aHadron->GetMass()
+bufferedDirection.mag2()) );
aHadron->SetMomentum(bufferedDirection);
aHadron->Lorentz(*aHadron, -1.*(theTarget+theNeutron));
@@ -60,7 +60,7 @@ void G4NeutronHPInelasticCompFS::Init (G4double A, G4double Z, G4String & dirNam
G4String filename = aFile.GetName();
theBaseA = aFile.GetA();
theBaseZ = aFile.GetZ();
if(!dbool || ( Z<2.5 && ( abs(theBaseZ - Z)>0.0001 || abs(theBaseA - A)>0.0001)))
if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001)))
{
if(getenv("NeutronHPNamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
hasAnyData = false;
@@ -106,7 +106,7 @@ void G4NeutronHPInelasticCompFS::Init (G4double A, G4double Z, G4String & dirNam
else if(dataType==5)
{
theEnergyDistribution[it] = new G4NeutronHPEnergyDistribution;
theEnergyDistribution[it]->Init(theData);
theEnergyDistribution[it]->Init(theData);
}
else if(dataType==6)
{
@@ -232,7 +232,7 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrack
aHadron.SetKineticEnergy(availableEnergy*residualMass*G4Neutron::Neutron()->GetPDGMass()/
(aHadron.GetMass()+residualMass*G4Neutron::Neutron()->GetPDGMass()));
aHadron.SetMomentum(theNeutron.GetMomentum()*(1./theNeutron.GetTotalMomentum())*
sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()-
std::sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()-
aHadron.GetMass()*aHadron.GetMass()));
}
else
@@ -284,8 +284,8 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrack
theRestEnergy->SetKineticEnergy(eGamm);
G4double costh = 2.*G4UniformRand()-1.;
G4double phi = twopi*G4UniformRand();
theRestEnergy->SetMomentum(eGamm*sin(acos(costh))*cos(phi),
eGamm*sin(acos(costh))*sin(phi),
theRestEnergy->SetMomentum(eGamm*std::sin(std::acos(costh))*std::cos(phi),
eGamm*std::sin(std::acos(costh))*std::sin(phi),
eGamm*costh);
if(thePhotons == NULL) thePhotons = new G4ReactionProductVector;
thePhotons->push_back(theRestEnergy);
@@ -329,7 +329,7 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrack
{
testEnergy = 0;
}
G4double deltaE = abs(testEnergy-aBaseEnergy);
G4double deltaE = std::abs(testEnergy-aBaseEnergy);
if(deltaE<0.1*keV)
{
G4ReactionProductVector * theNext =
@@ -383,10 +383,10 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrack
aHadron.SetKineticEnergy(availableEnergy*residualMass*G4Neutron::Neutron()->GetPDGMass()/
(aHadron.GetMass()+residualMass*G4Neutron::Neutron()->GetPDGMass()));
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();
G4ThreeVector Vector(cos(Phi)*SinTheta, sin(Phi)*SinTheta, CosTheta);
aHadron.SetMomentum(Vector* sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()-
G4ThreeVector Vector(std::cos(Phi)*SinTheta, std::sin(Phi)*SinTheta, CosTheta);
aHadron.SetMomentum(Vector* std::sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()-
aHadron.GetMass()*aHadron.GetMass()));
}
@@ -477,7 +477,7 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrack
->GetIon(static_cast<G4int>(residualZ), static_cast<G4int>(residualA), 0));
G4double resiualKineticEnergy = theResidual.GetMass()*theResidual.GetMass();
resiualKineticEnergy += totalMomentum*totalMomentum;
resiualKineticEnergy = sqrt(resiualKineticEnergy) - theResidual.GetMass();
resiualKineticEnergy = std::sqrt(resiualKineticEnergy) - theResidual.GetMass();
// cout << "Kinetic energy of the residual = "<<resiualKineticEnergy<<endl;
theResidual.SetKineticEnergy(resiualKineticEnergy);
theResidual.SetMomentum(-1.*totalMomentum);
@@ -106,7 +106,7 @@ GetCrossSection(const G4DynamicParticle* aP, const G4Element*anE, G4double aT)
G4int size = G4int(std::max(10., aT/60*kelvin));
G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
G4double neutronVMag = neutronVelocity.mag();
while(counter == 0 || abs(buffer-result/counter) > 0.01*buffer)
while(counter == 0 || std::abs(buffer-result/counter) > 0.01*buffer)
{
if(counter) buffer = result/counter;
while (counter<size)
@@ -45,9 +45,9 @@
else if(x2==0) result = y2;
else
{
G4double b = (y2-y1)/(log(x2)-log(x1));
G4double a = y1 - b*log(x1);
result = (a-b)*(x2-x1) + b*(x2*log(x2)-x1*log(x1));
G4double b = (y2-y1)/(std::log(x2)-std::log(x1));
G4double a = y1 - b*std::log(x1);
result = (a-b)*(x2-x1) + b*(x2*std::log(x2)-x1*std::log(x1));
}
}
else if(aScheme==LOGLIN||aScheme==CLOGLIN||aScheme==ULOGLIN)
@@ -55,9 +55,9 @@
if(y1==0||y2==0) result =0;
else
{
G4double b = (log(y2)-log(y1))/(x2-x1);
G4double a = log(y1) - b*x1;
result = (exp(a)/b)*(exp(b*x2)-exp(b*x1));
G4double b = (std::log(y2)-std::log(y1))/(x2-x1);
G4double a = std::log(y1) - b*x1;
result = (std::exp(a)/b)*(std::exp(b*x2)-std::exp(b*x1));
}
}
else if(aScheme==LOGLOG||aScheme==CLOGLOG||aScheme==ULOGLOG)
@@ -67,9 +67,9 @@
else if(y1==0||y2==0) result =0;
else
{
G4double b = (log(y2)-log(y1))/(log(x2)-log(x1));
G4double a = log(y1) - b*log(x1);;
result = (exp(a)/(b+1))*(pow(x2,b+1)-pow(x1,b+1));
G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
G4double a = std::log(y1) - b*std::log(x1);;
result = (std::exp(a)/(b+1))*(std::pow(x2,b+1)-std::pow(x1,b+1));
}
}
else
@@ -99,10 +99,10 @@
else if(x2==0) result = y2;
else
{
G4double b = (y2-y1)/(log(x2)-log(x1));
G4double a = y1 - b*log(x1);
result = ( x2*x2/2. * (a-b/2.+b*log(x2)) )
-( x1*x1/2. * (a-b/2.+b*log(x1)) );
G4double b = (y2-y1)/(std::log(x2)-std::log(x1));
G4double a = y1 - b*std::log(x1);
result = ( x2*x2/2. * (a-b/2.+b*std::log(x2)) )
-( x1*x1/2. * (a-b/2.+b*std::log(x1)) );
}
}
else if(aScheme==LOGLIN||aScheme==CLOGLIN||aScheme==ULOGLIN)
@@ -110,9 +110,9 @@
if(y1==0||y2==0) result = 0;
else
{
G4double b = (log(y2)-log(y1))/(x2-x1);
G4double a = log(y1) - b*x1;
result = exp(a)/(b*b)*( exp(b*x2)*(b*x2-1.) - exp(b*x1)*(b*x1-1.) );
G4double b = (std::log(y2)-std::log(y1))/(x2-x1);
G4double a = std::log(y1) - b*x1;
result = std::exp(a)/(b*b)*( std::exp(b*x2)*(b*x2-1.) - std::exp(b*x1)*(b*x1-1.) );
}
}
else if(aScheme==LOGLOG||aScheme==CLOGLOG||aScheme==ULOGLOG)
@@ -122,9 +122,9 @@
if(y1==0||y2==0) result = 0;
else
{
G4double b = (log(y2)-log(y1))/(log(x2)-log(x1));
G4double a = log(y1) - b*log(x1);;
result = exp(a)/(b+2.)*( pow(x2, b+2.) - pow(x1, b+2) );
G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
G4double a = std::log(y1) - b*std::log(x1);;
result = std::exp(a)/(b+2.)*( std::pow(x2, b+2.) - std::pow(x1, b+2) );
}
}
else
@@ -38,7 +38,7 @@
// if(filename=="") return false;
std::ifstream theChannel(filename);
if(Z==1 && (aFile.GetZ()!=Z || abs(aFile.GetA()-A)>0.0001) )
if(Z==1 && (aFile.GetZ()!=Z || std::abs(aFile.GetA()-A)>0.0001) )
{
if(getenv("NeutronHPNamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
theChannel.close();
@@ -81,13 +81,13 @@ G4ReactionProduct * G4NeutronHPIsotropic::Sample(G4double anEnergy, G4double mas
G4double cosTh = G4UniformRand();
G4double phi = twopi*G4UniformRand();
G4double theta = acos(cosTh);
G4double sinth = sin(theta);
G4double theta = std::acos(cosTh);
G4double sinth = std::sin(theta);
// we need the the Q value of the reaction
result->SetKineticEnergy(std::max(0.001*MeV, anEnergy+GetQValue()));
G4double mtot = result->GetTotalMomentum();
G4ThreeVector tempVector(mtot*sinth*cos(phi), mtot*sinth*sin(phi), mtot*cos(theta) );
G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
result->SetMomentum(tempVector);
return result;
@@ -57,15 +57,15 @@ G4double G4NeutronHPKallbachMannSyst::Kallbach(G4double cosTh, G4double anEnergy
// Kallbach-Mann systematics without normalization.
G4double result;
G4double theX = A(anEnergy)*cosTh;
result = 0.5*(exp( theX)*(1+theCompoundFraction)
+exp(-theX)*(1-theCompoundFraction));
result = 0.5*(std::exp( theX)*(1+theCompoundFraction)
+std::exp(-theX)*(1-theCompoundFraction));
return result;
}
G4double G4NeutronHPKallbachMannSyst::GetKallbachZero(G4double anEnergy)
{
G4double result;
result = 0.5 * (1./A(anEnergy)) * log((1-theCompoundFraction)/(1+theCompoundFraction));
result = 0.5 * (1./A(anEnergy)) * std::log((1-theCompoundFraction)/(1+theCompoundFraction));
return result;
}
@@ -115,7 +115,7 @@ G4double G4NeutronHPKallbachMannSyst::A(G4double anEnergy)
throw G4HadronicException(__FILE__, __LINE__, "Severe error in the sampling of Kallbach-Mann Systematics");
}
result = C1*X1 + C2*pow(X1, 3.) + C3*Ma*mb*pow(X3, 4.);
result = C1*X1 + C2*std::pow(X1, 3.) + C3*Ma*mb*std::pow(X3, 4.);
return result;
}
@@ -126,9 +126,9 @@ G4double G4NeutronHPKallbachMannSyst::SeparationEnergy(G4int Ac, G4int Nc, G4int
G4int Zc = Ac-Nc;
result = 15.68*(Ac-AA);
result += -28.07*((Nc-Zc)*(Nc-Zc)/Ac - (NA-ZA)*(NA-ZA)/AA);
result += -18.56*(pow(G4double(Ac), 2./3.) - pow(G4double(AA), 2./3.));
result += 33.22*((Nc-Zc)*(Nc-Zc)/pow(G4double(Ac), 4./3.) - (NA-ZA)*(NA-ZA)/pow(G4double(AA), 4./3.));
result += -0.717*(Zc*Zc/pow(G4double(Ac),1./3.)-ZA*ZA/pow(G4double(AA),1./3.));
result += -18.56*(std::pow(G4double(Ac), 2./3.) - std::pow(G4double(AA), 2./3.));
result += 33.22*((Nc-Zc)*(Nc-Zc)/std::pow(G4double(Ac), 4./3.) - (NA-ZA)*(NA-ZA)/std::pow(G4double(AA), 4./3.));
result += -0.717*(Zc*Zc/std::pow(G4double(Ac),1./3.)-ZA*ZA/std::pow(G4double(AA),1./3.));
result += 1.211*(Zc*Zc/Ac-ZA*ZA/AA);
G4double totalBinding(0);
G4int productA = theTargetA+1-theResidualA;
@@ -233,7 +233,7 @@ G4ReactionProduct * G4NeutronHPLabAngularEnergy::Sample(G4double anEnergy, G4dou
x = random;
x1 = theThVec.GetY(ith-1)-theThVec.GetY(0); // integrals
x2 = theThVec.GetY(ith)-theThVec.GetY(0);
y1 = theThVec.GetX(ith-1); // cos(theta)
y1 = theThVec.GetX(ith-1); // std::cos(theta)
y2 = theThVec.GetX(ith);
cosTh = theInt.Interpolate(theSecondManager[it].GetScheme(ith),
x, x1,x2,y1,y2);
@@ -341,10 +341,10 @@ G4ReactionProduct * G4NeutronHPLabAngularEnergy::Sample(G4double anEnergy, G4dou
result->SetKineticEnergy(secEnergy);
G4double phi = twopi*G4UniformRand();
G4double theta = acos(cosTh);
G4double sinth = sin(theta);
G4double theta = std::acos(cosTh);
G4double sinth = std::sin(theta);
G4double mtot = result->GetTotalMomentum();
G4ThreeVector tempVector(mtot*sinth*cos(phi), mtot*sinth*sin(phi), mtot*cos(theta) );
G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
result->SetMomentum(tempVector);
return result;
@@ -32,31 +32,31 @@
G4double EF;
EF = theAvarageKineticPerNucleonForLightFragments/eV;
G4double lightU1 = sqrt(energy)-sqrt(EF);
G4double lightU1 = std::sqrt(energy)-std::sqrt(EF);
lightU1 *= lightU1/tm;
G4double lightU2 = sqrt(energy)+sqrt(EF);
G4double lightU2 = std::sqrt(energy)+std::sqrt(EF);
lightU2 *= lightU2/tm;
G4double lightTerm=0;
if(theAvarageKineticPerNucleonForLightFragments>1*eV)
{
lightTerm = pow(lightU2, 1.5)*E1(lightU2);
lightTerm -= pow(lightU1, 1.5)*E1(lightU1);
lightTerm = std::pow(lightU2, 1.5)*E1(lightU2);
lightTerm -= std::pow(lightU1, 1.5)*E1(lightU1);
lightTerm += Gamma15(lightU2)-Gamma15(lightU1);
lightTerm /= 3.*sqrt(tm*EF);
lightTerm /= 3.*std::sqrt(tm*EF);
}
EF = theAvarageKineticPerNucleonForHeavyFragments/eV;
G4double heavyU1 = sqrt(energy)-sqrt(EF);
G4double heavyU1 = std::sqrt(energy)-std::sqrt(EF);
heavyU1 *= heavyU1/tm;
G4double heavyU2 = sqrt(energy)+sqrt(EF);
G4double heavyU2 = std::sqrt(energy)+std::sqrt(EF);
heavyU2 *= heavyU2/tm;
G4double heavyTerm=0 ;
if(theAvarageKineticPerNucleonForHeavyFragments> 1*eV)
{
heavyTerm = pow(heavyU2, 1.5)*E1(heavyU2);
heavyTerm -= pow(heavyU1, 1.5)*E1(heavyU1);
heavyTerm = std::pow(heavyU2, 1.5)*E1(heavyU2);
heavyTerm -= std::pow(heavyU1, 1.5)*E1(heavyU1);
heavyTerm += Gamma15(heavyU2)-Gamma15(heavyU1);
heavyTerm /= 3.*sqrt(tm*EF);
heavyTerm /= 3.*std::sqrt(tm*EF);
}
result = 0.5*(lightTerm+heavyTerm);
@@ -79,18 +79,18 @@
if(newValue < random)
{
buff = current;
current+=abs(current-last)/2.;
current+=std::abs(current-last)/2.;
last = buff;
if(current>190*MeV) throw G4HadronicException(__FILE__, __LINE__, "Madland-Nix Spectrum has not converged in sampling");
}
else
{
buff = current;
current-=abs(current-last)/2.;
current-=std::abs(current-last)/2.;
last = buff;
}
}
while (abs(oldValue-newValue)>precision*newValue);
while (std::abs(oldValue-newValue)>precision*newValue);
return current;
}
@@ -99,11 +99,11 @@
{
if(aMean<1*eV) return 0;
G4double b = anEnergy/eV;
G4double sb = sqrt(b);
G4double sb = std::sqrt(b);
G4double EF = aMean/eV;
G4double alpha = sqrt(tm);
G4double beta = sqrt(EF);
G4double alpha = std::sqrt(tm);
G4double beta = std::sqrt(EF);
G4double A = EF/tm;
G4double B = (sb+beta)*(sb+beta)/tm;
G4double Ap = A;
@@ -116,52 +116,52 @@
{
result =
(
(0.4*alpha2*pow(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
(0.4*alpha2*pow(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
(0.4*alpha2*std::pow(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
(0.4*alpha2*std::pow(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
)
-
(
(0.4*alpha2*pow(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
(0.4*alpha2*pow(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
(0.4*alpha2*std::pow(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
(0.4*alpha2*std::pow(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
)
+
(
(alpha2*B-2*alphabeta*sqrt(B))*Gamma15(B) -
(alpha2*A-2*alphabeta*sqrt(A))*Gamma15(A)
(alpha2*B-2*alphabeta*std::sqrt(B))*Gamma15(B) -
(alpha2*A-2*alphabeta*std::sqrt(A))*Gamma15(A)
)
-
(
(alpha2*Bp-2*alphabeta*sqrt(Bp))*Gamma15(Bp) -
(alpha2*Ap-2*alphabeta*sqrt(Ap))*Gamma15(Ap)
(alpha2*Bp-2*alphabeta*std::sqrt(Bp))*Gamma15(Bp) -
(alpha2*Ap-2*alphabeta*std::sqrt(Ap))*Gamma15(Ap)
)
- 0.6*alpha2*(Gamma25(B) - Gamma25(A) - Gamma25(Bp) + Gamma25(Ap))
- 1.5*alphabeta*(exp(-B)*(1+B) - exp(-A)*(1+A) + exp(-Bp)*(1+Bp) + exp(-Ap)*(1+Ap)) ;
- 1.5*alphabeta*(std::exp(-B)*(1+B) - std::exp(-A)*(1+A) + std::exp(-Bp)*(1+Bp) + std::exp(-Ap)*(1+Ap)) ;
}
else
{
result =
(
(0.4*alpha2*pow(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
(0.4*alpha2*pow(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
(0.4*alpha2*std::pow(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
(0.4*alpha2*std::pow(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
);
result -=
(
(0.4*alpha2*pow(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
(0.4*alpha2*pow(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
(0.4*alpha2*std::pow(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
(0.4*alpha2*std::pow(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
);
result +=
(
(alpha2*B-2*alphabeta*sqrt(B))*Gamma15(B) -
(alpha2*A-2*alphabeta*sqrt(A))*Gamma15(A)
(alpha2*B-2*alphabeta*std::sqrt(B))*Gamma15(B) -
(alpha2*A-2*alphabeta*std::sqrt(A))*Gamma15(A)
);
result -=
(
(alpha2*Bp+2*alphabeta*sqrt(Bp))*Gamma15(Bp) -
(alpha2*Ap+2*alphabeta*sqrt(Ap))*Gamma15(Ap)
(alpha2*Bp+2*alphabeta*std::sqrt(Bp))*Gamma15(Bp) -
(alpha2*Ap+2*alphabeta*std::sqrt(Ap))*Gamma15(Ap)
);
result -= 0.6*alpha2*(Gamma25(B) - Gamma25(A) - Gamma25(Bp) + Gamma25(Ap));
result -= 1.5*alphabeta*(exp(-B)*(1+B) - exp(-A)*(1+A) + exp(-Bp)*(1+Bp) + exp(-Ap)*(1+Ap) - 2.) ;
result -= 1.5*alphabeta*(std::exp(-B)*(1+B) - std::exp(-A)*(1+A) + std::exp(-Bp)*(1+Bp) + std::exp(-Ap)*(1+Ap) - 2.) ;
}
result = result / (3.*sqrt(tm*EF));
result = result / (3.*std::sqrt(tm*EF));
return result;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NeutronHPNBodyPhaseSpace.cc,v 1.10 2003/11/03 17:54:38 hpw Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4NeutronHPNBodyPhaseSpace.cc,v 1.11 2004/12/07 13:50:02 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
#include "G4NeutronHPNBodyPhaseSpace.hh"
#include "G4Gamma.hh"
@@ -78,7 +78,7 @@ G4ReactionProduct * G4NeutronHPNBodyPhaseSpace::Sample(G4double anEnergy, G4doub
// Get the energy from phase-space distribution
// in CMS
// P = Cn*sqrt(E')*(Emax-E')**(3*n/2-4)
// P = Cn*std::sqrt(E')*(Emax-E')**(3*n/2-4)
G4double maxE = GetEmax(anEnergy, result->GetMass());
G4double energy;
G4double max(0);
@@ -114,10 +114,10 @@ G4ReactionProduct * G4NeutronHPNBodyPhaseSpace::Sample(G4double anEnergy, G4doub
// now do random direction
G4double cosTh = 2.*G4UniformRand()-1.;
G4double phi = twopi*G4UniformRand();
G4double theta = acos(cosTh);
G4double sinth = sin(theta);
G4double theta = std::acos(cosTh);
G4double sinth = std::sin(theta);
G4double mtot = result->GetTotalMomentum();
G4ThreeVector tempVector(mtot*sinth*cos(phi), mtot*sinth*sin(phi), mtot*cos(theta) );
G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
result->SetMomentum(tempVector);
G4ReactionProduct aCMS = *GetTarget()+*GetNeutron();
result->Lorentz(*result, -1.*aCMS);
@@ -136,7 +136,7 @@ if(getenv("NeutronHPNames")) G4cout <<"HPWD 4 "<<*theName<<G4endl;
}
do
{
if (abs(myZ-Z)>theMaxOffSet||myZ==0||myA==0)
if (std::abs(myZ-Z)>theMaxOffSet||myZ==0||myA==0)
if(inc>0)
{
inc*= -1;
@@ -152,7 +152,7 @@ if(getenv("NeutronHPNames")) G4cout <<"HPWD 4 "<<*theName<<G4endl;
theFileName = "";
return result;
}
if (abs(myA-A)>theMaxOffSet)
if (std::abs(myA-A)>theMaxOffSet)
{
first = true;
myA = A;
@@ -140,7 +140,7 @@ G4NeutronHPVector * G4NeutronHPPartial::GetY(G4double e1)
theBuff.SetY(ii, theInt.Interpolate(theManager.GetScheme(high),
x, x1, x2, y1, y2)); //energy interpol
theBuff.SetScheme(ii, data[low].GetScheme(i1));
if(abs(GetX(low,i1)-GetX(high,i2))<0.001) i2++;
if(std::abs(GetX(low,i1)-GetX(high,i2))<0.001) i2++;
i1++;
ii++;
}
@@ -152,7 +152,7 @@ G4NeutronHPVector * G4NeutronHPPartial::GetY(G4double e1)
theBuff.SetY(ii, theInt.Interpolate(theManager.GetScheme(high),
x, x1, x2, y1, y2)); //energy interpol
theBuff.SetScheme(ii, data[high].GetScheme(i2));
if(abs(GetX(low,i1)-GetX(high,i2))<0.001) i1++;
if(std::abs(GetX(low,i1)-GetX(high,i2))<0.001) i1++;
i2++;
ii++;
}
@@ -265,11 +265,11 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
for (i=0; i< nSecondaries; i++)
{
G4double costheta = 2.*G4UniformRand()-1;
G4double theta = acos(costheta);
G4double theta = std::acos(costheta);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = thePhotons->operator[](i)->GetTotalEnergy();
G4ThreeVector temp(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
thePhotons->operator[](i)->SetMomentum( temp ) ;
// G4cout << "Isotropic distribution in PhotonDist"<<temp<<G4endl;
}
@@ -281,7 +281,7 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
G4double currentEnergy = thePhotons->operator[](i)->GetTotalEnergy();
for(ii=0; ii<nDiscrete2; ii++)
{
if (abs(currentEnergy-theGammas[ii])<0.1*keV) break;
if (std::abs(currentEnergy-theGammas[ii])<0.1*keV) break;
}
if(ii==nDiscrete2) ii--; // fix for what seems an (file12 vs file 14) inconsistancy found in the ENDF 7N14 data. @@
if(ii<nIso)
@@ -289,9 +289,9 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
// isotropic distribution
G4double theta = pi*G4UniformRand();
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = thePhotons->operator[](i)->GetTotalEnergy();
G4ThreeVector tempVector(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
thePhotons->operator[](i)->SetMomentum( tempVector ) ;
}
else if(tabulationType==1)
@@ -308,11 +308,11 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
aStore.SetCoeff(1, &(theLegendre[ii-nIso][it]));
aStore.SetCoeff(0, &(theLegendre[ii-nIso][it-1]));
G4double cosTh = aStore.SampleMax(anEnergy);
G4double theta = acos(cosTh);
G4double theta = std::acos(cosTh);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = thePhotons->operator[](i)->GetTotalEnergy();
G4ThreeVector tempVector(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
thePhotons->operator[](i)->SetMomentum( tempVector ) ;
}
else
@@ -326,11 +326,11 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
break;
}
G4double costh = theAngular[ii-nIso][it].GetCosTh(); // no interpolation yet @@
G4double theta = acos(costh);
G4double theta = std::acos(costh);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = thePhotons->operator[](i)->GetTotalEnergy();
G4ThreeVector tmpVector(en*sinth*cos(phi), en*sinth*sin(phi), en*costh );
G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
thePhotons->operator[](i)->SetMomentum( tmpVector ) ;
}
}
@@ -365,11 +365,11 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
if( isoFlag == 1)
{
G4double costheta = 2.*G4UniformRand()-1;
G4double theta = acos(costheta);
G4double theta = std::acos(costheta);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = theOne->GetTotalEnergy();
G4ThreeVector temp(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4ThreeVector temp(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
theOne->SetMomentum( temp ) ;
}
else
@@ -377,7 +377,7 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
G4double currentEnergy = theOne->GetTotalEnergy();
for(ii=0; ii<nDiscrete2; ii++)
{
if (abs(currentEnergy-theGammas[ii])<0.1*keV) break;
if (std::abs(currentEnergy-theGammas[ii])<0.1*keV) break;
}
if(ii==nDiscrete2) ii--; // fix for what seems an (file12 vs file 14) inconsistancy found in the ENDF 7N14 data. @@
if(ii<nIso)
@@ -385,9 +385,9 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
// isotropic distribution
G4double theta = pi*G4UniformRand();
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = theOne->GetTotalEnergy();
G4ThreeVector tempVector(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
theOne->SetMomentum( tempVector ) ;
}
else if(tabulationType==1)
@@ -404,11 +404,11 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
aStore.SetCoeff(1, &(theLegendre[ii-nIso][it]));
aStore.SetCoeff(0, &(theLegendre[ii-nIso][it-1]));
G4double cosTh = aStore.SampleMax(anEnergy);
G4double theta = acos(cosTh);
G4double theta = std::acos(cosTh);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = theOne->GetTotalEnergy();
G4ThreeVector tempVector(en*sinth*cos(phi), en*sinth*sin(phi), en*cos(theta) );
G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
theOne->SetMomentum( tempVector ) ;
}
else
@@ -422,11 +422,11 @@ G4ReactionProductVector * G4NeutronHPPhotonDist::GetPhotons(G4double anEnergy)
break;
}
G4double costh = theAngular[ii-nIso][it].GetCosTh(); // no interpolation yet @@
G4double theta = acos(costh);
G4double theta = std::acos(costh);
G4double phi = twopi*G4UniformRand();
G4double sinth = sin(theta);
G4double sinth = std::sin(theta);
G4double en = theOne->GetTotalEnergy();
G4ThreeVector tmpVector(en*sinth*cos(phi), en*sinth*sin(phi), en*costh );
G4ThreeVector tmpVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costh );
theOne->SetMomentum( tmpVector ) ;
}
}
@@ -44,7 +44,7 @@
result->SetData(running++, x, y);
j++;
}
else if(abs((right.GetX(j)-left.GetX(i))/(left.GetX(i)+right.GetX(j)))>0.001)
else if(std::abs((right.GetX(j)-left.GetX(i))/(left.GetX(i)+right.GetX(j)))>0.001)
{
x = left.GetX(i);
y = left.GetY(i)+right.GetY(x);
@@ -229,7 +229,7 @@
m++;
a++;
G4double xp = passive->GetEnergy(p);
if( abs(abs(xp-xa)/xa)<0.0000001&&a<active->GetVectorLength() )
if( std::abs(std::abs(xp-xa)/xa)<0.0000001&&a<active->GetVectorLength() )
{
p++;
tmp = active; t=a;
@@ -250,7 +250,7 @@
anX = passive->GetXsec(p)-deltaX;
if(anX>0)
{
if(abs(GetEnergy(m-1)-passive->GetEnergy(p))/passive->GetEnergy(p)>0.0000001)
if(std::abs(GetEnergy(m-1)-passive->GetEnergy(p))/passive->GetEnergy(p)>0.0000001)
{
SetData(m, passive->GetEnergy(p), anX);
theManager.AppendScheme(m++, passive->GetScheme(p));
@@ -289,7 +289,7 @@
x = theData[j].GetX();
if(x1-x2 == 0) y = (y2+y1)/2.;
else y = theInt.Lin(x, x1, x2, y1, y2);
if (abs(y-theData[j].GetY())>precision*y)
if (std::abs(y-theData[j].GetY())>precision*y)
{
aBuff[++count] = theData[current-1]; // for this one, everything was fine
start = current; // the next candidate
@@ -318,7 +318,7 @@
for(i=theBlocked.begin(); i!=theBlocked.end(); i++)
{
G4double aBlock = *i;
if(abs(aX-aBlock) < 0.1*MeV)
if(std::abs(aX-aBlock) < 0.1*MeV)
{
result = true;
theBlocked.erase(i);
@@ -31,13 +31,13 @@
G4double b = theBpar.GetY(anEnergy)/eV;
G4double result;
G4double random, cut, max;
max = sinh(sqrt(b*15.*a));
max = std::sinh(std::sqrt(b*15.*a));
do
{
random = G4UniformRand();
result = -a*log(random);
result = -a*std::log(random);
cut = G4UniformRand();
}
while(cut>sinh(sqrt(b*result))/max);
while(cut>std::sinh(std::sqrt(b*result))/max);
return result;
}