Import Geant4 10.6.2 source tree
This commit is contained in:
@@ -163,7 +163,7 @@ void G4ParticleHPInelasticBaseFS::Init (G4double A, G4double Z, G4int M, G4Strin
|
||||
else if(dataType==13)
|
||||
{
|
||||
theFinalStatePhotons = new G4ParticleHPPhotonDist;
|
||||
theFinalStatePhotons->InitPartials(theData);
|
||||
theFinalStatePhotons->InitPartials(theData, theXsection);
|
||||
hasFSData = true;
|
||||
}
|
||||
else if(dataType==14)
|
||||
|
||||
@@ -179,7 +179,7 @@ void G4ParticleHPInelasticCompFS::Init (G4double A, G4double Z, G4int M, G4Strin
|
||||
else if(dataType==13)
|
||||
{
|
||||
theFinalStatePhotons[it] = new G4ParticleHPPhotonDist;
|
||||
theFinalStatePhotons[it]->InitPartials(theData);
|
||||
theFinalStatePhotons[it]->InitPartials(theData, theXsection[50]);
|
||||
}
|
||||
else if(dataType==14)
|
||||
{
|
||||
@@ -406,48 +406,48 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile& theTrack
|
||||
G4double dqi = QI[it];
|
||||
if ( dqi < 0 || 849 < dqi ) useQI = true; //Former libraies does not have values of this range
|
||||
|
||||
if ( useQI )
|
||||
{
|
||||
// QI introudced since G4NDL3.15
|
||||
G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
|
||||
eExcitation = QM-QI[it];
|
||||
if(eExcitation<20*CLHEP::keV){eExcitation=0;}
|
||||
if (useQI) {
|
||||
// QI introudced since G4NDL3.15
|
||||
// G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
|
||||
// eExcitation = QM-QI[it];
|
||||
eExcitation = QI[0] - QI[it]; // Bug fix #1838
|
||||
if(eExcitation < 20*CLHEP::keV) eExcitation = 0;
|
||||
|
||||
//Re-evluate iLevel based on this eExcitation
|
||||
iLevel = 0;
|
||||
G4bool find = false;
|
||||
G4int imaxEx = 0;
|
||||
G4double level_tolerance = 1.0*CLHEP::keV;
|
||||
// Re-evluate iLevel based on this eExcitation
|
||||
iLevel = 0;
|
||||
G4bool find = false;
|
||||
G4int imaxEx = 0;
|
||||
G4double level_tolerance = 1.0*CLHEP::keV;
|
||||
|
||||
while( theGammas.GetLevel(iLevel+1) != 0 ) // Loop checking, 11.05.2015, T. Koi
|
||||
{
|
||||
G4double maxEx = 0.0;
|
||||
if ( maxEx < theGammas.GetLevel(iLevel)->GetLevelEnergy() )
|
||||
{
|
||||
maxEx = theGammas.GetLevel(iLevel)->GetLevelEnergy();
|
||||
imaxEx = iLevel;
|
||||
while( theGammas.GetLevel(iLevel+1) != 0 ) { // Loop checking, 11.05.2015, T. Koi
|
||||
G4double maxEx = 0.0;
|
||||
if (maxEx < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
|
||||
maxEx = theGammas.GetLevel(iLevel)->GetLevelEnergy();
|
||||
imaxEx = iLevel;
|
||||
}
|
||||
|
||||
// Fix bug 1789 DHW - first if-branch added because gamma data come from ENSDF
|
||||
// and do not necessarily match the excitations used in ENDF-B.VII
|
||||
// Compromise solution: use 1 keV tolerance suggested by T. Koi
|
||||
if (std::abs(eExcitation - theGammas.GetLevel(iLevel)->GetLevelEnergy() ) < level_tolerance) {
|
||||
find = true;
|
||||
break;
|
||||
|
||||
} else if (eExcitation < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
|
||||
find = true;
|
||||
iLevel--;
|
||||
// very small eExcitation, iLevel becomes -1, this is protected below
|
||||
if (theTrack.GetDefinition() == aDefinition) { // this line added as part of fix #1838
|
||||
if (iLevel == -1) iLevel = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
iLevel++;
|
||||
}
|
||||
|
||||
// Fix bug 1789 DHW - first if-branch added because gamma data come from ENSDF
|
||||
// and do not necessarily match the excitations used in ENDF-B.VII
|
||||
// Compromise solution: use 1 keV tolerance suggested by T. Koi
|
||||
if (std::abs(eExcitation - theGammas.GetLevel(iLevel)->GetLevelEnergy() ) < level_tolerance) {
|
||||
find = true;
|
||||
break;
|
||||
|
||||
} else if (eExcitation < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
|
||||
find = true;
|
||||
iLevel--;
|
||||
// very small eExcitation, iLevel becomes -1, this is protected below.
|
||||
if ( iLevel == -1 ) iLevel = 0; // But cause energy trouble.
|
||||
break;
|
||||
}
|
||||
iLevel++;
|
||||
}
|
||||
// In case, cannot find proper level, then use the maximum level.
|
||||
if ( !find ) iLevel = imaxEx;
|
||||
// If proper level cannot be found, use the maximum level
|
||||
if (!find) iLevel = imaxEx;
|
||||
}
|
||||
//110610TK END
|
||||
|
||||
if(std::getenv("G4ParticleHPDebug") && eKinetic-eExcitation < 0)
|
||||
{
|
||||
@@ -596,8 +596,9 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile& theTrack
|
||||
{
|
||||
// In this case, hadron should be isotropic in CM
|
||||
// Next 12 lines are Emilio's replacement
|
||||
G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
|
||||
G4double eExcitation = QM-QI[it];
|
||||
// G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
|
||||
// G4double eExcitation = QM-QI[it];
|
||||
G4double eExcitation = QI[0] - QI[it]; // Fix of bug #1838
|
||||
if(eExcitation<20*CLHEP::keV){eExcitation=0;}
|
||||
two_body_reaction(&incidReactionProduct,&theTarget,&aHadron,eExcitation);
|
||||
if(thePhotons==0 && eExcitation>0){
|
||||
|
||||
@@ -805,74 +805,74 @@ G4double G4ParticleHPThermalScattering::get_linear_interpolated ( G4double x , s
|
||||
|
||||
|
||||
|
||||
E_isoAng G4ParticleHPThermalScattering::create_E_isoAng_from_energy ( G4double energy , std::vector< E_isoAng* >* vEPM )
|
||||
E_isoAng
|
||||
G4ParticleHPThermalScattering::create_E_isoAng_from_energy(G4double energy,
|
||||
std::vector<E_isoAng*>* vEPM)
|
||||
{
|
||||
E_isoAng anEPM_T_E;
|
||||
std::vector<E_isoAng*>::iterator iv;
|
||||
|
||||
std::vector< E_isoAng* >::iterator iv;
|
||||
|
||||
std::vector< G4double > v_e;
|
||||
std::vector<G4double> v_e;
|
||||
v_e.clear();
|
||||
for ( iv = vEPM->begin() ; iv != vEPM->end() ; iv++ )
|
||||
v_e.push_back ( (*iv)->energy );
|
||||
for (iv = vEPM->begin(); iv != vEPM->end(); iv++)
|
||||
v_e.push_back( (*iv)->energy );
|
||||
|
||||
std::pair < G4double , G4double > energyLH = find_LH ( energy , &v_e );
|
||||
std::pair<G4double, G4double> energyLH = find_LH(energy, &v_e);
|
||||
//G4cout << " " << energy/eV << " " << energyLH.first/eV << " " << energyLH.second/eV << G4endl;
|
||||
|
||||
E_isoAng* panEPM_T_EL=0;
|
||||
E_isoAng* panEPM_T_EH=0;
|
||||
E_isoAng* panEPM_T_EL = 0;
|
||||
E_isoAng* panEPM_T_EH = 0;
|
||||
|
||||
if ( energyLH.first != 0.0 && energyLH.second != 0.0 )
|
||||
{
|
||||
for ( iv = vEPM->begin() ; iv != vEPM->end() ; iv++ )
|
||||
{
|
||||
if ( energyLH.first == (*iv)->energy ) {
|
||||
panEPM_T_EL = *iv;
|
||||
iv++;
|
||||
panEPM_T_EH = *iv;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( energyLH.first == 0.0 )
|
||||
{
|
||||
panEPM_T_EL = (*vEPM)[0];
|
||||
panEPM_T_EH = (*vEPM)[1];
|
||||
}
|
||||
else if ( energyLH.second == 0.0 )
|
||||
{
|
||||
panEPM_T_EH = (*vEPM).back();
|
||||
iv = vEPM->end();
|
||||
iv--;
|
||||
iv--;
|
||||
panEPM_T_EL = *iv;
|
||||
if (energyLH.first != 0.0 && energyLH.second != 0.0) {
|
||||
for (iv = vEPM->begin(); iv != vEPM->end(); iv++) {
|
||||
if (energyLH.first == (*iv)->energy) {
|
||||
panEPM_T_EL = *iv;
|
||||
iv++;
|
||||
panEPM_T_EH = *iv;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (energyLH.first == 0.0) {
|
||||
panEPM_T_EL = (*vEPM)[0];
|
||||
panEPM_T_EH = (*vEPM)[1];
|
||||
|
||||
} else if (energyLH.second == 0.0) {
|
||||
panEPM_T_EH = (*vEPM).back();
|
||||
iv = vEPM->end();
|
||||
iv--;
|
||||
iv--;
|
||||
panEPM_T_EL = *iv;
|
||||
}
|
||||
|
||||
//checking isoAng has proper values or not
|
||||
// Inelastic/FS, the first and last entries of *vEPM has all zero values.
|
||||
if ( ! ( check_E_isoAng (panEPM_T_EL) ) ) panEPM_T_EL= panEPM_T_EH;
|
||||
if ( ! ( check_E_isoAng (panEPM_T_EH) ) ) panEPM_T_EH= panEPM_T_EL;
|
||||
if (panEPM_T_EL != 0 && panEPM_T_EH != 0) {
|
||||
//checking isoAng has proper values or not
|
||||
// Inelastic/FS, the first and last entries of *vEPM has all zero values.
|
||||
if ( !(check_E_isoAng(panEPM_T_EL) ) ) panEPM_T_EL = panEPM_T_EH;
|
||||
if ( !(check_E_isoAng(panEPM_T_EH) ) ) panEPM_T_EH = panEPM_T_EL;
|
||||
|
||||
if ( panEPM_T_EL->n == panEPM_T_EH->n )
|
||||
{
|
||||
anEPM_T_E.energy = energy;
|
||||
anEPM_T_E.n = panEPM_T_EL->n;
|
||||
if (panEPM_T_EL->n == panEPM_T_EH->n) {
|
||||
anEPM_T_E.energy = energy;
|
||||
anEPM_T_E.n = panEPM_T_EL->n;
|
||||
|
||||
for ( G4int i=0 ; i < panEPM_T_EL->n ; i++ )
|
||||
{
|
||||
for (G4int i=0; i < panEPM_T_EL->n; i++) {
|
||||
G4double angle;
|
||||
angle = get_linear_interpolated ( energy , std::pair< G4double , G4double > ( energyLH.first , panEPM_T_EL->isoAngle[ i ] )
|
||||
, std::pair< G4double , G4double > ( energyLH.second , panEPM_T_EH->isoAngle[ i ] ) );
|
||||
anEPM_T_E.isoAngle.push_back( angle );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
|
||||
"NotSupported", JustWarning,
|
||||
"G4ParticleHPThermalScattering does not support yet EL->n != EH->n.");
|
||||
}
|
||||
angle = get_linear_interpolated(energy, std::pair<G4double,G4double>(energyLH.first, panEPM_T_EL->isoAngle[i] ),
|
||||
std::pair<G4double,G4double>(energyLH.second, panEPM_T_EH->isoAngle[i] ) );
|
||||
anEPM_T_E.isoAngle.push_back(angle);
|
||||
}
|
||||
|
||||
} else {
|
||||
G4Exception("G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
|
||||
"NotSupported", JustWarning,
|
||||
"G4ParticleHPThermalScattering does not support yet EL->n != EH->n.");
|
||||
}
|
||||
|
||||
} else {
|
||||
G4Exception("G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
|
||||
"HAD_THERM_000", FatalException,
|
||||
"Pointer panEPM_T_EL or panEPM_T_EH is zero");
|
||||
}
|
||||
|
||||
return anEPM_T_E;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user