Import Geant4 10.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2016-06-30 14:12:05 +02:00
parent a654a7ab1f
commit 4ec577e5c4
2021 changed files with 100995 additions and 78277 deletions
@@ -112,6 +112,8 @@ G4FFG_FUNCTIONENTER__
IsHeavy = (Particle->GetAtomicMass() > HalfWeight_);
IsNotFeasable = (Particle->GetAtomicMass() > RemainingA_ + 1
|| Particle->GetAtomicNumber() > RemainingZ_ + 1);
Counter++;
} while (IsHeavy || IsNotFeasable); // Loop checking, 11.05.2015, T. Koi
// Something went wrong, so figure out how to fix it
@@ -81,13 +81,13 @@
G4ParticleHPCapture::~G4ParticleHPCapture()
{
//delete [] theCapture;
// G4cout << "Leaving G4ParticleHPCapture::~G4ParticleHPCapture"<<G4endl;
for ( std::vector<G4ParticleHPChannel*>::iterator
ite = theCapture->begin() ; ite != theCapture->end() ; ite++ )
{
delete *ite;
if ( theCapture != NULL ) {
for ( std::vector<G4ParticleHPChannel*>::iterator
ite = theCapture->begin() ; ite != theCapture->end() ; ite++ ) {
delete *ite;
}
theCapture->clear();
}
theCapture->clear();
}
#include "G4ParticleHPThermalBoost.hh"
@@ -103,7 +103,7 @@
G4int index = theMaterial->GetElement(0)->GetIndex();
if(n!=1)
{
xSec = new G4double[n];
G4double* xSec = new G4double[n];
G4double sum=0;
G4int i;
const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
@@ -56,12 +56,16 @@ G4ParticleHPCaptureData::G4ParticleHPCaptureData()
theCrossSections = 0;
onFlightDB = true;
instanceOfWorker = false;
if ( G4Threading::IsWorkerThread() ) {
instanceOfWorker = true;
}
//BuildPhysicsTable(*G4Neutron::Neutron());
}
G4ParticleHPCaptureData::~G4ParticleHPCaptureData()
{
if ( theCrossSections != NULL ) {
if ( theCrossSections != NULL && instanceOfWorker != true ) {
theCrossSections->clearAndDestroy();
delete theCrossSections;
theCrossSections = NULL;
@@ -84,14 +84,16 @@
if ( HasFSData() && !G4ParticleHPManager::GetInstance()->GetUseOnlyPhotoEvaporation() )
{
//NDL has final state data
if ( hasExactMF6 )
{
if ( hasExactMF6 ) {
theMF6FinalState.SetTarget(theTarget);
theMF6FinalState.SetProjectileRP(theNeutron);
thePhotons = theMF6FinalState.Sample( eKinetic );
}
else
} else {
thePhotons = theFinalStatePhotons.GetPhotons(eKinetic);
}
if ( thePhotons == NULL ) {
throw G4HadronicException(__FILE__, __LINE__, "Final state data for photon is not properly allocated");
}
}
else
{
@@ -141,7 +143,7 @@
// add them to the final state
G4int nPhotons = 0;
if(thePhotons!=0) nPhotons=thePhotons->size();
nPhotons=thePhotons->size();
///*
if ( DoNotAdjustFinalState() ) {
@@ -57,7 +57,7 @@
#include "G4IonTable.hh"
#include <set>
G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* projectile)
G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* projectile )
{
theAngular = 0;
fCache.Get()->currentMeanEnergy = -2;
@@ -518,12 +518,12 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
G4double incidentMass = theProjectile->GetPDGMass();
G4double productEnergy = fsEnergy;
G4double productMass = result->GetMass();
G4int targetZ = G4int(theTargetCode/1000);
G4int targetA = G4int(theTargetCode-1000*targetZ);
G4int targetZ = G4int(fCache.Get()->theTargetCode/1000);
G4int targetA = G4int(fCache.Get()->theTargetCode-1000*targetZ);
// To correspond to natural composition (-nat-) data files.
if ( targetA == 0 )
targetA = G4int ( theTarget->GetMass()/amu_c2 + 0.5 );
G4double targetMass = theTarget->GetMass();
targetA = G4int ( fCache.Get()->theTarget->GetMass()/amu_c2 + 0.5 );
G4double targetMass = fCache.Get()->theTarget->GetMass();
G4int residualA = targetA+1-A;
G4int residualZ = targetZ-Z;
G4double residualMass = residualZ*G4Proton::Proton()->GetPDGMass();
@@ -65,12 +65,13 @@ G4ParticleHPData::G4ParticleHPData(G4ParticleDefinition* projectile )
theData.clear();
}
G4ParticleHPData * G4ParticleHPData::Instance(G4ParticleDefinition* projectile)
G4ParticleHPData * G4ParticleHPData::Instance(G4ParticleDefinition* projectile)
{
static G4ThreadLocal G4ParticleHPData *theCrossSectionData_G4MT_TLS_ = 0 ;
if (!theCrossSectionData_G4MT_TLS_) theCrossSectionData_G4MT_TLS_ = new G4ParticleHPData(projectile) ; G4ParticleHPData &theCrossSectionData = *theCrossSectionData_G4MT_TLS_;
if ( !theCrossSectionData_G4MT_TLS_ ) theCrossSectionData_G4MT_TLS_ = new G4ParticleHPData(projectile);
G4ParticleHPData &theCrossSectionData = *theCrossSectionData_G4MT_TLS_;
return &theCrossSectionData;
}
}
G4PhysicsVector * G4ParticleHPData::DoPhysicsVector(G4ParticleHPVector * theVector)
{
@@ -307,7 +307,9 @@ G4ReactionProduct * G4ParticleHPDiscreteTwoBody::Sample(G4double anEnergy, G4dou
//G4double kinE = restEnergy/(1+result->GetMass()/residualMass); // non relativistic @@
G4double A1 = GetTarget()->GetMass()/GetProjectileRP()->GetMass();
G4double A1prim = result->GetMass()/GetProjectileRP()->GetMass();
G4double E1 = (A1+1)*(A1+1)/A1/A1*anEnergy;
//G4double E1 = (A1+1)*(A1+1)/A1/A1*anEnergy;
//Bug fix Bugzilla #1815
G4double E1 = anEnergy;
G4double kinE = (A1+1-A1prim)/(A1+1)/(A1+1)*(A1*E1+(1+A1)*GetQValue());
result->SetKineticEnergy(kinE); // non relativistic @@
@@ -74,14 +74,13 @@
G4ParticleHPElastic::~G4ParticleHPElastic()
{
//delete [] theElastic;
/*
for ( std::vector<G4ParticleHPChannel*>::iterator
it = theElastic.begin() ; it != theElastic.end() ; it++ )
{
delete *it;
if ( theElastic != NULL ) {
for ( std::vector<G4ParticleHPChannel*>::iterator
it = theElastic->begin() ; it != theElastic->end() ; it++ ) {
delete *it;
}
theElastic->clear();
}
*/
theElastic->clear();
}
#include "G4ParticleHPThermalBoost.hh"
@@ -98,7 +97,7 @@
if(n!=1)
{
G4int i;
xSec = new G4double[n];
G4double* xSec = new G4double[n];
G4double sum=0;
const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
G4double rWeight;
@@ -54,12 +54,16 @@ G4ParticleHPElasticData::G4ParticleHPElasticData()
theCrossSections = 0;
onFlightDB = true;
instanceOfWorker = false;
if ( G4Threading::IsWorkerThread() ) {
instanceOfWorker = true;
}
// BuildPhysicsTable( *G4Neutron::Neutron() );
}
G4ParticleHPElasticData::~G4ParticleHPElasticData()
{
if ( theCrossSections != NULL ) {
if ( theCrossSections != NULL && instanceOfWorker != true ) {
theCrossSections->clearAndDestroy();
delete theCrossSections;
theCrossSections = NULL;
@@ -95,7 +95,7 @@
break;
}
}
targetMass = theFinalStateNeutrons.GetTargetMass();
//targetMass = theFinalStateNeutrons.GetTargetMass();
//theData.close();
}
@@ -79,12 +79,13 @@
G4ParticleHPFission::~G4ParticleHPFission()
{
//delete [] theFission;
for ( std::vector<G4ParticleHPChannel*>::iterator
it = theFission->begin() ; it != theFission->end() ; it++ )
{
delete *it;
if ( theFission != NULL ) {
for ( std::vector<G4ParticleHPChannel*>::iterator
it = theFission->begin() ; it != theFission->end() ; it++ ) {
delete *it;
}
theFission->clear();
}
theFission->clear();
}
#include "G4ParticleHPThermalBoost.hh"
@@ -97,7 +98,7 @@
G4int index = theMaterial->GetElement(0)->GetIndex();
if(n!=1)
{
xSec = new G4double[n];
G4double* xSec = new G4double[n];
G4double sum=0;
G4int i;
const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
@@ -52,12 +52,16 @@ G4ParticleHPFissionData::G4ParticleHPFissionData()
theCrossSections = 0;
onFlightDB = true;
instanceOfWorker = false;
if ( G4Threading::IsWorkerThread() ) {
instanceOfWorker = true;
}
//BuildPhysicsTable(*G4Neutron::Neutron());
}
G4ParticleHPFissionData::~G4ParticleHPFissionData()
{
if ( theCrossSections != NULL ) {
if ( theCrossSections != NULL && instanceOfWorker != true ) {
theCrossSections->clearAndDestroy();
delete theCrossSections;
theCrossSections = NULL;
@@ -52,13 +52,12 @@
theFF.Init(A, Z, M, dirName, aFSType, projectile);
if ( G4ParticleHPManager::GetInstance()->GetProduceFissionFragments() && theFF.HasFSData() )
{
G4cout << "Activate Fission Fragments Production for the target isotope of "
G4cout << "Fission fragment production is now activated in HP package for "
<< "Z = " << (G4int)Z
<< ", A = " << (G4int)A
//<< "M = " << M
<< G4endl;
G4cout << "As the result, delayed neutrons are omitted and they should be taken care by RadioaActiveDecay."
<< G4endl;
G4cout << "As currently modeled this option precludes production of delayed neutrons from fission fragments." << G4endl;
produceFissionFragments = true;
}
}
@@ -221,12 +221,11 @@ throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do w
{
// delete [] theInelastic;
if ( theInelastic != NULL ) {
for ( std::vector<G4ParticleHPChannelList*>::iterator
it = theInelastic->begin() ; it != theInelastic->end() ; it++ )
{
delete *it;
}
theInelastic->clear();
for ( std::vector<G4ParticleHPChannelList*>::iterator
it = theInelastic->begin() ; it != theInelastic->end() ; it++ ) {
delete *it;
}
theInelastic->clear();
}
}
@@ -241,7 +240,7 @@ throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do w
G4int it=0;
if(n!=1)
{
xSec = new G4double[n];
G4double* xSec = new G4double[n];
G4double sum=0;
G4int i;
const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
@@ -251,7 +250,7 @@ throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do w
{
index = theMaterial->GetElement(i)->GetIndex();
rWeight = NumAtomsPerVolume[i];
if(aTrack.GetDefinition() == G4Neutron::Neutron() ) {
if ( aTrack.GetDefinition() == G4Neutron::Neutron() ) {
xSec[i] = ((*theInelastic)[index])->GetXsec(aThermalE.GetThermalEnergy(aTrack,
theMaterial->GetElement(i),
theMaterial->GetTemperature()));
@@ -532,6 +531,7 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
if ( itry == 6 ) {
// No Final State at all.
/*
G4bool exceptional = false;
if ( (*(G4Element::GetElementTable()))[i]->GetNumberOfIsotopes() == 1 )
{
@@ -541,6 +541,16 @@ void G4ParticleHPInelastic::BuildPhysicsTable(const G4ParticleDefinition& projec
G4cerr << " ELEMENT Z " << (*(G4Element::GetElementTable()))[i]->GetIsotope( 0 )->GetZ() << " N " << (*(G4Element::GetElementTable()))[i]->GetIsotope( 0 )->GetN() << G4endl; //1H
throw G4HadronicException(__FILE__, __LINE__, "Channel: Do not know what to do with this element");
}
*/
if ( G4ParticleHPManager::GetInstance()->GetVerboseLevel() > 1 ) {
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;
for ( G4int ii = 0 ; ii < (G4int)( (*(G4Element::GetElementTable()))[i]->GetNumberOfIsotopes() ) ; ii++ ) {
G4cout << " Z: " << (*(G4Element::GetElementTable()))[i]->GetIsotope( ii )->GetZ() << ", A: " << (*(G4Element::GetElementTable()))[i]->GetIsotope( ii )->GetN() << G4endl;
}
G4cout << "No possible final state data of the element is found in " << dataDirVariable << "." << G4endl;
}
}
}
hpmanager->RegisterInelasticFinalStates( &projectile , theInelastic );
@@ -197,8 +197,10 @@ void G4ParticleHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
G4double targetMass;
G4double eps = 0.0001;
targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) /
theProjectile->GetPDGMass();
//theProjectile->GetPDGMass();
G4Neutron::Neutron()->GetPDGMass();
//give priority to ENDF vales for target mass
if(theEnergyAngData!=0)
{ targetMass = theEnergyAngData->GetTargetMass(); }
if(theAngularDistribution!=0)
@@ -210,13 +212,17 @@ void G4ParticleHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
if ( targetMass == 0 )
{
//G4cout << "TKDB targetMass = 0; ENDF-VII.0 21Sc45 has trouble in MF4MT22 (n,np) targetMass is not properly recorded. This could be a similar situation." << G4endl;
targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) / theProjectile->GetPDGMass();
//targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) / theProjectile->GetPDGMass();
targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) / G4Neutron::Neutron()->GetPDGMass();
}
G4Nucleus aNucleus;
G4ReactionProduct theTarget;
G4ThreeVector neuVelo = (1./hadProjectile->GetDefinition()->GetPDGMass())*incidReactionProduct.GetMomentum();
theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
//G4ThreeVector neuVelo = (1./hadProjectile->GetDefinition()->GetPDGMass())*incidReactionProduct.GetMomentum();
//theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
//G4Nucleus::GetBiasedThermalNucleus requests normalization of mass and velocity in neutron mass
G4ThreeVector neuVelo = (1./G4Neutron::Neutron()->GetPDGMass())*incidReactionProduct.GetMomentum();
theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
theTarget.SetDefinition( G4IonTable::GetIonTable()->GetIon( G4int(theBaseZ), G4int(theBaseA) , 0.0 ) );
@@ -280,7 +286,11 @@ void G4ParticleHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
}
G4ReactionProductVector * tmpHadrons = 0;
G4int ii = 0, dummy;
#ifdef G4PHPDEBUG
//To avoid compilation error around line 532.
G4int ii(0);
#endif
G4int dummy;
unsigned int i;
if(theEnergyAngData != 0)
@@ -319,22 +329,24 @@ void G4ParticleHPInelasticBaseFS::BaseApply(const G4HadProjectile & theTrack,
G4bool * Done = new G4bool[nDef];
G4int i0;
for(i0=0; i0<nDef; i0++) Done[i0] = false;
if(tmpHadrons == 0)
{
//Following lines are commented out to fix coverity defeat 58622
// if(tmpHadrons == 0)
// {
tmpHadrons = new G4ReactionProductVector;
}
else
{
for(i=0; i<tmpHadrons->size(); i++)
{
for(ii=0; ii<nDef; ii++)
if(!Done[ii] && tmpHadrons->operator[](i)->GetDefinition() == theDefs[ii])
Done[ii] = true;
}
// }
// else
// {
// for(i=0; i<tmpHadrons->size(); i++)
// {
// for(ii=0; ii<nDef; ii++)
// if(!Done[ii] && tmpHadrons->operator[](i)->GetDefinition() == theDefs[ii])
// Done[ii] = true;
// }
#ifdef G4PHPDEBUG
if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply secondary previously added " << tmpHadrons->operator[](i)->GetDefinition()->GetParticleName() << " E= " << tmpHadrons->operator[](i)->GetKineticEnergy() << G4endl;
// if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply secondary previously added " << tmpHadrons->operator[](i)->GetDefinition()->GetParticleName() << " E= " << tmpHadrons->operator[](i)->GetKineticEnergy() << G4endl;
#endif
}
// }
G4ReactionProduct * aHadron;
G4double localMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps)));
G4ThreeVector bufferedDirection(0,0,0);
@@ -246,8 +246,7 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrac
G4double targetMass=0;
G4double eps = 0.0001;
targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) /
theProjectile->GetPDGMass();
targetMass = G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps));
#ifdef G4PHPDEBUG
if( getenv("G4ParticleHPDebug")) G4cout <<this <<" G4ParticleHPInelasticCompFS::CompositeApply A " <<theBaseA <<" Z " <<theBaseZ <<" incident " <<hadProjectile->GetDefinition()->GetParticleName() <<G4endl;
#endif
@@ -259,16 +258,20 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrac
// targetMass = theFinalStatePhotons[50]->GetTargetMass();
G4ReactionProduct theTarget;
G4Nucleus aNucleus;
G4ThreeVector neuVelo = (1./hadProjectile->GetDefinition()->GetPDGMass())*incidReactionProduct.GetMomentum();
theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
//G4ThreeVector neuVelo = (1./hadProjectile->GetDefinition()->GetPDGMass())*incidReactionProduct.GetMomentum();
//theTarget = aNucleus.GetBiasedThermalNucleus( targetMass/hadProjectile->GetDefinition()->GetPDGMass() , neuVelo, theTrack.GetMaterial()->GetTemperature());
//G4Nucleus::GetBiasedThermalNucleus requests normalization of mass and velocity in neutron mass
G4ThreeVector neuVelo = ( 1./G4Neutron::Neutron()->GetPDGMass() )*incidReactionProduct.GetMomentum();
theTarget = aNucleus.GetBiasedThermalNucleus( targetMass/G4Neutron::Neutron()->GetPDGMass()
, neuVelo, theTrack.GetMaterial()->GetTemperature() );
theTarget.SetDefinition( G4IonTable::GetIonTable()->GetIon( G4int(theBaseZ), G4int(theBaseA) , 0.0 ) ); //XX
// prepare the residual mass
G4double residualMass=0;
G4double residualZ = theBaseZ - aDefinition->GetPDGCharge();
G4double residualA = theBaseA - aDefinition->GetBaryonNumber()+1;
residualMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(residualA+eps), static_cast<G4int>(residualZ+eps)) ) /
theProjectile->GetPDGMass();
G4double residualZ = theBaseZ + theProjectile->GetPDGCharge() - aDefinition->GetPDGCharge();
G4double residualA = theBaseA + theProjectile->GetBaryonNumber() - aDefinition->GetBaryonNumber();
residualMass = G4NucleiProperties::GetNuclearMass(static_cast<G4int>(residualA+eps), static_cast<G4int>(residualZ+eps));
// prepare energy in target rest frame
G4ReactionProduct boosted;
@@ -287,7 +290,7 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrac
G4ReactionProduct aHadron;
aHadron.SetDefinition(aDefinition); // what if only cross-sections exist ==> Na 23 11 @@@@
G4double availableEnergy = incidReactionProduct.GetKineticEnergy() + incidReactionProduct.GetMass() - aHadron.GetMass() +
(targetMass - residualMass)*theProjectile->GetPDGMass();
(targetMass - residualMass);
//080730c
if ( availableEnergy < 0 )
{
@@ -305,8 +308,8 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrac
// TK Excitation level is not determined
iLevel=-1;
aHadron.SetKineticEnergy(availableEnergy*residualMass*theProjectile->GetPDGMass()/
(aHadron.GetMass()+residualMass*theProjectile->GetPDGMass()));
aHadron.SetKineticEnergy(availableEnergy*residualMass/
(aHadron.GetMass()+residualMass));
//aHadron.SetMomentum(incidReactionProduct.GetMomentum()*(1./incidReactionProduct.GetTotalMomentum())*
// std::sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()-
@@ -519,7 +522,7 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrac
{
G4ReactionProductVector * theNext =
theFinalStatePhotons[j]->GetPhotons(anEnergy);
thePhotons->push_back(theNext->operator[](0));
if ( thePhotons != NULL ) thePhotons->push_back(theNext->operator[](0));
aBaseEnergy = testEnergy-theNext->operator[](0)->GetTotalEnergy();
delete theNext;
foundMatchingLevel = true;
@@ -535,7 +538,7 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrac
{
G4ReactionProductVector * theNext =
theFinalStatePhotons[closest]->GetPhotons(anEnergy);
thePhotons->push_back(theNext->operator[](0));
if ( thePhotons != NULL ) thePhotons->push_back(theNext->operator[](0));
aBaseEnergy = aBaseEnergy-theNext->operator[](0)->GetTotalEnergy();
delete theNext;
}
@@ -777,7 +780,7 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrac
adjust_final_state ( init_4p_lab );
// clean up the primary neutron
theResult.Get()->SetStatusChange(stopAndKill);
theResult.Get()->SetStatusChange( stopAndKill );
}
@@ -83,14 +83,17 @@ G4ParticleHPInelasticData::G4ParticleHPInelasticData(G4ParticleDefinition* proje
theProjectile=projectile;
theHPData = NULL;
instanceOfWorker = false;
if ( G4Threading::IsMasterThread() ) {
theHPData = new G4ParticleHPData( theProjectile );
} else {
instanceOfWorker = true;
}
}
G4ParticleHPInelasticData::~G4ParticleHPInelasticData()
{
if ( theCrossSections != NULL ) {
if ( theCrossSections != NULL && instanceOfWorker != true ) {
theCrossSections->clearAndDestroy();
delete theCrossSections;
theCrossSections = NULL;
@@ -268,8 +271,7 @@ GetCrossSection(const G4DynamicParticle* projectile, const G4Element*anE, G4doub
G4double theA = anE->GetN();
G4double theZ = anE->GetZ();
G4double eleMass;
eleMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theA+eps), static_cast<G4int>(theZ+eps))
) / theProjectile->GetPDGMass();
eleMass = G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theA+eps), static_cast<G4int>(theZ+eps) );
G4ReactionProduct boosted;
G4double aXsection;
@@ -290,7 +292,9 @@ GetCrossSection(const G4DynamicParticle* projectile, const G4Element*anE, G4doub
{
counter ++;
#endif
G4ReactionProduct aThermalNuc = aNuc.GetThermalNucleus(eleMass, aT);
//G4ReactionProduct aThermalNuc = aNuc.GetThermalNucleus( eleMass/theProjectile->GetPDGMass(), aT );
//G4Nucleus::GetThermalNucleus requests normalization of mass in neutron mass
G4ReactionProduct aThermalNuc = aNuc.GetThermalNucleus( eleMass/G4Neutron::Neutron()->GetPDGMass(), aT );
boosted.Lorentz(theNeutron, aThermalNuc);
G4double theEkin = boosted.GetKineticEnergy();
aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
@@ -147,7 +147,7 @@ if(getenv("NeutronHPNames")) G4cout <<"HPWD 1 "<<*theName<<G4endl;
first = false;
biff = new G4String(); // delete here as theName
*biff = base+"/CrossSection/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1];
if(theName!=0) delete theName;
delete theName;
theName = biff;
if(getenv("NeutronHPNames")) G4cout <<"HPWD 2 "<<*theName<<G4endl;
result.SetName(*theName);
@@ -168,9 +168,9 @@ if(getenv("NeutronHPNames")) G4cout <<"HPWD 2 "<<*theName<<G4endl;
else
{
biff = new G4String(); // delete here as theName
if(theName!=0) delete theName;
*biff = base+"/"+rest+"/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1];
if ( rest=="/CrossSection" ) *biff = base+rest+"/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1];
delete theName;
theName = biff;
if(getenv("NeutronHPNames")) G4cout <<"HPWD 3 "<<*theName<<G4endl;
result.SetName(*theName);
@@ -360,7 +360,8 @@ if(getenv("NeutronHPNames")) G4cout <<"HPWD 4b2c "<<*theName<<G4endl;
else
{
//080901 Add protection that deuteron data do not selected for hydrogen and so on by T. Koi
if ( ( reac.find("Inelastic") != reac.size() && ( (Z == 1 && A == 1) || (Z == 2 && A == 4) ) )
//160216 Increase protencted isotopes for fixing problem on charged particle HP
if ( ( reac.find("Inelastic") != reac.size() && ( (Z == 1 && A == 1) || (Z == 1 && A == 2) || (Z == 1 && A == 3) || (Z == 2 && A == 3) || (Z == 2 && A == 4) ) )
|| ( reac.find("Capture") != reac.size() && ( (Z == 1 && A == 3) || (Z == 2 && A == 4) ) )
|| ( reac.find("Fission") != reac.size() && ( (Z == 88 && A == 224) || (Z == 88 && A == 225) || (Z == 89 && A == 225) || (Z == 88 && A == 226) ) ) )
@@ -55,6 +55,9 @@
G4ParticleHPThermalScattering::G4ParticleHPThermalScattering()
:G4HadronicInteraction("NeutronHPThermalScattering")
,coherentFSs(NULL)
,incoherentFSs(NULL)
,inelasticFSs(NULL)
{
theHPElastic = new G4ParticleHPElastic();
@@ -126,7 +129,8 @@ G4ParticleHPThermalScattering::~G4ParticleHPThermalScattering()
*/
delete theHPElastic;
delete theXSection;
//TKDB 160506
//delete theXSection;
}
void G4ParticleHPThermalScattering::clearCurrentFSData() {
@@ -559,7 +563,7 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
}
else if ( tempLH.second == 0.0 )
{
pvE_p_TL = coherentFSs->find( ielement )->second->find ( v_temp.back() )->second;
pvE_p_TH = coherentFSs->find( ielement )->second->find ( v_temp.back() )->second;
std::vector< G4double >::iterator itv;
itv = v_temp.end();
itv--;
@@ -93,7 +93,6 @@
the15percentBorderCash = -DBL_MAX;
the50percentBorderCash = -DBL_MAX;
label = -DBL_MAX;
}
G4ParticleHPVector::G4ParticleHPVector(G4int n)
@@ -108,6 +107,7 @@
maxValue = -DBL_MAX;
the15percentBorderCash = -DBL_MAX;
the50percentBorderCash = -DBL_MAX;
label = -DBL_MAX;
}
G4ParticleHPVector::~G4ParticleHPVector()
@@ -95,7 +95,8 @@ G4FFG_FUNCTIONENTER__
}
//TK modified 131108 add next line
finalState->SetStatusChange(stopAndKill);
//TK 160112 fix for coverity #53481
if ( finalState != NULL ) finalState->SetStatusChange(stopAndKill);
G4FFG_FUNCTIONLEAVE__
return finalState;
}