Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
@@ -25,7 +25,7 @@
//
//
// $Id: G4DalitzDecayChannel.cc,v 1.8 2006/06/29 19:24:58 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DecayProducts.cc,v 1.14 2006/06/29 19:25:00 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DecayTable.cc,v 1.8 2006/06/29 19:25:02 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DecayTableMessenger.cc,v 1.6 2006/06/29 19:25:04 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//---------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DynamicParticle.cc,v 1.24 2006/06/29 19:25:21 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4ElectronOccupancy.cc,v 1.9 2006/06/29 19:25:24 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ----------------------------------------------------------------------
+77 -14
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4IonTable.cc,v 1.41 2006/06/29 19:25:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4IonTable.cc,v 1.43 2006/11/15 09:57:52 kurasige Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------
@@ -157,16 +157,20 @@ G4ParticleDefinition* G4IonTable::CreateIon(G4int Z, G4int A, G4double E, G4int
G4double mass = GetNucleusMass(Z, A)+ E;
G4double charge = G4double(Z)*eplus;
G4int encoding = GetNucleusEncoding(Z,A,E,J);
// create an ion
// spin, parity, isospin values are fixed
//
ion = new G4Ions( name, mass, 0.0*MeV, charge,
J, +1, 0,
0, 0, 0,
"nucleus", 0, A, 0,
"nucleus", 0, A, encoding,
stable, life, decayTable, false,
"generic", 0,
E );
//No Anti particle registered
ion->SetAntiPDGEncoding(0);
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
@@ -198,6 +202,26 @@ G4ParticleDefinition* G4IonTable::GetIon(G4int Z, G4int A, G4int J)
return GetIon( Z, A, 0.0, J);
}
////////////////////
G4ParticleDefinition* G4IonTable::GetIon(G4int encoding)
{
G4int Z, A, J;
G4double E;
if (!GetNucleusByEncoding(encoding,Z,A,E,J) ){
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout << "G4IonTable::GetIon() : illegal encoding" << G4endl;
G4cout << " CODE:" << encoding << G4endl;
}
#endif
G4Exception( "G4IonTable::GetIon()","Illegal operation",
JustWarning, "illegal encoding");
return 0;
}
// Only ground state is supported
return GetIon( Z, A, 0.0, J);
}
////////////////////
G4ParticleDefinition* G4IonTable::GetIon(G4int Z, G4int A, G4double E, G4int J)
{
@@ -271,6 +295,50 @@ G4ParticleDefinition* G4IonTable::FindIon(G4int Z, G4int A, G4double E, G4int J)
}
}
/////////////////
G4int G4IonTable::GetNucleusEncoding(G4int Z, G4int A, G4double E, G4int )
{
// PDG code for Ions
// Nuclear codes are given as 10-digit numbers +-100ZZZAAAI.
//For a nucleus consisting of np protons and nn neutrons
// A = np + nn and Z = np.
// I gives the isomer level, with I = 0 corresponding
// to the ground state and I >0 to excitations
//!!! I = 1 is assigned fo all excitation states !!!
G4int encoding = 1000000000;
encoding += Z * 10000;
encoding += A *10;
if (E>0.0) encoding += 1;
return encoding;
}
///////////////
G4bool G4IonTable::GetNucleusByEncoding(G4int encoding,
G4int &Z, G4int &A,
G4double &E, G4int &J)
{
if (encoding <= 0) {
// anti particle
return false;
}
if (encoding % 10 != 0) {
//!!!not supported for excitation states !!!
return false;
}
encoding -= 1000000000;
Z = encoding/10000;
encoding -= 10000*Z;
A = encoding/10;
E=0.0;
J=0;
return true;
}
/////////////////
G4String G4IonTable::GetIonName(G4int Z, G4int A, G4double E) const
{
@@ -303,20 +371,15 @@ G4bool G4IonTable::IsIon(G4ParticleDefinition* particle)
}
/////////////////
#include <algorithm>
G4bool G4IonTable::IsLightIon(G4ParticleDefinition* particle) const
{
// return true if the particle is pre-defined ion
G4String name = particle->GetParticleName();
static const std::string names[] = { "proton", "neutron", "alpha", "deuteron",
"triton", "He3", "GenericIon"};
G4bool value = (name == "proton");
value = value || (name == "neutron");
value = value || (name == "alpha");
value = value || (name == "deuteron");
value = value || (name == "triton") ;
value = value || (name == "He3");
value = value || (name == "GenericIon") ;
return value;
// return true if the particle is pre-defined ion
return std::find(names, names+7, particle->GetParticleName())!=names+7;
}
/////////////////
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4Ions.cc,v 1.11 2006/06/29 19:25:28 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ----------------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4IsotopeProperty.cc,v 1.5 2006/06/29 19:25:30 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ----------------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4KL3DecayChannel.cc,v 1.8 2006/06/29 19:25:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4MuonDecayChannel.cc,v 1.17 2006/06/29 19:25:34 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4NeutronBetaDecayChannel.cc,v 1.7 2006/06/29 19:25:38 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4NucleiProperties.cc,v 1.12 2006/06/29 19:25:40 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4NucleiPropertiesTableA.cc,v 1.10 2006/06/29 19:25:42 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
// GEANT 4 class file --- Copyright CERN 1997
@@ -25,7 +25,7 @@
//
//
// $Id: G4NucleiPropertiesTableB.cc,v 1.9 2006/06/29 19:25:44 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -25,7 +25,7 @@
//
//
// $Id: G4NucleiPropertiesTheoreticalTableA.cc,v 1.8 2006/06/29 19:25:46 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4PDGCodeChecker.cc,v 1.8 2006/06/29 19:25:50 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ----------------------------------------------------------------------
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ParticleDefinition.cc,v 1.27 2006/06/29 19:25:52 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4ParticleDefinition.cc,v 1.28 2006/09/05 01:15:11 kurasige Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------
@@ -114,14 +114,14 @@ G4ParticleDefinition::G4ParticleDefinition(
if (anti_encoding !=0) theAntiPDGEncoding = anti_encoding;
// check quark contents
#ifdef G4VERBOSE
if (this->FillQuarkContents() != thePDGEncoding) {
#ifdef G4VERBOSE
if (verboseLevel>0) {
// Using G4cerr expecting that it is available in construction of static objects
G4cerr << "Particle " << aName << " has a strange PDGEncoding " <<G4endl;
}
}
#endif
}
}
G4ParticleDefinition::G4ParticleDefinition(const G4ParticleDefinition &)
@@ -25,7 +25,7 @@
//
//
// $Id: G4ParticleMessenger.cc,v 1.8 2006/06/29 19:25:54 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//---------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4ParticlePropertyMessenger.cc,v 1.7 2006/06/29 19:25:59 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//---------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4ParticleTable.cc,v 1.27 2006/06/29 19:26:05 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// class G4ParticleTable
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PhaseSpaceDecayChannel.cc,v 1.10 2006/06/29 19:26:08 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4PhaseSpaceDecayChannel.cc,v 1.12 2006/09/28 14:30:33 kurasige Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -169,6 +169,22 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::TwoBodyDecayIt()
//calculate daughter momentum
daughtermomentum = Pmx(parentmass,daughtermass[0],daughtermass[1]);
if (daughtermomentum <0.0) {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cerr << "G4PhaseSpaceDecayChannel::TwoBodyDecayIt "
<< "sum of daughter mass is larger than parent mass" << G4endl;
G4cerr << "parent :" << parent->GetParticleName() << " " << parent_mass/GeV << G4endl;
G4cerr << "daughter 1 :" << daughters[0]->GetParticleName() << " " << daughtermass[0]/GeV << G4endl;
G4cerr << "daughter 2:" << daughters[1]->GetParticleName() << " " << daughtermass[1]/GeV << G4endl;
}
#endif
G4Exception("G4PhaseSpaceDecayChannel::TwoBodyDecayIt",
"can not create decay products", JustWarning,
"sum of daughter mass is larger than parent mass");
return products;
}
G4double costheta = 2.*G4UniformRand()-1.0;
G4double sintheta = std::sqrt((1.0 - costheta)*(1.0 + costheta));
G4double phi = twopi*G4UniformRand()*rad;
@@ -209,10 +225,31 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ThreeBodyDecayIt()
//create parent G4DynamicParticle at rest
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
delete parentparticle;
if (sumofdaughtermass >parentmass) {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cerr << "G4PhaseSpaceDecayChannel::ThreeBodyDecayIt "
<< "sum of daughter mass is larger than parent mass" << G4endl;
G4cerr << "parent :" << parent->GetParticleName() << " " << parent_mass/GeV << G4endl;
G4cerr << "daughter 1 :" << daughters[0]->GetParticleName() << " " << daughtermass[0]/GeV << G4endl;
G4cerr << "daughter 2:" << daughters[1]->GetParticleName() << " " << daughtermass[1]/GeV << G4endl;
G4cerr << "daughter 3:" << daughters[2]->GetParticleName() << " " << daughtermass[2]/GeV << G4endl;
}
#endif
G4Exception("G4PhaseSpaceDecayChannel::ThreeBodyDecayIt",
"can not create decay products", JustWarning,
"sum of daughter mass is larger than parent mass");
return products;
}
//calculate daughter momentum
// Generate two
G4double rd1, rd2, rd;
@@ -287,7 +324,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ThreeBodyDecayIt()
(direction0*daughtermomentum[0] + direction2*(daughtermomentum[2]/direction2.mag()))*(-1.0)
);
products->PushProducts(daughterparticle);
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
G4cout << "G4PhaseSpaceDecayChannel::ThreeBodyDecayIt ";
@@ -395,6 +432,11 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ManyBodyDecayIt()
delete [] sm;
delete [] daughtermass;
delete [] daughtermomentum;
G4Exception("G4PhaseSpaceDecayChannel::ManyBodyDecayIt",
"can not create decay products", JustWarning,
"sum of daughter mass is larger than parent mass");
return 0; // Error detection
} else {
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PrimaryParticle.cc,v 1.2 2006/06/29 19:26:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4PrimaryParticle.cc,v 1.4 2006/10/01 02:29:43 kurasige Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
#include "G4PrimaryParticle.hh"
@@ -125,6 +125,30 @@ void G4PrimaryParticle::SetG4code(G4ParticleDefinition* Gcode)
PDGcode = Gcode->GetPDGEncoding();
}
G4double G4PrimaryParticle::GetMass() const
{
if (mass <0.0 ) {
if (G4code != 0) {
// return PDG mass if dynamical mass has not be specified
return G4code->GetPDGMass();
}
}
return mass;
}
G4double G4PrimaryParticle::GetCharge() const
{
if ( charge <DBL_MAX ) {
return charge;
} else {
if (G4code != 0) {
// return PDG charge if dynamical mass has not be specified
return G4code->GetPDGCharge();
}
}
return charge;
}
const G4PrimaryParticle &
G4PrimaryParticle::operator=(const G4PrimaryParticle &)
{ return *this; }
@@ -166,3 +190,6 @@ void G4PrimaryParticle::Print() const
{ G4cout << "<<<< End of link" << G4endl; }
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PrimaryVertex.cc,v 1.1.2.1 2006/06/29 19:26:14 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4PrimaryVertex.cc,v 1.3 2006/07/20 15:14:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
#include "G4PrimaryVertex.hh"
@@ -36,18 +36,18 @@ G4Allocator<G4PrimaryVertex> aPrimaryVertexAllocator;
G4PrimaryVertex::G4PrimaryVertex()
:X0(0.),Y0(0.),Z0(0.),T0(0.),theParticle(0),theTail(0),
nextVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
{;}
G4PrimaryVertex::G4PrimaryVertex(
G4double x0,G4double y0,G4double z0,G4double t0)
:X0(x0),Y0(y0),Z0(z0),T0(t0),theParticle(0),theTail(0),
nextVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
{;}
G4PrimaryVertex::G4PrimaryVertex(G4ThreeVector xyz0,G4double t0)
:T0(t0),theParticle(0),theTail(0),
nextVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
{
X0=xyz0.x();
Y0=xyz0.y();
@@ -25,7 +25,7 @@
//
//
// $Id: G4ShortLivedTable.cc,v 1.14 2006/06/29 19:26:16 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4TauLeptonicDecayChannel.cc,v 1.5 2006/06/29 19:26:18 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4VDecayChannel.cc,v 1.18 2006/06/29 19:26:20 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4VUserPrimaryParticleInformation.cc,v 1.2 2006/06/29 19:26:22 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
#include "G4VUserPrimaryParticleInformation.hh"
G4VUserPrimaryParticleInformation::G4VUserPrimaryParticleInformation() {;}
@@ -25,7 +25,7 @@
//
//
// $Id: G4VUserPrimaryVertexInformation.cc,v 1.2 2006/06/29 19:26:24 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//---------------------------------------------------------------