Import Geant4 10.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 12:08:39 +02:00
parent 286caacf06
commit c9b32a6c0a
5770 changed files with 1050949 additions and 367105 deletions
@@ -28,6 +28,7 @@
#include "G4SystemOfUnits.hh"
#include "G4Nucleus.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTarg )
{
@@ -90,12 +91,12 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
{
if ( jA != 0 )
{
theSec->SetDefinition( G4ParticleTable::GetParticleTable()->FindIon( jZ , jA , 0 , 0 ) );
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , jA , iM ) );
totN += jA;
}
else
{
theSec->SetDefinition( G4ParticleTable::GetParticleTable()->FindIon( jZ , iA+1-totN , 0 , 0 ) );
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , iA+1-totN , iM ) );
}
}
else
@@ -28,7 +28,7 @@
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Nucleus.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
G4HadFinalState * G4LENDElastic::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTarg )
{
@@ -58,15 +58,16 @@ G4HadFinalState * G4LENDElastic::ApplyYourself(const G4HadProjectile& aTrack, G4
G4double theta = std::acos( aMu );
//G4double sinth = std::sin( theta );
G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>( aTrack.GetDefinition() ) );
G4ReactionProduct theNeutron( aTrack.GetDefinition() );
theNeutron.SetMomentum( aTrack.Get4Momentum().vect() );
theNeutron.SetKineticEnergy( ke );
//G4cout << "iZ " << iZ << " iA " << iA << G4endl;
G4ReactionProduct theTarget( G4ParticleTable::GetParticleTable()->FindIon( iZ , iA , 0 , iZ ) );
G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon( iZ , iA , iM );
G4ReactionProduct theTarget( pd );
G4double mass = G4ParticleTable::GetParticleTable()->FindIon( iZ , iA , 0 , iZ )->GetPDGMass();
G4double mass = pd->GetPDGMass();
// add Thermal motion
G4double kT = k_Boltzmann*temp;
@@ -133,7 +134,7 @@ G4HadFinalState * G4LENDElastic::ApplyYourself(const G4HadProjectile& aTrack, G4
G4DynamicParticle* theRecoil = new G4DynamicParticle;
// theRecoil->SetDefinition( ionTable->GetIon( iZ , iA ) );
theRecoil->SetDefinition( G4ParticleTable::GetParticleTable()->FindIon( iZ, iA , 0, iZ ));
theRecoil->SetDefinition( G4IonTable::GetIonTable()->GetIon( iZ, iA , iM ));
theRecoil->SetMomentum( theTarget.GetMomentum() );
theResult->AddSecondary( theRecoil );
@@ -26,7 +26,7 @@
#include "G4LENDFission.hh"
#include "G4SystemOfUnits.hh"
#include "G4Nucleus.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
G4HadFinalState * G4LENDFission::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTarg )
{
@@ -55,6 +55,7 @@ G4HadFinalState * G4LENDFission::ApplyYourself(const G4HadProjectile& aTrack, G4
{
G4int jZ = (*products)[j].Z;
G4int jA = (*products)[j].A;
G4int jM = (*products)[j].m;
//G4cout << "Z = " << (*products)[j].Z
// << ", A = " << (*products)[j].A
@@ -68,8 +69,7 @@ G4HadFinalState * G4LENDFission::ApplyYourself(const G4HadProjectile& aTrack, G4
if ( jZ > 0 )
{
//Ex j?
theSec->SetDefinition( G4ParticleTable::GetParticleTable()->FindIon( jZ, jA , 0, 0 ) );
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ, jA , jM ) );
}
else if ( jA == 1 && jZ == 0 )
{
@@ -92,3 +92,9 @@ G4HadFinalState * G4LENDFission::ApplyYourself(const G4HadProjectile& aTrack, G4
return theResult;
}
const std::pair<G4double, G4double> G4LENDFission::GetFatalEnergyCheckLevels() const
{
// max energy non-conservation is mass of heavy nucleus
//return std::pair<G4double, G4double>(5*perCent,250*GeV);
return std::pair<G4double, G4double>(5*perCent,DBL_MAX);
}
@@ -26,7 +26,7 @@
#include "G4LENDInelastic.hh"
#include "G4SystemOfUnits.hh"
#include "G4Nucleus.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
G4HadFinalState * G4LENDInelastic::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTarg )
{
@@ -66,6 +66,11 @@ G4HadFinalState * G4LENDInelastic::ApplyYourself(const G4HadProjectile& aTrack,
G4int jZ = (*products)[j].Z;
G4int jA = (*products)[j].A;
G4int jm = (*products)[j].m;
//TK
//We need coordination LEND *products)[j].m and G4IonTable(Z,A,m)
//Excitation energy of isomer level is might (probably) different each other.
//
//G4cout << "ZA = " << 1000 * (*products)[j].Z + (*products)[j].A << " EK = "
// << (*products)[j].kineticEnergy
@@ -90,12 +95,12 @@ G4HadFinalState * G4LENDInelastic::ApplyYourself(const G4HadProjectile& aTrack,
{
if ( jA != 0 )
{
theSec->SetDefinition( G4ParticleTable::GetParticleTable()->FindIon( jZ , jA , 0 , 0 ) );
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , jA , jm ) );
totN += jA;
}
else
{
theSec->SetDefinition( G4ParticleTable::GetParticleTable()->FindIon( jZ , iA+1-totN , 0 , 0 ) );
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , iA+1-totN , jm ) );
}
}
else
@@ -48,7 +48,7 @@ G4LENDManager::G4LENDManager()
:verboseLevel( 0 )
{
printBanner();
//printBanner();
G4String xmcf;
if( getenv("G4LENDDATA") == NULL ) {
@@ -71,7 +71,7 @@ G4LENDManager::G4LENDManager()
v_lend_target.clear();
ionTable = new G4IonTable();
ionTable = G4IonTable::GetIonTable();
nistElementBuilder = new G4NistElementBuilder( 0 );
}
@@ -95,7 +95,7 @@ G4LENDManager::~G4LENDManager()
delete it->second;
}
delete ionTable;
//delete ionTable;
delete nistElementBuilder;
}
@@ -167,7 +167,7 @@ void G4LENDModel::create_used_target_map()
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
G4HadFinalState * G4LENDModel::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTarg )
{
@@ -196,13 +196,14 @@ G4HadFinalState * G4LENDModel::ApplyYourself(const G4HadProjectile& aTrack, G4Nu
G4double theta = std::acos( aMu );
//G4double sinth = std::sin( theta );
G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>( aTrack.GetDefinition() ) );
G4ReactionProduct theNeutron( aTrack.GetDefinition() );
theNeutron.SetMomentum( aTrack.Get4Momentum().vect() );
theNeutron.SetKineticEnergy( ke );
G4ReactionProduct theTarget( G4ParticleTable::GetParticleTable()->FindIon( iZ , iA , 0 , iZ ) );
G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon( iZ , iA , iM );
G4ReactionProduct theTarget( pd );
G4double mass = G4ParticleTable::GetParticleTable()->FindIon( iZ , iA , 0 , iZ )->GetPDGMass();
G4double mass = pd->GetPDGMass();
// add Thermal motion
G4double kT = k_Boltzmann*temp;
@@ -254,7 +255,7 @@ G4HadFinalState * G4LENDModel::ApplyYourself(const G4HadProjectile& aTrack, G4Nu
theResult->SetMomentumChange(theNeutron.GetMomentum().unit());
G4DynamicParticle* theRecoil = new G4DynamicParticle;
theRecoil->SetDefinition( G4ParticleTable::GetParticleTable()->FindIon( iZ, iA , 0, iZ ) );
theRecoil->SetDefinition( G4IonTable::GetIonTable()->GetIon( iZ , iA , iM , iZ ) );
theRecoil->SetMomentum( theTarget.GetMomentum() );
theResult->AddSecondary( theRecoil );
@@ -33,6 +33,8 @@
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# <<END-copyright>>
*/
#include <iostream>
#include <float.h>
#include <string.h>
#include <cmath>
#include <tpia_target.h>
@@ -108,7 +110,12 @@ int tpia_kinetics_COMKineticEnergy2LabEnergyAndMomentum( statusMessageReporting
outgoingData[0].py_vy = py3;
outgoingData[0].pz_vz = pz3;
pp3 = p_perp2 + pz3 * pz3;
//TK140602 Modified for protecting divided by 0 BEGIN
if ( m3cc2 != 0 )
x = pp3 / ( 2 * m3cc2 );
else
x = FLT_MIN;
//TK140602 Modified for protecting divided by 0 END
if( x < 1e-5 ) {
outgoingData[0].kineticEnergy = m3cc * x * ( 1 - 0.5 * x * ( 1 - x ) ); }
else {
@@ -36,6 +36,8 @@
#include "Randomize.hh"
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -459,8 +461,22 @@ int tpia_misc_sampleEqualProbableBin( statusMessageReporting *, tpia_decaySampli
value1 = ( 1. - fE ) * binned->energies[index1].bins[j] + fE * binned->energies[index2].bins[j];
value2 = ( 1. - fE ) * binned->energies[index1].bins[j+1] + fE * binned->energies[index2].bins[j+1];
value3 = ( 1. - fE ) * binned->energies[index1].bins[j+2] + fE * binned->energies[index2].bins[j+2];
//
//TK140602 Modified for protecting divided by 0 BEGIN
if ( value1 == value2 && value2 == value3 ) {
value = value1;
} else {
if ( value2 != value1 )
P12 = 1. / ( value2 - value1 );
else
P12 =FLT_MAX;
if ( value3 != value2 )
P23 = 1. / ( value3 - value2 );
else
P23 =FLT_MAX;
r = tpia_misc_drng( decaySamplingInfo->rng, decaySamplingInfo->rngState );
if( 0.25 * ( 1.0 + 2.0 * ( value2 - value1 ) / ( value3 - value1 ) ) > r ) {
P23 = 2. / ( value3 - value1 );
@@ -472,6 +488,8 @@ int tpia_misc_sampleEqualProbableBin( statusMessageReporting *, tpia_decaySampli
r = tpia_misc_drng( decaySamplingInfo->rng, decaySamplingInfo->rngState );
if( P23 != P12 ) r = ( -P12 + std::sqrt( P12 * P12 * ( 1. - r ) + r * P23 * P23 ) ) / ( P23 - P12 );
value = 0.5 * ( value1 + value2 + r * ( value3 - value1 ) );
}
//TK140602 Modified for protecting divided by 0 END
}
*value_ = value;
return( 0 );
@@ -45,7 +45,8 @@ namespace GIDI {
using namespace GIDI;
#endif
static const int tpia_b_unknown = 0,
//static const int tpia_b_unknown = 0,
static const int /*tpia_b_unknown = 0,*/
tpia_b_twoBody_angular = tpia_m_angular,
tpia_b_twoBody_formFactor = 0, /* ??? */
tpia_b_NBody_Legendre = tpia_m_Legendre,