Import Geant4 10.2.0 source tree
This commit is contained in:
@@ -60,11 +60,10 @@
|
||||
G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* projectile)
|
||||
{
|
||||
theAngular = 0;
|
||||
currentMeanEnergy = -2;
|
||||
fresh = true;
|
||||
fCache.Get()->currentMeanEnergy = -2;
|
||||
fCache.Get()->fresh = true;
|
||||
adjustResult = true;
|
||||
if ( getenv( "G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) adjustResult = false;
|
||||
adjustResult = true;//GDEB
|
||||
|
||||
theMinEner = DBL_MAX;
|
||||
theMaxEner = -DBL_MAX;
|
||||
@@ -75,13 +74,11 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
{
|
||||
adjustResult = true;
|
||||
if ( getenv( "G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) adjustResult = false;
|
||||
adjustResult = true;//GDEB
|
||||
|
||||
theProjectile = projectile;
|
||||
|
||||
aDataFile >> theEnergy >> nEnergies >> nDiscreteEnergies >> nAngularParameters;
|
||||
if( getenv("G4PHPTEST") )
|
||||
G4cout << this << " G4ParticleHPContAngularPar::Init( " << theEnergy << " " << nEnergies << " " << nDiscreteEnergies << " " << nAngularParameters << G4endl; //GDEB
|
||||
/*if( getenv("G4PHPTEST") )*/
|
||||
theEnergy *= eV;
|
||||
theAngular = new G4ParticleHPList [nEnergies];
|
||||
for(G4int i=0; i<nEnergies; i++)
|
||||
@@ -101,6 +98,7 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
G4int angularRep, G4int /*interpolE*/ )
|
||||
{
|
||||
if( getenv("G4PHPTEST") ) G4cout << " G4ParticleHPContAngularPar::Sample " << anEnergy << " " << massCode << " " << angularRep << G4endl; //GDEB
|
||||
if ( fCache.Get() == NULL ) cacheInit();
|
||||
G4ReactionProduct * result = new G4ReactionProduct;
|
||||
G4int Z = static_cast<G4int>(massCode/1000);
|
||||
G4int A = static_cast<G4int>(massCode-1000*Z);
|
||||
@@ -152,19 +150,19 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
|
||||
//1st check remaining_energy
|
||||
// if this is the first set it. (How?)
|
||||
if ( fresh == true )
|
||||
if ( fCache.Get()->fresh == true )
|
||||
{
|
||||
//Discrete Lines, larger energies come first
|
||||
//Continues Emssions, low to high LAST
|
||||
remaining_energy = std::max ( theAngular[0].GetLabel() , theAngular[nEnergies-1].GetLabel() );
|
||||
fresh = false;
|
||||
fCache.Get()->remaining_energy = std::max ( theAngular[0].GetLabel() , theAngular[nEnergies-1].GetLabel() );
|
||||
fCache.Get()->fresh = false;
|
||||
}
|
||||
|
||||
//Cheating for small remaining_energy
|
||||
//TEMPORAL SOLUTION
|
||||
if ( nDiscreteEnergies == nEnergies )
|
||||
{
|
||||
remaining_energy = std::max ( remaining_energy , theAngular[nDiscreteEnergies-1].GetLabel() ); //Minimum Line
|
||||
fCache.Get()->remaining_energy = std::max ( fCache.Get()->remaining_energy , theAngular[nDiscreteEnergies-1].GetLabel() ); //Minimum Line
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -176,7 +174,7 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
cont_min = theAngular[j].GetLabel();
|
||||
if ( theAngular[j].GetValue(0) != 0.0 ) break;
|
||||
}
|
||||
remaining_energy = std::max ( remaining_energy , std::min ( theAngular[nDiscreteEnergies-1].GetLabel() , cont_min ) ); //Minimum Line or grid
|
||||
fCache.Get()->remaining_energy = std::max ( fCache.Get()->remaining_energy , std::min ( theAngular[nDiscreteEnergies-1].GetLabel() , cont_min ) ); //Minimum Line or grid
|
||||
}
|
||||
//
|
||||
G4double random = G4UniformRand();
|
||||
@@ -187,7 +185,7 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
for ( G4int j = 0 ; j < nDiscreteEnergies ; j++ )
|
||||
{
|
||||
G4double delta = 0.0;
|
||||
if ( theAngular[j].GetLabel() <= remaining_energy ) delta = theAngular[i].GetValue(0);
|
||||
if ( theAngular[j].GetLabel() <= fCache.Get()->remaining_energy ) delta = theAngular[i].GetValue(0);
|
||||
running[j+1] = running[j] + delta;
|
||||
}
|
||||
G4double tot_prob_DIS = running[ nDiscreteEnergies ];
|
||||
@@ -197,7 +195,7 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
G4double delta = 0.0;
|
||||
G4double e_low = 0.0;
|
||||
G4double e_high = 0.0;
|
||||
if ( theAngular[j].GetLabel() <= remaining_energy ) delta = theAngular[j].GetValue(0);
|
||||
if ( theAngular[j].GetLabel() <= fCache.Get()->remaining_energy ) delta = theAngular[j].GetValue(0);
|
||||
|
||||
//To calculate Prob. e_low and e_high should be in eV
|
||||
//There are two case
|
||||
@@ -317,7 +315,7 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
}
|
||||
|
||||
//TK080711
|
||||
if( adjustResult ) remaining_energy -= fsEnergy;
|
||||
if( adjustResult ) fCache.Get()->remaining_energy -= fsEnergy;
|
||||
//TK080711
|
||||
|
||||
//080801b
|
||||
@@ -329,10 +327,10 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
// Only continue, TK will clean up
|
||||
|
||||
//080714
|
||||
if ( fresh == true )
|
||||
if ( fCache.Get()->fresh == true )
|
||||
{
|
||||
remaining_energy = theAngular[ nEnergies-1 ].GetLabel();
|
||||
fresh = false;
|
||||
fCache.Get()->remaining_energy = theAngular[ nEnergies-1 ].GetLabel();
|
||||
fCache.Get()->fresh = false;
|
||||
}
|
||||
//080714
|
||||
G4double random = G4UniformRand();
|
||||
@@ -355,7 +353,7 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
*/
|
||||
|
||||
running[i]=running[i-1];
|
||||
if ( remaining_energy >= theAngular[i].GetLabel() )
|
||||
if ( fCache.Get()->remaining_energy >= theAngular[i].GetLabel() )
|
||||
{
|
||||
running[i] += theInt.GetBinIntegral(theManager.GetScheme(i-1),
|
||||
theAngular[i-1].GetLabel(), theAngular[i].GetLabel(),
|
||||
@@ -368,10 +366,10 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
// cash the mean energy in this distribution
|
||||
//080409 TKDB
|
||||
if ( nEnergies == 1 || running[nEnergies-1] == 0 )
|
||||
currentMeanEnergy = 0.0;
|
||||
fCache.Get()->currentMeanEnergy = 0.0;
|
||||
else
|
||||
{
|
||||
currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
fCache.Get()->currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
}
|
||||
|
||||
//080409 TKDB
|
||||
@@ -452,7 +450,7 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
delete [] running;
|
||||
|
||||
//080714
|
||||
if( adjustResult ) remaining_energy -= fsEnergy;
|
||||
if( adjustResult ) fCache.Get()->remaining_energy -= fsEnergy;
|
||||
//080714
|
||||
}
|
||||
}
|
||||
@@ -480,9 +478,9 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
//080409 TKDB
|
||||
//currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
if ( nEnergies == 1 )
|
||||
currentMeanEnergy = 0.0;
|
||||
fCache.Get()->currentMeanEnergy = 0.0;
|
||||
else
|
||||
currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
fCache.Get()->currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
|
||||
G4int itt(0);
|
||||
G4double randkal = G4UniformRand();
|
||||
@@ -558,9 +556,9 @@ G4ParticleHPContAngularPar::G4ParticleHPContAngularPar( G4ParticleDefinition* pr
|
||||
// cash the mean energy in this distribution
|
||||
//currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
if ( nEnergies == 1 )
|
||||
currentMeanEnergy = 0.0;
|
||||
fCache.Get()->currentMeanEnergy = 0.0;
|
||||
else
|
||||
currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
fCache.Get()->currentMeanEnergy = weighted/running[nEnergies-1];
|
||||
|
||||
//080409 TKDB
|
||||
if ( nEnergies == 1 ) it = 0;
|
||||
|
||||
Reference in New Issue
Block a user