Import Geant4 9.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:58:43 +02:00
parent 96c8bcd0af
commit b79225fb37
7544 changed files with 245407 additions and 91099 deletions
@@ -25,7 +25,7 @@
//
//
// $Id: G4DalitzDecayChannel.cc,v 1.8 2006/06/29 19:24:58 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DecayProducts.cc,v 1.16 2007/10/06 06:49:29 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DecayTable.cc,v 1.8 2006/06/29 19:25:02 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DecayTableMessenger.cc,v 1.6 2006/06/29 19:25:04 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//---------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4DynamicParticle.cc,v 1.25 2007/03/11 07:17:35 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// --------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4ElectronOccupancy.cc,v 1.9 2006/06/29 19:25:24 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ----------------------------------------------------------------------
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HyperNucleiProperties.cc,v 1.3 2007/12/10 16:30:47 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4HyperNucleiProperties.cc,v 1.4 2008/10/22 12:35:46 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -100,8 +100,6 @@ G4double G4HyperNucleiProperties::GetNuclearMass(G4int A, G4int Z, G4int L)
G4double G4HyperNucleiProperties::GetAtomicMass(G4int A, G4int Z, G4int L)
{
if (L==0) return G4NucleiProperties::GetAtomicMass(A,Z);
if (A < 1 || Z < 0 || Z > A-L || L > A || L <0 ) {
#ifdef G4VERBOSE
if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
+29 -20
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4IonTable.cc,v 1.48 2007/11/14 02:23:03 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4IonTable.cc,v 1.53 2008/10/15 02:41:37 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// --------------------------------------------------------------
@@ -80,8 +80,8 @@ G4IonTable::~G4IonTable()
delete fIsotopeTable;
}
fIsotopeTableList->clear();
delete fIsotopeTableList;
}
delete fIsotopeTableList;
fIsotopeTableList =0;
@@ -614,23 +614,38 @@ G4bool G4IonTable::IsLightIon(G4ParticleDefinition* particle) const
G4ParticleDefinition* G4IonTable::GetLightIon(G4int Z, G4int A) const
{
// returns pointer to pre-defined ions
static G4bool isInitialized = false;
static G4ParticleDefinition* p_proton=0;
static G4ParticleDefinition* p_neutron=0;
static G4ParticleDefinition* p_deuteron=0;
static G4ParticleDefinition* p_triton=0;
static G4ParticleDefinition* p_alpha=0;
static G4ParticleDefinition* p_He3=0;
if (!isInitialized) {
p_proton = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
p_neutron = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
p_deuteron = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron
p_triton = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // tritoon
p_alpha = G4ParticleTable::GetParticleTable()->FindParticle("alpha"); // alpha
p_He3 = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3
isInitialized = true;
}
G4ParticleDefinition* ion=0;
if ( (Z<=2) ) {
if ( (Z==1)&&(A==1) ) {
ion = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
ion = p_proton;
} else if ( (Z==0)&&(A==1) ) {
ion = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
ion = p_neutron;
} else if ( (Z==1)&&(A==2) ) {
ion = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron
ion = p_deuteron;
} else if ( (Z==1)&&(A==3) ) {
ion = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // tritoon
ion = p_triton;
} else if ( (Z==2)&&(A==4) ) {
ion = G4ParticleTable::GetParticleTable()->FindParticle("alpha"); // alpha
ion = p_alpha;
} else if ( (Z==2)&&(A==3) ) {
ion = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3
ion = p_He3;
}
}
return ion;
@@ -685,13 +700,6 @@ void G4IonTable::Insert(G4ParticleDefinition* particle)
{
if (IsIon(particle)) {
fIonList->push_back(particle);
} else {
//#ifdef G4VERBOSE
//if (GetVerboseLevel()>1) {
// G4cout << "G4IonTable::Insert :" << particle->GetParticleName() ;
// G4cout << " is not ions" << G4endl;
//}
//#endif
}
}
@@ -703,17 +711,18 @@ void G4IonTable::Remove(G4ParticleDefinition* particle)
for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
if ( particle == *idx) {
fIonList->erase(idx);
break;
}
}
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
if (GetVerboseLevel()>1) {
G4cout << "G4IonTable::Remove :" << particle->GetParticleName() ;
G4cout << " is not ions" << G4endl;
}
#endif
}
}
+12 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Ions.cc,v 1.12 2007/03/11 07:17:35 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4Ions.cc,v 1.13 2008/06/08 12:43:19 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ----------------------------------------------------------------------
@@ -67,8 +67,18 @@ G4Ions::G4Ions(
SetAtomicNumber( G4int(GetPDGCharge()/eplus) );
SetAtomicMass( GetBaryonNumber() );
//G4cout << "G4Ions::" << GetParticleName() << G4endl;
}
G4Ions::~G4Ions()
{
//G4cout << "G4Ions::" << GetParticleName() << G4endl;
}
G4Ions* G4Ions::IonsDefinition()
{
return this;
@@ -25,7 +25,7 @@
//
//
// $Id: G4IsotopeProperty.cc,v 1.7 2007/03/16 05:25:08 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ----------------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4KL3DecayChannel.cc,v 1.8 2006/06/29 19:25:32 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4MuonDecayChannel.cc,v 1.17 2006/06/29 19:25:34 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4NeutronBetaDecayChannel.cc,v 1.7 2006/06/29 19:25:38 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4NucleiProperties.cc,v 1.13 2007/09/14 07:04:09 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4NucleiProperties.cc,v 1.18 2008/11/06 13:17:36 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -42,7 +42,15 @@
#include "G4NucleiProperties.hh"
G4bool G4NucleiProperties::isIntialized = false;
G4double G4NucleiProperties::mass_proton = -1.;
G4double G4NucleiProperties::mass_neutron = -1.;
G4double G4NucleiProperties::mass_deuteron = -1.;
G4double G4NucleiProperties::mass_triton = -1.;
G4double G4NucleiProperties::mass_alpha = -1.;
G4double G4NucleiProperties::mass_He3 = -1.;
G4double G4NucleiProperties::electronMass[MaxZ];
G4double G4NucleiProperties::AtomicMass(G4double A, G4double Z)
{
@@ -75,6 +83,28 @@ G4double G4NucleiProperties::BindingEnergy(G4double A, G4double Z)
G4double G4NucleiProperties::GetNuclearMass(const G4double A, const G4double Z)
{
if (!isIntialized) {
isIntialized = true;
G4ParticleDefinition * nucleus = 0;
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
if (nucleus!=0) mass_proton = nucleus->GetPDGMass();
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
if (nucleus!=0) mass_neutron = nucleus->GetPDGMass();
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron
if (nucleus!=0) mass_deuteron = nucleus->GetPDGMass();
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // triton
if (nucleus!=0) mass_triton = nucleus->GetPDGMass();
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("alpha"); // alpha
if (nucleus!=0) mass_alpha = nucleus->GetPDGMass();
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3
if (nucleus!=0) mass_He3 = nucleus->GetPDGMass();
for (int iz=1; iz<MaxZ; iz+=1){
electronMass[iz] = iz*electron_mass_c2
- 1.433e-5*MeV*std::pow(G4double(iz),2.39); ;
}
}
if (A < 1 || Z < 0 || Z > A) {
#ifdef G4VERBOSE
if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
@@ -84,133 +114,58 @@ G4double G4NucleiProperties::GetNuclearMass(const G4double A, const G4double Z)
#endif
return 0.0;
} else {
G4ParticleDefinition * nucleus = 0;
G4double mass= -1.;
if ( (Z<=2) ) {
if ( (Z==1)&&(A==1) ) {
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
mass = mass_proton;
} else if ( (Z==0)&&(A==1) ) {
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
mass = mass_neutron;
} else if ( (Z==1)&&(A==2) ) {
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron
mass = mass_deuteron;
} else if ( (Z==1)&&(A==3) ) {
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // triton
mass = mass_triton;
} else if ( (Z==2)&&(A==4) ) {
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("alpha"); // alpha
mass = mass_alpha;
} else if ( (Z==2)&&(A==3) ) {
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3
mass = mass_He3;
}
}
if (nucleus!=0) {
return nucleus->GetPDGMass();
}else {
return GetAtomicMass(A,Z) - Z*electron_mass_c2 + 1.433e-5*MeV*std::pow(Z,2.39);
if (mass < 0.) {
if (Z >= MaxZ) {
mass = GetAtomicMass(A,Z) - Z*electron_mass_c2 + 1.433e-5*MeV*std::pow(Z,2.39);
} else {
mass = GetAtomicMass(A,Z) - electronMass[G4int(Z)];
}
}
if (mass < 0.) mass = 0.0;
return mass;
}
}
G4bool G4NucleiProperties::IsInStableTable(const G4double A, const G4double Z)
{
if (Z < 0 || Z > A) {
#ifdef G4VERBOSE
if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
G4cout << "G4NucleiProperties::IsInStableTable: Wrong values for A = "
<< A << " and Z = " << Z << G4endl;
}
#endif
return false;
// G4double G4NucleiProperties::CameronMassExcess(const G4int A, const G4int Z)
// {
// const G4double alpha = -17.0354*MeV;
// const G4double beta = -31.4506*MeV;
// const G4double phi = 44.2355*MeV;
// const G4double gamma = 25.8357*MeV;
//
// const G4double A13 = std::pow(G4double(A),1.0/3.0);
// const G4double A23 = A13*A13;
// const G4double A43 = A23*A23;
// const G4double Z43 = std::pow(G4double(Z),4.0/3.0);
// G4double D = (G4double(A) - 2.0*G4double(Z))/G4double(A);
// D *= D; // D = std::pow((A-2Z)/A,2)
//
//
// // Surface term
// G4double SurfaceEnergy = (gamma - phi*D)*(1.0 - 0.62025/A23)*(1.0 - 0.62025/A23)*A23;
//
// // Coulomb term
// G4double CoulombEnergy = 0.779*MeV*(G4double(Z*(Z-1))/A13)*(1.0-1.5849/A23+1.2273/A+1.5772/A43);
//
// // Exchange term
// G4double ExchangeEnergy = -0.4323*MeV*(Z43/A13)*(1.0-0.57811/A13-0.14518/A23+0.49597/A);
//
// // Volume term
// G4double VolumeEnergy = G4double(A)*(alpha-beta*D);
//
// // Shell+Pairing corrections for protons
// G4double SPcorrectionZ;
// if (Z <= TableSize) SPcorrectionZ = SPZTable[Z-1]*MeV;
// else SPcorrectionZ = 0.0;
//
// // Shell+Pairing corrections for protons
// G4int N = A - Z;
// G4double SPcorrectionN;
// if (N <= TableSize) SPcorrectionN = SPNTable[N-1]*MeV;
// else SPcorrectionN = 0.0;
//
//
// // Mass Excess
// // First two terms give the mass excess of the neutrons and protons in the nucleus
// // (see Cameron, Canadian Journal of Physics, 35, 1957 page 1022)
// G4double MassExcess = 8.367*MeV*A - 0.783*MeV*Z +
// SurfaceEnergy + CoulombEnergy + ExchangeEnergy + VolumeEnergy +
// SPcorrectionZ + SPcorrectionN;
//
// return MassExcess;
// }
// S(Z)+P(Z) from Tab. 1 from A.G.W. Cameron, Canad. J. Phys., 35(1957)1021
// or Delta M(Z) from Tab. 97 of book [1]
// const G4double G4NucleiProperties::SPZTable[TableSize] = {
// 20.80, 15.80, 21.00, 16.80, 19.80, 16.50, 18.80, 16.50, 18.50, 17.20, // 1 - 10
// 18.26, 15.05, 16.01, 12.04, 13.27, 11.09, 12.17, 10.26, 11.04, 8.41, // 11 - 20
// 9.79, 7.36, 8.15, 5.63, 5.88, 3.17, 3.32, .82, 1.83, .97, // 21 - 30
// 2.33, 1.27, 2.92, 1.61, 2.91, 1.35, 2.40, .89, 1.74, .36, // 31
// 0.95, -0.65, -0.04, -1.73, -0.96, -2.87, -2.05, -4.05, -3.40, -5.72, // 41
// -3.75, -4.13, -2.42, -2.85, -1.01, -1.33, 0.54, -0.02, 1.74, 0.75, // 51
// 2.24, 1.00, 1.98, 0.79, 1.54, 0.39, 1.08, 0.00, 0.78, -0.35, // 61
// 0.58, -0.55, 0.59, -0.61, 0.59, -0.35, 0.32, -0.96, -0.52, -2.08, // 71
// -2.46, -3.64, -1.55, -0.96, 0.97, 0.88, 2.37, 1.75, 2.72, 1.90, // 81
// 2.55, 1.46, 1.93, 0.86, 1.17, 0.08, 0.39, -0.76, -0.39, -1.51, // 91 - 100
// -1.17, -2.36, -1.95, -3.06, -2.62, -3.55, -2.95, -3.75, -3.07, -3.79, // 101 - 110
// -3.06, -3.77, -3.05, -3.78, -3.12, -3.90, -3.35, -4.24, -3.86, -4.92, // 111 - 120
// -5.06, -6.77, -7.41, -9.18,-10.16,-11.12, -9.76, -9.23, -7.96, -7.65, // 121 - 130
// // --------- from this point there are not tabulated values -----------------------
// 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, // 131 - 140
// 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, // 141 - 150
// 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, // 151
// 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, // 161
// 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, // 171
// 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, // 181
// 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 // 191 - 200
// };
// S(N)+P(N) from Tab. 1 from A.G.W. Cameron, Canad. J. Phys., 35(1957)1021
// or Delta M(N) from Tab. 97 of book [1]
// const G4double G4NucleiProperties::SPNTable[TableSize] = {
// -8.40,-12.90, -8.00, 11.90, -9.20,-12.50,-10.80,-13.60,-11.20,-12.20, // 1 - 10
// -12.81,-15.40,-13.07,-15.80,-13.81,-14.98,-12.63,-13.76,-11.37,-12.38, // 11 - 20
// -9.23, -9.65, -7.64, -9.17, -8.05, -9.72, -8.87,-10.76, -8.64, -8.89, // 21 - 30
// -6.60, -7.13, -4.77, -5.33, -3.06, -3.79, -1.72, -2.79, -0.93, -2.19, // 31
// -0.52, -1.90, -0.45, -2.20, -1.22, -3.07, -2.42, -4.37, -3.94, -6.08, // 41
// -4.49, -4.50, -3.14, -2.93, -1.04, -1.36, 0.69, 0.21, 2.11, 1.33, // 51
// 3.29, 2.46, 4.30, 3.32, 4.79, 3.62, 4.97, 3.64, 4.63, 3.07, // 61
// 4.06, 2.49, 3.30, 1.46, 2.06, 0.51, 0.74, -1.18, -1.26, -3.54, // 71
// -3.97, -5.26, -4.18, -3.71, -2.10, -1.70, -0.08, -0.18, 0.94, 0.27, // 81
// 1.13, 0.08, 0.91, -0.31, 0.49, -0.78, 0.08, -1.15, -0.23, -1.41, // 91 - 100
// -0.42, -1.55, -0.55, -1.66, -0.66, -1.73, -0.75, -1.74, -0.78, -1.69, // 101 - 110
// -0.78, -1.60, -0.75, -1.46, -0.67, -1.26, -0.51, -1.04, -0.53, -1.84, // 111 - 120
// -2.42, -4.52, -4.76, -6.33, -6.76, -7.81, -5.80, -5.37, -3.63, -3.35, // 121 - 130
// -1.75, -1.88, -0.61, -0.90, 0.09, -0.32, 0.55, -0.13, 0.70, -0.06, // 131 - 140
// 0.49, -0.20, 0.40, -0.22, 0.36, -0.09, 0.58, 0.12, 0.75, 0.15, // 141 - 150
// 0.70, 0.17, 1.11, 0.89, 1.85, 1.62, 2.54, 2.29, 3.20, 2.91, // 151
// 3.84, 3.53, 4.48, 4.15, 5.12, 4.78, 5.75, 5.39, 6.31, 5.91, // 161
// 6.87, 6.33, 7.13, 6.61, 7.30, 6.31, 6.27, 4.83, 4.49, 2.85, // 171
// 2.32, 0.58, -0.11, -0.98, 0.81, 1.77, 3.37, 4.13, 5.60, 6.15, // 181
// 7.29, 7.35, 7.95, 7.67, 8.16, 7.83, 8.31, 8.01, 8.53, 8.27 // 191 - 200
// };
} else {
G4int iA = G4int(A);
G4int iZ = G4int(Z);
return G4NucleiPropertiesTable::IsInTable(iZ,iA);
}
}
G4double G4NucleiProperties::GetMassExcess(const G4double A, const G4double Z)
{
G4int iA = G4int(A);
G4int iZ = G4int(Z);
return GetMassExcess(iA,iZ);
}
G4double G4NucleiProperties::GetMassExcess(const G4int A, const G4int Z)
{
@@ -264,6 +219,13 @@ G4double G4NucleiProperties::GetAtomicMass(const G4double A, const G4double Z)
}
}
G4double G4NucleiProperties::GetBindingEnergy(const G4double A, const G4double Z)
{
G4int iA = G4int(A);
G4int iZ = G4int(Z);
return GetBindingEnergy(iA,iZ);
}
G4double G4NucleiProperties::GetBindingEnergy(const G4int A, const G4int Z)
{
if (A < 1 || Z < 0 || Z > A) {
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4NucleiPropertiesTableA.cc,v 1.10 2006/06/29 19:25:42 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4NucleiPropertiesTableA.cc,v 1.11 2008/10/23 13:34:59 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// -------------------------------------------------------------------
// GEANT 4 class file --- Copyright CERN 1997
@@ -107,8 +107,6 @@ G4double G4NucleiPropertiesTable::GetNuclearMass(G4int Z, G4int A)
}
G4double G4NucleiPropertiesTable::GetMassExcess(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
@@ -25,7 +25,7 @@
//
//
// $Id: G4NucleiPropertiesTableB.cc,v 1.9 2006/06/29 19:25:44 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-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-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PDGCodeChecker.cc,v 1.10 2007/11/14 02:22:08 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4PDGCodeChecker.cc,v 1.11 2008/06/08 12:43:19 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ----------------------------------------------------------------------
@@ -44,7 +44,7 @@
G4PDGCodeChecker::G4PDGCodeChecker()
{
code = 0;
verboseLevel = 3;
verboseLevel = 1;
}
/////////////
@@ -100,7 +100,7 @@ G4int G4PDGCodeChecker::CheckForBaryons()
if ((quark1==0)||(quark2==0)||(quark3==0)){
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " meson has three quark ";
G4cout << " PDG code=" << code <<G4endl;
@@ -160,7 +160,7 @@ G4int G4PDGCodeChecker::CheckForBaryons()
// check quark flavor
if ((quark1<quark2)||(quark2<quark3)||(quark1<quark3)) {
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " illegal code for baryon ";
G4cout << " PDG code=" << code <<G4endl;
@@ -170,7 +170,7 @@ G4int G4PDGCodeChecker::CheckForBaryons()
}
if (quark1> NumberOfQuarkFlavor) {
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " ??? unknown quark ";
G4cout << " PDG code=" << code <<G4endl;
@@ -210,7 +210,7 @@ G4int G4PDGCodeChecker::CheckForMesons()
//
if ((quark1 !=0)||(quark2==0)||(quark3==0)){
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " meson has only quark and anti-quark pair";
G4cout << " PDG code=" << code <<G4endl;
@@ -220,7 +220,7 @@ G4int G4PDGCodeChecker::CheckForMesons()
}
if (quark2<quark3) {
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " illegal code for meson ";
G4cout << " PDG code=" << code <<G4endl;
@@ -232,7 +232,7 @@ G4int G4PDGCodeChecker::CheckForMesons()
// check quark flavor
if (quark2> NumberOfQuarkFlavor){
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " ??? unknown quark ";
G4cout << " PDG code=" << code <<G4endl;
@@ -281,7 +281,7 @@ G4int G4PDGCodeChecker::CheckForDiQuarks()
} else if (quark2>NumberOfQuarkFlavor){
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " ??? unknown quark ";
G4cout << " PDG code=" << code <<G4endl;
@@ -308,7 +308,7 @@ G4int G4PDGCodeChecker::CheckForQuarks()
{
if ( std::abs(quark1)>NumberOfQuarkFlavor ) {
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " ??? unknown quark ";
G4cout << " PDG code=" << code <<G4endl;
@@ -344,7 +344,7 @@ G4bool G4PDGCodeChecker::CheckCharge(G4double thePDGCharge) const
if (std::abs(totalCharge-thePDGCharge)>0.1*eplus) {
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckCharge : ";
G4cout << " illegal electric charge " << thePDGCharge/eplus;
G4cout << " PDG code=" << code <<G4endl;
@@ -373,7 +373,7 @@ G4int G4PDGCodeChecker::CheckForNuclei()
if (A < 2 || Z > A-L || L>A || Z<=0 ) {
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
G4cout << " ??? Illegal PDG encoding for nucleus ";
G4cout << " PDG code=" << code <<G4endl;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ParticleDefinition.cc,v 1.30 2007/11/14 02:22:08 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4ParticleDefinition.cc,v 1.31 2008/06/08 12:43:19 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// --------------------------------------------------------------
@@ -112,6 +112,9 @@ G4ParticleDefinition::G4ParticleDefinition(
// check name and register this particle into ParticleTable
theParticleTable = G4ParticleTable::GetParticleTable();
theParticleTable->Insert(this);
//set verboseLevel equal to ParticleTable
verboseLevel = theParticleTable->GetVerboseLevel();
if (anti_encoding !=0) theAntiPDGEncoding = anti_encoding;
@@ -179,6 +182,7 @@ G4int G4ParticleDefinition::FillQuarkContents()
}
G4PDGCodeChecker checker;
checker.SetVerboseLevel(verboseLevel);
G4int temp = checker.CheckPDGCode(thePDGEncoding, theParticleType);
@@ -192,7 +196,7 @@ G4int G4ParticleDefinition::FillQuarkContents()
if (!checker.CheckCharge(thePDGCharge) ){
temp = 0;
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << "G4ParticleDefinition::FillQuarkContents : ";
G4cout << " illegal charge (" << thePDGCharge/eplus;
G4cout << " PDG code=" << thePDGEncoding <<G4endl;
@@ -203,7 +207,7 @@ G4int G4ParticleDefinition::FillQuarkContents()
if (checker.GetSpin() != thePDGiSpin) {
temp=0;
#ifdef G4VERBOSE
if (verboseLevel>1) {
if (verboseLevel>0) {
G4cout << "G4ParticleDefinition::FillQuarkContents : ";
G4cout << " illegal SPIN (" << thePDGiSpin << "/2";
G4cout << " PDG code=" << thePDGEncoding <<G4endl;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ParticleMessenger.cc,v 1.9 2007/03/15 06:53:27 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4ParticleMessenger.cc,v 1.10 2008/06/08 12:43:19 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//---------------------------------------------------------------
@@ -89,6 +89,16 @@ G4ParticleMessenger::G4ParticleMessenger(G4ParticleTable* pTable)
findCmd->SetDefaultValue(0);
findCmd->SetParameterName("encoding", false);
// -- particle/property/Verbose ---
verboseCmd = new G4UIcmdWithAnInteger("/particle/verbose",this);
verboseCmd->SetGuidance("Set Verbose level of particle table.");
verboseCmd->SetGuidance(" 0 : Silent (default)");
verboseCmd->SetGuidance(" 1 : Display warning messages");
verboseCmd->SetGuidance(" 2 : Display more");
verboseCmd->SetParameterName("verbose_level",true);
verboseCmd->SetDefaultValue(0);
verboseCmd->SetRange("verbose_level >=0");
currentParticle = 0;
//UI messenger for Particle Properties
@@ -99,10 +109,13 @@ G4ParticleMessenger::G4ParticleMessenger(G4ParticleTable* pTable)
G4ParticleMessenger::~G4ParticleMessenger()
{
delete fParticlePropertyMessenger;
delete listCmd;
delete selectCmd;
delete thisDirectory;
delete findCmd;
delete verboseCmd;
delete thisDirectory;
}
@@ -153,6 +166,9 @@ void G4ParticleMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
G4cout << tmp->GetParticleName() << G4endl;
tmp->DumpTable();
}
} else if( command==verboseCmd ) {
//Commnad /particle/verbose
theParticleTable->SetVerboseLevel(verboseCmd->GetNewIntValue(newValues));
}
}
@@ -178,6 +194,9 @@ G4String G4ParticleMessenger::GetCurrentValue(G4UIcommand * command)
} else {
return currentParticle->GetParticleName();
}
} else if( command==verboseCmd ){
//Commnad /particle/verbose
return verboseCmd->ConvertToString(theParticleTable->GetVerboseLevel());
}
return "";
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4ParticlePropertyMessenger.cc,v 1.7 2006/06/29 19:25:59 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//---------------------------------------------------------------
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ParticleTable.cc,v 1.29 2007/10/06 06:49:29 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4ParticleTable.cc,v 1.33 2008/06/08 12:55:45 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// class G4ParticleTable
//
@@ -56,10 +56,9 @@
#include "G4IonTable.hh"
#include "G4ShortLivedTable.hh"
////////////////////
G4ParticleTable::G4ParticleTable()
:verboseLevel(0),fParticleMessenger(0),
:verboseLevel(1),fParticleMessenger(0),
noName(" "),
readyToUse(false)
{
@@ -99,11 +98,12 @@ G4ParticleTable::~G4ParticleTable()
}
if(fDictionary){
if (fIterator!=0 )delete fIterator;
fIterator =0;
fDictionary->clear();
delete fDictionary;
fDictionary =0;
if (fIterator!=0 )delete fIterator;
fIterator =0;
}
if (fParticleMessenger!=0) delete fParticleMessenger;
@@ -155,10 +155,34 @@ void G4ParticleTable::DeleteMessenger()
//UI messenger
delete fParticleMessenger;
fParticleMessenger= 0;
// remove all items from G4ParticleTable
// temporaly comment out
// RemoveAllParticles();
}
}
////////////////////
void G4ParticleTable::DeleteAllParticles()
{
#ifdef G4VERBOSE
if (verboseLevel>1){
G4cout << "G4ParticleTable::DeleteAllParticles() " << G4endl;
}
#endif
// delete all particles
G4PTblDicIterator *piter = fIterator;
piter -> reset();
while( (*piter)() ){
#ifdef G4VERBOSE
if (verboseLevel>2){
G4cout << "Delete " << (piter->value())->GetParticleName()
<< " " << (piter->value()) << G4endl;
}
#endif
delete (piter->value());
}
RemoveAllParticles();
}
////////////////////
@@ -170,42 +194,26 @@ void G4ParticleTable::RemoveAllParticles()
G4cout << "G4ParticleTable::RemoveAllParticles() " << G4endl;
}
#endif
// delete all particles
G4PTblDicIterator *piter = fIterator;
piter -> reset();
while( (*piter)() ){
delete (piter->value());
}
//delete Ion Table and contents
//remove all contnts in Ion Table
if (fIonTable!=0) {
delete fIonTable;
fIonTable = 0;
fIonTable->clear();
}
// delete Short Lived table and contents
// remomve all contents in hort Lived table
if (fShortLivedTable!=0) {
delete fShortLivedTable;
fShortLivedTable = 0;
fShortLivedTable->clear();
}
// delete dictionary for encoding
if (fEncodingDictionary)
{
// clear dictionary for encoding
if (fEncodingDictionary) {
fEncodingDictionary->clear();
delete fEncodingDictionary;
fEncodingDictionary = 0;
}
}
// delete dictionary
if (fDictionary)
{
if (fIterator!=0 )delete fIterator;
fIterator =0;
fDictionary->clear();
delete fDictionary;
fDictionary = 0;
}
// clear dictionary
if (fDictionary) {
fDictionary->clear();
}
}
////////////////////
@@ -238,11 +246,13 @@ G4ParticleDefinition* G4ParticleTable::Insert(G4ParticleDefinition *particle)
G4PTblDictionary *pdic = fDictionary;
G4PTblEncodingDictionary *pedic = fEncodingDictionary;
(*pdic)[GetKey(particle)] = particle;
// insert into Dictionary
pdic->insert( std::pair<G4String, G4ParticleDefinition*>(GetKey(particle), particle) );
// insert into EncodingDictionary
G4int code = particle->GetPDGEncoding();
if (code !=0 ) {
(*pedic)[code] = particle;
pedic->insert( std::pair<G4int, G4ParticleDefinition*>(code ,particle) );
}
// insert it in IonTable if "nucleus"
@@ -255,6 +265,16 @@ G4ParticleDefinition* G4ParticleTable::Insert(G4ParticleDefinition *particle)
fShortLivedTable->Insert(particle);
}
// set Verbose Level same as ParticleTable
particle->SetVerboseLevel(verboseLevel);
#ifdef G4VERBOSE
if (verboseLevel>3){
G4cout << "The particle "<< particle->GetParticleName()
<< " is inserted in the ParticleTable " << G4endl;
}
#endif
return particle;
}
}
@@ -285,6 +305,14 @@ G4ParticleDefinition* G4ParticleTable::Remove(G4ParticleDefinition* particle)
if (particle->IsShortLived() ){
fShortLivedTable->Remove(particle);
}
#ifdef G4VERBOSE
if (verboseLevel>3){
G4cout << "The particle "<< particle->GetParticleName()
<< " is removed from the ParticleTable " << G4endl;
}
#endif
return particle;
}
@@ -351,9 +379,9 @@ G4ParticleDefinition* G4ParticleTable::GetParticle(G4int index)
if ( counter == index ) return piter->value();
counter++;
}
}
}
#ifdef G4VERBOSE
if (verboseLevel>0){
if (verboseLevel>1){
G4cout << " G4ParticleTable::GetParticle";
G4cout << " invalid index (=" << index << ")" << G4endl;
}
@@ -364,7 +392,7 @@ G4ParticleDefinition* G4ParticleTable::GetParticle(G4int index)
////////////////////
G4ParticleDefinition* G4ParticleTable::FindParticle(const G4ParticleDefinition *particle)
{
CheckReadiness();
CheckReadiness();
G4String key = GetKey(particle);
return FindParticle(key);
}
@@ -376,13 +404,13 @@ G4ParticleDefinition* G4ParticleTable::FindParticle(G4int aPDGEncoding )
// check aPDGEncoding is valid
if (aPDGEncoding == 0){
#ifdef G4VERBOSE
if (verboseLevel>0){
if (verboseLevel>1){
G4cout << "PDGEncoding [" << aPDGEncoding << "] is not valid " << G4endl;
}
#endif
return 0;
}
G4PTblEncodingDictionary *pedic = fEncodingDictionary;
G4ParticleDefinition* particle =0;
@@ -392,7 +420,7 @@ G4ParticleDefinition* G4ParticleTable::FindParticle(G4int aPDGEncoding )
}
#ifdef G4VERBOSE
if ((particle == 0) && (verboseLevel>0) ){
if ((particle == 0) && (verboseLevel>1) ){
G4cout << "CODE:" << aPDGEncoding << " does not exist in ParticleTable " << G4endl;
}
#endif
@@ -445,3 +473,4 @@ void G4ParticleTable::CheckReadiness()
@@ -25,7 +25,7 @@
//
//
// $Id: G4PhaseSpaceDecayChannel.cc,v 1.13 2007/10/06 06:49:29 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4PrimaryParticle.cc,v 1.5 2007/10/06 06:49:29 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4PrimaryParticle.hh"
@@ -25,7 +25,7 @@
//
//
// $Id: G4PrimaryVertex.cc,v 1.4 2007/10/06 06:49:29 kurasige Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4PrimaryVertex.hh"
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ShortLivedTable.cc,v 1.14 2006/06/29 19:26:16 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4ShortLivedTable.cc,v 1.16 2008/06/08 12:55:45 kurasige Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// --------------------------------------------------------------
@@ -88,11 +88,12 @@ void G4ShortLivedTable::Remove(G4ParticleDefinition* particle)
for (idx = fShortLivedList->begin(); idx!= fShortLivedList->end(); ++idx) {
if ( particle == *idx) {
fShortLivedList->erase(idx);
break;
}
}
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
if (GetVerboseLevel()>1) {
G4cout << "G4ShortLivedTable::Remove :" << particle->GetParticleName() ;
G4cout << " is not short lived" << G4endl;
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4TauLeptonicDecayChannel.cc,v 1.5 2006/06/29 19:26:18 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4VDecayChannel.cc,v 1.18 2006/06/29 19:26:20 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4VUserPrimaryParticleInformation.cc,v 1.2 2006/06/29 19:26:22 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-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-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
//---------------------------------------------------------------