Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -25,6 +25,8 @@
//
#include "G4LENDCapture.hh"
#include "G4Fragment.hh"
#include "G4PhotonEvaporation.hh"
#include "G4SystemOfUnits.hh"
#include "G4Nucleus.hh"
#include "G4ParticleTable.hh"
@@ -51,13 +53,18 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
theResult->Clear();
G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
std::vector<G4GIDI_Product>* products = aTarget->getCaptureFinalState( ke*MeV, temp, NULL, NULL );
//std::vector<G4GIDI_Product>* products = aTarget->getCaptureFinalState( ke*MeV, temp, NULL, NULL );
std::vector<G4GIDI_Product>* products = aTarget->getCaptureFinalState( ke*MeV, temp, MyRNG, NULL );
G4int ipZ = aTrack.GetDefinition()->GetAtomicNumber();
G4int ipA = aTrack.GetDefinition()->GetAtomicMass();
G4bool needResidual=true;
G4ThreeVector p(0,0,0);
if ( products != NULL )
{
G4ThreeVector p(0,0,0);
G4int totN = 0;
for ( G4int j = 0; j < int( products->size() ); j++ )
@@ -72,13 +79,14 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
// << " pz " << (*products)[j].pz
// << G4endl;
if ( jZ == iZ + ipZ && jA == iA + ipA ) needResidual = false;
G4ThreeVector dp((*products)[j].px,(*products)[j].py,(*products)[j].pz);
p += dp;
G4DynamicParticle* theSec = new G4DynamicParticle;
if ( jA == 1 && jZ == 1 )
{
if ( jA == 1 && jZ == 1 ) {
theSec->SetDefinition( G4Proton::Proton() );
totN += 1;
}
@@ -87,8 +95,7 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
theSec->SetDefinition( G4Neutron::Neutron() );
totN += 1;
}
else if ( jZ > 0 )
{
else if ( jZ > 0 ) {
if ( jA != 0 )
{
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , jA , iM ) );
@@ -99,21 +106,62 @@ G4HadFinalState * G4LENDCapture::ApplyYourself(const G4HadProjectile& aTrack, G4
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , iA+1-totN , iM ) );
}
}
else
{
else {
theSec->SetDefinition( G4Gamma::Gamma() );
}
theSec->SetMomentum( G4ThreeVector( (*products)[j].px*MeV , (*products)[j].py*MeV , (*products)[j].pz*MeV ) );
/*
if ( dp.mag() == 0 )
{
theSec->SetMomentum( -p*MeV );
//theSec->SetMomentum( -p*MeV );
}
*/
theResult->AddSecondary( theSec );
}
}
else
{
//For the case data does not provide final states
//G4cout << "products != NULL; iZ = " << iZ << ", iA = " << iA << G4endl;
// TK comment
// aTarg->ReturnTargetParticle()->Get4Momentum has trouble, thus we use following
G4Fragment nucleus( iA + ipA , iZ + ipZ , aTrack.Get4Momentum() + G4LorentzVector( G4ThreeVector(0,0,0) , G4IonTable::GetIonTable()->GetIon( iZ + ipZ , iA )->GetPDGMass() ) );
G4PhotonEvaporation photonEvaporation;
photonEvaporation.SetICM( TRUE );
G4FragmentVector* products_from_PE = photonEvaporation.BreakItUp(nucleus);
G4FragmentVector::iterator it;
for ( it = products_from_PE->begin(); it != products_from_PE->end(); it++)
{
if ( (*it)->GetZ_asInt() == iZ + ipZ && (*it)->GetA_asInt() == iA + ipA ) needResidual = false;
G4DynamicParticle* theSec = new G4DynamicParticle;
if ( (*it)->GetParticleDefinition() != NULL ) {
//G4cout << (*it)->GetParticleDefinition()->GetParticleName() << G4endl;
theSec->SetDefinition( (*it)->GetParticleDefinition() );
theSec->Set4Momentum( (*it)->GetMomentum() );
} else {
//G4cout << (*it)->GetZ_asInt() << " " << (*it)->GetA_asInt() << G4endl;
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( (*it)->GetZ_asInt() , (*it)->GetA_asInt() ) );
theSec->Set4Momentum( (*it)->GetMomentum() );
}
theResult->AddSecondary( theSec );
}
}
//if necessary, generate residual nucleus
if ( needResidual ) {
G4DynamicParticle* residual = new G4DynamicParticle;
residual->SetDefinition( G4IonTable::GetIonTable()->GetIon( iZ + ipZ , iA + ipA ) );
residual->SetMomentum( -p*MeV );
theResult->AddSecondary( residual );
}
delete products;
theResult->SetStatusChange( stopAndKill );