Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -50,19 +50,29 @@ G4ParticleHPInelastic::G4ParticleHPInelastic(G4ParticleDefinition* projectile, c
,numEle(0)
,theProjectile(projectile)
{
const char* dataDirVariable;
G4String baseName;
if ( getenv("G4PARTICLEHPDATA") ) {
baseName = getenv( "G4PARTICLEHPDATA" );
}
//const char* dataDirVariable;
G4String particleName;
if( theProjectile == G4Neutron::Neutron() ) {
dataDirVariable = "G4NEUTRONHPDATA";
}else if( theProjectile == G4Proton::Proton() ) {
dataDirVariable = "G4PROTONHPDATA";
particleName = "Proton";
}else if( theProjectile == G4Deuteron::Deuteron() ) {
dataDirVariable = "G4DEUTERONHPDATA";
particleName = "Deuteron";
}else if( theProjectile == G4Triton::Triton() ) {
dataDirVariable = "G4TRITONHPDATA";
particleName = "Triton";
}else if( theProjectile == G4He3::He3() ) {
dataDirVariable = "G4HE3HPDATA";
particleName = "He3";
}else if( theProjectile == G4Alpha::Alpha() ) {
dataDirVariable = "G4ALPHAHPDATA";
particleName = "Alpha";
} else {
G4String message("G4ParticleHPInelastic may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + theProjectile->GetParticleName());
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
@@ -72,12 +82,16 @@ G4ParticleHPInelastic::G4ParticleHPInelastic(G4ParticleDefinition* projectile, c
SetMaxEnergy( 20.*MeV );
// G4cout << " entering G4ParticleHPInelastic constructor"<<G4endl;
if(!getenv(dataDirVariable)){
G4String message("Please set the environement variable " + G4String(dataDirVariable) + " to point to the " + theProjectile->GetParticleName() + " cross-section files.");
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
}
dirName = getenv(dataDirVariable);
G4cout << dirName << G4endl;
if ( !getenv("G4PARTICLEHPDATA") && !getenv(dataDirVariable) ) {
G4String message( "Please set the environement variable " + G4String(dataDirVariable) + " to point to the " + theProjectile->GetParticleName() + " cross-section files." );
throw G4HadronicException(__FILE__, __LINE__,message.c_str());
}
if ( getenv(dataDirVariable) ) {
dirName = getenv(dataDirVariable);
} else {
dirName = baseName + "/" + particleName;
}
G4cout << dirName << G4endl;
G4String tString = "/Inelastic";
dirName = dirName + tString;
@@ -450,7 +464,7 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
numEle = G4Element::GetNumberOfElements();
return;
}
/*
const char* dataDirVariable;
if( &projectile == G4Neutron::Neutron() ) {
dataDirVariable = "G4NEUTRONHPDATA";
@@ -478,8 +492,8 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
G4String tString = "/Inelastic";
dirName = dirName + tString;
*/
G4cout << "@@@ G4ParticleHPInelastic instantiated for particle " << projectile.GetParticleName() << " data directory variable is " << dataDirVariable << " pointing to " << dirName << G4endl;
for (G4int i = numEle ; i < (G4int)G4Element::GetNumberOfElements(); i++)
{
theInelastic->push_back( new G4ParticleHPChannelList );