Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -400,7 +400,7 @@ G4FFG_SAMPLING_FUNCTIONENTER__
{
A = NeutronInducedWattConstants[IsotopeIndex][0][0];
WattConstants_->B = NeutronInducedWattConstants[IsotopeIndex][0][1];
} else if (WattConstants_->Energy > 14.0 * MeV)
} else if (WattConstants_->Energy > 14.0 * CLHEP::MeV)
{
G4Exception("G4FPYSamplingOps::G4SampleWatt()",
"Incident neutron energy above 14 MeV requested.",
@@ -40,6 +40,11 @@
#include "G4FFGDebuggingMacros.hh"
#include "G4FFGDefaultValues.hh"
// Use a few select constant of CLHEP namespace
using CLHEP::eV;
using CLHEP::keV;
using CLHEP::MeV;
using CLHEP::GeV;
#include "G4FFGEnumerations.hh"
#include "G4FPYNormalFragmentDist.hh"
#include "G4FPYBiasedLightFragmentDist.hh"
@@ -60,6 +60,12 @@ G4ParticleHPCaptureData::G4ParticleHPCaptureData()
if ( G4Threading::IsWorkerThread() ) {
instanceOfWorker = true;
}
element_cache = NULL;
material_cache = NULL;
ke_cache = 0.0;
xs_cache = 0.0;
//BuildPhysicsTable(*G4Neutron::Neutron());
}
@@ -91,7 +97,13 @@ G4double G4ParticleHPCaptureData::GetIsoCrossSection( const G4DynamicParticle* d
const G4Element* element ,
const G4Material* material )
{
if ( dp->GetKineticEnergy() == ke_cache && element == element_cache && material == material_cache ) return xs_cache;
ke_cache = dp->GetKineticEnergy();
element_cache = element;
material_cache = material;
G4double xs = GetCrossSection( dp , element , material->GetTemperature() );
xs_cache = xs;
return xs;
}
@@ -46,14 +46,18 @@ G4ThreadLocal G4int G4ParticleHPChannelList::trycounter = 0;
theChannels = new G4ParticleHPChannel * [n];
allChannelsCreated = false;
theInitCount = 0;
theElement = NULL;
}
#include "G4Neutron.hh"
G4ParticleHPChannelList::G4ParticleHPChannelList()
{
nChannels = 0;
theChannels = 0;
allChannelsCreated = false;
theInitCount = 0;
theElement = NULL;
theProjectile = G4Neutron::Neutron();
}
G4ParticleHPChannelList::~G4ParticleHPChannelList()
@@ -152,6 +156,7 @@ G4ThreadLocal G4int G4ParticleHPChannelList::trycounter = 0;
//TK121106
G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->SetTargA( targA );
G4ParticleHPManager::GetInstance()->GetReactionWhiteBoard()->SetTargZ( targZ );
delete [] running;
return &unChanged;
}
//TK120607
@@ -60,6 +60,7 @@
G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* projectile )
{
theAngular = 0;
if ( fCache.Get() == NULL ) cacheInit();
fCache.Get()->currentMeanEnergy = -2;
fCache.Get()->fresh = true;
adjustResult = true;
@@ -68,6 +69,11 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
theMinEner = DBL_MAX;
theMaxEner = -DBL_MAX;
theProjectile = projectile;
theEnergy = 0.0;
nEnergies = 0;
nDiscreteEnergies = 0;
nAngularParameters = 0;
}
void G4ParticleHPContAngularPar::Init(std::istream & aDataFile, G4ParticleDefinition* projectile)
@@ -849,7 +855,12 @@ void G4ParticleHPContAngularPar::BuildByInterpolation(G4double anEnergy, G4Inter
angpar1.theEnergy, angpar2.theEnergy,
val1,
val2);
value /= (theMaxEner-theMinEner);
//value /= (theMaxEner-theMinEner);
if ( theMaxEner != theMinEner ) {
value /= (theMaxEner-theMinEner);
} else if ( value != 0 ) {
throw G4HadronicException(__FILE__, __LINE__, "G4ParticleHPContAngularPar::PrepareTableInterpolation theMaxEner == theMinEner and value != 0.");
}
if( getenv("G4PHPTEST2") ) G4cout << ie << " " << ip << " G4ParticleHPContAngularPar::Merge val1 " << val1 << " val2 " << val2 << " value " << value << G4endl; //GDEB
//- val1 = angpar1.theAngular[ie1-1].GetValue(ip) * (maxEner1-minEner1);
//- val2 = angpar2.theAngular[ie2-1].GetValue(ip) * (maxEner2-minEner2);
@@ -111,14 +111,13 @@ G4ReactionProduct * G4ParticleHPDiscreteTwoBody::Sample(G4double anEnergy, G4dou
G4InterpolationManager aManager;
aManager.Init(LINLIN, theCoeff[it].GetNumberOfPoly()/2);
theStore.SetInterpolationManager(aManager);
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i+=2)
{
//101110
//theStore.SetX(i, theCoeff[it].GetCoeff(i));
//theStore.SetY(i, theCoeff[it].GetCoeff(i));
theStore.SetX(i/2, theCoeff[it].GetCoeff(i));
theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1));
i++;
}
cosTh = theStore.Sample();
}
@@ -128,14 +127,13 @@ G4ReactionProduct * G4ParticleHPDiscreteTwoBody::Sample(G4double anEnergy, G4dou
G4InterpolationManager aManager;
aManager.Init(LOGLIN, theCoeff[it].GetNumberOfPoly()/2);
theStore.SetInterpolationManager(aManager);
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i+=2)
{
//101110
//theStore.SetX(i, theCoeff[it].GetCoeff(i));
//theStore.SetY(i, theCoeff[it].GetCoeff(i));
theStore.SetX(i/2, theCoeff[it].GetCoeff(i));
theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1));
i++;
}
cosTh = theStore.Sample();
}
@@ -167,26 +165,24 @@ G4ReactionProduct * G4ParticleHPDiscreteTwoBody::Sample(G4double anEnergy, G4dou
G4InterpolationManager aManager1;
aManager1.Init(LINLIN, theCoeff[it-1].GetNumberOfPoly()/2);
theBuff1.SetInterpolationManager(aManager1);
for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++)
for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i+=2)
{
//101110
//theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
//theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i));
theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
i++;
}
G4ParticleHPVector theBuff2;
G4InterpolationManager aManager2;
aManager2.Init(LINLIN, theCoeff[it].GetNumberOfPoly()/2);
theBuff2.SetInterpolationManager(aManager2);
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i+=2)
{
//theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
//theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
theBuff2.SetX(i/2, theCoeff[it].GetCoeff(i));
theBuff2.SetY(i/2, theCoeff[it].GetCoeff(i+1));
i++;
}
G4double x1 = theCoeff[it-1].GetEnergy();
@@ -226,28 +222,26 @@ G4ReactionProduct * G4ParticleHPDiscreteTwoBody::Sample(G4double anEnergy, G4dou
G4InterpolationManager aManager1;
aManager1.Init(LOGLIN, theCoeff[it-1].GetNumberOfPoly()/2);
theBuff1.SetInterpolationManager(aManager1);
for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++)
for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i+=2)
{
//101110
//theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
//theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i));
theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
i++;
}
G4ParticleHPVector theBuff2;
G4InterpolationManager aManager2;
aManager2.Init(LOGLIN, theCoeff[it].GetNumberOfPoly()/2);
theBuff2.SetInterpolationManager(aManager2);
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
for(i=0;i<theCoeff[it].GetNumberOfPoly(); i+=2)
{
//101110
//theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
//theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
theBuff2.SetX(i/2, theCoeff[it].GetCoeff(i));
theBuff2.SetY(i/2, theCoeff[it].GetCoeff(i+1));
i++;
}
G4double x1 = theCoeff[it-1].GetEnergy();
@@ -58,6 +58,10 @@ G4ParticleHPElasticData::G4ParticleHPElasticData()
if ( G4Threading::IsWorkerThread() ) {
instanceOfWorker = true;
}
element_cache = NULL;
material_cache = NULL;
ke_cache = 0.0;
xs_cache = 0.0;
// BuildPhysicsTable( *G4Neutron::Neutron() );
}
@@ -90,7 +94,13 @@ G4double G4ParticleHPElasticData::GetIsoCrossSection( const G4DynamicParticle* d
const G4Element* element ,
const G4Material* material )
{
if ( dp->GetKineticEnergy() == ke_cache && element == element_cache && material == material_cache ) return xs_cache;
ke_cache = dp->GetKineticEnergy();
element_cache = element;
material_cache = material;
G4double xs = GetCrossSection( dp , element , material->GetTemperature() );
xs_cache = xs;
return xs;
}
@@ -126,6 +126,12 @@ void G4ParticleHPElasticFS::Init (G4double A, G4double Z, G4int M, G4String & di
{
G4int nEnergy_Legendre;
theData >> nEnergy_Legendre;
if ( nEnergy_Legendre == 0 ) {
std::stringstream iss;
iss << "G4ParticleHPElasticFS::Init Data Error repFlag is 3 but nEnergy_Legendre is 0.";
iss << "Z, A and M of problematic file is " << theNDLDataZ << ", " << theNDLDataA << " and " << theNDLDataM << " respectively.";
throw G4HadronicException(__FILE__, __LINE__, iss.str() );
}
theCoefficients = new G4ParticleHPLegendreStore( nEnergy_Legendre );
theCoefficients->InitInterpolation( theData );
G4double temp, energy;
@@ -116,8 +116,10 @@ G4ReactionProductVector * G4ParticleHPEnAngCorrelation::Sample(G4double anEnergy
bool bNPOK = true;
//TKDB_PHP_150507
#ifdef PHP_AS_HP
G4int iTry(0);
#endif
//TKDB_PHP_161107
G4int iTry(0);
//TKDB_PHP_161107
//TKDB_PHP_150507
do {
G4int sumZ = 0;
@@ -157,6 +159,8 @@ G4ReactionProductVector * G4ParticleHPEnAngCorrelation::Sample(G4double anEnergy
}
//TKDB_PHP_150507
#ifdef PHP_AS_HP
#endif
//TKDB_PHP_161107
iTry++;
if ( iTry > 1024 ) {
G4Exception("G4ParticleHPEnAngCorrelation::Sample",
@@ -165,7 +169,7 @@ G4ReactionProductVector * G4ParticleHPEnAngCorrelation::Sample(G4double anEnergy
"Too many trials were done. Exiting current loop by force. You may have Probably, the result violating (baryon number) conservation law will be obtained.");
bNPOK=true;
}
#endif
//TKDB_PHP_161107
//TKDB_PHP_150507
}while(!bNPOK); // Loop checking, 11.05.2015, T. Koi
@@ -56,6 +56,10 @@ G4ParticleHPFissionData::G4ParticleHPFissionData()
if ( G4Threading::IsWorkerThread() ) {
instanceOfWorker = true;
}
element_cache = NULL;
material_cache = NULL;
ke_cache = 0.0;
xs_cache = 0.0;
//BuildPhysicsTable(*G4Neutron::Neutron());
}
@@ -87,7 +91,13 @@ G4double G4ParticleHPFissionData::GetIsoCrossSection( const G4DynamicParticle* d
const G4Element* element ,
const G4Material* material )
{
if ( dp->GetKineticEnergy() == ke_cache && element == element_cache && material == material_cache ) return xs_cache;
ke_cache = dp->GetKineticEnergy();
element_cache = element;
material_cache = material;
G4double xs = GetCrossSection( dp , element , material->GetTemperature() );
xs_cache = xs;
return xs;
}
@@ -38,6 +38,9 @@ G4ThreadLocal int G4ParticleHPGamma::instancecount = 0;
{
next = 0;
instancecount ++;
levelEnergy = 0.0;
gammaEnergy = 0.0;
probability = 0.0;
}
G4ParticleHPGamma::~G4ParticleHPGamma() {instancecount--;}
@@ -50,19 +50,29 @@ G4ParticleHPInelastic::G4ParticleHPInelastic(G4ParticleDefinition* projectile, c
,numEle(0)
,theProjectile(projectile)
{
const char* dataDirVariable;
G4String baseName;
if ( getenv("G4PARTICLEHPDATA") ) {
baseName = getenv( "G4PARTICLEHPDATA" );
}
//const char* dataDirVariable;
G4String particleName;
if( theProjectile == G4Neutron::Neutron() ) {
dataDirVariable = "G4NEUTRONHPDATA";
}else if( theProjectile == G4Proton::Proton() ) {
dataDirVariable = "G4PROTONHPDATA";
particleName = "Proton";
}else if( theProjectile == G4Deuteron::Deuteron() ) {
dataDirVariable = "G4DEUTERONHPDATA";
particleName = "Deuteron";
}else if( theProjectile == G4Triton::Triton() ) {
dataDirVariable = "G4TRITONHPDATA";
particleName = "Triton";
}else if( theProjectile == G4He3::He3() ) {
dataDirVariable = "G4HE3HPDATA";
particleName = "He3";
}else if( theProjectile == G4Alpha::Alpha() ) {
dataDirVariable = "G4ALPHAHPDATA";
particleName = "Alpha";
} else {
G4String message("G4ParticleHPInelastic may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + theProjectile->GetParticleName());
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
@@ -72,12 +82,16 @@ G4ParticleHPInelastic::G4ParticleHPInelastic(G4ParticleDefinition* projectile, c
SetMaxEnergy( 20.*MeV );
// G4cout << " entering G4ParticleHPInelastic constructor"<<G4endl;
if(!getenv(dataDirVariable)){
G4String message("Please set the environement variable " + G4String(dataDirVariable) + " to point to the " + theProjectile->GetParticleName() + " cross-section files.");
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
}
dirName = getenv(dataDirVariable);
G4cout << dirName << G4endl;
if ( !getenv("G4PARTICLEHPDATA") && !getenv(dataDirVariable) ) {
G4String message( "Please set the environement variable " + G4String(dataDirVariable) + " to point to the " + theProjectile->GetParticleName() + " cross-section files." );
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
}
if ( getenv(dataDirVariable) ) {
dirName = getenv(dataDirVariable);
} else {
dirName = baseName + "/" + particleName;
}
G4cout << dirName << G4endl;
G4String tString = "/Inelastic";
dirName = dirName + tString;
@@ -450,7 +464,7 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
numEle = G4Element::GetNumberOfElements();
return;
}
/*
const char* dataDirVariable;
if( &projectile == G4Neutron::Neutron() ) {
dataDirVariable = "G4NEUTRONHPDATA";
@@ -478,8 +492,8 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
G4String tString = "/Inelastic";
dirName = dirName + tString;
*/
G4cout << "@@@ G4ParticleHPInelastic instantiated for particle " << projectile.GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
for (G4int i = numEle ; i < (G4int)G4Element::GetNumberOfElements(); i++)
{
theInelastic->push_back( new G4ParticleHPChannelList );
@@ -297,6 +297,7 @@ void G4ParticleHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
{
tmpHadrons = theEnergyAngData->Sample(eKinetic);
if ( !getenv( "G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) {
//141017 Fix BEGIN
//Adjust A and Z in the case of miss much between selected data and target nucleus
if ( tmpHadrons != NULL ) {
@@ -322,7 +323,7 @@ void G4ParticleHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
}
}
//141017 Fix END
}
}
else if(theAngularDistribution!= 0)
{
@@ -47,18 +47,24 @@ G4ParticleHPInelasticData::G4ParticleHPInelasticData(G4ParticleDefinition* proje
: G4VCrossSectionDataSet("")
{
const char* dataDirVariable;
G4String particleName;
if( projectile == G4Neutron::Neutron() ) {
dataDirVariable = "G4NEUTRONHPDATA";
}else if( projectile == G4Proton::Proton() ) {
dataDirVariable = "G4PROTONHPDATA";
particleName = "Proton";
}else if( projectile == G4Deuteron::Deuteron() ) {
dataDirVariable = "G4DEUTERONHPDATA";
particleName = "Deuteron";
}else if( projectile == G4Triton::Triton() ) {
dataDirVariable = "G4TRITONHPDATA";
particleName = "Triton";
}else if( projectile == G4He3::He3() ) {
dataDirVariable = "G4HE3HPDATA";
particleName = "He3";
}else if( projectile == G4Alpha::Alpha() ) {
dataDirVariable = "G4ALPHAHPDATA";
particleName = "Alpha";
} else {
G4String message("G4ParticleHPInelasticData may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + projectile->GetParticleName());
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
@@ -68,12 +74,19 @@ G4ParticleHPInelasticData::G4ParticleHPInelasticData(G4ParticleDefinition* proje
dataName.at(0) = toupper(dataName.at(0)) ;
SetName( dataName );
if(!getenv(dataDirVariable)){
G4String message("Please setenv " + G4String(dataDirVariable) + " to point to the " + projectile->GetParticleName() + " cross-section files.");
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
if ( !getenv(dataDirVariable) && !getenv( "G4PARTICLEHPDATA" ) ){
G4String message("Please setenv " + G4String(dataDirVariable) + " to point to the " + projectile->GetParticleName() + " cross-section files.");
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
}
G4cout << "@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << getenv(dataDirVariable) << G4endl;
G4String dirName;
if ( getenv(dataDirVariable) ) {
dirName = getenv(dataDirVariable);
} else {
G4String baseName = getenv( "G4PARTICLEHPDATA" );
dirName = baseName + "/" + particleName;
}
G4cout << "@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
SetMinKinEnergy( 0*CLHEP::MeV );
SetMaxKinEnergy( 20*CLHEP::MeV );
@@ -89,6 +102,10 @@ G4ParticleHPInelasticData::G4ParticleHPInelasticData(G4ParticleDefinition* proje
} else {
instanceOfWorker = true;
}
element_cache = NULL;
material_cache = NULL;
ke_cache = 0.0;
xs_cache = 0.0;
}
G4ParticleHPInelasticData::~G4ParticleHPInelasticData()
@@ -98,6 +115,10 @@ G4ParticleHPInelasticData::~G4ParticleHPInelasticData()
delete theCrossSections;
theCrossSections = NULL;
}
if ( theHPData != NULL && instanceOfWorker != true ) {
delete theHPData;
theHPData = NULL;
}
}
G4bool G4ParticleHPInelasticData::IsIsoApplicable( const G4DynamicParticle* dp ,
@@ -119,9 +140,14 @@ G4double G4ParticleHPInelasticData::GetIsoCrossSection( const G4DynamicParticle*
const G4Element* element ,
const G4Material* material )
{
if ( dp->GetKineticEnergy() == ke_cache && element == element_cache && material == material_cache ) return xs_cache;
ke_cache = dp->GetKineticEnergy();
element_cache = element;
material_cache = material;
G4double xs = GetCrossSection( dp , element , material->GetTemperature() );
xs_cache = xs;
return xs;
//return GetCrossSection( dp , element , material->GetTemperature() );
}
/*
@@ -82,11 +82,42 @@ G4bool G4ParticleHPIsoData::Init(G4int A, G4int Z, G4int M, G4double abun, G4Str
}
//void G4ParticleHPIsoData::Init(G4int A, G4int Z, G4double abun) //fill PhysicsVector for this Isotope
#include "G4Proton.hh"
#include "G4Deuteron.hh"
#include "G4Triton.hh"
#include "G4He3.hh"
#include "G4Alpha.hh"
void G4ParticleHPIsoData::Init(G4int A, G4int Z, G4int M,G4double abun, G4ParticleDefinition* projectile, const char* dataDirVariable ) //fill PhysicsVector for this Isotope
{
G4String dirName;
G4String baseName = getenv(dataDirVariable);
G4String particleName;
if ( projectile == G4Neutron::Neutron() ) {
;
} else if ( projectile == G4Proton::Proton() ) {
particleName = "Proton";
} else if ( projectile == G4Deuteron::Deuteron() ) {
particleName = "Deuteron";
} else if ( projectile == G4Triton::Triton() ) {
particleName = "Triton";
} else if ( projectile == G4He3::He3() ) {
particleName = "He3";
} else if ( projectile == G4Alpha::Alpha() ) {
particleName = "Alpha";
} else {
G4String message("G4ParticleHPInelastic may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + projectile->GetParticleName());
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
}
G4String baseName;
if ( getenv( dataDirVariable ) ) {
baseName = getenv( dataDirVariable );
} else {
baseName = getenv( "G4PARTICLEHPDATA" );
baseName += "/" + particleName;
}
// G4String baseName = getenv(dataDirVariable);
G4String dirName;
if( projectile == G4Neutron::Neutron() ){
dirName = baseName+"/Fission";
//if(Z>89)
@@ -122,7 +122,7 @@ G4ReactionProduct * G4ParticleHPLabAngularEnergy::Sample(G4double anEnergy, G4do
//if ( it == 0 || it == nEnergies-1 ) // it marks the energy bin
if ( it == 0 ) // it marks the energy bin
{
if(it==0) G4cout << "080808 Something unexpected is happen in G4ParticleHPLabAngularEnergy " << G4endl;
G4cout << "080808 Something unexpected is happen in G4ParticleHPLabAngularEnergy " << G4endl;
// integrate the prob for each costh, and select theta.
G4double * running = new G4double [nCosTh[it]];
running[0]=0;
@@ -67,8 +67,8 @@ Init (G4double A, G4double Z, G4int M, G4String & dirName, G4String & aFSType, G
ResidualA = A-1;
ResidualZ = Z-1;
} else if( projectile == G4He3::He3() ) {
ResidualA = A;
ResidualZ = Z-1;
ResidualA = A-1;
ResidualZ = Z;
} else if( projectile == G4Alpha::Alpha() ) {
ResidualA = A;
ResidualZ = Z;
@@ -67,8 +67,8 @@ Init (G4double A, G4double Z, G4int M, G4String & dirName, G4String & aFSType, G
ResidualA = A-1;
ResidualZ = Z;
} else if( projectile == G4He3::He3() ) {
ResidualA = A+1;
ResidualZ = Z;
ResidualA = A-1;
ResidualZ = Z+1;
} else if( projectile == G4Alpha::Alpha() ) {
ResidualA = A;
ResidualZ = Z+1;
@@ -279,9 +279,12 @@ if(getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
G4cout << "G4ParticleHPNames: The material was: A="<<A<<", Z="<<Z<<G4endl;
//throw G4HadronicException(__FILE__, __LINE__, "In case the data sets are at present not available in the neutron data library, please contact Hans-Peter.Wellisch@cern.ch");
throw G4HadronicException(__FILE__, __LINE__, "In case the data sets are at present not available in the neutron data library, please contact Hadron Group Coordinator");
/*
160910 TK makes commented out sructurally dead code
delete theName;
theFileName = "";
return result;
*/
//}
}
@@ -138,7 +138,7 @@ if ( repFlag == 2 ) G4cout << "G4ParticleHPPhotonDist: repFlag == 2 && isoFlag !
std::vector < G4int > vct_primary_par;
std::vector < G4int > vct_distype_par;
std::vector < G4ParticleHPVector* > vct_pXS_par;
if ( theGammas != NULL )
if ( theGammas != NULL && theShells != NULL )
{
//copy the cross section data
for ( i = 0 ; i < nDiscrete ; i++ )
@@ -401,6 +401,8 @@ G4int maxEnergyIndex = 0;
break;
}
/*
160910 TK makes commented out sructurally dead code
G4cout << "NeutronHPPhotonDist could not find fitted energy set for multiplicity of " << actualMult.Get()->at(0) << "." << G4endl;
G4cout << "NeutronHPPhotonDist will use the best set." << G4endl;
for ( std::vector< G4double >::iterator
@@ -408,6 +410,7 @@ G4int maxEnergyIndex = 0;
{
thePhotons->operator[](count)->SetKineticEnergy( *it );
}
*/
//G4cout << "Not Good " << actualMult[0] << " j " << j << " total photons E "
// << best/eV << " ratio " << best / maximumE
// << G4endl;
@@ -516,7 +516,7 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
} else {
//TL.second.n != TH.second.n
G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data! Do not yet supported");
throw G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data! Do not yet supported");
}
//set
@@ -575,7 +575,7 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
else
{
//tempLH.first == 0.0 && tempLH.second
G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data! Unexpected temperature values in data");
throw G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data! Unexpected temperature values in data");
}
std::vector< G4double > vE_T;
@@ -586,7 +586,7 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
for ( G4int i=1 ; i < n1 ; i++ )
{
if ( (*pvE_p_TL)[i]->first != (*pvE_p_TH)[i]->first ) G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data!");
if ( (*pvE_p_TL)[i]->first != (*pvE_p_TH)[i]->first ) throw G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data!");
vE_T.push_back ( (*pvE_p_TL)[i]->first );
vp_T.push_back ( get_linear_interpolated ( aTemp , std::pair< G4double , G4double > ( tempLH.first , (*pvE_p_TL)[i]->second ) , std::pair< G4double , G4double > ( tempLH.second , (*pvE_p_TL)[i]->second ) ) );
}
@@ -688,7 +688,7 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
} else {
// anEPM_TL_E.n != anEPM_TH_E.n
G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data! Do not yet supported");
throw G4HadronicException(__FILE__, __LINE__, "A problem is found in Thermal Scattering Data! Do not yet supported");
}
// Set Final State
@@ -825,12 +825,13 @@ E_isoAng G4ParticleHPThermalScattering::create_E_isoAng_from_energy ( G4double e
{
for ( iv = vEPM->begin() ; iv != vEPM->end() ; iv++ )
{
if ( energyLH.first == (*iv)->energy )
if ( energyLH.first == (*iv)->energy ) {
panEPM_T_EL = *iv;
iv++;
panEPM_T_EH = *iv;
break;
}
}
panEPM_T_EL = *iv;
iv++;
panEPM_T_EH = *iv;
}
else if ( energyLH.first == 0.0 )
{
@@ -535,8 +535,13 @@ G4double G4ParticleHPThermalScatteringData::GetX ( const G4DynamicParticle* aP,
for ( it = amapTemp_EnergyCross->begin() ; it != amapTemp_EnergyCross->end() ; it++ ) {
if ( aT < it->first ) break;
}
if ( it == amapTemp_EnergyCross->begin() && it != amapTemp_EnergyCross->end() ) it++; // lower than the first
if ( it != amapTemp_EnergyCross->begin() && it == amapTemp_EnergyCross->end() ) it--; // upper than the last
//if ( it == amapTemp_EnergyCross->begin() && it != amapTemp_EnergyCross->end() ) it++; // lower than the first
//if ( it != amapTemp_EnergyCross->begin() && it == amapTemp_EnergyCross->end() ) it--; // upper than the last
if ( it == amapTemp_EnergyCross->begin() ) {
it++; // lower than the first
} else if ( it == amapTemp_EnergyCross->end() ) {
it--; // upper than the last
}
G4double TH = it->first;
G4double XH = it->second->GetXsec ( eKinetic );
@@ -312,6 +312,19 @@
y1=aBuff[count].GetY();
x2=theData[current].GetX();
y2=theData[current].GetY();
if ( x1-x2 == 0 ) {
//Following block added for avoiding div 0 error on Release + G4FPE_DEBUG
for ( G4int j=start; j<current; j++ ) {
x = theData[j].GetX();
y = (y2+y1)/2.;
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
break;
}
}
} else {
for(G4int j=start; j<current; j++)
{
x = theData[j].GetX();
@@ -324,6 +337,7 @@
break;
}
}
}
current++ ;
}
// The last one also always goes, and is never tested.