Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DynamicParticleVector.hh,v 1.1.8.1.2.1 1999/12/07 20:52:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DynamicParticleVector.hh,v 1.3 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// For information related to this code contact:
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GHEKinematicsVector.hh,v 1.1.10.1.2.2 1999/12/10 15:42:17 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4GHEKinematicsVector.hh,v 1.2 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file --- Copyright CERN 1998
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LightMedia.hh,v 1.1.10.1 1999/12/07 20:52:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4LightMedia.hh,v 1.2 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Hadronic Process: Light Media Charge and/or Strangeness Exchange
// J.L. Chuma, TRIUMF, 21-Feb-1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Nucleus.hh,v 1.1.10.1 1999/12/07 20:52:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4Nucleus.hh,v 1.2 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// original by H.P. Wellisch
// modified by J.L. Chuma, TRIUMF, 19-Nov-1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleVector.hh,v 1.1.8.1.2.1 1999/12/07 20:52:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleVector.hh,v 1.3 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// ------------------------------------------------------------
// HPW decoupling theo models from RW (Mon Mar 16 1998)
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReactionDynamics.hh,v 1.1.10.1 1999/12/07 20:52:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ReactionDynamics.hh,v 1.2 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Hadronic Process: Reaction Dynamics
// original by H.P. Wellisch
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReactionKinematics.hh,v 1.1.10.1 1999/12/07 20:52:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ReactionKinematics.hh,v 1.2 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file --- Copyright CERN 1995
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReactionProduct.hh,v 1.1.10.1 1999/12/07 20:52:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ReactionProduct.hh,v 1.2 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// J.L. Chuma, TRIUMF, 31-Oct-1996
// last modified: 19-Dec-1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReactionProductVector.hh,v 1.1.8.1.2.1 1999/12/07 20:52:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ReactionProductVector.hh,v 1.3 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// For information related to this code contact:
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StableIsotopes.hh,v 1.1.10.1 1999/12/07 20:52:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4StableIsotopes.hh,v 1.3 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
#ifndef G4StableIsotopes_h
#define G4StableIsotopes_h 1
@@ -36,7 +36,7 @@ G4int GetIsotopeNucleonCount(G4int number) {return nucleonCount[number];}
G4double GetAbundance(G4int number) {return abundance[number];}
G4int GetProtonCount(G4int Z) {return protonCount[Z-1];}
public:
private:
static const G4int protonCount[92];
static const G4String elementName[92];
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LightMedia.cc,v 1.1.10.1.2.1 1999/12/10 15:42:17 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4LightMedia.cc,v 1.2 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// Hadronic Process: Light Media Charge and/or Strangeness Exchange
// J.L. Chuma, TRIUMF, 21-Feb-1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Nucleus.cc,v 1.3.8.1.2.1 1999/12/10 15:42:18 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4Nucleus.cc,v 1.4 1999/12/15 14:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// original by H.P. Wellisch
// modified by J.L. Chuma, TRIUMF, 19-Nov-1996
@@ -1331,6 +1331,9 @@
currentParticle = *vec[0];
targetParticle = *vec[1];
for( i=0; i<(vecLen-2); ++i )*vec[i] = *vec[i+2];
if(vecLen<2) G4Exception("G4ReactionDynamics::TwoCluster: Negative number of particles");
delete vec[vecLen-1];
delete vec[vecLen-2];
vecLen -= 2;
currentMass = currentParticle.GetMass()/GeV;
targetMass = targetParticle.GetMass()/GeV;
@@ -1375,7 +1378,9 @@
//
// nucleons and some pions from intranuclear cascade
//
const G4double afc = 0.312 + 0.2 * log(log(centerofmassEnergy*centerofmassEnergy));
G4double term1 = log(centerofmassEnergy*centerofmassEnergy);
if(term1 < 0) term1 = 0.0001; // making sure xtarg<0;
const G4double afc = 0.312 + 0.2 * log(term1);
G4double xtarg;
if( centerofmassEnergy < 2.0+G4UniformRand() ) // added +2 below, JLC 4Jul97
xtarg = afc * (pow(atomicWeight,0.33)-1.0) * (2*backwardCount+vecLen+2)/2.0;
@@ -1465,7 +1470,10 @@
}
else
{
if( vecLen == 0 )return false; // all secondaries have been eliminated
if( vecLen == 0 )
{
return false; // all secondaries have been eliminated
}
if( targetParticle.GetSide() == -1 )
{
pMass = targetParticle.GetMass()/GeV;
@@ -3578,45 +3586,49 @@
G4int nt = 2;
if( (index>=6) || (G4UniformRand()<G4std::min(0.5,ke*10.0)) )nt = 3;
G4ReactionProduct *v = new G4ReactionProduct [3];
v[0].SetMass( mass[index]*MeV );
G4ReactionProduct **v = new G4ReactionProduct * [3];
v[0] = new G4ReactionProduct;
v[1] = new G4ReactionProduct;
v[2] = new G4ReactionProduct;
v[0]->SetMass( mass[index]*MeV );
switch( index )
{
case 0:
v[1].SetDefinition( aGamma );
v[2].SetDefinition( aGamma );
v[1]->SetDefinition( aGamma );
v[2]->SetDefinition( aGamma );
break;
case 1:
v[1].SetDefinition( aNeutron );
v[2].SetDefinition( aGamma );
v[1]->SetDefinition( aNeutron );
v[2]->SetDefinition( aGamma );
break;
case 2:
v[1].SetDefinition( aProton );
v[2].SetDefinition( aGamma );
v[1]->SetDefinition( aProton );
v[2]->SetDefinition( aGamma );
break;
case 3:
v[1].SetDefinition( aDeuteron );
v[2].SetDefinition( aGamma );
v[1]->SetDefinition( aDeuteron );
v[2]->SetDefinition( aGamma );
break;
case 4:
v[1].SetDefinition( aTriton );
v[2].SetDefinition( aGamma );
v[1]->SetDefinition( aTriton );
v[2]->SetDefinition( aGamma );
break;
case 5:
v[1].SetDefinition( anAlpha );
v[2].SetDefinition( aGamma );
v[1]->SetDefinition( anAlpha );
v[2]->SetDefinition( aGamma );
break;
case 6:
v[1].SetDefinition( aNeutron );
v[2].SetDefinition( aNeutron );
v[1]->SetDefinition( aNeutron );
v[2]->SetDefinition( aNeutron );
break;
case 7:
v[1].SetDefinition( aNeutron );
v[2].SetDefinition( aProton );
v[1]->SetDefinition( aNeutron );
v[2]->SetDefinition( aProton );
break;
case 8:
v[1].SetDefinition( aProton );
v[2].SetDefinition( aProton );
v[1]->SetDefinition( aProton );
v[2]->SetDefinition( aProton );
break;
}
//
@@ -3633,40 +3645,40 @@
G4FastVector<G4ReactionProduct,128> tempV;
tempV.Initialize( nt );
G4int tempLen = 0;
tempV.SetElement( tempLen++, &v[0] );
tempV.SetElement( tempLen++, &v[1] );
if( nt == 3 )tempV.SetElement( tempLen++, &v[2] );
tempV.SetElement( tempLen++, v[0] );
tempV.SetElement( tempLen++, v[1] );
if( nt == 3 )tempV.SetElement( tempLen++, v[2] );
G4bool constantCrossSection = true;
G4double wgt =
GenerateNBodyEvent( pseudo2.GetMass()/MeV, constantCrossSection, tempV, tempLen );
v[0].Lorentz( v[0], pseudo2 );
v[1].Lorentz( v[1], pseudo2 );
if( nt == 3 )v[2].Lorentz( v[2], pseudo2 );
v[0]->Lorentz( *v[0], pseudo2 );
v[1]->Lorentz( *v[1], pseudo2 );
if( nt == 3 )v[2]->Lorentz( *v[2], pseudo2 );
G4bool particleIsDefined = false;
if( v[0].GetMass()/MeV - aProtonMass < 0.1 )
if( v[0]->GetMass()/MeV - aProtonMass < 0.1 )
{
v[0].SetDefinition( aProton );
v[0]->SetDefinition( aProton );
particleIsDefined = true;
}
else if( v[0].GetMass()/MeV - aNeutronMass < 0.1 )
else if( v[0]->GetMass()/MeV - aNeutronMass < 0.1 )
{
v[0].SetDefinition( aNeutron );
v[0]->SetDefinition( aNeutron );
particleIsDefined = true;
}
else if( v[0].GetMass()/MeV - aDeuteronMass < 0.1 )
else if( v[0]->GetMass()/MeV - aDeuteronMass < 0.1 )
{
v[0].SetDefinition( aDeuteron );
v[0]->SetDefinition( aDeuteron );
particleIsDefined = true;
}
else if( v[0].GetMass()/MeV - aTritonMass < 0.1 )
else if( v[0]->GetMass()/MeV - aTritonMass < 0.1 )
{
v[0].SetDefinition( aTriton );
v[0]->SetDefinition( aTriton );
particleIsDefined = true;
}
else if( v[0].GetMass()/MeV - anAlphaMass < 0.1 )
else if( v[0]->GetMass()/MeV - anAlphaMass < 0.1 )
{
v[0].SetDefinition( anAlpha );
v[0]->SetDefinition( anAlpha );
particleIsDefined = true;
}
currentParticle.SetKineticEnergy(
@@ -3686,69 +3698,84 @@
if( particleIsDefined )
{
v[0].SetKineticEnergy(
G4std::max( 0.001, 0.5*G4UniformRand()*v[0].GetKineticEnergy()/MeV ) );
p = v[0].GetTotalMomentum();
pp = v[0].GetMomentum().mag();
v[0]->SetKineticEnergy(
G4std::max( 0.001, 0.5*G4UniformRand()*v[0]->GetKineticEnergy()/MeV ) );
p = v[0]->GetTotalMomentum();
pp = v[0]->GetMomentum().mag();
if( pp <= 0.001*MeV )
{
G4double phinve = twopi*G4UniformRand();
G4double rthnve = acos( G4std::max(-1.0,G4std::min(1.0,-1.0+2.0*G4UniformRand())) );
v[0].SetMomentum( p*sin(rthnve)*cos(phinve),
v[0]->SetMomentum( p*sin(rthnve)*cos(phinve),
p*sin(rthnve)*sin(phinve),
p*cos(rthnve) );
}
else
v[0].SetMomentum( v[0].GetMomentum() * (p/pp) );
v[0]->SetMomentum( v[0]->GetMomentum() * (p/pp) );
}
if( (v[1].GetDefinition() == aDeuteron) ||
(v[1].GetDefinition() == aTriton) ||
(v[1].GetDefinition() == anAlpha) )
v[1].SetKineticEnergy(
G4std::max( 0.001, 0.5*G4UniformRand()*v[1].GetKineticEnergy()/MeV ) );
if( (v[1]->GetDefinition() == aDeuteron) ||
(v[1]->GetDefinition() == aTriton) ||
(v[1]->GetDefinition() == anAlpha) )
v[1]->SetKineticEnergy(
G4std::max( 0.001, 0.5*G4UniformRand()*v[1]->GetKineticEnergy()/MeV ) );
else
v[1].SetKineticEnergy( G4std::max( 0.001, v[1].GetKineticEnergy()/MeV ) );
v[1]->SetKineticEnergy( G4std::max( 0.001, v[1]->GetKineticEnergy()/MeV ) );
p = v[1].GetTotalMomentum();
pp = v[1].GetMomentum().mag();
p = v[1]->GetTotalMomentum();
pp = v[1]->GetMomentum().mag();
if( pp <= 0.001*MeV )
{
G4double phinve = twopi*G4UniformRand();
G4double rthnve = acos( G4std::max(-1.0,G4std::min(1.0,-1.0+2.0*G4UniformRand())) );
v[1].SetMomentum( p*sin(rthnve)*cos(phinve),
v[1]->SetMomentum( p*sin(rthnve)*cos(phinve),
p*sin(rthnve)*sin(phinve),
p*cos(rthnve) );
}
else
v[1].SetMomentum( v[1].GetMomentum() * (p/pp) );
v[1]->SetMomentum( v[1]->GetMomentum() * (p/pp) );
if( nt == 3 )
{
if( (v[2].GetDefinition() == aDeuteron) ||
(v[2].GetDefinition() == aTriton) ||
(v[2].GetDefinition() == anAlpha) )
v[2].SetKineticEnergy(
G4std::max( 0.001, 0.5*G4UniformRand()*v[2].GetKineticEnergy()/MeV ) );
if( (v[2]->GetDefinition() == aDeuteron) ||
(v[2]->GetDefinition() == aTriton) ||
(v[2]->GetDefinition() == anAlpha) )
v[2]->SetKineticEnergy(
G4std::max( 0.001, 0.5*G4UniformRand()*v[2]->GetKineticEnergy()/MeV ) );
else
v[2].SetKineticEnergy( G4std::max( 0.001, v[2].GetKineticEnergy()/MeV ) );
v[2]->SetKineticEnergy( G4std::max( 0.001, v[2]->GetKineticEnergy()/MeV ) );
p = v[2].GetTotalMomentum();
pp = v[2].GetMomentum().mag();
p = v[2]->GetTotalMomentum();
pp = v[2]->GetMomentum().mag();
if( pp <= 0.001*MeV )
{
G4double phinve = twopi*G4UniformRand();
G4double rthnve = acos( G4std::max(-1.0,G4std::min(1.0,-1.0+2.0*G4UniformRand())) );
v[2].SetMomentum( p*sin(rthnve)*cos(phinve),
v[2]->SetMomentum( p*sin(rthnve)*cos(phinve),
p*sin(rthnve)*sin(phinve),
p*cos(rthnve) );
}
else
v[2].SetMomentum( v[2].GetMomentum() * (p/pp) );
v[2]->SetMomentum( v[2]->GetMomentum() * (p/pp) );
}
vecLen = 0;
if( particleIsDefined )vec.SetElement( vecLen++, &v[0] );
vec.SetElement( vecLen++, &v[1] );
if( nt == 3 )vec.SetElement( vecLen++, &v[2] );
if( particleIsDefined )
{
vec.SetElement( vecLen++, v[0] );
}
else
{
delete v[0];
}
vec.SetElement( vecLen++, v[1] );
if( nt == 3 )
{
vec.SetElement( vecLen++, v[2] );
}
else
{
delete v[2];
}
delete [] v;
return;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReactionKinematics.cc,v 1.1.10.1 1999/12/07 20:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ReactionKinematics.cc,v 1.2 1999/12/15 14:53:41 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// CERN Geneva Switzerland
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ReactionProduct.cc,v 1.1.10.1 1999/12/07 20:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ReactionProduct.cc,v 1.2 1999/12/15 14:53:41 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// J.L. Chuma, TRIUMF, 31-Oct-1996
// last modified: 19-Dec-1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StableIsotopes.cc,v 1.1.10.1 1999/12/07 20:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4StableIsotopes.cc,v 1.2 1999/12/15 14:53:41 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
#include "G4StableIsotopes.hh"