Import Geant4 3.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:10:37 +02:00
parent 137e303ecc
commit 36c080dca6
3464 changed files with 119310 additions and 52696 deletions
@@ -1,3 +1,25 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// neutron_hp -- source file
// J.P. Wellisch, Nov-1996
// A prototype of the low energy neutron transport model.
@@ -42,13 +64,16 @@ void G4NeutronHPInelasticCompFS::Init (G4double A, G4double Z, G4String & dirNam
G4String filename = aFile.GetName();
theBaseA = aFile.GetA();
theBaseZ = aFile.GetZ();
if(!dbool)
if(!dbool || ( Z<2.5 && ( abs(theBaseZ - Z)>0.0001 || abs(theBaseA - A)>0.0001)))
{
if(getenv("NeutronHPNamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
hasAnyData = false;
hasFSData = false;
hasXsec = false;
return;
}
theBaseA = A;
theBaseZ = G4int(Z+.5);
#ifdef G4USE_STD_NAMESPACE
G4std::ifstream theData(filename, G4std::ios::in);
#else
@@ -59,6 +84,7 @@ void G4NeutronHPInelasticCompFS::Init (G4double A, G4double Z, G4String & dirNam
hasAnyData = false;
hasFSData = false;
hasXsec = false;
theData.close();
return;
}
// here we go
@@ -118,6 +144,7 @@ void G4NeutronHPInelasticCompFS::Init (G4double A, G4double Z, G4String & dirNam
G4Exception("Data-type unknown to G4NeutronHPInelasticCompFS");
}
}
theData.close();
}
G4int G4NeutronHPInelasticCompFS::SelectExitChannel(G4double eKinetic)
@@ -174,7 +201,8 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4Track & theTrack, G4Part
// targetMass = theFinalStatePhotons[50]->GetTargetMass();
G4Nucleus aNucleus;
G4ReactionProduct theTarget;
theTarget = aNucleus.GetThermalNucleus(targetMass);
G4ThreeVector neuVelo = (1./incidentParticle->GetDefinition()->GetPDGMass())*theNeutron.GetMomentum();
theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
// prepare the residual mass
G4double residualMass=0;
@@ -238,9 +266,18 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4Track & theTrack, G4Part
{
G4double eExcitation = 0;
if(iLevel>=0) eExcitation = theGammas.GetLevel(iLevel)->GetLevelEnergy();
aHadron.SetKineticEnergy(aHadron.GetKineticEnergy() - eExcitation);
// consistency of data assumed....@@@@@
while (eKinetic-eExcitation < 0 && iLevel>0)
{
iLevel--;
eExcitation = theGammas.GetLevel(iLevel)->GetLevelEnergy();
}
if(getenv("InelasticCompFSLogging") && eKinetic-eExcitation < 0)
{
G4Exception("SEVERE: InelasticCompFS: Consistency of data not good enough, please file report");
}
if(eKinetic-eExcitation < 0) eExcitation = 0;
if(iLevel!= -1) aHadron.SetKineticEnergy(eKinetic - eExcitation);
}
theAngularDistribution[it]->SampleAndUpdate(aHadron);
@@ -440,7 +477,7 @@ void G4NeutronHPInelasticCompFS::CompositeApply(const G4Track & theTrack, G4Part
delete theParticles->at(i);
}
delete theParticles;
if(needsSeparateRecoil)
if(needsSeparateRecoil && residualZ!=0)
{
G4ReactionProduct theResidual;
theResidual.SetDefinition(G4ParticleTable::GetParticleTable()->GetIon(residualZ, residualA, 0));