Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
@@ -14,6 +14,12 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
26-Feb-2018 V.Ivanchenko hadr-pre-V10-04-00
- G4PreCompoundEmission, G4PreCompoundFragment, G4PreCompoundNucleon
fxied computations for OPT=1,2
- G4PreCompoundModel - fixed initialisation
- G4PreCompoundFragmentVector - moved inlined methods to the source
31-Oct-2017 V.Ivanchenko hadr-pre-V10-03-03
- G4PreCompoundEmission - used G4RandomDirection() if angular sampling
is disabled
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PreCompoundFragmentVector.hh 100378 2016-10-19 15:03:27Z gcosmo $
// $Id: G4PreCompoundFragmentVector.hh 108685 2018-02-27 07:58:38Z gcosmo $
//
// Hadronic Process: Nuclear Preequilibrium
// by V. Lara
@@ -55,7 +55,7 @@ public:
explicit G4PreCompoundFragmentVector(pcfvector * avector);
~G4PreCompoundFragmentVector();
~G4PreCompoundFragmentVector() = default;
void SetVector(pcfvector * avector);
@@ -63,9 +63,9 @@ public:
void UseSICB(G4bool);
inline G4double CalculateProbabilities(const G4Fragment & aFragment);
G4double CalculateProbabilities(const G4Fragment & aFragment);
inline G4VPreCompoundFragment * ChooseFragment();
G4VPreCompoundFragment * ChooseFragment();
private:
@@ -81,34 +81,5 @@ private:
G4int nChannels;
};
inline G4double
G4PreCompoundFragmentVector::CalculateProbabilities(const G4Fragment & aFragment)
{
//G4cout << "## G4PreCompoundFragmentVector::CalculateProbabilities" << G4endl;
G4double probtot = 0.0;
G4double prob;
for (G4int i=0; i< nChannels; ++i) {
(*theChannels)[i]->Initialize(aFragment);
prob = 0.0;
if ((*theChannels)[i]->IsItPossible(aFragment)) {
prob = (*theChannels)[i]->CalcEmissionProbability(aFragment);
}
probtot += prob;
probabilities[i] = probtot;
//G4cout<<" prob= "<<prob<<" for "<<(*theChannels)[i]->GetName()<<G4endl;
}
return probtot;
}
inline G4VPreCompoundFragment* G4PreCompoundFragmentVector::ChooseFragment()
{
G4double x = probabilities[nChannels-1]*G4UniformRand();
G4int i=0;
for (; i<nChannels; ++i) {
if(x <= probabilities[i]) { break; }
}
return (*theChannels)[i];
}
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PreCompoundEmission.cc 107062 2017-11-01 15:01:02Z gcosmo $
// $Id: G4PreCompoundEmission.cc 108685 2018-02-27 07:58:38Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -105,7 +105,7 @@ G4PreCompoundEmission::PerformEmission(G4Fragment & aFragment)
// Choose a Fragment for emission
G4VPreCompoundFragment * thePreFragment =
theFragmentsVector->ChooseFragment();
if (thePreFragment == 0)
if (thePreFragment == nullptr)
{
G4cout << "G4PreCompoundEmission::PerformEmission : "
<< "I couldn't choose a fragment\n"
@@ -170,9 +170,9 @@ G4PreCompoundEmission::PerformEmission(G4Fragment & aFragment)
G4ReactionProduct * MyRP = thePreFragment->GetReactionProduct();
// if(kinEnergy < MeV) {
// G4cout << "G4PreCompoundEmission::Fragment emitted" << G4endl;
// G4cout << *thePreFragment << G4endl;
// }
//G4cout << "G4PreCompoundEmission::Fragment emitted" << G4endl;
//G4cout << *thePreFragment << G4endl;
// }
return MyRP;
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PreCompoundFragment.cc 100691 2016-10-31 11:26:25Z gcosmo $
// $Id: G4PreCompoundFragment.cc 108685 2018-02-27 07:58:38Z gcosmo $
//
// J. M. Quesada (August 2008).
// Based on previous work by V. Lara
@@ -64,9 +64,7 @@ CalcEmissionProbability(const G4Fragment & aFragment)
if (theMaxKinEnergy <= theMinKinEnergy) { return 0.0; }
// compute power once
if(OPTxs <= 2) {
muu = G4ChatterjeeCrossSection::ComputePowerParameter(theResA, index);
} else {
if(0 < index) {
muu = G4KalbachCrossSection::ComputePowerParameter(theResA, index);
}
@@ -92,23 +90,20 @@ IntegrateEmissionProbability(G4double low, G4double up,
G4double del = (up - low);
G4int nbins = std::max(3,(G4int)(del*den));
del /= (G4double)nbins;
G4double e = low;
G4double y0 = ProbabilityDistributionFunction(e, aFragment);
probmax = y0;
//G4cout << " 0. e= " << low << " y= " << y0 << G4endl;
G4double e = low + 0.5*del;
probmax = ProbabilityDistributionFunction(e, aFragment);
//G4cout << " 0. e= " << e << " y= " << probmax << G4endl;
G4double sum(0.0), ds(0.0), y;
for (G4int i=0; i<nbins; ++i) {
G4double sum = probmax;
for (G4int i=1; i<nbins; ++i) {
e += del;
y = ProbabilityDistributionFunction(e, aFragment);
G4double y = ProbabilityDistributionFunction(e, aFragment);
probmax = std::max(probmax, y);
ds = y0 + y;
sum += ds;
if(ds < sum*0.01) { break; }
sum += y;
if(y < sum*0.01) { break; }
//G4cout << " " << i << ". e= " << e << " y= " << y << " sum= " << sum << G4endl;
y0 = y;
}
sum *= del*0.5;
sum *= del;
//G4cout << "Evap prob: " << sum << " probmax= " << probmax << G4endl;
return sum;
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PreCompoundFragmentVector.cc 96603 2016-04-25 13:29:51Z gcosmo $
// $Id: G4PreCompoundFragmentVector.cc 108685 2018-02-27 07:58:38Z gcosmo $
//
// Hadronic Process: Nuclear Preequilibrium
// by V. Lara
@@ -41,22 +41,25 @@ G4PreCompoundFragmentVector::G4PreCompoundFragmentVector(pcfvector * avector)
SetVector(avector);
}
G4PreCompoundFragmentVector::~G4PreCompoundFragmentVector()
{}
void G4PreCompoundFragmentVector::SetVector(pcfvector * avector)
{
theChannels = avector;
if(avector != theChannels) {
delete theChannels;
theChannels = avector;
}
if(theChannels) {
nChannels = theChannels->size();
probabilities.resize(nChannels);
probabilities.resize(nChannels, 0.0);
} else {
nChannels = 0;
probabilities.clear();
}
}
//for inverse cross section choice
void G4PreCompoundFragmentVector::SetOPTxs(G4int opt)
{
for (G4int i=0; i< nChannels; ++i) {
for (G4int i=0; i<nChannels; ++i) {
(*theChannels)[i]->SetOPTxs(opt);
}
}
@@ -69,3 +72,34 @@ void G4PreCompoundFragmentVector::UseSICB(G4bool use)
}
}
G4double G4PreCompoundFragmentVector::CalculateProbabilities(
const G4Fragment & aFragment)
{
//G4cout << "## G4PreCompoundFragmentVector::CalculateProbabilities nCh= "
// << nChannels << G4endl;
G4double probtot = 0.0;
for (G4int i=0; i< nChannels; ++i) {
(*theChannels)[i]->Initialize(aFragment);
G4double prob = ((*theChannels)[i]->IsItPossible(aFragment))
? (*theChannels)[i]->CalcEmissionProbability(aFragment)
: 0.0;
probtot += prob;
probabilities[i] = probtot;
//G4cout<<" prob= " << prob << " probtot= " << probtot
// << " for "<< i << "-th channel" <<G4endl;
}
return probtot;
}
G4VPreCompoundFragment* G4PreCompoundFragmentVector::ChooseFragment()
{
//G4cout << "## G4PreCompoundFragmentVector::ChooseFragment nCh= "
// << nChannels << G4endl;
G4double x = probabilities[nChannels-1]*G4UniformRand();
G4int i=0;
for (; i<nChannels; ++i) {
if(x <= probabilities[i]) { break; }
}
return (*theChannels)[i];
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PreCompoundModel.cc 106233 2017-09-22 21:34:41Z gcosmo $
// $Id: G4PreCompoundModel.cc 108685 2018-02-27 07:58:38Z gcosmo $
//
// by V. Lara
//
@@ -119,7 +119,7 @@ void G4PreCompoundModel::InitialiseModel()
theEmission = new G4PreCompoundEmission();
if(param->UseHETC()) { theEmission->SetHETCModel(); }
else { theEmission->SetDefaultModel(); }
//else { theEmission->SetDefaultModel(); }
theEmission->SetOPTxs(param->GetPrecoModelType());
if(param->UseGNASH()) { theTransition = new G4GNASHTransitions; }
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PreCompoundNucleon.cc 100378 2016-10-19 15:03:27Z gcosmo $
// $Id: G4PreCompoundNucleon.cc 108685 2018-02-27 07:58:38Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -83,6 +83,9 @@ ProbabilityDistributionFunction(G4double eKin,
/(CLHEP::pi2*CLHEP::hbarc*CLHEP::hbarc*CLHEP::hbarc);
G4double Probability = fact * theReducedMass * rj * xs * eKin * P * (N-1)
* g4calc->powN(g1*E1/(g0*E0),N-2) * g1 / (E0*g0*g0);
//G4cout << "N= " << N << " g0= " << g0 << " g1= " << g1 << " E0= " << E0 << " E1= " << E1
// << " prob= " << Probability << G4endl;
return Probability;
}