Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -23,13 +23,14 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// Implementation of the HETC88 code into Geant4.
// Evaporation and De-excitation parts
// T. Lampen, Helsinki Institute of Physics, May-2000
//
// 20120608 M. Kelsey -- Change vars 's','m','m2' to avoid name collisions
#include "G4BEChargedChannel.hh"
#include "G4SystemOfUnits.hh"
G4BEChargedChannel::G4BEChargedChannel()
{
@@ -65,9 +66,9 @@ void G4BEChargedChannel::calculateProbability()
// max(s_i), where i goes over all channels.
G4double levelParam = getLevelDensityParameter();
G4double s = 2 * std::sqrt( levelParam * ( excitationEnergy - getThresh() - correction ) );
G4double slevel = 2 * std::sqrt( levelParam * ( excitationEnergy - getThresh() - correction ) );
G4double constant = A / 2 * ( 2 * spin + 1 ) * ( 1 + coulombFactor() );
G4double eye1 = ( std::pow( s, 2. ) - 3 * s + 3 ) / ( 4 * std::pow( levelParam, 2. ) ) * std::exp( s );
G4double eye1 = ( slevel*slevel - 3 * slevel + 3 ) / ( 4 * levelParam*levelParam ) * std::exp( slevel );
emissionProbability = constant * std::pow( G4double(residualA), 0.6666666 ) * eye1;
@@ -92,37 +93,12 @@ void G4BEChargedChannel::calculateProbability()
G4double G4BEChargedChannel::sampleKineticEnergy()
{
// G4double randExp1;
// G4double randExp2;
// G4double s;
// G4double levelParam;
// G4double kineticEnergyAv;
// G4double kineticEnergy;
// randExp1 = RandExponential::shoot( 1 );
// randExp2 = RandExponential::shoot( 1 );
// levelParam = getLevelDensityParameter();
// s = 2 * std::sqrt( levelParam * ( excitationEnergy - getThresh() - correction ) );
// kineticEnergyAv = 2 * ( std::pow( s, 3. ) - 6.0 * std::pow( s, 2. ) + 15.0 * s - 15.0 ) /
// ( ( 2.0 * std::pow( s, 2. ) - 6.0 * s + 6.0 ) * levelParam );
// kineticEnergy = 0.5 * ( randExp1 + randExp2 ) * kineticEnergyAv + getThresh() - getQ();
// if ( verboseLevel >= 10 )
// G4cout << " G4BEChargedChannel : sampleKineticEnergy() " << G4endl
// << " kinetic e = " << kineticEnergy << G4endl
// << " average = " << kineticEnergyAv << G4endl
// << " s = " << s << G4endl
// << " levelParam = " << levelParam << G4endl
// << " randExp1 = " << randExp1 << G4endl
// << " randExp2 = " << randExp2 << G4endl;
G4double levelParam;
levelParam = getLevelDensityParameter();
const G4double xMax = excitationEnergy - getThresh() - correction; // maximum number
const G4double xProb = ( - 1 + std::sqrt ( 1 + 4 * levelParam * xMax ) ) / ( 2 * levelParam ); // most probable value
const G4double m = xProb * std::exp ( 2 * std::sqrt ( levelParam * ( xMax - xProb ) ) ); // maximum value of P(x)
const G4double maxProb = xProb * std::exp ( 2 * std::sqrt ( levelParam * ( xMax - xProb ) ) ); // maximum value of P(x)
// Sample x according to density function P(x) with rejection method
G4double r1;
@@ -131,7 +107,7 @@ G4double G4BEChargedChannel::sampleKineticEnergy()
do
{
r1 = G4UniformRand() * xMax;
r2 = G4UniformRand() * m;
r2 = G4UniformRand() * maxProb;
koe++;
}
while ( r1 * std::exp ( 2 * std::sqrt ( levelParam * ( xMax - r1 ) ) ) < r2 );
@@ -31,6 +31,7 @@
#include "globals.hh"
#include "G4ios.hh"
#include "Randomize.hh"
#include "G4PhysicalConstants.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
#include "G4Deuteron.hh"
@@ -27,10 +27,13 @@
// Implementation of the HETC88 code into Geant4.
// Evaporation and De-excitation parts
// T. Lampen, Helsinki Institute of Physics, May-2000
//
// 20120608 M. Kelsey -- Change vars 's','m','m2' to avoid name collisions
#include "globals.hh"
#include "G4ios.hh"
#include "Randomize.hh"
#include "G4SystemOfUnits.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
#include "G4Deuteron.hh"
@@ -77,11 +80,9 @@ void G4BENeutronChannel::calculateProbability()
const G4double levelParam = getLevelDensityParameter();
const G4double s = 2 * std::sqrt( levelParam * ( excitationEnergy - getThresh() - correction ) );
// const G4double temp = ( std::pow( s, 2. ) - 3 * s + 3 ) / ( 4 * std::pow( levelParam, 2. ) )
// + beta() * ( s - 1 ) / ( 2 * levelParam );
const G4double eye0 = std::exp( s ) * ( s - 1 ) / ( 2 * levelParam );
const G4double eye1 = ( std::pow( s, 2. ) - 3*s +3 ) * std::exp( s ) / ( 4 * std::pow( levelParam, 2. ) ) ;
const G4double slevel = 2 * std::sqrt( levelParam * ( excitationEnergy - getThresh() - correction ) );
const G4double eye0 = std::exp( slevel ) * ( slevel - 1 ) / ( 2 * levelParam );
const G4double eye1 = ( slevel*slevel - 3*slevel +3 ) * std::exp( slevel ) / ( 4 * levelParam*levelParam ) ;
emissionProbability = std::pow( G4double(residualA), 0.666666 ) * alpha() * ( eye1 + beta() * eye0 );
@@ -106,33 +107,6 @@ void G4BENeutronChannel::calculateProbability()
G4double G4BENeutronChannel::sampleKineticEnergy()
{
// Samples the kinetic energy of the particle in CMS
//
// Algorithm used in HETC98
//
// G4double e1;
// G4double e2;
// G4double s;
// G4double levelParam;
// G4double eye0;
// G4double eye1;
// G4double kineticEnergyAv;
// G4double kineticEnergy;
// e1 = RandExponential::shoot( 1 );
// e2 = RandExponential::shoot( 1 );
// levelParam = getLevelDensityParameter();
// s = 2 * std::sqrt( levelParam * ( excitationEnergy - getThresh() - correction ) );
// eye0 = 0.5 * ( s - 1 ) * std::exp( s ) / levelParam;
// eye1 = ( std::pow( s, 2. ) - 3*s + 3 ) * std::exp( s ) / ( 4 * std::pow( levelParam, 2. ) );
// kineticEnergyAv = 2 * ( std::pow( s, 3. ) - 6.0 * std::pow( s, 2. ) + 15.0 * s - 15.0 ) /
// ( ( 2.0 * std::pow( s, 2. ) - 6.0 * s + 6.0 ) * levelParam );
// kineticEnergyAv = ( kineticEnergyAv + beta() ) / ( 1.0 + beta() * eye0
// / eye1 );
// kineticEnergy = 0.5 * ( e1 + e2 ) * kineticEnergyAv + getThresh() - getQ();
////////////////
// A random number is sampled from the density function
// P(x) = x * std::exp ( 2 std::sqrt ( a ( xMax - x ) ) ) [not normalized],
@@ -145,7 +119,7 @@ G4double G4BENeutronChannel::sampleKineticEnergy()
const G4double xMax = excitationEnergy - getThresh() - correction + beta(); // maximum number
const G4double xProb = ( - 1 + std::sqrt ( 1 + 4 * levelParam * xMax ) ) / ( 2 * levelParam ); // most probable value
const G4double m = xProb * std::exp ( 2 * std::sqrt ( levelParam * ( xMax - xProb ) ) ); // maximum value of P(x)
const G4double maxProb = xProb * std::exp ( 2 * std::sqrt ( levelParam * ( xMax - xProb ) ) ); // maximum value of P(x)
// Sample x according to density function P(x) with rejection method
G4double r1;
@@ -154,7 +128,7 @@ G4double G4BENeutronChannel::sampleKineticEnergy()
do
{
r1 = beta() + G4UniformRand() * ( xMax - beta() );
r2 = G4UniformRand() * m;
r2 = G4UniformRand() * maxProb;
koe++;
}
while ( r1 * std::exp ( 2 * std::sqrt ( levelParam * ( xMax - r1 ) ) ) < r2 );
@@ -30,6 +30,8 @@
#include "globals.hh"
#include "G4BertiniEvaporation.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4BENeutronChannel.hh"
#include "G4BEProtonChannel.hh"
#include "G4BEDeuteronChannel.hh"
@@ -31,6 +31,8 @@
#include "globals.hh"
#include "G4ios.hh"
#include "Randomize.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
#include "G4Deuteron.hh"
@@ -161,7 +163,7 @@ G4double G4BertiniEvaporationChannel::getCoulomb()
const G4double factor = 0.84696; // = e / ( 4 pi epsilon_0 r0 ) * 10^-6, r0=1.7E-15
// In HETC88 this factor was 0.88235, perhaps due to different r0
G4double coulomb = factor * particleZ * qmFactor() * residualZ /
G4double coulombBarrier = factor * particleZ * qmFactor() * residualZ /
( std::pow( G4double(residualA), 0.33333333 ) + rho ) * MeV;
if ( verboseLevel >= 10 )
@@ -174,7 +176,7 @@ G4double G4BertiniEvaporationChannel::getCoulomb()
<< " part Z " << particleZ << G4endl
<< " (correction) " << correction << G4endl;
return coulomb;
return coulombBarrier;
}