Import Geant4 0.0.0 source tree
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,285 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Nucleus.cc,v 2.6 1998/10/05 09:12:40 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// original by H.P. Wellisch
|
||||
// modified by J.L. Chuma, TRIUMF, 19-Nov-1996
|
||||
// last modified: 27-Mar-1997
|
||||
// J.P.Wellisch: 23-Apr-97: minor simplifications
|
||||
// modified by J.L.Chuma 24-Jul-97 to set the total momentum in Cinema and
|
||||
// EvaporationEffects
|
||||
// modified by J.L.Chuma 21-Oct-97 put abs() around the totalE^2-mass^2
|
||||
// in calculation of total momentum in
|
||||
// Cinema and EvaporationEffects
|
||||
// Chr. Volcker, 10-Nov-1997: new methods and class variables.
|
||||
// HPW added utilities for low energy neutron transport. (12.04.1998)
|
||||
// M.G. Pia, 2 Oct 1998: modified GetFermiMomentum to avoid memory leaks
|
||||
|
||||
#include "G4Nucleus.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
G4ReactionProduct G4Nucleus::GetThermalNucleus(G4double targetMass) const
|
||||
{
|
||||
G4ReactionProduct theTarget;
|
||||
theTarget.SetMass(targetMass*G4Neutron::Neutron()->GetPDGMass());
|
||||
G4double px, py, pz;
|
||||
px = GetThermalPz(theTarget.GetMass(), theTemp);
|
||||
py = GetThermalPz(theTarget.GetMass(), theTemp);
|
||||
pz = GetThermalPz(theTarget.GetMass(), theTemp);
|
||||
theTarget.SetMomentum(px, py, pz);
|
||||
G4double tMom = sqrt(px*px+py*py+pz*pz);
|
||||
G4double tEtot = sqrt((tMom+theTarget.GetMass())*
|
||||
(tMom+theTarget.GetMass())-
|
||||
2.*tMom*theTarget.GetMass());
|
||||
if(1-tEtot/theTarget.GetMass()>0.001)
|
||||
{
|
||||
theTarget.SetTotalEnergy(tEtot);
|
||||
}
|
||||
else
|
||||
{
|
||||
theTarget.SetKineticEnergy(tMom*tMom/(2.*theTarget.GetMass()));
|
||||
}
|
||||
return theTarget;
|
||||
}
|
||||
|
||||
void
|
||||
G4Nucleus::ChooseParameters( const G4Material *aMaterial )
|
||||
{
|
||||
G4double random = G4UniformRand();
|
||||
G4double sum = 0;
|
||||
const G4ElementVector *theElementVector = aMaterial->GetElementVector();
|
||||
for( G4int i=0; i<aMaterial->GetNumberOfElements(); ++i )
|
||||
{
|
||||
sum += aMaterial->GetAtomicNumDensityVector()[i];
|
||||
if( sum > random ) {
|
||||
aEff = (*theElementVector)(i)->GetA()*mole/g;
|
||||
zEff = (*theElementVector)(i)->GetZ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4Nucleus::SetParameters( const G4double A, const G4double Z )
|
||||
{
|
||||
G4int myZ = G4int(Z + 0.5);
|
||||
G4int myA = G4int(A + 0.5);
|
||||
if( myA<1 || myZ<0 || myZ>myA )
|
||||
G4Exception("G4Nucleus::SetParameters called with non-physical parameters");
|
||||
aEff = A; // atomic weight
|
||||
zEff = Z; // atomic number
|
||||
}
|
||||
|
||||
G4DynamicParticle *
|
||||
G4Nucleus::ReturnTargetParticle() const
|
||||
{
|
||||
// choose a proton or a neutron as the target particle
|
||||
|
||||
G4DynamicParticle *targetParticle = new G4DynamicParticle;
|
||||
if( G4UniformRand() < zEff/aEff )
|
||||
targetParticle->SetDefinition( G4Proton::Proton() );
|
||||
else
|
||||
targetParticle->SetDefinition( G4Neutron::Neutron() );
|
||||
return targetParticle;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4Nucleus::AtomicMass( const G4double A, const G4double Z ) const
|
||||
{
|
||||
// derived from original FORTRAN code ATOMAS by H. Fesefeldt (2-Dec-1986)
|
||||
//
|
||||
// Computes atomic mass in MeV
|
||||
// units for A example: A = material->GetA()/(g/mole);
|
||||
//
|
||||
// Note: can't just use aEff and zEff since the Nuclear Reaction
|
||||
// function needs to calculate atomic mass for various values of A and Z
|
||||
|
||||
const G4double electron_mass = G4Electron::Electron()->GetPDGMass()/MeV;
|
||||
const G4double proton_mass = G4Proton::Proton()->GetPDGMass()/MeV;
|
||||
const G4double neutron_mass = G4Neutron::Neutron()->GetPDGMass()/MeV;
|
||||
const G4double deuteron_mass = G4Deuteron::Deuteron()->GetPDGMass()/MeV;
|
||||
const G4double alpha_mass = G4Alpha::Alpha()->GetPDGMass()/MeV;
|
||||
|
||||
G4int myZ = G4int(Z + 0.5);
|
||||
G4int myA = G4int(A + 0.5);
|
||||
if( myZ < 0 )return 0.0;
|
||||
if( myZ > myA )return 0.0;
|
||||
if( myA == 1 )
|
||||
{
|
||||
if( myZ == 0 )return neutron_mass*MeV;
|
||||
if( myZ == 1 )return proton_mass*MeV + electron_mass*MeV; // hydrogen
|
||||
}
|
||||
else if( myA == 2 && myZ == 1 )
|
||||
{
|
||||
return deuteron_mass*MeV;
|
||||
}
|
||||
else if( myA == 4 && myZ == 2 )
|
||||
{
|
||||
return alpha_mass*MeV;
|
||||
}
|
||||
//
|
||||
// Weitzsaecker's Mass formula
|
||||
//
|
||||
G4double mass =
|
||||
(A-Z)*neutron_mass + Z*proton_mass + Z*electron_mass
|
||||
- 15.67*A // nuclear volume
|
||||
+ 17.23*pow(A,2./3.) // surface energy
|
||||
+ 93.15*pow(A/2.-Z,2.)/A // asymmetry
|
||||
+ 0.6984523*pow(Z,2.)*pow(A,-1./3.); // coulomb
|
||||
G4int ipp = (myA - myZ)%2; // pairing
|
||||
G4int izz = myZ%2;
|
||||
if( ipp == izz )mass += (ipp+izz-1) * 12.0 * pow(A,-0.5);
|
||||
return mass*MeV;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4Nucleus::GetThermalPz( const G4double mass, const G4double temp ) const
|
||||
{
|
||||
G4double result = 0.0;
|
||||
for( int i=0; i<12 ; ++i )
|
||||
result += G4UniformRand() - 0.5;
|
||||
result *= sqrt(k_Boltzmann*temp*mass); // Das ist impuls (Pz),
|
||||
// nichtrelativistische rechnung
|
||||
// Maxwell verteilung angenommen
|
||||
if ( G4UniformRand()<0.5 ) result =-result;
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4Nucleus::EvaporationEffects( G4double kineticEnergy )
|
||||
{
|
||||
// derived from original FORTRAN code EXNU by H. Fesefeldt (10-Dec-1986)
|
||||
//
|
||||
// Nuclear evaporation as function of atomic number
|
||||
// and kinetic energy (MeV) of primary particle
|
||||
//
|
||||
// returns kinetic energy (MeV)
|
||||
//
|
||||
if( aEff < 1.5 )
|
||||
{
|
||||
pnBlackTrackEnergy = dtaBlackTrackEnergy = 0.0;
|
||||
return 0.0;
|
||||
}
|
||||
G4double ek = kineticEnergy/GeV;
|
||||
G4float ekin = min( 4.0, max( 0.1, ek ) );
|
||||
const G4float atno = min( 120., aEff );
|
||||
const G4float gfa = 2.0*((aEff-1.0)/70.)*exp(-(aEff-1.0)/70.);
|
||||
//
|
||||
// 0.35 value at 1 GeV
|
||||
// 0.05 value at 0.1 GeV
|
||||
//
|
||||
G4float cfa = max( 0.15, 0.35 + ((0.35-0.05)/2.3)*log(ekin) );
|
||||
G4float exnu = 7.716 * cfa * exp(-cfa)
|
||||
* ((atno-1.0)/120.)*exp(-(atno-1.0)/120.);
|
||||
G4float fpdiv = max( 0.5, 1.0-0.25*ekin*ekin );
|
||||
//
|
||||
// pnBlackTrackEnergy is the kinetic energy (in GeV) available for
|
||||
// proton/neutron black track particles
|
||||
// dtaBlackTrackEnergy is the kinetic energy (in GeV) available for
|
||||
// deuteron/triton/alpha black track particles
|
||||
//
|
||||
pnBlackTrackEnergy = exnu*fpdiv;
|
||||
dtaBlackTrackEnergy = exnu*(1.0-fpdiv);
|
||||
|
||||
if( G4int(zEff+0.1) != 82 )
|
||||
{
|
||||
//G4double ran1 = RandGauss::shoot();
|
||||
//G4double ran2 = RandGauss::shoot();
|
||||
G4double ran1 = -6.0;
|
||||
G4double ran2 = -6.0;
|
||||
for( G4int i=0; i<12; ++i )
|
||||
{
|
||||
ran1 += G4UniformRand();
|
||||
ran2 += G4UniformRand();
|
||||
}
|
||||
pnBlackTrackEnergy *= 1.0 + ran1*gfa;
|
||||
dtaBlackTrackEnergy *= 1.0 + ran2*gfa;
|
||||
}
|
||||
pnBlackTrackEnergy = max( 0.0, pnBlackTrackEnergy );
|
||||
dtaBlackTrackEnergy = max( 0.0, dtaBlackTrackEnergy );
|
||||
while( pnBlackTrackEnergy+dtaBlackTrackEnergy >= ek )
|
||||
{
|
||||
pnBlackTrackEnergy *= 1.0 - 0.5*G4UniformRand();
|
||||
dtaBlackTrackEnergy *= 1.0 - 0.5*G4UniformRand();
|
||||
}
|
||||
return (pnBlackTrackEnergy+dtaBlackTrackEnergy)*GeV;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4Nucleus::Cinema( G4double kineticEnergy )
|
||||
{
|
||||
// derived from original FORTRAN code CINEMA by H. Fesefeldt (14-Oct-1987)
|
||||
//
|
||||
// input: kineticEnergy (MeV)
|
||||
// returns modified kinetic energy (MeV)
|
||||
//
|
||||
static const G4double expxu = 82.; // upper bound for arg. of exp
|
||||
static const G4double expxl = -expxu; // lower bound for arg. of exp
|
||||
|
||||
G4double ek = kineticEnergy/GeV;
|
||||
G4double ekLog = log( ek );
|
||||
G4double aLog = log( aEff );
|
||||
G4double em = min( 1.0, 0.2390 + 0.0408*aLog*aLog );
|
||||
G4double temp1 = -ek * min( 0.15, 0.0019*aLog*aLog*aLog );
|
||||
G4double temp2 = exp( max( expxl, min( expxu, -(ekLog-em)*(ekLog-em)*2.0 ) ) );
|
||||
G4double result = 0.0;
|
||||
if( abs( temp1 ) < 1.0 )
|
||||
{
|
||||
if( temp2 > 1.0e-10 )result = temp1*temp2;
|
||||
}
|
||||
else result = temp1*temp2;
|
||||
if( result < -ek )result = -ek;
|
||||
return result*GeV;
|
||||
}
|
||||
|
||||
//
|
||||
// methods for class G4Nucleus ... by Christian Volcker
|
||||
//
|
||||
|
||||
G4ThreeVector G4Nucleus::GetFermiMomentum()
|
||||
{
|
||||
// chv: .. we assume zero temperature!
|
||||
|
||||
// momentum is equally distributed in each phasespace volume dpx, dpy, dpz.
|
||||
G4double ranflat1=RandFlat::shoot((HepDouble)0.,(HepDouble)fermiMomentum);
|
||||
G4double ranflat2=RandFlat::shoot((HepDouble)0.,(HepDouble)fermiMomentum);
|
||||
G4double ranflat3=RandFlat::shoot((HepDouble)0.,(HepDouble)fermiMomentum);
|
||||
G4double ranmax = (ranflat1>ranflat2? ranflat1: ranflat2);
|
||||
ranmax = (ranmax>ranflat3? ranmax : ranflat3);
|
||||
|
||||
// - random decay angle
|
||||
G4double theta=RandFlat::shoot((HepDouble)0.,(HepDouble)pi); // isotropic decay angle theta
|
||||
G4double phi =RandFlat::shoot((HepDouble)0.,(HepDouble)2*pi); // isotropic decay angle phi
|
||||
|
||||
// - setup ThreeVector
|
||||
G4double pz=cos(theta)*ranmax;
|
||||
G4double px=sin(theta)*cos(phi)*ranmax;
|
||||
G4double py=sin(theta)*sin(phi)*ranmax;
|
||||
G4ThreeVector p(px,py,pz);
|
||||
return p;
|
||||
}
|
||||
|
||||
G4ReactionProductVector* G4Nucleus::Fragmentate()
|
||||
{
|
||||
// needs implementation!
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void G4Nucleus::AddMomentum(const G4ThreeVector aMomentum)
|
||||
{
|
||||
momentum+=(aMomentum);
|
||||
}
|
||||
|
||||
void G4Nucleus::AddExcitationEnergy( G4double anEnergy )
|
||||
{
|
||||
excitationEnergy+=anEnergy;
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,75 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ReactionKinematics.cc,v 2.1 1998/10/02 17:24:09 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// ------------ G4ReactionDynamics::TwoBody ------
|
||||
// new method TwoBodyScattering
|
||||
// by Christian V"olcker (CERN-Munich), September 1997
|
||||
// E-mail: Christian.Volcker@cern.ch
|
||||
// ************************************************************
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "G4ReactionKinematics.hh"
|
||||
|
||||
// ************************************************************
|
||||
void G4ReactionKinematics::TwoBodyScattering(
|
||||
const G4DynamicParticle* pIn1, const G4DynamicParticle* pIn2,
|
||||
G4DynamicParticle* pOut1, G4DynamicParticle* pOut2)
|
||||
// ************************************************************
|
||||
{
|
||||
// initial particles:
|
||||
|
||||
// - total invariant mass
|
||||
G4LorentzVector sumIn(pIn1->Get4Momentum()+pIn2->Get4Momentum());
|
||||
G4double invariantMass=sumIn.mag();
|
||||
|
||||
// - beta of center-of-mass system
|
||||
G4ThreeVector betaCMS=sumIn.boostVector();
|
||||
|
||||
// final particles:
|
||||
|
||||
// - get final particle masses
|
||||
G4double massOut1=pOut1->GetMass();
|
||||
G4double massOut2=pOut2->GetMass();
|
||||
|
||||
// - calculate breakup momentum:
|
||||
G4double breakupMomentum=BreakupMomentum(invariantMass, massOut1, massOut2);
|
||||
|
||||
// - random decay angle
|
||||
G4double theta=RandFlat::shoot(HepDouble(0.),HepDouble(pi)); // isotropic decay angle theta
|
||||
G4double phi =RandFlat::shoot(HepDouble(0.),HepDouble(twopi)); // isotropic decay angle phi
|
||||
|
||||
// - setup LorentzVectors
|
||||
G4double pz=cos(theta)*breakupMomentum;
|
||||
G4double px=sin(theta)*cos(phi)*breakupMomentum;
|
||||
G4double py=sin(theta)*sin(phi)*breakupMomentum;
|
||||
|
||||
G4double breakupMomentumSquared=breakupMomentum*breakupMomentum;
|
||||
G4double energy1=sqrt(breakupMomentumSquared+massOut1*massOut1);
|
||||
G4double energy2=sqrt(breakupMomentumSquared+massOut2*massOut2);
|
||||
|
||||
G4LorentzVector lorentz1(px, py, pz, energy1);
|
||||
G4LorentzVector lorentz2(px, py, pz, energy2);
|
||||
|
||||
// - back into lab system
|
||||
|
||||
lorentz1.boost(betaCMS);
|
||||
lorentz2.boost(betaCMS);
|
||||
|
||||
// fill in new particles:
|
||||
|
||||
pOut1->Set4Momentum(lorentz1);
|
||||
pOut2->Set4Momentum(lorentz2);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ReactionProduct.cc,v 2.1 1998/11/06 10:59:11 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// J.L. Chuma, TRIUMF, 31-Oct-1996
|
||||
// last modified: 19-Dec-1996
|
||||
// Modified by J.L.Chuma, 05-May-97
|
||||
|
||||
#include "G4ReactionProduct.hh"
|
||||
|
||||
G4ReactionProduct::G4ReactionProduct() :
|
||||
theParticleDefinition(NULL),
|
||||
formationTime(0.0),
|
||||
hasInitialStateParton(false),
|
||||
mass(0.0),
|
||||
totalEnergy(0.0),
|
||||
kineticEnergy(0.0),
|
||||
timeOfFlight(0.0),
|
||||
side(0),
|
||||
NewlyAdded(false)
|
||||
{
|
||||
SetMomentum( 0.0, 0.0, 0.0 );
|
||||
SetPositionInNucleus( 0.0, 0.0, 0.0 );
|
||||
}
|
||||
|
||||
G4ReactionProduct::G4ReactionProduct(
|
||||
G4ParticleDefinition *aParticleDefinition )
|
||||
{
|
||||
SetMomentum( 0.0, 0.0, 0.0 );
|
||||
SetPositionInNucleus( 0.0, 0.0, 0.0 );
|
||||
formationTime = 0.0;
|
||||
hasInitialStateParton = false;
|
||||
theParticleDefinition = aParticleDefinition;
|
||||
mass = aParticleDefinition->GetPDGMass();
|
||||
totalEnergy = mass;
|
||||
kineticEnergy = 0.0;
|
||||
(aParticleDefinition->GetPDGEncoding()<0) ? timeOfFlight=-1.0 : timeOfFlight=1.0;
|
||||
side = 0;
|
||||
NewlyAdded = false;
|
||||
}
|
||||
|
||||
G4ReactionProduct::G4ReactionProduct(
|
||||
const G4ReactionProduct &right )
|
||||
{
|
||||
theParticleDefinition = right.theParticleDefinition;
|
||||
positionInNucleus = right.positionInNucleus;
|
||||
formationTime = right.formationTime;
|
||||
hasInitialStateParton = right.hasInitialStateParton;
|
||||
momentum = right.momentum;
|
||||
mass = right.mass;
|
||||
totalEnergy = right.totalEnergy;
|
||||
kineticEnergy = right.kineticEnergy;
|
||||
timeOfFlight = right.timeOfFlight;
|
||||
side = right.side;
|
||||
NewlyAdded = right.NewlyAdded;
|
||||
}
|
||||
|
||||
G4ReactionProduct &G4ReactionProduct::operator=(
|
||||
const G4ReactionProduct &right )
|
||||
{
|
||||
if( this != &right ) {
|
||||
theParticleDefinition = right.theParticleDefinition;
|
||||
positionInNucleus = right.positionInNucleus;
|
||||
formationTime = right.formationTime;
|
||||
hasInitialStateParton = right.hasInitialStateParton;
|
||||
momentum = right.momentum;
|
||||
mass = right.mass;
|
||||
totalEnergy = right.totalEnergy;
|
||||
kineticEnergy = right.kineticEnergy;
|
||||
timeOfFlight = right.timeOfFlight;
|
||||
side = right.side;
|
||||
NewlyAdded = right.NewlyAdded;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4ReactionProduct &G4ReactionProduct::operator=(
|
||||
const G4DynamicParticle &right )
|
||||
{
|
||||
theParticleDefinition = right.GetDefinition();
|
||||
SetPositionInNucleus( 0.0, 0.0, 0.0 );
|
||||
formationTime = 0.0;
|
||||
hasInitialStateParton = false;
|
||||
momentum = right.GetMomentum();
|
||||
mass = right.GetDefinition()->GetPDGMass();
|
||||
totalEnergy = right.GetTotalEnergy();
|
||||
kineticEnergy = right.GetKineticEnergy();
|
||||
(right.GetDefinition()->GetPDGEncoding()<0) ? timeOfFlight=-1.0 : timeOfFlight=1.0;
|
||||
side = 0;
|
||||
NewlyAdded = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void G4ReactionProduct::SetDefinitionAndUpdateE(
|
||||
G4ParticleDefinition *aParticleDefinition )
|
||||
{
|
||||
G4double aKineticEnergy = GetKineticEnergy();
|
||||
G4double pp = GetMomentum().mag();
|
||||
G4ThreeVector aMomentum = GetMomentum();
|
||||
SetDefinition( aParticleDefinition );
|
||||
SetKineticEnergy( aKineticEnergy );
|
||||
if( pp > DBL_MIN )
|
||||
SetMomentum( aMomentum * (sqrt(aKineticEnergy*aKineticEnergy +
|
||||
2*aKineticEnergy*GetMass())/pp) );
|
||||
}
|
||||
|
||||
void G4ReactionProduct::SetDefinition(
|
||||
G4ParticleDefinition *aParticleDefinition )
|
||||
{
|
||||
theParticleDefinition = aParticleDefinition;
|
||||
mass = aParticleDefinition->GetPDGMass();
|
||||
totalEnergy = mass;
|
||||
kineticEnergy = 0.0;
|
||||
(aParticleDefinition->GetPDGEncoding()<0) ?
|
||||
timeOfFlight=-1.0 : timeOfFlight=1.0;
|
||||
}
|
||||
|
||||
void G4ReactionProduct::SetMomentum(
|
||||
const G4double x, const G4double y, const G4double z )
|
||||
{
|
||||
momentum.setX( x );
|
||||
momentum.setY( y );
|
||||
momentum.setZ( z );
|
||||
}
|
||||
|
||||
void G4ReactionProduct::SetMomentum(
|
||||
const G4double x, const G4double y )
|
||||
{
|
||||
momentum.setX( x );
|
||||
momentum.setY( y );
|
||||
}
|
||||
|
||||
void G4ReactionProduct::SetMomentum( const G4double z )
|
||||
{
|
||||
momentum.setZ( z );
|
||||
}
|
||||
|
||||
void G4ReactionProduct::SetZero()
|
||||
{
|
||||
SetMomentum( 0.0, 0.0, 0.0 );
|
||||
totalEnergy = 0.0;
|
||||
kineticEnergy = 0.0;
|
||||
mass = 0.0;
|
||||
timeOfFlight = 0.0;
|
||||
side = 0;
|
||||
NewlyAdded = false;
|
||||
SetPositionInNucleus( 0.0, 0.0, 0.0 );
|
||||
formationTime = 0.0;
|
||||
hasInitialStateParton = false;
|
||||
}
|
||||
|
||||
void G4ReactionProduct::Lorentz(
|
||||
const G4ReactionProduct &p1, const G4ReactionProduct &p2 )
|
||||
{
|
||||
G4ThreeVector p1M = p1.momentum;
|
||||
G4ThreeVector p2M = p2.momentum;
|
||||
G4double p1x = p1M.x(); G4double p1y = p1M.y(); G4double p1z = p1M.z();
|
||||
G4double p2x = p2M.x(); G4double p2y = p2M.y(); G4double p2z = p2M.z();
|
||||
G4double a = ( (p1x*p2x+p1y*p2y+p1z*p2z)/(p2.totalEnergy+p2.mass) -
|
||||
p1.totalEnergy ) / p2.mass;
|
||||
G4double x = p1x+a*p2x;
|
||||
G4double y = p1y+a*p2y;
|
||||
G4double z = p1z+a*p2z;
|
||||
G4double p = sqrt(x*x+y*y+z*z);
|
||||
SetMass( p1.mass );
|
||||
SetTotalEnergy( sqrt( (p1.mass+p)*(p1.mass+p) - 2.*p1.mass*p ) );
|
||||
//SetTotalEnergy( sqrt( p1.mass*p1.mass + x*x + y*y + z*z ) );
|
||||
SetMomentum( x, y, z );
|
||||
}
|
||||
|
||||
G4double G4ReactionProduct::Angle(
|
||||
const G4ReactionProduct& p ) const
|
||||
{
|
||||
G4ThreeVector tM = momentum;
|
||||
G4ThreeVector pM = p.momentum;
|
||||
G4double tx = tM.x(); G4double ty = tM.y(); G4double tz = tM.z();
|
||||
G4double px = pM.x(); G4double py = pM.y(); G4double pz = pM.z();
|
||||
G4double a = sqrt( ( px*px + py*py + pz*pz ) * ( tx*tx + ty*ty + tz*tz ) );
|
||||
if( a == 0.0 ) {
|
||||
return 0.0;
|
||||
} else {
|
||||
a = ( tx*px + ty*py + tz*pz ) / a;
|
||||
if( fabs(a) > 1.0 ) { a<0.0 ? a=-1.0 : a=1.0; }
|
||||
return acos( a );
|
||||
}
|
||||
}
|
||||
|
||||
G4ReactionProduct operator+(
|
||||
const G4ReactionProduct& p1, const G4ReactionProduct& p2 )
|
||||
{
|
||||
G4double totEnergy = p1.totalEnergy + p2.totalEnergy;
|
||||
G4double x = p1.momentum.x() + p2.momentum.x();
|
||||
G4double y = p1.momentum.y() + p2.momentum.y();
|
||||
G4double z = p1.momentum.z() + p2.momentum.z();
|
||||
G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
|
||||
if( newMass < 0.0 )
|
||||
newMass = -1. * sqrt( -newMass );
|
||||
else
|
||||
newMass = sqrt( newMass );
|
||||
G4ReactionProduct result;
|
||||
result.SetMass( newMass );
|
||||
result.SetMomentum( x, y, z );
|
||||
result.SetTotalEnergy( totEnergy );
|
||||
result.SetPositionInNucleus( 0.0, 0.0, 0.0 );
|
||||
result.SetFormationTime(0.0);
|
||||
result.HasInitialStateParton(false);
|
||||
return result;
|
||||
}
|
||||
|
||||
G4ReactionProduct operator-(
|
||||
const G4ReactionProduct& p1, const G4ReactionProduct& p2 )
|
||||
{
|
||||
G4double totEnergy = p1.totalEnergy - p2.totalEnergy;
|
||||
G4double x = p1.momentum.x() - p2.momentum.x();
|
||||
G4double y = p1.momentum.y() - p2.momentum.y();
|
||||
G4double z = p1.momentum.z() - p2.momentum.z();
|
||||
G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
|
||||
if( newMass < 0.0 )
|
||||
newMass = -1. * sqrt( -newMass );
|
||||
else
|
||||
newMass = sqrt( newMass );
|
||||
G4ReactionProduct result;
|
||||
result.SetMass( newMass );
|
||||
result.SetMomentum( x, y, z );
|
||||
result.SetTotalEnergy( totEnergy );
|
||||
result.SetPositionInNucleus( 0.0, 0.0, 0.0 );
|
||||
result.SetFormationTime(0.0);
|
||||
result.HasInitialStateParton(false);
|
||||
return result;
|
||||
}
|
||||
/* end of code */
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4StableIsotopes.cc,v 2.0 1998/07/02 16:39:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#include "G4StableIsotopes.hh"
|
||||
|
||||
const G4int G4StableIsotopes::protonCount[92] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92};
|
||||
const G4String G4StableIsotopes::elementName[92] = {"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "", "Nb", "Mo", "", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "", "", "", "", "", "", "Th", "", "U"};
|
||||
const G4int G4StableIsotopes::nIsotopes[92] = {2, 2, 2, 1, 2, 2, 2, 3, 1, 3, 1, 3, 1, 3, 1, 4, 2, 3, 3, 6, 1, 5, 2, 4, 1, 4, 1, 5, 2, 5, 2, 5, 1, 6, 2, 6, 2, 4, 1, 5, 1, 7, 0, 7, 1, 6, 2, 8, 2, 10, 2, 8, 1, 9, 1, 7, 2, 4, 1, 7, 0, 7, 2, 7, 1, 7, 1, 6, 1, 7, 2, 6, 2, 5, 2, 7, 2, 6, 1, 7, 2, 4, 1, 0, 0, 0, 0, 0, 0, 1, 0, 3};
|
||||
const G4int G4StableIsotopes::start[92] = {0, 2, 4, 6, 7, 9, 11, 13, 16, 17, 20, 21, 24, 25, 28, 29, 33, 35, 38, 41, 47, 48, 53, 55, 59, 60, 64, 65, 70, 72, 77, 79, 84, 85, 91, 93, 99, 101, 105, 106, 111, 112, 119, 119, 126, 127, 133, 135, 143, 145, 155, 157, 165, 166, 175, 176, 183, 185, 189, 190, 197, 197, 204, 206, 213, 214, 221, 222, 228, 229, 236, 238, 244, 246, 251, 253, 260, 262, 268, 269, 276, 278, 282, 283, 283, 283, 283, 283, 283, 283, 284, 284};
|
||||
const G4int G4StableIsotopes::nucleonCount[287] = {1, 2, 3, 4, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 35, 37, 36, 38, 40, 39, 40, 41, 40, 42, 43, 44, 46, 48, 45, 46, 47, 48, 49, 50, 50, 51, 50, 52, 53, 54, 55, 54, 56, 57, 58, 59, 58, 60, 61, 62, 64, 63, 65, 64, 66, 67, 68, 70, 69, 71, 70, 72, 73, 74, 76, 75, 74, 76, 77, 78, 80, 82, 79, 81, 78, 80, 82, 83, 84, 86, 85, 87, 84, 86, 87, 88, 89, 90, 91, 92, 94, 96, 93, 92, 94, 95, 96, 97, 98, 100, 96, 98, 99, 100, 101, 102, 104, 103, 102, 104, 105, 106, 108, 110, 107, 109, 106, 108, 110, 111, 112, 113, 114, 116, 113, 115, 112, 114, 115, 116, 117, 118, 119, 120, 122, 124, 121, 123, 120, 122, 123, 124, 125, 126, 128, 130, 127, 124, 126, 128, 129, 130, 131, 132, 134, 136, 133, 130, 132, 134, 135, 136, 137, 138, 138, 139, 136, 138, 140, 142, 141, 142, 143, 144, 145, 146, 148, 150, 144, 147, 148, 149, 150, 152, 154, 151, 153, 152, 154, 155, 156, 157, 158, 160, 159, 156, 158, 160, 161, 162, 163, 164, 165, 162, 164, 166, 167, 168, 170, 169, 168, 170, 171, 172, 173, 174, 176, 175, 176, 174, 176, 177, 178, 179, 180, 180, 181, 180, 182, 183, 184, 186, 185, 187, 184, 186, 187, 188, 189, 190, 192, 191, 193, 190, 192, 194, 195, 196, 198, 197, 196, 198, 199, 200, 201, 202, 204, 203, 205, 204, 206, 207, 208, 209, 232, 234, 235, 238};
|
||||
const G4double G4StableIsotopes::abundance[287] = {99.985, 0.015, 0.000137, 99.9999, 7.5, 92.5, 100, 19.9, 80.1, 98.9, 1.1, 99.634, 0.366, 99.762, 0.038, 0.2, 100, 90.48, 0.27, 9.25, 100, 78.99, 10, 11.01, 100, 92.23, 4.67, 3.1, 100, 95.02, 0.75, 4.21, 0.02, 75.77, 24.23, 0.337, 0.063, 99.6, 93.2581, 0.0117, 6.7302, 96.941, 0.647, 0.135, 2.086, 0.004, 0.187, 100, 8, 7.2, 73.8, 5.5, 5.4, 0.25, 99.75, 4.345, 83.789, 9.501, 2.365, 100, 5.8, 91.72, 2.2, 0.28, 100, 68.277, 26.223, 1.14, 3.634, 0.926, 69.17, 30.83, 48.6, 27.9, 4.1, 18.8, 0.6, 60.108, 39.892, 21.23, 27.66, 7.73, 36.94, 7.44, 100, 0.89, 9.36, 7.63, 23.78, 49.61, 8.73, 50.69, 49.31, 0.35, 2.25, 11.6, 11.5, 57, 17.3, 72.165, 27.835, 0.56, 9.86, 7, 82.58, 100, 51.45, 11.22, 17.15, 17.38, 2.8, 100, 14.84, 9.25, 15.92, 16.68, 9.55, 24.13, 9.63, 5.52, 1.88, 12.7, 12.6, 17, 31.6, 18.7, 100, 1.02, 11.14, 22.33, 27.33, 26.46, 11.72, 51.839, 48.161, 1.25, 0.89, 12.49, 12.8, 24.13, 12.22, 28.73, 7.49, 4.3, 95.7, 0.97, 0.65, 0.36, 14.53, 7.68, 24.22, 8.58, 32.59, 4.63, 5.79, 57.36, 42.64, 0.096, 2.6, 0.908, 4.816, 7.14, 18.95, 31.69, 33.8, 100, 0.1, 0.09, 1.91, 26.4, 4.1, 21.2, 26.9, 10.4, 8.9, 100, 0.106, 0.101, 2.417, 6.592, 7.854, 11.23, 71.7, 0.0902, 99.9098, 0.19, 0.25, 88.48, 11.08, 100, 27.13, 12.18, 23.8, 8.3, 17.19, 5.76, 5.64, 3.1, 15, 11.3, 13.8, 7.4, 26.7, 22.7, 47.8, 52.2, 0.2, 2.18, 14.8, 20.47, 15.65, 24.84, 21.86, 100, 0.06, 0.1, 2.34, 18.9, 25.5, 24.9, 28.2, 100, 0.14, 1.61, 33.6, 22.95, 26.8, 14.9, 100, 0.13, 3.05, 14.3, 21.9, 16.12, 31.8, 12.7, 97.41, 2.59, 0.162, 5.206, 18.606, 27.297, 13.629, 35.1, 0.012, 99.988, 0.13, 26.3, 14.3, 30.67, 28.6, 37.4, 62.6, 0.02, 1.58, 1.6, 13.3, 16.1, 26.4, 41, 37.3, 62.7, 0.01, 0.79, 32.9, 33.8, 25.3, 7.2, 100, 0.15, 9.97, 16.87, 23.1, 13.18, 29.86, 6.87, 29.524, 70.476, 1.4, 24.1, 22.1, 52.4, 100, 100, 0.005, 0.72, 99.275};
|
||||
Reference in New Issue
Block a user