Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Fragment.cc,v 1.9 1998/12/16 11:46:56 larazb Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Fragment.cc,v 1.4 1999/04/15 11:13:06 larazb Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (May 1998)
@@ -24,8 +24,10 @@ G4Fragment::G4Fragment() :
numberOfExcitons(0),
numberOfHoles(0),
numberOfCharged(0),
theParticleDefinition(0)
theParticleDefinition(0),
theCreationTime(0.0)
{
theAngularMomentum = IsotropicRandom3Vector();
}
// Copy Constructor
@@ -40,6 +42,7 @@ G4Fragment::G4Fragment(const G4Fragment &right)
numberOfHoles = right.numberOfHoles;
numberOfCharged = right.numberOfCharged;
theParticleDefinition = right.theParticleDefinition;
theCreationTime = right.theCreationTime;
}
@@ -51,70 +54,74 @@ G4Fragment::~G4Fragment()
G4Fragment::G4Fragment(const G4int A, const G4int Z, const G4LorentzVector aMomentum) :
theA(A),
theZ(Z),
theExcitationEnergy(0.0),
theMomentum(aMomentum),
theAngularMomentum(0),
numberOfExcitons(0),
numberOfHoles(0),
numberOfCharged(0),
theParticleDefinition(0)
theParticleDefinition(0),
theCreationTime(0.0)
{
theExcitationEnergy = theMomentum.mag() - G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( theZ, theA );
if( theExcitationEnergy < 0.0 )
if( theExcitationEnergy > -10.0 * eV )
theExcitationEnergy = 0.0;
else
{
cout << "A, Z, momentum, theExcitationEnergy"<<
A<<" "<<Z<<" "<<aMomentum<<" "<<theExcitationEnergy<<endl;
G4Exception( "G4Fragment::G4Fragment Excitation Energy < 0.0!" );
}
}
// This constructor is for initialize photons
G4Fragment::G4Fragment(const G4LorentzVector aMomentum, G4ParticleDefinition * aParticleDefinition) :
theA(0),
theZ(0),
theExcitationEnergy(0),
theMomentum(aMomentum),
theAngularMomentum(0),
numberOfExcitons(0),
numberOfHoles(0),
numberOfCharged(0),
theParticleDefinition(aParticleDefinition)
theParticleDefinition(aParticleDefinition),
theCreationTime(0.0)
{
// This constructor is for initialize photons
theExcitationEnergy = CalculateExcitationEnergy(aMomentum);
theAngularMomentum = IsotropicRandom3Vector();
}
G4Fragment::G4Fragment(const G4int A, const G4int Z, const G4double anExEnergy,
const G4LorentzVector aMomentum,
const G4ThreeVector anAngularMomentum, const G4int aNumberOfExcitons,
const G4int aNumberOfHoles, const G4int aNumberOfCharged) :
theA(A),
theZ(Z),
theExcitationEnergy(anExEnergy),
theMomentum(aMomentum),
theAngularMomentum(anAngularMomentum),
numberOfExcitons(aNumberOfExcitons),
numberOfHoles(aNumberOfHoles),
numberOfCharged(aNumberOfCharged),
theParticleDefinition(0)
{}
// G4Fragment::G4Fragment(const G4int A, const G4int Z, const G4double anExEnergy,
// const G4LorentzVector aMomentum,
// const G4ThreeVector anAngularMomentum, const G4int aNumberOfExcitons,
// const G4int aNumberOfHoles, const G4int aNumberOfCharged) :
// theA(A),
// theZ(Z),
// theExcitationEnergy(anExEnergy),
// theMomentum(aMomentum),
// theAngularMomentum(anAngularMomentum),
// numberOfExcitons(aNumberOfExcitons),
// numberOfHoles(aNumberOfHoles),
// numberOfCharged(aNumberOfCharged),
// theParticleDefinition(0)
// {}
G4Fragment::G4Fragment(const G4int A, const G4int Z, const G4double anExEnergy,
const G4LorentzVector aMomentum,
const G4ThreeVector anAngularMomentum, const G4int aNumberOfExcitons,
const G4int aNumberOfHoles, const G4int aNumberOfCharged,
G4ParticleDefinition * aParticleDefinition) :
theA(A),
theZ(Z),
theExcitationEnergy(anExEnergy),
theMomentum(aMomentum),
theAngularMomentum(anAngularMomentum),
numberOfExcitons(aNumberOfExcitons),
numberOfHoles(aNumberOfHoles),
numberOfCharged(aNumberOfCharged),
theParticleDefinition(aParticleDefinition)
{}
// G4Fragment::G4Fragment(const G4int A, const G4int Z, const G4double anExEnergy,
// const G4LorentzVector aMomentum,
// const G4ThreeVector anAngularMomentum, const G4int aNumberOfExcitons,
// const G4int aNumberOfHoles, const G4int aNumberOfCharged,
// G4ParticleDefinition * aParticleDefinition) :
// theA(A),
// theZ(Z),
// theExcitationEnergy(anExEnergy),
// theMomentum(aMomentum),
// theAngularMomentum(anAngularMomentum),
// numberOfExcitons(aNumberOfExcitons),
// numberOfHoles(aNumberOfHoles),
// numberOfCharged(aNumberOfCharged),
// theParticleDefinition(aParticleDefinition)
// {}
@@ -131,6 +138,7 @@ const G4Fragment & G4Fragment::operator=(const G4Fragment &right)
numberOfHoles = right.numberOfHoles;
numberOfCharged = right.numberOfCharged;
theParticleDefinition = right.theParticleDefinition;
theCreationTime = right.theCreationTime;
}
return *this;
}
@@ -185,3 +193,31 @@ ostream& operator << (ostream &out, const G4Fragment &theFragment)
out << &theFragment;
return out;
}
G4double G4Fragment::CalculateExcitationEnergy(const G4LorentzVector value) const
{
G4double U = value.m() - GetGroundStateMass();
if( U < 0.0 )
if( U > -10.0 * eV )
U = 0.0;
else
G4Exception( "G4Fragment::G4Fragment Excitation Energy < 0!" );
return U;
}
G4ThreeVector G4Fragment::IsotropicRandom3Vector(const G4double Magnitude) const
// Create a unit vector with a random direction isotropically distributed
{
G4double CosTheta = 1.0 - 2.0*G4UniformRand();
G4double SinTheta = sqrt(1.0 - CosTheta*CosTheta);
G4double Phi = twopi*G4UniformRand();
G4ThreeVector Vector(Magnitude*cos(Phi)*SinTheta,
Magnitude*sin(Phi)*SinTheta,
Magnitude*CosTheta);
return Vector;
}