Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -45,6 +45,7 @@
#include "G4ParticleHPData.hh"
#include "G4ParticleHPManager.hh"
#include "G4Threading.hh"
#include "G4HadronicParameters.hh"
#include "G4Pow.hh"
G4ParticleHPCaptureData::G4ParticleHPCaptureData()
@@ -125,9 +126,13 @@ void G4ParticleHPCaptureData::BuildPhysicsTable(const G4ParticleDefinition& aP)
//080428
if ( G4ParticleHPManager::GetInstance()->GetNeglectDoppler() )
{
G4cout << "Find a flag of \"G4NEUTRONHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of capture reaction of neutrons (<20MeV)." << G4endl;
onFlightDB = false;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "Find a flag of \"G4NEUTRONHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of capture reaction of neutrons (<20MeV)." << G4endl;
}
#endif
}
if ( G4Threading::IsWorkerThread() ) {
@@ -149,11 +154,13 @@ void G4ParticleHPCaptureData::BuildPhysicsTable(const G4ParticleDefinition& aP)
static G4ThreadLocal G4ElementTable *theElementTable = 0 ; if (!theElementTable) theElementTable= G4Element::GetElementTable();
for( size_t i=0; i<numberOfElements; ++i )
{
#ifdef G4VERBOSE
if(std::getenv("CaptureDataIndexDebug"))
{
G4int index_debug = ((*theElementTable)[i])->GetIndex();
G4cout << "IndexDebug "<< i <<" "<<index_debug<<G4endl;
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) G4cout << "IndexDebug "<< i <<" "<<index_debug<<G4endl;
}
#endif
G4PhysicsVector* physVec = G4ParticleHPData::
Instance(G4Neutron::Neutron())->MakePhysicsVector((*theElementTable)[i], this);
theCrossSections->push_back(physVec);
@@ -165,8 +172,11 @@ void G4ParticleHPCaptureData::BuildPhysicsTable(const G4ParticleDefinition& aP)
void G4ParticleHPCaptureData::DumpPhysicsTable(const G4ParticleDefinition& aP)
{
if(&aP!=G4Neutron::Neutron())
throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() == 0 ) return;
//
// Dump element based cross section
// range 10e-5 eV to 20 MeV
@@ -208,8 +218,8 @@ void G4ParticleHPCaptureData::DumpPhysicsTable(const G4ParticleDefinition& aP)
G4cout << G4endl;
}
// G4cout << "G4ParticleHPCaptureData::DumpPhysicsTable still to be implemented"<<G4endl;
//G4cout << "G4ParticleHPCaptureData::DumpPhysicsTable still to be implemented"<<G4endl;
#endif
}
#include "G4NucleiProperties.hh"
@@ -224,7 +224,7 @@
G4bool residual = false;
G4ParticleDefinition * aRecoil = G4IonTable::GetIonTable()
->GetIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0);
for ( G4int j = 0 ; j != theResult.Get()->GetNumberOfSecondaries() ; j++ )
for ( std::size_t j = 0 ; j != theResult.Get()->GetNumberOfSecondaries() ; j++ )
{
if ( theResult.Get()->GetSecondary(j)->GetParticle()->GetDefinition() == aRecoil ) residual = true;
}
@@ -233,7 +233,7 @@
{
G4int nNonZero = 0;
G4LorentzVector p_photons(0,0,0,0);
for ( G4int j = 0 ; j != theResult.Get()->GetNumberOfSecondaries() ; j++ )
for ( std::size_t j = 0 ; j != theResult.Get()->GetNumberOfSecondaries() ; j++ )
{
p_photons += theResult.Get()->GetSecondary(j)->GetParticle()->Get4Momentum();
// To many 0 momentum photons -> Check PhotonDist
@@ -44,6 +44,7 @@
#include "G4ElementTable.hh"
#include "G4ParticleHPData.hh"
#include "G4ParticleHPManager.hh"
#include "G4HadronicParameters.hh"
#include "G4Pow.hh"
G4ParticleHPElasticData::G4ParticleHPElasticData()
@@ -123,9 +124,13 @@ void G4ParticleHPElasticData::BuildPhysicsTable(const G4ParticleDefinition& aP)
//080428
if ( G4ParticleHPManager::GetInstance()->GetNeglectDoppler() )
{
G4cout << "Find a flag of \"G4NEUTRONHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of elastic scattering of neutrons (<20MeV)." << G4endl;
onFlightDB = false;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "Find a flag of \"G4NEUTRONHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of elastic scattering of neutrons (<20MeV)." << G4endl;
}
#endif
}
if ( G4Threading::IsWorkerThread() ) {
@@ -159,6 +164,9 @@ void G4ParticleHPElasticData::DumpPhysicsTable(const G4ParticleDefinition& aP)
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;
//
// Dump element based cross section
// range 10e-5 eV to 20 MeV
@@ -200,8 +208,8 @@ void G4ParticleHPElasticData::DumpPhysicsTable(const G4ParticleDefinition& aP)
G4cout << G4endl;
}
// G4cout << "G4ParticleHPElasticData::DumpPhysicsTable still to be implemented"<<G4endl;
//G4cout << "G4ParticleHPElasticData::DumpPhysicsTable still to be implemented"<<G4endl;
#endif
}
#include "G4Nucleus.hh"
@@ -42,6 +42,7 @@
#include "G4ElementTable.hh"
#include "G4ParticleHPData.hh"
#include "G4ParticleHPManager.hh"
#include "G4HadronicParameters.hh"
#include "G4Pow.hh"
G4ParticleHPFissionData::G4ParticleHPFissionData()
@@ -115,9 +116,13 @@ void G4ParticleHPFissionData::BuildPhysicsTable(const G4ParticleDefinition& aP)
{
if ( G4ParticleHPManager::GetInstance()->GetNeglectDoppler() ) {
G4cout << "Find a flag of \"G4NEUTRONHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of fission reaction of neutrons (<20MeV)." << G4endl;
onFlightDB = false;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "Find a flag of \"G4NEUTRONHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of fission reaction of neutrons (<20MeV)." << G4endl;
}
#endif
}
if(&aP!=G4Neutron::Neutron())
@@ -153,8 +158,11 @@ void G4ParticleHPFissionData::BuildPhysicsTable(const G4ParticleDefinition& aP)
void G4ParticleHPFissionData::DumpPhysicsTable(const G4ParticleDefinition& aP)
{
if(&aP!=G4Neutron::Neutron())
throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() == 0 ) return;
//
// Dump element based cross section
// range 10e-5 eV to 20 MeV
@@ -204,6 +212,7 @@ void G4ParticleHPFissionData::DumpPhysicsTable(const G4ParticleDefinition& aP)
}
//G4cout << "G4ParticleHPFissionData::DumpPhysicsTable still to be implemented"<<G4endl;
#endif
}
#include "G4NucleiProperties.hh"
@@ -41,6 +41,7 @@
#include "G4ParticleHPInelastic.hh"
#include "G4SystemOfUnits.hh"
#include "G4ParticleHPManager.hh"
#include "G4HadronicParameters.hh"
#include "G4Threading.hh"
G4ParticleHPInelastic::G4ParticleHPInelastic(G4ParticleDefinition* projectile, const char* name )
@@ -49,54 +50,60 @@ G4ParticleHPInelastic::G4ParticleHPInelastic(G4ParticleDefinition* projectile, c
,numEle(0)
,theProjectile(projectile)
{
G4String baseName;
if ( std::getenv("G4PARTICLEHPDATA") ) {
baseName = std::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());
}
G4String baseName;
if ( std::getenv("G4PARTICLEHPDATA") ) {
baseName = std::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());
}
SetMinEnergy( 0.0 );
SetMaxEnergy( 20.*MeV );
// G4cout << " entering G4ParticleHPInelastic constructor"<<G4endl;
if ( !std::getenv("G4PARTICLEHPDATA") && !std::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 ( std::getenv(dataDirVariable) ) {
dirName = std::getenv(dataDirVariable);
} else {
dirName = baseName + "/" + particleName;
}
G4cout << dirName << G4endl;
//G4cout << " entering G4ParticleHPInelastic constructor"<<G4endl;
if ( !std::getenv("G4PARTICLEHPDATA") && !std::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 ( std::getenv(dataDirVariable) ) {
dirName = std::getenv(dataDirVariable);
} else {
dirName = baseName + "/" + particleName;
}
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) G4cout << dirName << G4endl;
#endif
G4String tString = "/Inelastic";
dirName = dirName + tString;
//numEle = G4Element::GetNumberOfElements();
G4cout << "@@@ G4ParticleHPInelastic instantiated for particle " << theProjectile->GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << "@@@ G4ParticleHPInelastic instantiated for particle " << theProjectile->GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
#endif
/*
theInelastic = new G4ParticleHPChannelList[numEle];
@@ -276,7 +283,10 @@ throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do w
xSec[i] *= rWeight;
sum+=xSec[i];
#ifdef G4PHPDEBUG
if( std::getenv("G4ParticleHPDebug") ) G4cout << " G4ParticleHPInelastic XSEC ELEM " << i << " = " << xSec[i] << G4endl;
#ifdef G4VERBOSE
if( std::getenv("G4ParticleHPDebug") && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << " G4ParticleHPInelastic XSEC ELEM " << i << " = " << xSec[i] << G4endl;
#endif
#endif
}
@@ -294,7 +304,10 @@ throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do w
}
#ifdef G4PHPDEBUG
if( std::getenv("G4ParticleHPDebug") ) G4cout << " G4ParticleHPInelastic SELECTED ELEM " << it << " = " << theMaterial->GetElement(it)->GetName() << " FROM MATERIAL " << theMaterial->GetName() << G4endl;
#ifdef G4VERBOSE
if( std::getenv("G4ParticleHPDebug") && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << " G4ParticleHPInelastic SELECTED ELEM " << it << " = " << theMaterial->GetElement(it)->GetName() << " FROM MATERIAL " << theMaterial->GetName() << G4endl;
#endif
#endif
//return theInelastic[index].ApplyYourself(theMaterial->GetElement(it), aTrack);
G4HadFinalState* result = ((*theInelastic)[index])->ApplyYourself(theMaterial->GetElement(it), aTrack);
@@ -319,7 +332,10 @@ throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do w
G4HadSecondary* seco = result->GetSecondary(0);
if(seco) {
G4ThreeVector secoMom = seco->GetParticle()->GetMomentum();
G4cout << " G4ParticleHPinelastic COS THETA " << std::cos(secoMom.theta()) <<" " << secoMom << G4endl;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << " G4ParticleHPinelastic COS THETA " << std::cos(secoMom.theta()) <<" " << secoMom << G4endl;
#endif
}
}
@@ -495,7 +511,10 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
dirName = dirName + tString;
*/
G4cout << "@@@ G4ParticleHPInelastic instantiated for particle " << projectile.GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << "@@@ G4ParticleHPInelastic instantiated for particle " << projectile.GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
#endif
for (G4int i = numEle ; i < (G4int)G4Element::GetNumberOfElements(); i++)
{
theInelastic->push_back( new G4ParticleHPChannelList );
@@ -558,7 +577,9 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do with this element");
}
*/
if ( G4ParticleHPManager::GetInstance()->GetVerboseLevel() > 1 ) {
#ifdef G4VERBOSE
if ( G4ParticleHPManager::GetInstance()->GetVerboseLevel() > 1 &&
G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "ParticleHP::Inelastic for " << projectile.GetParticleName() << ". Do not know what to do with element of \"" << (*(G4Element::GetElementTable()))[i]->GetName() << "\"." << G4endl;
G4cout << "The components of the element are" << G4endl;
//G4cout << "TKDB dataDirVariable = " << dataDirVariable << G4endl;
@@ -567,6 +588,7 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
}
G4cout << "No possible final state data of the element is found in " << dataDirVariable << "." << G4endl;
}
#endif
}
}
hpmanager->RegisterInelasticFinalStates( &projectile , theInelastic );
@@ -41,6 +41,7 @@
#include "G4Neutron.hh"
#include "G4ElementTable.hh"
#include "G4ParticleHPData.hh"
#include "G4HadronicParameters.hh"
#include "G4Pow.hh"
G4ParticleHPInelasticData::G4ParticleHPInelasticData(G4ParticleDefinition* projectile)
@@ -86,7 +87,11 @@ G4ParticleHPInelasticData::G4ParticleHPInelasticData(G4ParticleDefinition* proje
G4String baseName = std::getenv( "G4PARTICLEHPDATA" );
dirName = baseName + "/" + particleName;
}
G4cout << "@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
}
#endif
SetMinKinEnergy( 0*CLHEP::MeV );
SetMaxKinEnergy( 20*CLHEP::MeV );
@@ -169,9 +174,13 @@ void G4ParticleHPInelasticData::BuildPhysicsTable( const G4ParticleDefinition& p
//080428
if ( G4ParticleHPManager::GetInstance()->GetNeglectDoppler() )
{
G4cout << "Find a flag of \"G4PHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of inelastic scattering of neutrons (<20MeV)." << G4endl;
onFlightDB = false;
onFlightDB = false;
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "Find a flag of \"G4PHP_NEGLECT_DOPPLER\"." << G4endl;
G4cout << "On the fly Doppler broadening will be neglect in the cross section calculation of inelastic scattering of neutrons (<20MeV)." << G4endl;
}
#endif
}
if ( G4Threading::IsWorkerThread() ) {
@@ -215,6 +224,8 @@ void G4ParticleHPInelasticData::DumpPhysicsTable(const G4ParticleDefinition& pro
if(&projectile!=theProjectile)
throw G4HadronicException(__FILE__, __LINE__, "Attempt to use ParticleHP data for a wrong projectile!!!");
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() == 0 ) return;
//
// Dump element based cross section
// range 10e-5 eV to 20 MeV
@@ -258,6 +269,7 @@ void G4ParticleHPInelasticData::DumpPhysicsTable(const G4ParticleDefinition& pro
}
//G4cout << "G4ParticleHPInelasticData::DumpPhysicsTable still to be implemented"<<G4endl;
#endif
}
#include "G4NucleiProperties.hh"
@@ -43,6 +43,7 @@
#include "G4ParticleHPManager.hh"
#include "G4SandiaTable.hh"
#include "G4HadronicException.hh"
#include "G4HadronicParameters.hh"
#include <fstream>
const G4String G4ParticleHPNames::theString[100] = {"Hydrogen", "Helium",
@@ -64,12 +65,13 @@
"Einsteinium","Fermium"};
G4String G4ParticleHPNames::GetName(G4int i) { return theString[i]; }
G4String G4ParticleHPNames::GetName(G4int i) { return theString[i]; }
//G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool & aFlag)
G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, G4String base, G4String rest, G4bool & aFlag)
{
#ifdef G4VERBOSE
G4int verboseLevel = G4ParticleHPManager::GetInstance()->GetVerboseLevel();
#endif
//G4cout << Z << " " << A << " " << M << " " << base << " " << rest << G4endl;
@@ -85,15 +87,19 @@ G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, G4Str
G4ParticleHPDataUsed result;
aFlag = true;
if (std::getenv("NeutronHPNames") ) G4cout << "Names::GetName entered for Z = " << Z << ", A = " << A <<G4endl;
#ifdef G4VERBOSE
if (std::getenv("NeutronHPNames") && G4HadronicParameters::Instance()->GetVerboseLevel() > 0)
G4cout << "Names::GetName entered for Z = " << Z << ", A = " << A <<G4endl;
#endif
G4int myA = A;
G4int myZ = Z;
G4String * theName = 0;
G4String theFileName("");
// G4int inc = 1;
//G4int inc = 1;
G4int flip_Z = 1;
G4int delta_Z = 0;
@@ -101,10 +107,14 @@ G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, G4Str
G4int flip_A = 1;
G4int delta_A = 0;
//std::ifstream * check = new std::ifstream(".dummy");
//std::ifstream * check = new std::ifstream(".dummy");
std::istringstream* check = NULL;
G4bool first = true;
if (std::getenv("NeutronHPNames")) G4cout << "entered GetName!!!"<<G4endl;
#ifdef G4VERBOSE
if (std::getenv("NeutronHPNames") && G4HadronicParameters::Instance()->GetVerboseLevel() > 0)
G4cout << "entered GetName!!!"<<G4endl;
#endif
do
{
@@ -118,13 +128,13 @@ G4ParticleHPDataUsed G4ParticleHPNames::GetName(G4int A, G4int Z, G4int M, G4Str
result.SetA(myA);
result.SetZ(myZ);
result.SetM(M);
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 1 "<<*theName<<G4endl;
//if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 1 "<<*theName<<G4endl;
// T.K. debug for memory leak
if ( check != NULL ) {
//check->close();
delete check;
}
// T.K. debug for memory leak
if ( check != NULL ) {
//check->close();
delete check;
}
//check = new std::ifstream(*theName);
check = new std::istringstream(std::ios::in);
@@ -143,7 +153,7 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 1 "<<*theName<<G4endl;
*biff = base+"/CrossSection/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1];
delete theName;
theName = biff;
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 2 "<<*theName<<G4endl;
//if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 2 "<<*theName<<G4endl;
result.SetName(*theName);
G4double natA = myZ/G4SandiaTable::GetZtoA(myZ);
result.SetA(natA);
@@ -166,7 +176,7 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 2 "<<*theName<<G4endl;
if ( rest=="/CrossSection" ) *biff = base+rest+"/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1];
delete theName;
theName = biff;
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 3 "<<*theName<<G4endl;
//if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 3 "<<*theName<<G4endl;
result.SetName(*theName);
natA = myZ/G4SandiaTable::GetZtoA(myZ);
result.SetA(natA);
@@ -178,17 +188,17 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 3 "<<*theName<<G4endl;
}
else
{
// 070706 T. Koi Modified
/*
// 070706 T. Koi Modified
/*
biff = new G4String(); // delete here as theName
*biff = base+"/"+rest+itoa(myZ)+"_"+itoa(myA)+"_"+theString[myZ-1];
if(theName!=0) delete theName;
theName = biff;
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4 "<<*theName<<G4endl;
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4 "<<*theName<<G4endl;
result.SetName(*theName);
result.SetA(myA);
result.SetZ(myZ);
*/
*/
G4double tmpA = myA;
//std::ifstream* file = NULL;
@@ -198,68 +208,72 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4 "<<*theName<<G4endl;
if ( rest == "/CrossSection" )
{
//fileName = base+"/"+rest+"/"+itoa(myZ)+"_"+itoa(myA)+sM+"_"+theString[myZ-1];
fileName = base+rest+"/"+itoa(myZ)+"_"+itoa(myA)+sM+"_"+theString[myZ-1];
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4a "<<*theName<<G4endl;
//fileName = base+"/"+rest+"/"+itoa(myZ)+"_"+itoa(myA)+sM+"_"+theString[myZ-1];
fileName = base+rest+"/"+itoa(myZ)+"_"+itoa(myA)+sM+"_"+theString[myZ-1];
//if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4a "<<*theName<<G4endl;
} else {
} else {
// For FS
fileName = base+"/"+rest+"/"+itoa(myZ)+"_"+itoa(myA)+sM+"_"+theString[myZ-1];
file = new std::istringstream(std::ios::in);
G4ParticleHPManager::GetInstance()->GetDataStream2(fileName,*file);
// For FS
fileName = base+"/"+rest+"/"+itoa(myZ)+"_"+itoa(myA)+sM+"_"+theString[myZ-1];
file = new std::istringstream(std::ios::in);
G4ParticleHPManager::GetInstance()->GetDataStream2(fileName,*file);
if (*file) {
if (*file) {
// isotope FS
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b1 "<<*theName<<G4endl;
} else {
// isotope FS
//if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b1 "<<*theName<<G4endl;
} else {
// _nat_ FS
fileName = base+"/"+rest+"/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1];
// _nat_ FS
fileName = base+"/"+rest+"/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1];
delete file;
//file = new std::ifstream(fileName);
file = new std::istringstream(std::ios::in);
G4ParticleHPManager::GetInstance()->GetDataStream2(fileName,*file);
if (*file) {
delete file;
//file = new std::ifstream(fileName);
file = new std::istringstream(std::ios::in);
G4ParticleHPManager::GetInstance()->GetDataStream2(fileName,*file);
if (*file) {
// FS neither isotope nor _nat_
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2a "<<*theName<<G4endl;
G4double natA = myZ/G4SandiaTable::GetZtoA(myZ);
tmpA = natA;
} else {
if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
fileName="INVALID";
}
}
// FS neither isotope nor _nat_
//if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2a "<<*theName<<G4endl;
G4double natA = myZ/G4SandiaTable::GetZtoA(myZ);
tmpA = natA;
} else {
//if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
fileName="INVALID";
}
}
delete file;
}
delete file;
}
result.SetName(fileName);
result.SetA(tmpA);
result.SetZ(myZ);
result.SetM(M);
result.SetName(fileName);
result.SetA(tmpA);
result.SetZ(myZ);
result.SetM(M);
}
do
{
if (delta_Z > theMaxOffSet) {
if (!G4ParticleHPManager::GetInstance()->GetSkipMissingIsotopes() ) {
G4cout << "G4ParticleHPNames: There are no data available for some isotopes in this material " << G4endl;
G4cout << "G4ParticleHPNames: nor are there data for nearby isotopes." << G4endl;
G4cout << "G4ParticleHPNames: Please make sure G4NEUTRONHPDATA points to the directory " << G4endl;
G4cout << "G4ParticleHPNames: in which the neutron scattering data are located." << 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 Hadron Group Coordinator");
if (!G4ParticleHPManager::GetInstance()->GetSkipMissingIsotopes()) {
#ifdef G4VERBOSE
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "G4ParticleHPNames: There are no data available for some isotopes in this material " << G4endl;
G4cout << "G4ParticleHPNames: nor are there data for nearby isotopes." << G4endl;
G4cout << "G4ParticleHPNames: Please make sure G4NEUTRONHPDATA points to the directory " << G4endl;
G4cout << "G4ParticleHPNames: in which the neutron scattering data are located." << G4endl;
G4cout << "G4ParticleHPNames: The material was A = " << A << ", Z = " << Z << G4endl;
}
#endif
throw G4HadronicException(__FILE__, __LINE__, "In case the data sets are at present not available in the neutron data library, please contact Hadron Group Coordinator");
} else {
check = new std::istringstream(std::ios::in);
break;
}
}
//if ( std::abs( myA - A ) > theMaxOffSet )
//if ( std::abs( myA - A ) > theMaxOffSet )
if (delta_A > 2*theMaxOffSet) {
delta_A = 0;
flip_A = 1;
@@ -283,7 +297,7 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
myZ = 1;
}
// myZ += inc;
//myZ += inc;
} else {
if ( flip_A > 0 )
{
@@ -297,7 +311,7 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
myA = 1;
}
// myA += inc;
//myA += inc;
}
}
@@ -306,13 +320,16 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
}
while((!check) || (!(*check))); // Loop checking, 11.05.2015, T. Koi
if(std::getenv("NeutronHPNamesLogging") || std::getenv("NeutronHPNames"))
#ifdef G4VERBOSE
if( (std::getenv("NeutronHPNamesLogging") || std::getenv("NeutronHPNames")) &&
G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
{
G4cout << "Names::GetName: last theName proposal = "<< G4endl;
G4cout << *theName <<" "<<A<<" "<<Z<<" "<<result.GetName()<<G4endl;
}
// administration and anouncement for lacking of exact data in NDL
#endif
// administration and anouncement for lacking of exact data in NDL
if ( Z != result.GetZ() || A != result.GetA() )
{
if ( rest == "/CrossSection" )
@@ -322,9 +339,11 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
reac.erase ( 0 , dir.length() );
if ( G4ParticleHPManager::GetInstance()->GetSkipMissingIsotopes() && !( Z == result.GetZ() && result.IsThisNaturalAbundance() ) )
{
if ( verboseLevel > 0 ) {
#ifdef G4VERBOSE
if ( verboseLevel > 0 && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "NeutronHP: " << reac << " file for Z = " << Z << ", A = " << A << " is not found and CrossSection set to 0." << G4endl;
}
#endif
G4String new_name = base+"/"+rest+"/"+"0_0_Zero";
result.SetName( new_name );
}
@@ -342,9 +361,11 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
}
else
{
if ( verboseLevel > 0 ) {
#ifdef G4VERBOSE
if ( verboseLevel > 0 && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
G4cout << "NeutronHP: " << reac << " file for Z = " << Z << ", A = " << A << " is not found and NeutronHP will use " << result.GetName() << G4endl;
}
#endif
}
}
}
@@ -358,4 +379,4 @@ if(std::getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
check = NULL;
}
return result;
}
}
@@ -40,6 +40,7 @@
#include "G4ParticleHPProduct.hh"
#include "G4Poisson.hh"
#include "G4Proton.hh"
#include "G4HadronicParameters.hh"
G4int G4ParticleHPProduct::GetMultiplicity(G4double anEnergy )
{
@@ -78,8 +79,11 @@ G4int G4ParticleHPProduct::GetMultiplicity(G4double anEnergy )
multi = G4Poisson ( mean );
#else
if( theMultiplicityMethod == G4HPMultiPoisson ) {
multi = G4Poisson ( mean );
if( std::getenv("G4PHPTEST") ) G4cout << " MULTIPLICITY MULTIPLIED " << multi << " " << theMassCode << G4endl;
multi = G4Poisson ( mean );
#ifdef G4VERBOSE
if( std::getenv("G4PHPTEST") && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << " MULTIPLICITY MULTIPLIED " << multi << " " << theMassCode << G4endl;
#endif
} else { // if( theMultiplicityMethod == G4HPMultiBetweenInts ) {
G4double radnf = CLHEP::RandFlat::shoot();
G4int imulti = G4int(mean);
@@ -92,7 +96,10 @@ G4int G4ParticleHPProduct::GetMultiplicity(G4double anEnergy )
// if( CLHEP::RandFlat::shoot() > mean-multi ) multi++;
}
#ifdef G4PHPDEBUG
if( std::getenv("G4ParticleHPDebug") ) G4cout << "G4ParticleHPProduct::GetMultiplicity " << theMassCode << " " << theMass << " multi " << multi << " mean " << mean << G4endl;
#ifdef G4VERBOSE
if( std::getenv("G4ParticleHPDebug") && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << "G4ParticleHPProduct::GetMultiplicity " << theMassCode << " " << theMass << " multi " << multi << " mean " << mean << G4endl;
#endif
#endif
}
@@ -119,12 +126,18 @@ G4ReactionProductVector * G4ParticleHPProduct::Sample(G4double anEnergy, G4int m
{
#ifdef G4PHPDEBUG
if( std::getenv("G4PHPTEST") )
if( std::getenv("G4ParticleHPDebug") && tmp != 0 ) G4cout << multi << " " << i << " @@@ G4ParticleHPProduct::Sample " << anEnergy << " Mass " << theMassCode << " " << theMass << G4endl;
#ifdef G4VERBOSE
if( std::getenv("G4ParticleHPDebug") && tmp != 0 && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << multi << " " << i << " @@@ G4ParticleHPProduct::Sample " << anEnergy << " Mass " << theMassCode << " " << theMass << G4endl;
#endif
#endif
tmp = theDist->Sample(anEnergy, theMassCode, theMass);
if(tmp != 0) { result->push_back(tmp); }
#ifndef G4PHPDEBUG //GDEB
if( std::getenv("G4ParticleHPDebug") && tmp != 0 ) G4cout << multi << " " << i << " @@@ G4ParticleHPProduct::Sample " << tmp->GetDefinition()->GetParticleName() << " E= " << tmp->GetKineticEnergy() << G4endl;
#ifdef G4VERBOSE
if( std::getenv("G4ParticleHPDebug") && tmp != 0 && G4HadronicParameters::Instance()->GetVerboseLevel() > 0 )
G4cout << multi << " " << i << " @@@ G4ParticleHPProduct::Sample " << tmp->GetDefinition()->GetParticleName() << " E= " << tmp->GetKineticEnergy() << G4endl;
#endif
#endif
}
if(multi == 0)