Import Geant4 11.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2024-12-06 11:11:40 +01:00
parent e58e650b32
commit 32390e802b
1984 changed files with 98713 additions and 83996 deletions
@@ -140,23 +140,26 @@ G4double G4CrossSectionHP::IsoCrossSection(const G4double ekin,
const G4int Z, const G4int A,
const G4double T)
{
//G4cout << "G4CrossSectionHP::IsoCrossSection Z=" << Z << " A=" << A
// G4cout << "G4CrossSectionHP::IsoCrossSection Z=" << Z << " A=" << A
// << " E(MeV)=" << ekin/MeV << " T=" << T << " " << GetName() << G4endl;
G4double xs = 0.0;
if (ekin > emax || Z > maxZ || Z < minZ || ekin < elimit) { return xs; }
const G4PhysicsVector* pv0 = fData->GetElementData(Z - minZ);
auto pv0 = fData->GetElementData(Z - minZ);
if (nullptr == pv0) {
InitialiseOnFly(Z);
Initialise(Z);
pv0 = fData->GetElementData(Z - minZ);
}
// if there is no element data then no iso data
if (nullptr == pv0) { return xs; }
const G4PhysicsVector* pv = fData->GetComponentDataByID(Z - minZ, A);
const auto pv = fData->GetComponentDataByID(Z - minZ, A);
if (nullptr == pv) { return xs; }
// no Doppler broading
G4double factT = T/CLHEP::STP_Temperature;
if (ekin >= emaxT*factT || fManagerHP->GetNeglectDoppler()) {
// G4double factT = T/CLHEP::STP_Temperature;
if (ekin >= emaxT*T/CLHEP::STP_Temperature || fManagerHP->GetNeglectDoppler()) {
xs = pv->LogFreeVectorValue(ekin, logek);
} else {
@@ -165,6 +168,7 @@ G4double G4CrossSectionHP::IsoCrossSection(const G4double ekin,
G4double e0 = CLHEP::k_Boltzmann*T;
G4double mass = fParticle->GetPDGMass();
G4double massTarget = G4NucleiProperties::GetNuclearMass(A, Z);
G4double sig = std::sqrt(2.0*e0/(3.0*massTarget));
// projectile
G4LorentzVector lv(0., 0., std::sqrt(ekin*(ekin + 2*mass)), mass + ekin);
@@ -177,11 +181,12 @@ G4double G4CrossSectionHP::IsoCrossSection(const G4double ekin,
G4double xs2 = 0.0;
for (G4int i=0; i<nn; ++i) {
G4double erand = G4RandGamma::shoot(2.0, e0);
auto mom = G4RandomDirection()*std::sqrt(2*massTarget*erand);
fLV.set(mom.x(), mom.y(), mom.z(), massTarget + erand);
G4double vx = G4RandGauss::shoot(0., sig);
G4double vy = G4RandGauss::shoot(0., sig);
G4double vz = G4RandGauss::shoot(0., sig);
fLV.set(massTarget*vx, massTarget*vy, massTarget*vz, massTarget*(1.0 + 0.5*(vx*vx + vy*vy + vz*vz)));
fBoost = fLV.boostVector();
fLV = lv.boost(fBoost);
fLV = lv.boost(-fBoost);
if (fLV.pz() <= 0.0) { continue; }
++ii;
G4double e = fLV.e() - mass;
@@ -223,7 +228,7 @@ const G4Isotope* G4CrossSectionHP::SelectIsotope(const G4Element* elm,
// more than 1 isotope
G4int Z = elm->GetZasInt();
if (Z >= minZ && Z <= maxZ && nullptr == fData->GetElementData(Z - minZ)) {
InitialiseOnFly(Z);
Initialise(Z);
}
const G4double* abundVector = elm->GetRelativeAbundanceVector();
@@ -264,7 +269,7 @@ const G4Isotope* G4CrossSectionHP::SelectIsotope(const G4Element* elm,
void G4CrossSectionHP::BuildPhysicsTable(const G4ParticleDefinition& p)
{
if (verboseLevel > 1){
if (verboseLevel > 1) {
G4cout << "G4CrossSectionHP::BuildPhysicsTable for "
<< p.GetParticleName() << " and " << fDataName << G4endl;
}
@@ -275,9 +280,8 @@ void G4CrossSectionHP::BuildPhysicsTable(const G4ParticleDefinition& p)
// Access to elements
for ( auto const & elm : *table ) {
G4int Z = elm->GetZasInt();
if (Z >= minZ && Z <= maxZ &&
nullptr == fData->GetElementData(Z - minZ)) {
InitialiseOnFly(Z);
if (Z >= minZ && Z <= maxZ && nullptr == fData->GetElementData(Z - minZ)) {
Initialise(Z);
}
}
@@ -349,13 +353,6 @@ void G4CrossSectionHP::PrepareCache(const G4Material* mat)
fIsoXS.resize(fZA.size(), 0.0);
}
void G4CrossSectionHP::InitialiseOnFly(const G4int Z)
{
G4AutoLock l(&theHPXS);
Initialise(Z);
l.unlock();
}
void G4CrossSectionHP::Initialise(const G4int Z)
{
if (fManagerHP->GetVerboseLevel() > 1) {
@@ -366,6 +363,11 @@ void G4CrossSectionHP::Initialise(const G4int Z)
if (Z < minZ || Z > maxZ || nullptr != fData->GetElementData(Z - minZ)) {
return;
}
G4AutoLock l(&theHPXS);
if (nullptr != fData->GetElementData(Z - minZ)) {
l.unlock();
return;
}
// add empty vector to avoid double initialisation
fData->InitialiseForElement(Z - minZ, new G4PhysicsVector());
@@ -432,5 +434,6 @@ void G4CrossSectionHP::Initialise(const G4int Z)
}
}
if (noComp) { fData->InitialiseForComponent(Z - minZ, 0); }
l.unlock();
}
@@ -44,7 +44,7 @@
#include <map>
#include <vector>
G4ENDFTapeRead::G4ENDFTapeRead(G4String FileLocation, G4String FileName,
G4ENDFTapeRead::G4ENDFTapeRead(const G4String& FileLocation, const G4String& FileName,
G4FFGEnumerations::YieldType WhichYield,
G4FFGEnumerations::FissionCause /*WhichCause*/)
: /* Cause_(WhichCause),*/
@@ -55,7 +55,7 @@ G4ENDFTapeRead::G4ENDFTapeRead(G4String FileLocation, G4String FileName,
Initialize(FileLocation + FileName);
}
G4ENDFTapeRead::G4ENDFTapeRead(G4String FileLocation, G4String FileName,
G4ENDFTapeRead::G4ENDFTapeRead(const G4String& FileLocation, const G4String& FileName,
G4FFGEnumerations::YieldType WhichYield,
G4FFGEnumerations::FissionCause /*WhichCause*/, G4int Verbosity)
: /*Cause_(WhichCause),*/
@@ -77,7 +77,7 @@ G4ENDFTapeRead::G4ENDFTapeRead(std::istringstream& dataStream,
Initialize(dataStream);
}
void G4ENDFTapeRead::Initialize(G4String dataFile)
void G4ENDFTapeRead::Initialize(const G4String& dataFile)
{
std::istringstream dataStream(std::ios::in);
G4ParticleHPManager::GetInstance()->GetDataStream(dataFile, dataStream);
@@ -107,7 +107,7 @@ void G4ENDFTapeRead::Initialize(std::istringstream& dataStream)
G4FFG_FUNCTIONLEAVE__
}
G4double* G4ENDFTapeRead::G4GetEnergyGroupValues()
G4double* G4ENDFTapeRead::G4GetEnergyGroupValues() const
{
G4FFG_FUNCTIONENTER__
@@ -115,7 +115,7 @@ G4double* G4ENDFTapeRead::G4GetEnergyGroupValues()
return EnergyGroupValues_;
}
G4int G4ENDFTapeRead::G4GetNumberOfEnergyGroups()
G4int G4ENDFTapeRead::G4GetNumberOfEnergyGroups() const
{
G4FFG_FUNCTIONENTER__
@@ -123,7 +123,7 @@ G4int G4ENDFTapeRead::G4GetNumberOfEnergyGroups()
return EnergyGroups_;
}
G4int G4ENDFTapeRead::G4GetNumberOfFissionProducts()
G4int G4ENDFTapeRead::G4GetNumberOfFissionProducts() const
{
G4FFG_FUNCTIONENTER__
@@ -133,7 +133,7 @@ G4int G4ENDFTapeRead::G4GetNumberOfFissionProducts()
return NumberOfElements;
}
G4ENDFYieldDataContainer* G4ENDFTapeRead::G4GetYield(G4int WhichYield)
G4ENDFYieldDataContainer* G4ENDFTapeRead::G4GetYield(G4int WhichYield) const
{
G4FFG_DATA_FUNCTIONENTER__
@@ -282,7 +282,7 @@ G4NeutronHPCaptureFS::ApplyYourself(const G4HadProjectile& theTrack)
}
void G4NeutronHPCaptureFS::Init(G4double AA, G4double ZZ, G4int M,
G4String& dirName, G4String&,
const G4String& dirName, const G4String&,
G4ParticleDefinition*)
{
G4int Z = G4lrint(ZZ);
@@ -321,12 +321,12 @@ void G4NeutronHPCaptureFS::Init(G4double AA, G4double ZZ, G4int M,
}
// TK110430 END
G4String tString = "/FS";
const G4String& tString = "/FS";
G4bool dbool;
G4ParticleHPDataUsed aFile =
const G4ParticleHPDataUsed& aFile =
theNames.GetName(A, Z, M, dirName, tString, dbool);
G4String filename = aFile.GetName();
const G4String& filename = aFile.GetName();
SetAZMs(A, Z, M, aFile);
if (!dbool || (Z <= 2 && (theBaseZ != Z || theBaseA != A))) {
hasAnyData = false;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHP2AInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHP2AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP2AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -58,8 +58,8 @@ G4HadFinalState* G4ParticleHP2N2AInelasticFS::ApplyYourself(const G4HadProjectil
return theResult.Get();
}
void G4ParticleHP2N2AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP2N2AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHP2NAInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHP2NAInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP2NAInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHP2NDInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHP2NDInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP2NDInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHP2NInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHP2NInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP2NInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHP2NPInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHP2NPInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP2NPInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHP2PInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHP2PInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP2PInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHP3AInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHP3AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP3AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -57,8 +57,8 @@ G4HadFinalState* G4ParticleHP3NAInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHP3NAInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP3NAInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHP3NInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHP3NInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP3NInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -57,8 +57,8 @@ G4HadFinalState* G4ParticleHP3NPInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHP3NPInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP3NPInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -57,8 +57,8 @@ G4HadFinalState* G4ParticleHP4NInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHP4NInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHP4NInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -40,8 +40,8 @@ G4ParticleHPAInelasticFS::G4ParticleHPAInelasticFS()
secID = G4PhysicsModelCatalog::GetModelID("model_G4ParticleHPAInelasticFS_F27");
}
void G4ParticleHPAInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPAInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticCompFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -76,19 +76,19 @@ G4ParticleHPChannel::~G4ParticleHPChannel()
delete[] active;
}
G4double G4ParticleHPChannel::GetXsec(G4double energy)
G4double G4ParticleHPChannel::GetXsec(G4double energy) const
{
return std::max(0., theChannelData->GetXsec(energy));
}
G4double G4ParticleHPChannel::GetWeightedXsec(G4double energy,
G4int isoNumber)
G4int isoNumber) const
{
return theIsotopeWiseData[isoNumber].GetXsec(energy);
}
G4double G4ParticleHPChannel::GetFSCrossSection(G4double energy,
G4int isoNumber)
G4int isoNumber) const
{
return theFinalStates[isoNumber]->GetXsec(energy);
}
@@ -168,7 +168,7 @@ void G4ParticleHPChannel::UpdateData(G4int A, G4int Z, G4int M, G4int index,
}
else // get data from CrossSection directory
{
G4String tString = "/CrossSection";
const G4String& tString = "/CrossSection";
active[index] = theIsotopeWiseData[index].Init(A, Z, M, abundance,
theDir, tString);
if (active[index]) theBuffer = theIsotopeWiseData[index].MakeChannelData();
@@ -223,7 +223,7 @@ void G4ParticleHPChannel::Harmonise(G4ParticleHPVector*& theStore,
theStore = theMerge;
}
G4WendtFissionFragmentGenerator* G4ParticleHPChannel::GetWendtFissionGenerator() {
G4WendtFissionFragmentGenerator* G4ParticleHPChannel::GetWendtFissionGenerator() const {
if ( wendtFissionGenerator ) return wendtFissionGenerator;
else return nullptr;
}
@@ -322,7 +322,7 @@ G4ParticleHPChannel::ApplyYourself(const G4HadProjectile& theTrack,
return theFinalState;
}
void G4ParticleHPChannel::DumpInfo()
void G4ParticleHPChannel::DumpInfo() const
{
G4cout << " Element: " << theElement->GetName() << G4endl;
G4cout << " Directory name: " << theDir << G4endl;
@@ -57,8 +57,8 @@ G4HadFinalState* G4ParticleHPD2AInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHPD2AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPD2AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHPDAInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPDAInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPDAInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -40,8 +40,8 @@ G4ParticleHPDInelasticFS::G4ParticleHPDInelasticFS()
secID = G4PhysicsModelCatalog::GetModelID("model_G4ParticleHPDInelasticFS_F24");
}
void G4ParticleHPDInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPDInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticCompFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -101,16 +101,6 @@ G4double G4ParticleHPElasticData::GetIsoCrossSection(const G4DynamicParticle* dp
return xs;
}
/*
G4bool G4ParticleHPElasticData::IsApplicable(const G4DynamicParticle*aP, const G4Element*)
{
G4bool result = true;
G4double eKin = aP->GetKineticEnergy();
if(eKin>20*MeV||aP->GetDefinition()!=G4Neutron::Neutron()) result = false;
return result;
}
*/
void G4ParticleHPElasticData::BuildPhysicsTable(const G4ParticleDefinition& aP)
{
if (&aP != G4Neutron::Neutron())
@@ -132,8 +122,7 @@ void G4ParticleHPElasticData::BuildPhysicsTable(const G4ParticleDefinition& aP)
// make a PhysicsVector for each element
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
for (std::size_t i = 0; i < numberOfElements; ++i) {
G4PhysicsVector* physVec = G4ParticleHPData::Instance(G4Neutron::Neutron())
->MakePhysicsVector((*theElementTable)[i], this);
@@ -143,12 +132,8 @@ void G4ParticleHPElasticData::BuildPhysicsTable(const G4ParticleDefinition& aP)
G4ParticleHPManager::GetInstance()->RegisterElasticCrossSections(theCrossSections);
}
void G4ParticleHPElasticData::DumpPhysicsTable(const G4ParticleDefinition& aP)
void G4ParticleHPElasticData::DumpPhysicsTable(const G4ParticleDefinition&)
{
if (&aP != G4Neutron::Neutron())
throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
#ifdef G4VERBOSE
if (G4HadronicParameters::Instance()->GetVerboseLevel() == 0) return;
@@ -169,8 +154,7 @@ void G4ParticleHPElasticData::DumpPhysicsTable(const G4ParticleDefinition& aP)
G4cout << G4endl;
std::size_t numberOfElements = G4Element::GetNumberOfElements();
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
for (std::size_t i = 0; i < numberOfElements; ++i) {
G4cout << (*theElementTable)[i]->GetName() << G4endl;
@@ -77,15 +77,15 @@ G4ParticleHPElasticFS::G4ParticleHPElasticFS()
}
void G4ParticleHPElasticFS::Init(G4double A, G4double Z, G4int M,
G4String& dirName, G4String&,
const G4String& dirName, const G4String&,
G4ParticleDefinition*)
{
G4String tString = "/FS";
G4bool dbool = true;
SetA_Z(A, Z, M);
G4ParticleHPDataUsed aFile =
const G4ParticleHPDataUsed& aFile =
theNames.GetName(theBaseA, theBaseZ, M, dirName, tString, dbool);
G4String filename = aFile.GetName();
const G4String& filename = aFile.GetName();
SetAZMs(aFile);
if (!dbool) {
hasAnyData = false;
@@ -53,8 +53,11 @@
#include "G4Threading.hh"
G4ParticleHPElasticURR::G4ParticleHPElasticURR() : G4HadronicInteraction( "NeutronHPElasticURR" ) {
SetMinEnergy( 0.0 * CLHEP::eV );
G4ParticleHPElasticURR::G4ParticleHPElasticURR( G4bool isThermalScatteringOn ) :
G4HadronicInteraction( "NeutronHPElasticURR" ) {
G4double minEnergy = 0.0;
if ( isThermalScatteringOn ) minEnergy = 4.0 * CLHEP::eV;
SetMinEnergy( minEnergy );
SetMaxEnergy( 20.0 * CLHEP::MeV );
particleHPelastic = new G4ParticleHPElastic;
}
@@ -31,8 +31,8 @@
//
#include "G4ParticleHPFCFissionFS.hh"
void G4ParticleHPFCFissionFS::Init(G4double A, G4double Z, G4int M, G4String& dirName, G4String&,
G4ParticleDefinition* projectile)
void G4ParticleHPFCFissionFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String&, G4ParticleDefinition* projectile)
{
G4String aString = "/FC/";
G4ParticleHPFissionBaseFS::Init(A, Z, M, dirName, aString, projectile);
@@ -62,8 +62,8 @@ G4ParticleHPFFFissionFS::~G4ParticleHPFFFissionFS()
}
}
void G4ParticleHPFFFissionFS::Init(G4double A, G4double Z, G4int M, G4String& dirName, G4String&,
G4ParticleDefinition*)
void G4ParticleHPFFFissionFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String&, G4ParticleDefinition*)
{
// G4cout << "G4ParticleHPFFFissionFS::Init" << G4endl;
G4String aString = "FF";
@@ -43,14 +43,14 @@
#include "G4ThreeVector.hh"
#include "G4Triton.hh"
void G4ParticleHPFSFissionFS::Init(G4double A, G4double Z, G4int M, G4String& dirName, G4String&,
G4ParticleDefinition*)
void G4ParticleHPFSFissionFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String&, G4ParticleDefinition*)
{
G4String tString = "/FS/";
G4bool dbool;
G4ParticleHPDataUsed aFile =
const G4ParticleHPDataUsed& aFile =
theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, dirName, tString, dbool);
G4String filename = aFile.GetName();
const G4String& filename = aFile.GetName();
SetAZMs(A, Z, M, aFile);
if (!dbool) {
hasAnyData = false;
@@ -43,14 +43,14 @@
#include "G4ThreeVector.hh"
#include "G4Triton.hh"
void G4ParticleHPFissionBaseFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& bit, G4ParticleDefinition*)
void G4ParticleHPFissionBaseFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& bit, G4ParticleDefinition*)
{
G4String tString = dirName;
G4bool dbool;
G4ParticleHPDataUsed aFile =
const G4ParticleHPDataUsed& aFile =
theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, bit, dbool);
G4String filename = aFile.GetName();
const G4String& filename = aFile.GetName();
SetAZMs(A, Z, M, aFile);
// theBaseA = aFile.GetA();
// theBaseZ = aFile.GetZ();
@@ -60,7 +60,6 @@ G4ParticleHPFissionData::G4ParticleHPFissionData() : G4VCrossSectionDataSet("Neu
material_cache = nullptr;
ke_cache = 0.0;
xs_cache = 0.0;
// BuildPhysicsTable(*G4Neutron::Neutron());
}
G4ParticleHPFissionData::~G4ParticleHPFissionData()
@@ -97,12 +96,8 @@ G4double G4ParticleHPFissionData::GetIsoCrossSection(const G4DynamicParticle* dp
return xs;
}
void G4ParticleHPFissionData::BuildPhysicsTable(const G4ParticleDefinition& aP)
void G4ParticleHPFissionData::BuildPhysicsTable(const G4ParticleDefinition&)
{
if (&aP != G4Neutron::Neutron())
throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
if (G4Threading::IsWorkerThread()) {
theCrossSections = G4ParticleHPManager::GetInstance()->GetFissionCrossSections();
return;
@@ -116,8 +111,7 @@ void G4ParticleHPFissionData::BuildPhysicsTable(const G4ParticleDefinition& aP)
// make a PhysicsVector for each element
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
for (std::size_t i = 0; i < numberOfElements; ++i) {
G4PhysicsVector* physVec = G4ParticleHPData::Instance(G4Neutron::Neutron())
->MakePhysicsVector((*theElementTable)[i], this);
@@ -127,12 +121,8 @@ void G4ParticleHPFissionData::BuildPhysicsTable(const G4ParticleDefinition& aP)
G4ParticleHPManager::GetInstance()->RegisterFissionCrossSections(theCrossSections);
}
void G4ParticleHPFissionData::DumpPhysicsTable(const G4ParticleDefinition& aP)
void G4ParticleHPFissionData::DumpPhysicsTable(const G4ParticleDefinition&)
{
if (&aP != G4Neutron::Neutron())
throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
#ifdef G4VERBOSE
if (G4HadronicParameters::Instance()->GetVerboseLevel() == 0) return;
@@ -152,8 +142,7 @@ void G4ParticleHPFissionData::DumpPhysicsTable(const G4ParticleDefinition& aP)
G4cout << G4endl;
std::size_t numberOfElements = G4Element::GetNumberOfElements();
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
for (std::size_t i = 0; i < numberOfElements; ++i) {
G4cout << (*theElementTable)[i]->GetName() << G4endl;
@@ -49,8 +49,8 @@ G4ParticleHPFissionFS::G4ParticleHPFissionFS()
produceFissionFragments = false;
}
void G4ParticleHPFissionFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPFissionFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
theFS.Init(A, Z, M, dirName, aFSType, projectile);
theFC.Init(A, Z, M, dirName, aFSType, projectile);
@@ -40,8 +40,8 @@ G4ParticleHPHe3InelasticFS::G4ParticleHPHe3InelasticFS()
secID = G4PhysicsModelCatalog::GetModelID("model_G4ParticleHPHe3InelasticFS_F26");
}
void G4ParticleHPHe3InelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPHe3InelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticCompFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -215,7 +215,7 @@ const std::pair<G4double, G4double> G4ParticleHPInelastic::GetFatalEnergyCheckLe
return std::pair<G4double, G4double>(10.0 * perCent, 350.0 * CLHEP::GeV);
}
void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition&)
void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projectile)
{
if (fLock[indexP]) {
G4AutoLock l(&theHPInelastic);
@@ -294,6 +294,7 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition&)
}
#endif
}
fManager->RegisterInelasticFinalStates( &projectile , theInelastic[indexP] );
l.unlock();
}
@@ -82,8 +82,8 @@ void G4ParticleHPInelasticBaseFS::InitGammas(G4double AR, G4double ZR)
}
void G4ParticleHPInelasticBaseFS::Init(G4double A, G4double Z, G4int M,
G4String& dirName,
G4String& bit, G4ParticleDefinition*)
const G4String& dirName,
const G4String& bit, G4ParticleDefinition*)
{
gammaPath = fManager->GetNeutronHPPath() + "/Inelastic/Gammas/";
G4String tString = dirName;
@@ -126,17 +126,17 @@ void G4ParticleHPInelasticCompFS::InitGammas(G4double AR, G4double ZR)
theGammas.Init(theGammaData);
}
void G4ParticleHPInelasticCompFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition*)
void G4ParticleHPInelasticCompFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition*)
{
gammaPath = fManager->GetNeutronHPPath() + "/Inelastic/Gammas/";
G4String tString = dirName;
const G4String& tString = dirName;
SetA_Z(A, Z, M);
G4bool dbool;
G4ParticleHPDataUsed aFile =
const G4ParticleHPDataUsed& aFile =
theNames.GetName(theBaseA, theBaseZ, M, tString, aFSType, dbool);
SetAZMs(aFile);
G4String filename = aFile.GetName();
const G4String& filename = aFile.GetName();
#ifdef G4VERBOSE
if (fManager->GetDEBUG())
G4cout << " G4ParticleHPInelasticCompFS::Init FILE " << filename << G4endl;
@@ -184,8 +184,7 @@ void G4ParticleHPInelasticData::BuildPhysicsTable(const G4ParticleDefinition& pr
// make a PhysicsVector for each element
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
for (std::size_t i = 0; i < numberOfElements; ++i) {
G4PhysicsVector* physVec = theHPData->MakePhysicsVector((*theElementTable)[i], this);
theCrossSections->push_back(physVec);
@@ -193,12 +192,8 @@ void G4ParticleHPInelasticData::BuildPhysicsTable(const G4ParticleDefinition& pr
G4ParticleHPManager::GetInstance()->RegisterInelasticCrossSections(&projectile, theCrossSections);
}
void G4ParticleHPInelasticData::DumpPhysicsTable(const G4ParticleDefinition& projectile)
void G4ParticleHPInelasticData::DumpPhysicsTable(const G4ParticleDefinition&)
{
if (&projectile != theProjectile)
throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use ParticleHP data for a wrong projectile!!!");
#ifdef G4VERBOSE
if (G4HadronicParameters::Instance()->GetVerboseLevel() == 0) return;
@@ -217,8 +212,7 @@ void G4ParticleHPInelasticData::DumpPhysicsTable(const G4ParticleDefinition& pro
G4cout << G4endl;
std::size_t numberOfElements = G4Element::GetNumberOfElements();
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
for (std::size_t i = 0; i < numberOfElements; ++i) {
G4cout << (*theElementTable)[i]->GetName() << G4endl;
@@ -51,6 +51,7 @@
#include "G4Neutron.hh"
#include "G4Element.hh"
#include "G4ParticleHPManager.hh"
#include "G4HadronicParameters.hh"
#include "G4ParticleHPProbabilityTablesStore.hh"
#include "G4HadronicException.hh"
@@ -69,11 +70,11 @@ G4ParticleHPInelasticDataPT::~G4ParticleHPInelasticDataPT() {}
G4bool G4ParticleHPInelasticDataPT::IsIsoApplicable( const G4DynamicParticle* dp , G4int /*Z*/ , G4int /*A*/ ,
const G4Element* elm, const G4Material* /*mat*/ ) {
// checks applicability for the element
if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "njoy" ) {
if ( doNOTusePTforInelastic ) {
// do not use for njoy
return false;
} else if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "calendf" ) {
if ( dp->GetDefinition() != G4Neutron::Neutron() ) {
}
if ( dp->GetDefinition() != G4Neutron::Neutron() ) {
return false;
} else {
std::size_t elementI = elm->GetIndex();
@@ -83,7 +84,6 @@ G4bool G4ParticleHPInelasticDataPT::IsIsoApplicable( const G4DynamicParticle* dp
} else if ( eKin > (*URRlimits).at(elementI).second ) { // kinetic energy above the URR energy range for this element = maxURR(isotopes in element)
return false;
}
}
return true;
}
return false;
@@ -97,10 +97,12 @@ G4double G4ParticleHPInelasticDataPT::GetIsoCrossSection( const G4DynamicParticl
void G4ParticleHPInelasticDataPT::BuildPhysicsTable( const G4ParticleDefinition& aP ) {
if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "njoy" ) {
if ( G4HadronicParameters::Instance()->GetTypeTablePT() == "njoy" ) {
SetMinKinEnergy( DBL_MAX );
SetMaxKinEnergy( 0.0 );
} else if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "calendf" ) {
doNOTusePTforInelastic = true;
} else if ( G4HadronicParameters::Instance()->GetTypeTablePT() == "calendf" ) {
doNOTusePTforInelastic = false;
G4cout << "BuildPhysicsTable in G4ParticleHPInelasticDataPT." << G4endl;
if ( &aP != G4Neutron::Neutron() ) {
throw G4HadronicException( __FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!" );
@@ -47,6 +47,7 @@
#include "G4ParticleHPInelasticURR.hh"
#include "G4ParticleHPManager.hh"
#include "G4HadronicParameters.hh"
#include "G4ParticleHPChannel.hh"
#include "G4ParticleHPInelastic.hh"
#include "G4ParticleHPProbabilityTablesStore.hh"
@@ -124,9 +125,9 @@ G4HadFinalState* G4ParticleHPInelasticURR::ApplyYourself( const G4HadProjectile&
void G4ParticleHPInelasticURR::BuildPhysicsTable( const G4ParticleDefinition& ) {
particleHPinelastic->BuildPhysicsTable( *(G4Neutron::Neutron()) );
if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "njoy" ) {
if ( G4HadronicParameters::Instance()->GetTypeTablePT() == "njoy" ) {
doNOTusePTforInelastic = true;
} else if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "calendf" ) {
} else if ( G4HadronicParameters::Instance()->GetTypeTablePT() == "calendf" ) {
doNOTusePTforInelastic = false;
// in the case of calendf probability tables, it sets the limits of the URR
URRlimits = G4ParticleHPManager::GetInstance()->GetURRlimits();
@@ -56,8 +56,8 @@ void G4ParticleHPIsoData::FillChannelData(G4ParticleHPVector* aBuffer)
theChannelData->Hash();
}
G4bool G4ParticleHPIsoData::Init(G4int A, G4int Z, G4int M, G4double abun, G4String dirName,
G4String aFSType)
G4bool G4ParticleHPIsoData::Init(G4int A, G4int Z, G4int M, G4double abun, const G4String& dirName,
const G4String& aFSType)
{
theChannelData = nullptr;
G4double abundance = abun / 100.;
@@ -134,7 +134,7 @@ void G4ParticleHPIsoData::Init(G4int A, G4int Z, G4int M, G4double abun,
theChannelData = nullptr;
}
G4String G4ParticleHPIsoData::GetName(G4int A, G4int Z, G4String base, G4String rest)
G4String G4ParticleHPIsoData::GetName(G4int A, G4int Z, const G4String& base, const G4String& rest)
{
G4bool dbool;
return (theNames.GetName(A, Z, base, rest, dbool)).GetName();
@@ -60,38 +60,23 @@
#include "G4Neutron.hh"
#include "G4ParticleHPChannel.hh"
#include "G4ParticleHPChannelList.hh"
#include <string>
#include <fstream>
///--------------------------------------------------------------------------------------
G4ParticleHPIsoProbabilityTable::G4ParticleHPIsoProbabilityTable() :
theEnergies( nullptr ), theProbabilities( nullptr ), theElasticData( nullptr ),
theCaptureData( nullptr ), theFissionData( nullptr )
G4ParticleHPIsoProbabilityTable::~G4ParticleHPIsoProbabilityTable()
{
Z = 0;
A = 0;
m = -1;
T = -1.0;
Emin = DBL_MAX;
Emax = 0.0;
}
///--------------------------------------------------------------------------------------
G4ParticleHPIsoProbabilityTable::~G4ParticleHPIsoProbabilityTable() {
for ( std::vector< std::vector< G4double >* >::iterator it = theProbabilities->begin();
it != theProbabilities->end(); ++it ) {
for ( auto it = theProbabilities->cbegin(); it != theProbabilities->cend(); ++it ) {
delete* it;
}
for ( std::vector< std::vector< G4double >* >::iterator it = theElasticData->begin();
it != theElasticData->end(); ++it ) {
for ( auto it = theElasticData->cbegin(); it != theElasticData->cend(); ++it ) {
delete* it;
}
for ( std::vector< std::vector< G4double >* >::iterator it = theCaptureData->begin();
it != theCaptureData->end(); ++it ) {
for ( auto it = theCaptureData->cbegin(); it != theCaptureData->cend(); ++it ) {
delete* it;
}
for ( std::vector< std::vector< G4double >* >::iterator it = theFissionData->begin();
it != theFissionData->end(); ++it ) {
for ( auto it = theFissionData->cbegin(); it != theFissionData->cend(); ++it ) {
delete* it;
}
delete theEnergies;
@@ -102,7 +87,7 @@ G4ParticleHPIsoProbabilityTable::~G4ParticleHPIsoProbabilityTable() {
}
///--------------------------------------------------------------------------------------
void G4ParticleHPIsoProbabilityTable::Init( G4int, G4int, G4int, G4double, G4String ) {}
void G4ParticleHPIsoProbabilityTable::Init( G4int, G4int, G4int, G4double, const G4String& ) {}
///--------------------------------------------------------------------------------------
G4double G4ParticleHPIsoProbabilityTable::GetCorrelatedIsoCrossSectionPT( const G4DynamicParticle*, G4int,
@@ -62,19 +62,18 @@
#include <sstream>
///--------------------------------------------------------------------------------------
G4ParticleHPIsoProbabilityTable_CALENDF::G4ParticleHPIsoProbabilityTable_CALENDF() : theInelasticData(0) {}
G4ParticleHPIsoProbabilityTable_CALENDF::G4ParticleHPIsoProbabilityTable_CALENDF() : theInelasticData(nullptr) {}
///--------------------------------------------------------------------------------------
G4ParticleHPIsoProbabilityTable_CALENDF::~G4ParticleHPIsoProbabilityTable_CALENDF() {
for ( std::vector< std::vector< G4double >* >::iterator it = theInelasticData->begin();
it != theInelasticData->end(); ++it ) {
for ( auto it = theInelasticData->cbegin(); it != theInelasticData->cend(); ++it ) {
delete* it;
}
delete theInelasticData;
}
///--------------------------------------------------------------------------------------
void G4ParticleHPIsoProbabilityTable_CALENDF::Init( G4int theZ, G4int theA, G4int them, G4double theT, G4String dirName ) {
void G4ParticleHPIsoProbabilityTable_CALENDF::Init( G4int theZ, G4int theA, G4int them, G4double theT, const G4String& dirName ) {
Z = theZ;
A = theA;
m = them;
@@ -82,7 +81,7 @@ void G4ParticleHPIsoProbabilityTable_CALENDF::Init( G4int theZ, G4int theA, G4in
G4cout << "The CALENDF probability tables are being initialized for Z=" << Z << " A=" << A << " and T=" << T << " K." << G4endl;
filename = std::to_string(Z) + "_" + std::to_string(A);
if ( m != 0 ) filename += "_m" + std::to_string(m);
G4String fullPathFileName = dirName + filename + "." + std::to_string( (G4int)(T) ) + ".pt.z";
G4String fullPathFileName = dirName + filename + "." + std::to_string( (G4int)(T) ) + ".pt";
std::istringstream theData( std::ios::in );
G4ParticleHPManager::GetInstance()->GetDataStream( fullPathFileName, theData );
if ( theData.good() ) {
@@ -58,6 +58,7 @@
#include "G4ParticleHPChannelList.hh"
#include "G4Nucleus.hh"
#include "G4Element.hh"
#include <string>
#include <sstream>
@@ -71,7 +72,7 @@ G4ParticleHPIsoProbabilityTable_NJOY::G4ParticleHPIsoProbabilityTable_NJOY() {
G4ParticleHPIsoProbabilityTable_NJOY::~G4ParticleHPIsoProbabilityTable_NJOY() {}
///--------------------------------------------------------------------------------------
void G4ParticleHPIsoProbabilityTable_NJOY::Init( G4int theZ, G4int theA, G4int them, G4double theT, G4String dirName ) {
void G4ParticleHPIsoProbabilityTable_NJOY::Init( G4int theZ, G4int theA, G4int them, G4double theT, const G4String& dirName ) {
Z = theZ;
A = theA;
m = them;
@@ -84,7 +85,7 @@ void G4ParticleHPIsoProbabilityTable_NJOY::Init( G4int theZ, G4int theA, G4int t
std::string strm = std::to_string(m);
filename += "_m" + strm;
}
G4String fullPathFileName = dirName + filename + "." + std::to_string( (G4int)(T) ) + ".pt.z";
G4String fullPathFileName = dirName + filename + "." + std::to_string( (G4int)(T) ) + ".pt";
std::istringstream theData( std::ios::in );
G4ParticleHPManager::GetInstance()->GetDataStream( fullPathFileName, theData );
if ( theData.good() ) {
@@ -73,7 +73,7 @@ G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData()
mIsotope.clear();
}
G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData(G4String reaction, G4ParticleDefinition* pd)
G4ParticleHPJENDLHEData::G4ParticleHPJENDLHEData(const G4String& reaction, G4ParticleDefinition* pd)
: G4VCrossSectionDataSet("JENDLHE" + reaction + "CrossSection")
{
reactionName = reaction;
@@ -86,9 +86,9 @@ void G4ParticleHPJENDLHEData::BuildPhysicsTable(const G4ParticleDefinition& aP)
{
particleName = aP.GetParticleName();
G4String baseName = G4FindDataDir("G4NEUTRONHPDATA");
G4String dirName = baseName + "/JENDL_HE/" + particleName + "/" + reactionName;
G4String aFSType = "/CrossSection/";
const G4String& baseName = G4FindDataDir("G4NEUTRONHPDATA");
const G4String& dirName = baseName + "/JENDL_HE/" + particleName + "/" + reactionName;
const G4String& aFSType = "/CrossSection/";
G4ParticleHPNames theNames;
G4String filename;
@@ -31,8 +31,8 @@
//
#include "G4ParticleHPLCFissionFS.hh"
void G4ParticleHPLCFissionFS::Init(G4double A, G4double Z, G4int M, G4String& dirName, G4String&,
G4ParticleDefinition* projectile)
void G4ParticleHPLCFissionFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String&, G4ParticleDefinition* projectile)
{
G4String aString = "/LC/";
G4ParticleHPFissionBaseFS::Init(A, Z, M, dirName, aString, projectile);
@@ -75,14 +75,8 @@ void G4ParticleHPList::Init(std::istream& aDataFile, G4double unit)
}
}
G4double G4ParticleHPList::GetValue(G4int i)
G4double G4ParticleHPList::GetValue(G4int i) const
{
// G4cout << "TestList "<<i<<" "<<nEntries<<G4endl;
if (nEntries < 0) {
// G4cout <<nPoints<<" "<<nEntries<<" "<<theData<<G4endl;
// for(G4int ii=0; ii<2; ii++) G4cout << theData[ii]<<" ";
// G4cout << G4endl;
}
if (i < 0) i = 0;
if (i >= GetListLength()) i = GetListLength() - 1;
return theData[i];
@@ -252,7 +252,7 @@ void G4ParticleHPManager::register_data_file(const G4String& filename, const G4S
mDataEvaluation.insert(std::pair<G4String, G4String>(filename, source));
}
void G4ParticleHPManager::DumpDataSource()
void G4ParticleHPManager::DumpDataSource() const
{
G4cout << "Data source of this Partile HP calculation are " << G4endl;
for (const auto& it : mDataEvaluation) {
@@ -280,7 +280,7 @@ void G4ParticleHPManager::DumpSetting()
<< " PHP check " << PHP_CHECK << G4endl
<< " CHECK HP NAMES " << CHECK_HP_NAMES << G4endl
<< " Enable DEBUG " << DEBUG << G4endl
<< " Use probability tables from " << USE_PROBABILITY_TABLE_FROM << G4endl
<< " Use probability tables from " << G4HadronicParameters::Instance()->GetTypeTablePT() << G4endl
<< "=======================================================" << G4endl << G4endl;
isPrinted = true;
}
@@ -142,12 +142,6 @@ G4ParticleHPMessenger::G4ParticleHPMessenger(G4ParticleHPManager* man) : manager
MaxEnergyDBRCCmd->SetUnitCategory("Energy");
MaxEnergyDBRCCmd->SetDefaultValue(210. * CLHEP::eV);
MaxEnergyDBRCCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
PTformatCmd = new G4UIcmdWithAString("/process/had/particle_hp/use_probability_table_from", this);
PTformatCmd->SetGuidance("Choose format of the probability tables.");
PTformatCmd->SetParameterName("choice", false);
PTformatCmd->SetCandidates("njoy calendf");
PTformatCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
}
G4ParticleHPMessenger::~G4ParticleHPMessenger()
@@ -166,7 +160,6 @@ G4ParticleHPMessenger::~G4ParticleHPMessenger()
delete MinADBRCCmd;
delete MinEnergyDBRCCmd;
delete MaxEnergyDBRCCmd;
delete PTformatCmd;
}
void G4ParticleHPMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
@@ -414,21 +407,4 @@ void G4ParticleHPMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
}
}
if (command == PTformatCmd) {
if (manager->GetUsedPTformat() != newValue) {
manager->SetUsedPTformat(newValue);
}
#ifdef G4VERBOSE
if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
G4cout << G4endl
<< "=== G4ParticleHPMessenger CHANGED PARAMETER UsedPTformat TO "
<< newValue << " ===" << G4endl;
}
if (newValue == "njoy") {
G4cout << " -> Probablity tables for the unresolved resonace region will be used from NJOY21." << G4endl;
} else if (newValue == "calendf") {
G4cout << " -> Probablity tables for the unresolved resonace region will be used from CALENDF." << G4endl;
}
#endif
}
}
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHPN2AInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHPN2AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPN2AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHPN2PInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHPN2PInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPN2PInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -57,8 +57,8 @@ G4HadFinalState* G4ParticleHPN3AInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHPN3AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPN3AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHPNAInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPNAInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNAInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -58,8 +58,8 @@ G4HadFinalState* G4ParticleHPND2AInelasticFS::ApplyYourself(const G4HadProjectil
return theResult.Get();
}
void G4ParticleHPND2AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPND2AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHPNDInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPNDInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNDInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHPNHe3InelasticFS::ApplyYourself(const G4HadProjectil
return theResult.Get();
}
void G4ParticleHPNHe3InelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNHe3InelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -46,8 +46,8 @@ G4ParticleHPNInelasticFS::G4ParticleHPNInelasticFS()
secID = G4PhysicsModelCatalog::GetModelID("model_G4ParticleHPNInelasticFS_F01");
}
void G4ParticleHPNInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
// G4cout << "Getting initialized for: "<<A<<" "<< Z<<G4endl;
G4ParticleHPInelasticCompFS::Init(A, Z, M, dirName, aFSType, projectile);
@@ -57,8 +57,8 @@ G4HadFinalState* G4ParticleHPNPAInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHPNPAInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNPAInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHPNPInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPNPInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNPInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -58,8 +58,8 @@ G4HadFinalState* G4ParticleHPNT2AInelasticFS::ApplyYourself(const G4HadProjectil
return theResult.Get();
}
void G4ParticleHPNT2AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNT2AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHPNTInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPNTInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNTInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -54,8 +54,8 @@ G4HadFinalState* G4ParticleHPNXInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPNXInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPNXInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -76,12 +76,12 @@ G4ParticleHPNames::G4ParticleHPNames(G4int maxOffSet) : theMaxOffSet(maxOffSet)
fManager = G4ParticleHPManager::GetInstance();
}
G4String G4ParticleHPNames::GetName(G4int i)
G4String G4ParticleHPNames::GetName(G4int i) const
{
return (i > 0 && i < 100) ? theString[i] : G4String("");
}
G4String G4ParticleHPNames::itoa(G4int current)
G4String G4ParticleHPNames::itoa(G4int current) const
{
const char theDigits[11] = "0123456789";
G4String result;
@@ -95,7 +95,7 @@ G4String G4ParticleHPNames::itoa(G4int current)
}
G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, const G4String& base,
const G4String& rest, G4bool& aFlag)
const G4String& rest, G4bool& aFlag) const
{
// G4cout << Z << " " << A << " " << M << " " << base << " " << rest << G4endl;
@@ -318,7 +318,7 @@ G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, const
if (Z != result.GetZ() || A != result.GetA()) {
if (rest == "/CrossSection") {
G4String reac = base;
G4String dir = fManager->GetNeutronHPPath();
const G4String& dir = fManager->GetNeutronHPPath();
reac.erase(0, dir.length());
if (fManager->GetSkipMissingIsotopes()
&& (Z != result.GetZ() || !result.IsThisNaturalAbundance()))
@@ -329,7 +329,7 @@ G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, const
<< " is not found and CrossSection set to 0." << G4endl;
}
#endif
G4String new_name = base + "/" + rest + "/" + "0_0_Zero";
const G4String& new_name = base + "/" + rest + "/" + "0_0_Zero";
result.SetName(new_name);
}
else {
@@ -344,7 +344,7 @@ G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, const
|| (Z == 88 && A == 226))))
{
G4String new_name = base + "/" + rest + "/" + "0_0_Zero";
const G4String& new_name = base + "/" + rest + "/" + "0_0_Zero";
result.SetName(new_name);
}
else {
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHPPAInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPPAInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPPAInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -56,8 +56,8 @@ G4HadFinalState* G4ParticleHPPDInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPPDInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPPDInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -40,8 +40,8 @@ G4ParticleHPPInelasticFS::G4ParticleHPPInelasticFS()
secID = G4PhysicsModelCatalog::GetModelID("model_G4ParticleHPPInelasticFS_F23");
}
void G4ParticleHPPInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPPInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticCompFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHPPTInelasticFS::ApplyYourself(const G4HadProjectile&
return theResult.Get();
}
void G4ParticleHPPTInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPPTInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -308,7 +308,7 @@ G4ReactionProductVector* G4ParticleHPPhotonDist::GetPhotons(G4double anEnergy)
if (std::accumulate(photons_e.cbegin(), photons_e.cend(), 0.0) > maximumE) {
if (std::accumulate(photons_e.cbegin(), photons_e.cend(), 0.0) < best)
photons_e_best = photons_e;
photons_e_best = std::move(photons_e);
continue;
}
G4int iphot = 0;
@@ -49,6 +49,7 @@
#include "G4SystemOfUnits.hh"
#include "G4ParticleHPVector.hh"
#include "G4ParticleHPManager.hh"
#include "G4HadronicParameters.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4Isotope.hh"
@@ -71,16 +72,16 @@ G4ParticleHPProbabilityTablesStore::G4ParticleHPProbabilityTablesStore() :
G4Exception( "G4ParticleHPProbabilityTablesStore::G4ParticleHPProbabilityTablesStore()", "hadhp01",
FatalException, "Please setenv G4URRPTDATA, it is not defined." );
}
if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "njoy" ) {
dirName += "/ProbabilityTables/njoy/";
if ( G4HadronicParameters::Instance()->GetTypeTablePT() == "njoy" ) {
dirName += "/njoy/";
usedNjoy = true;
} else if ( G4ParticleHPManager::GetInstance()->GetUsedPTformat() == "calendf" ) {
dirName += "/ProbabilityTables/calendf/";
} else if ( G4HadronicParameters::Instance()->GetTypeTablePT() == "calendf" ) {
dirName += "/calendf/";
usedCalendf = true;
} else {
G4Exception( "G4ParticleHPProbabilityTablesStore::G4ParticleHPProbabilityTablesStore()", "hadhp01",
FatalException, "The format of probability tables is not set properly, "
"please check variable USE_PROBABILITY_TABLE_FROM in G4ParticleHPManager." );
"please set it with G4HadronicParameters::Instance()->SetTypeTablePT() before initialization in your main." );
}
numIso = (G4int)G4Isotope::GetNumberOfIsotopes();
// find all possible temperatures for all isotopes.
@@ -91,9 +92,9 @@ G4ParticleHPProbabilityTablesStore::G4ParticleHPProbabilityTablesStore() :
std::vector< G4int > isotemperatures;
std::map< std::thread::id, G4double > simpleMapE;
std::map< std::thread::id, G4double > simpleMapRN;
Temperatures->push_back( isotemperatures );
energy_cache.push_back( simpleMapE );
random_number_cache.push_back( simpleMapRN );
Temperatures->push_back( std::move(isotemperatures) );
energy_cache.push_back( std::move(simpleMapE) );
random_number_cache.push_back( std::move(simpleMapRN) );
}
for ( std::size_t im = 0; im < G4Material::GetNumberOfMaterials(); ++im ) {
std::vector< G4bool > isoinmat( numIso, false );
@@ -172,7 +173,7 @@ void G4ParticleHPProbabilityTablesStore::Init() {
}
tempPTmap[T]->Init( Z, A, meso, T, dirName );
}
ProbabilityTables->push_back( tempPTmap );
ProbabilityTables->push_back( std::move(tempPTmap) );
}
}
@@ -198,7 +199,7 @@ void G4ParticleHPProbabilityTablesStore::InitURRlimits() {
G4bool hasalreadyPT = false;
G4bool doesnothavePTyet = false;
for ( G4int T : (*Temperatures)[indexI] ) {
G4String fullPathFileName = dirName + filename + "." + std::to_string(T) + ".pt.z";
G4String fullPathFileName = dirName + filename + "." + std::to_string(T) + ".pt";
std::istringstream theData( std::ios::in );
G4ParticleHPManager::GetInstance()->GetDataStream( fullPathFileName, theData );
if ( theData.good() && hasalreadyPT ) {
@@ -37,7 +37,7 @@ G4ParticleHPReactionWhiteBoard::~G4ParticleHPReactionWhiteBoard()
mapStringPair.clear();
}
void G4ParticleHPReactionWhiteBoard::Dump()
void G4ParticleHPReactionWhiteBoard::Dump() const
{
G4cout << "G4ParticleHPReactionWhiteBoard::Dump" << G4endl;
G4cout << "Target Z = " << targZ << G4endl;
@@ -51,7 +51,7 @@ void G4ParticleHPReactionWhiteBoard::Dump()
G4cout << G4endl;
}
bool G4ParticleHPReactionWhiteBoard::AddRecord(std::pair<G4String, G4String> new_record)
G4bool G4ParticleHPReactionWhiteBoard::AddRecord(std::pair<G4String, G4String> new_record)
{
if (mapStringPair.find(new_record.first) != mapStringPair.end()) {
G4cout << "This key is already used in the current reaction white board!" << G4endl;
@@ -61,7 +61,7 @@ bool G4ParticleHPReactionWhiteBoard::AddRecord(std::pair<G4String, G4String> new
return true;
}
G4String G4ParticleHPReactionWhiteBoard::GetValue(G4String key)
G4String G4ParticleHPReactionWhiteBoard::GetValue(const G4String& key) const
{
auto it = mapStringPair.find(key);
if (it == mapStringPair.end()) {
@@ -71,7 +71,7 @@ G4String G4ParticleHPReactionWhiteBoard::GetValue(G4String key)
return it->second;
}
G4int G4ParticleHPReactionWhiteBoard::GetValueInInt(G4String key)
G4int G4ParticleHPReactionWhiteBoard::GetValueInInt(const G4String& key) const
{
G4String result = GetValue(key);
if (result == "NONE") return 0;
@@ -82,7 +82,7 @@ G4int G4ParticleHPReactionWhiteBoard::GetValueInInt(G4String key)
return i;
}
G4double G4ParticleHPReactionWhiteBoard::GetValueInDouble(G4String key)
G4double G4ParticleHPReactionWhiteBoard::GetValueInDouble(const G4String& key) const
{
G4String result = GetValue(key);
if (result == "NONE") return 0.0;
@@ -30,8 +30,8 @@
//
#include "G4ParticleHPSCFissionFS.hh"
void G4ParticleHPSCFissionFS::Init(G4double A, G4double Z, G4int M, G4String& dirName, G4String&,
G4ParticleDefinition* projectile)
void G4ParticleHPSCFissionFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String&, G4ParticleDefinition* projectile)
{
G4String aString = "/SC/";
G4ParticleHPFissionBaseFS::Init(A, Z, M, dirName, aString, projectile);
@@ -55,8 +55,8 @@ G4HadFinalState* G4ParticleHPT2AInelasticFS::ApplyYourself(const G4HadProjectile
return theResult.Get();
}
void G4ParticleHPT2AInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPT2AInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticBaseFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -30,8 +30,8 @@
//
#include "G4ParticleHPTCFissionFS.hh"
void G4ParticleHPTCFissionFS::Init(G4double A, G4double Z, G4int M, G4String& dirName, G4String&,
G4ParticleDefinition* projectile)
void G4ParticleHPTCFissionFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String&, G4ParticleDefinition* projectile)
{
G4String aString = "/TC/";
G4ParticleHPFissionBaseFS::Init(A, Z, M, dirName, aString, projectile);
@@ -39,8 +39,8 @@ G4ParticleHPTInelasticFS::G4ParticleHPTInelasticFS()
secID = G4PhysicsModelCatalog::GetModelID("model_G4ParticleHPTInelasticFS_F25");
}
void G4ParticleHPTInelasticFS::Init(G4double A, G4double Z, G4int M, G4String& dirName,
G4String& aFSType, G4ParticleDefinition* projectile)
void G4ParticleHPTInelasticFS::Init(G4double A, G4double Z, G4int M, const G4String& dirName,
const G4String& aFSType, G4ParticleDefinition* projectile)
{
G4ParticleHPInelasticCompFS::Init(A, Z, M, dirName, aFSType, projectile);
G4double ResidualA = 0;
@@ -125,7 +125,7 @@ void G4ParticleHPThermalScattering::BuildPhysicsTable(const G4ParticleDefinition
}
std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*
G4ParticleHPThermalScattering::readACoherentFSDATA(G4String name)
G4ParticleHPThermalScattering::readACoherentFSDATA(const G4String& name)
{
auto aCoherentFSDATA = new std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>;
@@ -164,7 +164,7 @@ G4ParticleHPThermalScattering::readACoherentFSDATA(G4String name)
}
std::map<G4double, std::vector<E_P_E_isoAng*>*>*
G4ParticleHPThermalScattering::readAnInelasticFSDATA(G4String name)
G4ParticleHPThermalScattering::readAnInelasticFSDATA(const G4String& name)
{
auto anT_E_P_E_isoAng = new std::map<G4double, std::vector<E_P_E_isoAng*>*>;
@@ -250,7 +250,7 @@ G4ParticleHPThermalScattering::readAnE_P_E_isoAng(std::istream* file) // for in
}
std::map<G4double, std::vector<E_isoAng*>*>*
G4ParticleHPThermalScattering::readAnIncoherentFSDATA(G4String name)
G4ParticleHPThermalScattering::readAnIncoherentFSDATA(const G4String& name)
{
auto T_E = new std::map<G4double, std::vector<E_isoAng*>*>;
@@ -563,9 +563,9 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
E_isoAng anEPM_T_E_sampled;
G4double rand_temp = G4UniformRand();
if (rand_temp < (aTemp - tempLH.first) / (tempLH.second - tempLH.first))
anEPM_T_E_sampled = anEPM_TH_E;
anEPM_T_E_sampled = std::move(anEPM_TH_E);
else
anEPM_T_E_sampled = anEPM_TL_E;
anEPM_T_E_sampled = std::move(anEPM_TL_E);
mu = getMu(&anEPM_T_E_sampled);
@@ -1061,8 +1061,7 @@ void G4ParticleHPThermalScattering::buildPhysicsTable()
}
// Searching TS Elements
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
std::size_t numberOfElements = G4Element::GetNumberOfElements();
for (std::size_t i = 0; i < numberOfElements; ++i) {
const G4Element* element = (*theElementTable)[i];
@@ -1172,8 +1171,8 @@ const std::pair<G4double, G4double> G4ParticleHPThermalScattering::GetFatalEnerg
return std::pair<G4double, G4double>(10.0 * perCent, 350.0 * CLHEP::GeV);
}
void G4ParticleHPThermalScattering::AddUserThermalScatteringFile(G4String nameG4Element,
G4String filename)
void G4ParticleHPThermalScattering::AddUserThermalScatteringFile(const G4String& nameG4Element,
const G4String& filename)
{
names.AddThermalElement(nameG4Element, filename);
theXSection->AddUserThermalScatteringFile(nameG4Element, filename);
@@ -23,23 +23,12 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Thermal Neutron Scattering
// Koi, Tatsumi (SCCS/SLAC)
// G4ParticleHPThermalScatteringData
//
// Class Description
// Cross Sections for a high precision (based on evaluated data
// libraries) description of themal neutron scattering below 4 eV;
// Based on Thermal neutron scattering files
// from the evaluated nuclear data files ENDF/B-VI, Release2
// To be used in your physics list in case you need this physics.
// In this case you want to register an object of this class with
// the corresponding process.
// Class Description - End
// 15-Nov-06 First implementation is done by T. Koi (SLAC/SCCS)
// 070625 implement clearCurrentXSData to fix memory leaking by T. Koi
// P. Arce, June-2014 Conversion neutron_hp to particle_hp
//
// ---------------------------------------------------------------------
#include "G4ParticleHPThermalScatteringData.hh"
@@ -209,8 +198,7 @@ void G4ParticleHPThermalScatteringData::BuildPhysicsTable(const G4ParticleDefini
}
// Searching TS Elements
static G4ThreadLocal G4ElementTable* theElementTable = nullptr;
if (theElementTable == nullptr) theElementTable = G4Element::GetElementTable();
auto theElementTable = G4Element::GetElementTable();
std::size_t numberOfElements = G4Element::GetNumberOfElements();
for (std::size_t i = 0; i < numberOfElements; ++i) {
@@ -308,7 +296,7 @@ void G4ParticleHPThermalScatteringData::BuildPhysicsTable(const G4ParticleDefini
}
std::map<G4double, G4ParticleHPVector*>*
G4ParticleHPThermalScatteringData::readData(G4String full_name)
G4ParticleHPThermalScatteringData::readData(const G4String& full_name)
{
auto aData = new std::map<G4double, G4ParticleHPVector*>;
@@ -405,9 +393,9 @@ G4int G4ParticleHPThermalScatteringData::getTS_ID(const G4Material* material,
return result;
}
G4double G4ParticleHPThermalScatteringData::GetX(
const G4DynamicParticle* aP, G4double aT,
std::map<G4double, G4ParticleHPVector*>* amapTemp_EnergyCross)
G4double G4ParticleHPThermalScatteringData::
GetX(const G4DynamicParticle* aP, G4double aT,
std::map<G4double, G4ParticleHPVector*>* amapTemp_EnergyCross)
{
G4double result = 0;
if (amapTemp_EnergyCross->empty()) return result;
@@ -454,8 +442,8 @@ G4double G4ParticleHPThermalScatteringData::GetX(
return result;
}
void G4ParticleHPThermalScatteringData::AddUserThermalScatteringFile(G4String nameG4Element,
G4String filename)
void G4ParticleHPThermalScatteringData::AddUserThermalScatteringFile(const G4String& nameG4Element,
const G4String& filename)
{
names->AddThermalElement(nameG4Element, filename);
}
@@ -41,7 +41,6 @@
#include "G4ElementTable.hh"
#include "G4Neutron.hh"
// #include "G4ParticleHPData.hh"
G4ParticleHPThermalScatteringNames::G4ParticleHPThermalScatteringNames()
{
@@ -211,19 +210,16 @@ G4ParticleHPThermalScatteringNames::G4ParticleHPThermalScatteringNames()
// "G4_BENZENE" , "C" ) , "benzen" ) );
}
G4ParticleHPThermalScatteringNames::~G4ParticleHPThermalScatteringNames()
{
;
}
G4bool G4ParticleHPThermalScatteringNames::IsThisThermalElement(G4String aname)
G4bool G4ParticleHPThermalScatteringNames::
IsThisThermalElement(const G4String& aname) const
{
G4bool result = false;
if (names.find(aname) != names.end()) result = true;
return result;
}
G4bool G4ParticleHPThermalScatteringNames::IsThisThermalElement(G4String material, G4String element)
G4bool G4ParticleHPThermalScatteringNames::
IsThisThermalElement(const G4String& material, const G4String& element) const
{
G4bool result = false;
if (nist_names.find(std::pair<G4String, G4String>(material, element)) != nist_names.end())
@@ -232,8 +228,8 @@ G4bool G4ParticleHPThermalScatteringNames::IsThisThermalElement(G4String materia
}
// Name of G4Element , Name of NDL file
void G4ParticleHPThermalScatteringNames::AddThermalElement(G4String nameG4Element,
G4String filename)
void G4ParticleHPThermalScatteringNames::AddThermalElement(const G4String& nameG4Element,
const G4String& filename)
{
if (names.find(nameG4Element) == names.end())
names.insert(std::pair<G4String, G4String>(nameG4Element, filename));