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
@@ -22,7 +22,7 @@
//
//
// $Id: G4EnergyRangeManager.cc,v 1.11 2003/11/03 17:47:30 hpw Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// Hadronic Process: Energy Range Manager
// original by H.P. Wellisch
@@ -218,7 +218,7 @@ GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
{
G4double fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(localZ)+i);
G4double runningA=theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
running[i]=fracInPercent*pow(runningA, 2./3.);
running[i]=fracInPercent*std::pow(runningA, 2./3.);
// rough approximation; to get it better, redesign getMSC to not use G4Element, see also below
if(i!=0) running[i] += running[i-1];
}
@@ -265,7 +265,7 @@ GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
{
G4double fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(localZ)+i);
G4double runningA=theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
running[i]=fracInPercent*pow(runningA, 2./3.);
running[i]=fracInPercent*std::pow(runningA, 2./3.);
if(i!=0) running[i] += running[i-1];
}
G4double trial = G4UniformRand();
@@ -293,7 +293,7 @@ GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
{
G4double fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(localZ)+i);
G4double runningA=theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
running[i]=fracInPercent*pow(runningA, 2./3.);
running[i]=fracInPercent*std::pow(runningA, 2./3.);
// rough approximation; to get it better, redesign getMSC to not use G4Element
if(i!=0) running[i] += running[i-1];
}
@@ -555,8 +555,8 @@ XBiasSurvivalProbability()
{
G4double result = 0;
G4double nLTraversed = GetTotalNumberOfInteractionLengthTraversed();
G4double biasedProbability = 1.-exp(-nLTraversed);
G4double realProbability = 1-exp(-nLTraversed/aScaleFactor);
G4double biasedProbability = 1.-std::exp(-nLTraversed);
G4double realProbability = 1-std::exp(-nLTraversed/aScaleFactor);
result = (biasedProbability-realProbability)/biasedProbability;
return result;
}
@@ -566,7 +566,7 @@ XBiasSecondaryWeight()
{
G4double result = 0;
G4double nLTraversed = GetTotalNumberOfInteractionLengthTraversed();
result = 1./aScaleFactor*exp(-nLTraversed/aScaleFactor*(1-1./aScaleFactor));
result = 1./aScaleFactor*std::exp(-nLTraversed/aScaleFactor*(1-1./aScaleFactor));
return result;
}
@@ -583,10 +583,10 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
// <<G4endl;
G4Nancheck go_wild;
theTotalResult->Clear();
theTotalResult->SetLocalEnergyDeposit(0.);
theTotalResult->ProposeLocalEnergyDeposit(0.);
theTotalResult->Initialize(aT);
theTotalResult->SetSecondaryWeightByProcess(true);
theTotalResult->SetStatusChange(fAlive);
theTotalResult->ProposeTrackStatus(fAlive);
G4double rotation = 2.*pi*G4UniformRand();
G4ThreeVector it(0., 0., 1.);
/*
@@ -604,19 +604,19 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
{
if( xBiasOn && G4UniformRand()<XBiasSurvivalProbability() )
{
theTotalResult->SetWeightChange( XBiasSurvivalProbability()*aT.GetWeight() );
theTotalResult->ProposeParentWeight( XBiasSurvivalProbability()*aT.GetWeight() );
}
else
{
theTotalResult->SetStatusChange(fStopAndKill);
theTotalResult->SetEnergyChange( 0.0 );
theTotalResult->ProposeTrackStatus(fStopAndKill);
theTotalResult->ProposeEnergy( 0.0 );
}
}
else if(aR->GetStatusChange()!=stopAndKill )
{
if(aR->GetStatusChange()==suspend)
{
theTotalResult->SetStatusChange(fSuspend);
theTotalResult->ProposeTrackStatus(fSuspend);
if(xBiasOn)
{
G4Exception("G4HadronicProcess", "007", FatalException,
@@ -625,7 +625,7 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
}
if(xBiasOn && G4UniformRand()<XBiasSurvivalProbability())
{
theTotalResult->SetWeightChange( XBiasSurvivalProbability()*aT.GetWeight() );
theTotalResult->ProposeParentWeight( XBiasSurvivalProbability()*aT.GetWeight() );
G4double newWeight = aR->GetWeightChange()*aT.GetWeight();
if(go_wild(aR->GetEnergyChange()))
{
@@ -641,7 +641,7 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
}
G4double newM=aT.GetDefinition()->GetPDGMass();
G4double newE=aR->GetEnergyChange() + newM;
G4double newP=sqrt(newE*newE - newM*newM);
G4double newP=std::sqrt(newE*newE - newM*newM);
G4DynamicParticle * aNew =
new G4DynamicParticle(aT.GetDefinition(), newE, newP*aR->GetMomentumChange());
G4HadSecondary * theSec = new G4HadSecondary(aNew, newWeight);
@@ -650,7 +650,7 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
else
{
G4double newWeight = aR->GetWeightChange()*aT.GetWeight();
theTotalResult->SetWeightChange(newWeight); // This is multiplicative
theTotalResult->ProposeParentWeight(newWeight); // This is multiplicative
if(aR->GetEnergyChange()>-.5)
{
if(go_wild(aR->GetEnergyChange()))
@@ -658,11 +658,11 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
G4Exception("G4HadronicProcess", "007", FatalException,
"track received NaN energy.");
}
theTotalResult->SetEnergyChange(aR->GetEnergyChange());
theTotalResult->ProposeEnergy(aR->GetEnergyChange());
}
G4LorentzVector newDirection(aR->GetMomentumChange().unit(), 1.);
newDirection*=aR->GetTrafoToLab();
theTotalResult->SetMomentumDirectionChange(newDirection.vect());
theTotalResult->ProposeMomentumDirection(newDirection.vect());
}
}
else
@@ -675,14 +675,14 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
&&
AlwaysKillLeadingHadron()
&&
theTotalResult->GetStatusChange()==fAlive
theTotalResult->GetTrackStatus()==fAlive
&&
aR->GetStatusChange()==isAlive)
{
G4double newWeight = theTotalResult->GetWeightChange();
G4double newWeight = theTotalResult->GetParentWeight();
G4double newM=aT.GetDefinition()->GetPDGMass();
G4double newE=aR->GetEnergyChange() + newM;
G4double newP=sqrt(newE*newE - newM*newM);
G4double newP=std::sqrt(newE*newE - newM*newM);
G4DynamicParticle * aNew =
new G4DynamicParticle(aT.GetDefinition(), newE, newP*aR->GetMomentumChange());
// std::cout << "Debug 0 "<<aR->GetNumberOfSecondaries()<<std::endl;
@@ -693,11 +693,11 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
G4HadSecondary * theSec = new G4HadSecondary(aNew, newWeight);
aR->AddSecondary(theSec);
aR->SetStatusChange(stopAndKill);
theTotalResult->SetStatusChange(fStopAndKill);
theTotalResult->SetEnergyChange( 0.0 );
theTotalResult->ProposeTrackStatus(fStopAndKill);
theTotalResult->ProposeEnergy( 0.0 );
//std::cout << "Debug 4 "<< aR->GetNumberOfSecondaries() <<std::endl;
}
theTotalResult->SetLocalEnergyDeposit(aR->GetLocalEnergyDeposit());
theTotalResult->ProposeLocalEnergyDeposit(aR->GetLocalEnergyDeposit());
theTotalResult->SetNumberOfSecondaries(aR->GetNumberOfSecondaries());
for(G4int i=0; i<aR->GetNumberOfSecondaries(); i++)
@@ -757,6 +757,7 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
}
}*/
track->SetTouchableHandle(aT.GetTouchableHandle());
theTotalResult->AddSecondary(track);
}
aR->Clear();