Import Geant4 10.5.1 source tree

This commit is contained in:
Gabriele Cosmo
2019-04-17 10:39:02 +02:00
parent a7fdc52004
commit 28a70706e0
661 changed files with 55791 additions and 106984 deletions
@@ -14,6 +14,25 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
11 April 2019 Dennis Wright (hadr-hpp-V10-04-13)
-------------------------------------------------
- fix of bug report #1824
Adopoted fix of Artem Zontikov to make sure production cross section is
not ignored when sampling discrete gamma emission.
G4ParticleHPPhotonDist.hh : added reaction cross section data member
G4ParticleHPPhotonDist::GetPhotons() modified to statistically suppress
gammas when reaction cross section is non-zero.
G4ParticleHPPhotonDist::InitPartials() modified to take cross section
argument
G4ParticleHPInelasticBaseFS.cc and G4ParticleHPInelasticCompFS.cc
modified to change calls to InitPartials to take cross section argument
6 February 2019 Alberto Ribon (hadr-hpp-V10-04-12)
-----------------------------------------------------
- G4ParticleHPKallbachMannSyst::Kallbach : replaced G4Exp with std::exp in order
to avoid underflow/overflow crashes observed with the physics list
QGSP_BIC_AllHP in the version G4 10.5 .
26 November 2018 Gabriele Cosmo (hadr-hpp-V10-04-11)
-----------------------------------------------------
- Fixed potential leaks in G4ParticleHPPhotonDist, G4ParticleHPContAngularPar
@@ -76,6 +76,7 @@ public:
energy = 0;
theYield = 0;
thePartialXsec = 0;
theReactionXsec = 0;
isPrimary = 0;
theShells = 0;
theGammas = 0;
@@ -99,6 +100,7 @@ public:
delete [] energy;
delete [] theYield;
delete [] thePartialXsec;
delete [] theReactionXsec;
delete [] isPrimary;
delete [] theShells;
delete [] theGammas;
@@ -135,7 +137,7 @@ public:
void InitEnergies(std::istream & aDataFile);
void InitPartials(std::istream & aDataFile);
void InitPartials(std::istream& aDataFile, G4ParticleHPVector* theXsec = 0);
G4ReactionProductVector * GetPhotons(G4double anEnergy);
@@ -151,12 +153,13 @@ private:
G4double targetMass;
G4int nDiscrete; //number of discrete photons
G4int * disType; // discrete, or continuum photons
G4double * energy; // photon energies
G4ParticleHPVector * theYield; // multiplicity as a function of neutron energy.
G4int* disType; // discrete, or continuum photons
G4double* energy; // photon energies
G4ParticleHPVector* theYield; // multiplicity as a function of neutron energy.
G4ParticleHPVector theTotalXsec;
G4ParticleHPVector * thePartialXsec;
G4int * isPrimary;
G4ParticleHPVector* thePartialXsec;
G4ParticleHPVector* theReactionXsec;
G4int* isPrimary;
G4int isoFlag; // isotropic or not?
G4int tabulationType;
@@ -1025,7 +1025,7 @@ G4FFG_DATA_FUNCTIONENTER__
// // issue /run/particle/addProcManage
// G4UImanager::GetUIpointer()->ApplyCommand(cmdAdd);
//
// // retreive /control/verbose
// // retrieve /control/verbose
// G4UImanager::GetUIpointer()->SetVerboseLevel(tempVerboseLevel);
// }
@@ -158,7 +158,7 @@ void G4ParticleHPInelasticBaseFS::Init (G4double A, G4double Z, G4int M, G4Strin
else if(dataType==13)
{
theFinalStatePhotons = new G4ParticleHPPhotonDist;
theFinalStatePhotons->InitPartials(theData);
theFinalStatePhotons->InitPartials(theData, theXsection);
hasFSData = true;
}
else if(dataType==14)
@@ -176,7 +176,7 @@ void G4ParticleHPInelasticCompFS::Init (G4double A, G4double Z, G4int M, G4Strin
else if(dataType==13)
{
theFinalStatePhotons[it] = new G4ParticleHPPhotonDist;
theFinalStatePhotons[it]->InitPartials(theData);
theFinalStatePhotons[it]->InitPartials(theData, theXsection[50]);
}
else if(dataType==14)
{
@@ -76,8 +76,10 @@ G4double G4ParticleHPKallbachMannSyst::Kallbach(G4double cosTh, G4double anEnerg
// Kallbach-Mann systematics without normalization.
G4double result;
G4double theX = A(anEnergy)*cosTh;
result = 0.5*(G4Exp( theX)*(1+theCompoundFraction)
+G4Exp(-theX)*(1-theCompoundFraction));
// We need to use here std::exp (and not G4Exp) to avoid underflow/overflow problems
// (observed with the physics list QGSP_BIC_AllHP in the version G4 10.5).
result = 0.5*(std::exp( theX)*(1+theCompoundFraction)
+std::exp(-theX)*(1-theCompoundFraction));
return result;
}
@@ -121,18 +121,20 @@ G4bool G4ParticleHPPhotonDist::InitMean(std::istream & aDataFile)
void G4ParticleHPPhotonDist::InitAngular(std::istream & aDataFile)
{
G4int i, ii;
//angular distributions
aDataFile >> isoFlag;
if (isoFlag != 1)
{
if ( repFlag == 2 ) G4cout << "G4ParticleHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 Hyper News. Thanks." << G4endl;
if (repFlag == 2) G4cout << "G4ParticleHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 HyperNews. " << G4endl;
aDataFile >> tabulationType >> nDiscrete2 >> nIso;
//080731
if ( theGammas != NULL && nDiscrete2 != nDiscrete ) G4cout << "080731c G4ParticleHPPhotonDist nDiscrete2 != nDiscrete, It looks like something wrong in your NDL files. Please update the latest. If you still have this messages after the update, then please report to Geant4 Hyper News." << G4endl;
if (theGammas != NULL && nDiscrete2 != nDiscrete)
G4cout << "080731c G4ParticleHPPhotonDist nDiscrete2 != nDiscrete, It looks like something wrong in your NDL files. Please update the latest. If you still have this messages after the update, then please report to Geant4 Hyper News." << G4endl;
// The order of cross section (InitPartials) and distribution (InitAngular here) data are different, we have to re-coordinate consistent data order.
// The order of cross section (InitPartials) and distribution
// (InitAngular here) data are different, we have to re-coordinate
// consistent data order.
std::vector < G4double > vct_gammas_par;
std::vector < G4double > vct_shells_par;
std::vector < G4int > vct_primary_par;
@@ -250,10 +252,11 @@ void G4ParticleHPPhotonDist::InitEnergies(std::istream & aDataFile)
}
}
void G4ParticleHPPhotonDist::InitPartials(std::istream & aDataFile)
void G4ParticleHPPhotonDist::InitPartials(std::istream& aDataFile,
G4ParticleHPVector* theXsec)
{
if (theXsec) theReactionXsec = theXsec;
//G4cout << "G4ParticleHPPhotonDist::InitPartials " << G4endl;
aDataFile >> nDiscrete >> targetMass;
if(nDiscrete != 1)
{
@@ -724,6 +727,16 @@ G4int maxEnergyIndex = 0;
//G4cout << "iphoton " << iphoton << G4endl;
//G4cout << "photon energy " << theGammas[ iphoton ] /eV << G4endl;
// Statistically suppress the photon according to reaction cross section
// Fix proposed by Artem Zontikov, Bug report #1824
if (theReactionXsec) {
if (thePartialXsec[iphoton].GetXsec(anEnergy)/theReactionXsec->GetXsec(anEnergy) < G4UniformRand() ) {
delete thePhotons;
thePhotons = 0;
return thePhotons;
}
}
// Angle
G4double cosTheta = 0.0; // mu