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
@@ -48,7 +48,7 @@
#include "G4LorentzVector.hh"
#include "G4IonTable.hh"
#include "G4ParticleHPDataUsed.hh"
#include "G4Pow.hh"
#include "zlib.h"
void G4ParticleHPElasticFS::Init (G4double A, G4double Z, G4int M, G4String & dirName, G4String &, G4ParticleDefinition* )
@@ -119,6 +119,7 @@ void G4ParticleHPElasticFS::Init (G4double A, G4double Z, G4int M, G4String & di
theProbArray->SetX(i, ii, costh);
theProbArray->SetY(i, ii, prob);
}
theProbArray->DoneSetXY( i );
}
}
else if ( repFlag==3 )
@@ -175,6 +176,7 @@ void G4ParticleHPElasticFS::Init (G4double A, G4double Z, G4int M, G4String & di
theProbArray->SetX( i , ii , costh );
theProbArray->SetY( i , ii , prob );
}
theProbArray->DoneSetXY( i );
}
}
else if (repFlag==0)
@@ -192,7 +194,8 @@ void G4ParticleHPElasticFS::Init (G4double A, G4double Z, G4int M, G4String & di
G4HadFinalState * G4ParticleHPElasticFS::ApplyYourself(const G4HadProjectile & theTrack)
{
// G4cout << "G4ParticleHPElasticFS::ApplyYourself+"<<G4endl;
theResult.Clear();
if ( theResult.Get() == NULL ) theResult.Put( new G4HadFinalState );
theResult.Get()->Clear();
G4double eKinetic = theTrack.GetKineticEnergy();
const G4HadProjectile *incidentParticle = &theTrack;
G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition() ));
@@ -296,8 +299,8 @@ void G4ParticleHPElasticFS::Init (G4double A, G4double Z, G4int M, G4String & di
theNeutron.Lorentz(theNeutron, -1.*theCMS);
theTarget.Lorentz(theTarget, -1.*theCMS);
//111005 Protection for not producing 0 kinetic energy target
if ( theNeutron.GetKineticEnergy() <= 0 ) theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + std::pow( 10 , -15.65 ) ) );
if ( theTarget.GetKineticEnergy() <= 0 ) theTarget.SetTotalEnergy ( theTarget.GetMass() * ( 1 + std::pow( 10 , -15.65 ) ) );
if ( theNeutron.GetKineticEnergy() <= 0 ) theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
if ( theTarget.GetKineticEnergy() <= 0 ) theTarget.SetTotalEnergy ( theTarget.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
}
else if (frameFlag == 2) // CMS
{
@@ -343,7 +346,7 @@ G4cout << "after " << ( n4p.e() - n4p.m() ) / eV<< G4endl;
//theNeutron.SetMomentum( G4ThreeVector(0) );
//theNeutron.SetTotalEnergy ( theNeutron.GetMass() );
//110822 Protection for not producing 0 kinetic energy neutron
theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + std::pow( 10 , -15.65 ) ) );
theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
}
theTarget.Lorentz(theTarget, -1.*theCMS);
@@ -353,7 +356,7 @@ G4cout << "after " << ( n4p.e() - n4p.m() ) / eV<< G4endl;
//theTarget.SetMomentum( G4ThreeVector(0) );
//theTarget.SetTotalEnergy ( theTarget.GetMass() );
//110822 Protection for not producing 0 kinetic energy target
theTarget.SetTotalEnergy ( theTarget.GetMass() * ( 1 + std::pow( 10 , -15.65 ) ) );
theTarget.SetTotalEnergy ( theTarget.GetMass() * ( 1 + G4Pow::GetInstance()->powA( 10 , -15.65 ) ) );
}
}
else
@@ -363,46 +366,14 @@ G4cout << "after " << ( n4p.e() - n4p.m() ) / eV<< G4endl;
}
// now all in Lab
// nun den recoil generieren...und energy change, momentum change angeben.
theResult.SetEnergyChange(theNeutron.GetKineticEnergy());
theResult.SetMomentumChange(theNeutron.GetMomentum().unit());
theResult.Get()->SetEnergyChange(theNeutron.GetKineticEnergy());
theResult.Get()->SetMomentumChange(theNeutron.GetMomentum().unit());
G4DynamicParticle* theRecoil = new G4DynamicParticle;
if(targetMass<4.5)
{
if(targetMass<1)
{
// proton
theRecoil->SetDefinition(G4Proton::Proton());
}
else if(targetMass<2 )
{
// deuteron
theRecoil->SetDefinition(G4Deuteron::Deuteron());
}
else if(targetMass<2.999 )
{
// 3He
theRecoil->SetDefinition(G4He3::He3());
}
else if(targetMass<3 )
{
// Triton
theRecoil->SetDefinition(G4Triton::Triton());
}
else
{
// alpha
theRecoil->SetDefinition(G4Alpha::Alpha());
}
}
else
{
theRecoil->SetDefinition(G4IonTable::GetIonTable()
->GetIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA), 0 ));
}
theRecoil->SetDefinition( G4IonTable::GetIonTable()->GetIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA), 0 ) );
theRecoil->SetMomentum(theTarget.GetMomentum());
theResult.AddSecondary(theRecoil);
theResult.Get()->AddSecondary(theRecoil);
// G4cout << "G4ParticleHPElasticFS::ApplyYourself 10+"<<G4endl;
// postpone the tracking of the primary neutron
theResult.SetStatusChange(suspend);
return &theResult;
theResult.Get()->SetStatusChange(suspend);
return theResult.Get();
}