Import Geant4 11.0.2 source tree
This commit is contained in:
@@ -88,7 +88,7 @@ GetFissionProduct( void )
|
||||
{
|
||||
G4FFG_FUNCTIONENTER__
|
||||
|
||||
G4Ions* Particle;
|
||||
G4Ions* Particle=nullptr;
|
||||
|
||||
// Generate a (0, 1] random number and return the respective particle.
|
||||
// The ENDF data tables lists 72172 as the largest fission fragment produced
|
||||
|
||||
@@ -313,7 +313,7 @@ G4FFG_FUNCTIONENTER__
|
||||
// distribution is dependant on the alpha particle generation and the
|
||||
// Watt fission sampling for neutrons, we only have the left-over energy
|
||||
// to work with for the fission daughter products.
|
||||
G4double FragmentsKE;
|
||||
G4double FragmentsKE=0.;
|
||||
G4int icounter=0;
|
||||
G4int icounter_max=1024;
|
||||
do
|
||||
@@ -1327,8 +1327,8 @@ G4FFG_FUNCTIONENTER__
|
||||
// The condition of sampling more energy from the fission products than is
|
||||
// alloted is statistically unfavorable, but it could still happen. The
|
||||
// do-while loop prevents such an occurrence from happening
|
||||
G4double TotalNeutronEnergy;
|
||||
G4double NeutronEnergy;
|
||||
G4double TotalNeutronEnergy=0.;
|
||||
G4double NeutronEnergy=0.;
|
||||
|
||||
// Make sure that we don't sample more energy than is available
|
||||
G4int icounter=0;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,101 +33,106 @@
|
||||
//
|
||||
#include "G4ParticleHPContEnergyAngular.hh"
|
||||
|
||||
G4ReactionProduct * G4ParticleHPContEnergyAngular::Sample(G4double anEnergy, G4double massCode, G4double /*mass*/)
|
||||
G4ReactionProduct*
|
||||
G4ParticleHPContEnergyAngular::Sample(G4double anEnergy, G4double massCode,
|
||||
G4double /*mass*/)
|
||||
{
|
||||
G4ReactionProduct * result;
|
||||
G4int i(0);
|
||||
G4int it(0);
|
||||
for(i=0;i<nEnergy;i++)
|
||||
{
|
||||
it = i;
|
||||
G4ReactionProduct* result;
|
||||
G4int i(0);
|
||||
G4int it(0);
|
||||
for (i = 0; i < nEnergy; i++) {
|
||||
it = i;
|
||||
#ifdef PHP_AS_HP
|
||||
if(theAngular[i].GetEnergy()>anEnergy) break;
|
||||
if(theAngular[i].GetEnergy() > anEnergy) break;
|
||||
#else
|
||||
if(theAngular[i].GetEnergy()>=anEnergy) break;
|
||||
if(theAngular[i].GetEnergy() >= anEnergy) break;
|
||||
#endif
|
||||
}
|
||||
if( std::getenv("G4PHPTEST") ) G4cout << i << " G4ParticleHPContEnergyAngular dataE " << theAngular[i].GetEnergy() << " > " << anEnergy << " it_theAngular " << it << " interpolation " << theInterpolation << G4endl; //GDEB
|
||||
G4double targetMass = GetTarget()->GetMass();
|
||||
if(it==0)
|
||||
{
|
||||
theAngular[0].SetTarget(GetTarget());
|
||||
theAngular[0].SetTargetCode(theTargetCode);
|
||||
theAngular[0].SetPrimary(GetProjectileRP());
|
||||
result = theAngular[0].Sample(anEnergy, massCode, targetMass,
|
||||
}
|
||||
|
||||
if (std::getenv("G4PHPTEST") )
|
||||
G4cout << i << " G4ParticleHPContEnergyAngular dataE "
|
||||
<< theAngular[i].GetEnergy()
|
||||
<< " > " << anEnergy << " it_theAngular " << it << " interpolation "
|
||||
<< theInterpolation << G4endl; //GDEB
|
||||
|
||||
G4double targetMass = GetTarget()->GetMass();
|
||||
if (it == 0) {
|
||||
theAngular[0].SetTarget(GetTarget());
|
||||
theAngular[0].SetTargetCode(theTargetCode);
|
||||
theAngular[0].SetPrimary(GetProjectileRP());
|
||||
result = theAngular[0].Sample(anEnergy, massCode, targetMass,
|
||||
theAngularRep, theInterpolation);
|
||||
currentMeanEnergy.Put( theAngular[0].MeanEnergyOfThisInteraction() );
|
||||
}
|
||||
else
|
||||
{
|
||||
currentMeanEnergy.Put(theAngular[0].MeanEnergyOfThisInteraction() );
|
||||
|
||||
} else {
|
||||
// interpolation through alternating sampling. This needs improvement @@@
|
||||
// This is the cause of the He3 problem !!!!!!!!
|
||||
// See to it, if you can improve this.
|
||||
//080714 TK commnet Randomizing use angular distribution
|
||||
//080714 TK Always use the upper side distribution. enabling ClearHistories method.
|
||||
//G4double random = G4UniformRand();
|
||||
//G4double deltaE = theAngular[it].GetEnergy()-theAngular[it-1].GetEnergy();
|
||||
//G4double offset = theAngular[it].GetEnergy()-anEnergy;
|
||||
//if(random<offset/deltaE) it--;
|
||||
//--- create new
|
||||
// if( theManager.GetScheme(0) != LINLIN ) { // asserted in G4ParticleHPContEnergyAngular::init there is only one range
|
||||
// if (theManager.GetScheme(0) != LINLIN) {
|
||||
// // asserted in G4ParticleHPContEnergyAngular::init there is only one range
|
||||
#ifdef PHP_AS_HP
|
||||
theAngular[it].SetTarget(GetTarget());
|
||||
theAngular[it].SetTargetCode(theTargetCode);
|
||||
theAngular[it].SetPrimary(GetProjectileRP());
|
||||
result = theAngular[it].Sample(anEnergy, massCode, targetMass,
|
||||
theAngular[it].SetTarget(GetTarget());
|
||||
theAngular[it].SetTargetCode(theTargetCode);
|
||||
theAngular[it].SetPrimary(GetProjectileRP());
|
||||
result = theAngular[it].Sample(anEnergy, massCode, targetMass,
|
||||
theAngularRep, theInterpolation);
|
||||
currentMeanEnergy.Put( theAngular[it].MeanEnergyOfThisInteraction() );
|
||||
currentMeanEnergy.Put(theAngular[it].MeanEnergyOfThisInteraction() );
|
||||
#else
|
||||
if( std::getenv("G4PHPTEST") ) G4cout << i << " G4ParticleHPContEnergyAngular To BUILDBYINTERPOLATION " << it << " : " << theAngular[it].GetEnergy()<< " , " << theAngular[it].GetNEnergies() << " " << it-1 << " : " << theAngular[it-1].GetEnergy()<< " : " << theAngular[it-1].GetNEnergies() << G4endl; //GDEB
|
||||
if (std::getenv("G4PHPTEST") )
|
||||
G4cout << i << " G4ParticleHPContEnergyAngular To BUILDBYINTERPOLATION "
|
||||
<< it << " : " << theAngular[it].GetEnergy()<< " , "
|
||||
<< theAngular[it].GetNEnergies() << " " << it-1 << " : "
|
||||
<< theAngular[it-1].GetEnergy()<< " : "
|
||||
<< theAngular[it-1].GetNEnergies() << G4endl; //GDEB
|
||||
|
||||
// G4ParticleHPContAngularPar * fAngular = new G4ParticleHPContAngularPar(theProjectile ); //fix start
|
||||
if (fCacheAngular.Get() == NULL) {
|
||||
G4ParticleHPContAngularPar* angpar = new G4ParticleHPContAngularPar(theProjectile);
|
||||
fCacheAngular.Put(angpar);
|
||||
}
|
||||
fCacheAngular.Get()->SetInterpolation(theInterpolation);
|
||||
fCacheAngular.Get()->BuildByInterpolation( anEnergy, theManager.GetScheme(0), (theAngular[it-1]), (theAngular[it]) );
|
||||
fCacheAngular.Get()->SetTarget(GetTarget());
|
||||
fCacheAngular.Get()->SetTargetCode(theTargetCode);
|
||||
fCacheAngular.Get()->SetPrimary(GetProjectileRP());
|
||||
result = fCacheAngular.Get()->Sample(anEnergy, massCode, targetMass,
|
||||
theAngularRep, theInterpolation);
|
||||
currentMeanEnergy.Put( fCacheAngular.Get()->MeanEnergyOfThisInteraction() );
|
||||
fCacheAngular.Get()->ClearHistories();
|
||||
|
||||
// delete fAngular; //fix end
|
||||
|
||||
if (fCacheAngular.Get() == NULL) {
|
||||
G4ParticleHPContAngularPar* angpar = new G4ParticleHPContAngularPar(theProjectile);
|
||||
fCacheAngular.Put(angpar);
|
||||
}
|
||||
fCacheAngular.Get()->SetInterpolation(theInterpolation);
|
||||
fCacheAngular.Get()->BuildByInterpolation(anEnergy, theManager.GetScheme(0),
|
||||
(theAngular[it-1]), (theAngular[it]) );
|
||||
fCacheAngular.Get()->SetTarget(GetTarget());
|
||||
fCacheAngular.Get()->SetTargetCode(theTargetCode);
|
||||
fCacheAngular.Get()->SetPrimary(GetProjectileRP());
|
||||
|
||||
result = fCacheAngular.Get()->Sample(anEnergy, massCode, targetMass,
|
||||
theAngularRep, theInterpolation);
|
||||
currentMeanEnergy.Put(fCacheAngular.Get()->MeanEnergyOfThisInteraction() );
|
||||
#endif
|
||||
}
|
||||
} // end (it != 0) branch
|
||||
|
||||
// G4cout << " 0 0 @@@ G4ParticleHPContEnergyAngular::Sample " << result->GetDefinition()->GetParticleName() << " E= " << result->GetKineticEnergy() << G4endl;//GDEB
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double G4ParticleHPContEnergyAngular::
|
||||
MeanEnergyOfThisInteraction()
|
||||
|
||||
G4double G4ParticleHPContEnergyAngular::MeanEnergyOfThisInteraction()
|
||||
{
|
||||
G4double result(0);
|
||||
if(currentMeanEnergy.Get()<-1)
|
||||
{
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4ParticleHPContEnergyAngular: Logical error in Product class");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = currentMeanEnergy.Get();
|
||||
}
|
||||
currentMeanEnergy.Put( -2 );
|
||||
return result;
|
||||
G4double result(0);
|
||||
if (currentMeanEnergy.Get() < -1) {
|
||||
throw G4HadronicException(__FILE__, __LINE__,
|
||||
"G4ParticleHPContEnergyAngular: Logical error in Product class");
|
||||
} else {
|
||||
result = currentMeanEnergy.Get();
|
||||
}
|
||||
currentMeanEnergy.Put(-2);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void G4ParticleHPContEnergyAngular::ClearHistories()
|
||||
{
|
||||
if ( theAngular!= NULL )
|
||||
{
|
||||
for ( G4int i = 0 ; i< nEnergy ; i++ )
|
||||
theAngular[i].ClearHistories();
|
||||
}
|
||||
if (theAngular!= NULL) {
|
||||
for (G4int i = 0; i < nEnergy; i++) theAngular[i].ClearHistories();
|
||||
}
|
||||
|
||||
// Added fCacheAngular ClearHistories() - this is the one actually used!
|
||||
// Maybe theAngular does not even need ClearHistories()?
|
||||
if (fCacheAngular.Get() != 0) fCacheAngular.Get()->ClearHistories();
|
||||
}
|
||||
|
||||
|
||||
@@ -368,7 +368,7 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile& theTrack
|
||||
G4double dqi = 0.0;
|
||||
if ( QI[it] < 0 || 849 < QI[it] ) dqi = QI[it]; //For backword compatibility QI introduced since G4NDL3.15
|
||||
G4double MaxEne=eKinetic+dqi;
|
||||
G4double eSecN;
|
||||
G4double eSecN=0.;
|
||||
|
||||
G4int icounter=0;
|
||||
G4int icounter_max=1024;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
G4double G4ParticleHPKallbachMannSyst::Sample(G4double anEnergy)
|
||||
{
|
||||
G4double result;
|
||||
G4double result=0.;
|
||||
|
||||
G4double zero = GetKallbachZero(anEnergy);
|
||||
if(zero>1) zero=1.;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
//080612TK contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #3
|
||||
G4double G4ParticleHPLegendreStore::SampleDiscreteTwoBody (G4double anEnergy)
|
||||
{
|
||||
G4double result;
|
||||
G4double result=0.;
|
||||
|
||||
G4int i0;
|
||||
G4int low(0), high(0);
|
||||
@@ -125,7 +125,7 @@ G4double G4ParticleHPLegendreStore::SampleDiscreteTwoBody (G4double anEnergy)
|
||||
|
||||
G4double G4ParticleHPLegendreStore::SampleMax (G4double anEnergy)
|
||||
{
|
||||
G4double result;
|
||||
G4double result=0.;
|
||||
|
||||
G4int i0;
|
||||
G4int low(0), high(0);
|
||||
@@ -201,7 +201,7 @@ G4double G4ParticleHPLegendreStore::SampleMax (G4double anEnergy)
|
||||
|
||||
G4double G4ParticleHPLegendreStore::SampleElastic (G4double anEnergy)
|
||||
{
|
||||
G4double result;
|
||||
G4double result=0.;
|
||||
|
||||
G4int i0;
|
||||
G4int low(0), high(0);
|
||||
@@ -322,7 +322,7 @@ G4double G4ParticleHPLegendreStore::Sample (G4double energy) // still in interpo
|
||||
|
||||
G4double G4ParticleHPLegendreStore::Integrate(G4int k, G4double costh) // still in interpolation; not used anymore
|
||||
{
|
||||
G4double result=0;
|
||||
G4double result=0.;
|
||||
G4ParticleHPFastLegendre theLeg;
|
||||
// G4cout <<"the COEFFS "<<k<<" ";
|
||||
// G4cout <<theCoeff[k].GetNumberOfPoly()<<" ";
|
||||
|
||||
@@ -87,7 +87,7 @@ G4ReactionProduct * G4ParticleHPNBodyPhaseSpace::Sample(G4double anEnergy, G4dou
|
||||
if(maxE<=0){
|
||||
maxE=1.*CLHEP::eV;
|
||||
}
|
||||
G4double energy;
|
||||
G4double energy=0.;
|
||||
G4double max(0);
|
||||
if(theTotalCount<=3)
|
||||
{
|
||||
|
||||
@@ -371,7 +371,7 @@
|
||||
|
||||
G4double G4ParticleHPVector::Sample() // Samples X according to distribution Y
|
||||
{
|
||||
G4double result;
|
||||
G4double result=0.;
|
||||
G4int j;
|
||||
for(j=0; j<GetVectorLength(); j++)
|
||||
{
|
||||
@@ -417,7 +417,7 @@
|
||||
result = value;
|
||||
*/
|
||||
G4double rand;
|
||||
G4double value, test;
|
||||
G4double value = 0., test;
|
||||
G4int jcounter=0;
|
||||
G4int jcounter_max=1024;
|
||||
do
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
{
|
||||
G4double a = theApar.GetY(anEnergy)*eV;
|
||||
G4double b = theBpar.GetY(anEnergy)/eV;
|
||||
G4double result;
|
||||
G4double result=0.;
|
||||
G4double random, cut, max;
|
||||
max = std::sinh(std::sqrt(b*15.*a));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user