33 #define INCLXX_IN_GEANT4_MODE 1
44 #ifdef INCLXX_IN_GEANT4_MODE
48 #ifdef INCLXX_IN_GEANT4_MODE
55 namespace ParticleTable {
60 const NaturalIsotopicDistributions *theNaturalIsotopicDistributions = NULL;
62 const G4double theINCLNucleonMass = 938.2796;
63 const G4double theINCLPionMass = 138.0;
76 const G4int mediumNucleiTableSize = 30;
78 const G4double mediumDiffuseness[mediumNucleiTableSize] =
79 {0.0,0.0,0.0,0.0,0.0,1.78,1.77,1.77,1.77,1.71,
80 1.69,1.69,1.635,1.730,1.81,1.833,1.798,
81 1.841,0.567,0.571, 0.560,0.549,0.550,0.551,
82 0.580,0.575,0.569,0.537,0.0,0.0};
83 const G4double mediumRadius[mediumNucleiTableSize] =
84 {0.0,0.0,0.0,0.0,0.0,0.334,0.327,0.479,0.631,0.838,
85 0.811,1.07,1.403,1.335,1.25,1.544,1.498,1.513,
86 2.58,2.77, 2.775,2.78,2.88,2.98,3.22,3.03,2.84,
91 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0},
92 {-1.0, -1.0, 2.10, 1.80, 1.70, 1.83, 2.60, 2.50, -1.0, -1.0, -1.0, -1.0, -1.0},
93 {-1.0, -1.0, -1.0, 1.80, 1.68, 1.70, 2.60, 2.50, 2.50, 2.50, 2.50, -1.0, -1.0},
94 {-1.0, -1.0, -1.0, -1.0, 1.70, 1.83, 2.56, 2.40, 2.50, 2.50, 2.50, 2.50, 2.50},
95 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 2.60, 2.50, 2.50, 2.51, 2.50, 2.50, 2.50},
96 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 2.50, 2.50, 2.50, 2.50, 2.45, 2.40, 2.50},
97 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 2.50, 2.50, 2.50, 2.50, 2.47},
98 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 2.50, 2.50, 2.50},
99 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 2.50}
104 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0},
105 {-1.0, -1.0, 77.0, 110., 153., 100., 100., 100., -1.0, -1.0, -1.0, -1.0, -1.0},
106 {-1.0, -1.0, -1.0, 110., 153., 100., 100., 100., 100., 100., 100., -1.0, -1.0},
107 {-1.0, -1.0, -1.0, -1.0, 153., 100., 100., 100., 100., 100., 100., 100., 100.},
108 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100., 100., 100., 100., 100.},
109 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100., 100., 100., 100., 100.},
110 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100., 100., 100.},
111 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100.},
112 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100.}
115 const G4int elementTableSize = 113;
118 const std::string elementTable[elementTableSize] = {
235 const std::string elementIUPACDigits =
"nubtqphsoe";
237 #define INCL_DEFAULT_SEPARATION_ENERGY 6.83
242 #undef INCL_DEFAULT_SEPARATION_ENERGY
249 #ifdef INCLXX_IN_GEANT4_MODE
257 char iupacToInt(
char c) {
258 return (
char)(((
G4int)
'0')+elementIUPACDigits.find(c));
262 char intToIUPAC(
char n) {
return elementIUPACDigits.at(n); }
265 const NaturalIsotopicDistributions *getNaturalIsotopicDistributions() {
266 if(!theNaturalIsotopicDistributions)
267 theNaturalIsotopicDistributions =
new NaturalIsotopicDistributions;
268 return theNaturalIsotopicDistributions;
274 protonMass = theINCLNucleonMass;
275 neutronMass = theINCLNucleonMass;
276 piPlusMass = theINCLPionMass;
277 piMinusMass = theINCLPionMass;
278 piZeroMass = theINCLPionMass;
288 #ifndef INCLXX_IN_GEANT4_MODE
289 std::string dataFilePath;
295 #ifdef INCLXX_IN_GEANT4_MODE
324 if(aFermiMomentum>0.)
325 constantFermiMomentum = aFermiMomentum;
342 std::fill(rpCorrelationCoefficient, rpCorrelationCoefficient +
UnknownParticle, 1.);
378 INCL_ERROR(
"Requested isospin of an unknown particle!");
397 std::stringstream stream;
403 std::stringstream stream;
412 return std::string(
"proton");
414 return std::string(
"neutron");
416 return std::string(
"delta++");
418 return std::string(
"delta+");
420 return std::string(
"delta0");
422 return std::string(
"delta-");
424 return std::string(
"pi+");
426 return std::string(
"pi0");
428 return std::string(
"pi-");
430 return std::string(
"composite");
432 return std::string(
"unknown");
437 return std::string(
"p");
439 return std::string(
"n");
441 return std::string(
"d++");
443 return std::string(
"d+");
445 return std::string(
"d0");
447 return std::string(
"d-");
449 return std::string(
"pi+");
451 return std::string(
"pi0");
453 return std::string(
"pi-");
455 return std::string(
"comp");
457 return std::string(
"unknown");
472 INCL_ERROR(
"getMass : Unknown particle type." << std::endl);
480 return theRealProtonMass;
483 return theRealNeutronMass;
487 return theRealChargedPiMass;
490 return theRealPiZeroMass;
493 INCL_ERROR(
"Particle::getRealMass : Unknown particle type." << std::endl);
511 #ifndef INCLXX_IN_GEANT4_MODE
512 return ::G4INCL::NuclearMassTable::getMass(A,Z);
514 return theG4IonTable->GetNucleusMass(Z,A) /
MeV;
528 return Z*(protonMass - protonSeparationEnergy) + (A-Z)*(neutronMass - neutronSeparationEnergy);
529 else if(A==1 && Z==0)
531 else if(A==1 && Z==1)
600 if(A >= 19 || (A < 6 && A >= 2)) {
604 }
else if(A < clusterTableASize && Z>=0 && Z < clusterTableZSize && A >= 6) {
605 const G4double thisRMS = positionRMS[Z][
A];
609 INCL_DEBUG(
"getNuclearRadius: Radius for nucleus A = " << A <<
" Z = " << Z <<
" is not available" << std::endl
610 <<
"returning radius for C12");
611 return positionRMS[6][12];
618 return 1.581*theDiffusenessParameter*
619 (2.+5.*theRadiusParameter)/(2.+3.*theRadiusParameter);
621 INCL_ERROR(
"getNuclearRadius: No radius for nucleus A = " << A <<
" Z = " << Z << std::endl);
634 G4double r0 = (2.745e-4 * A + 1.063) * std::pow(A, 1.0/3.0);
636 r0 += neutronSkinThickness;
638 }
else if(A < 6 && A >= 2) {
639 if(Z<clusterTableZSize && Z>=0) {
640 const G4double thisRMS = positionRMS[Z][
A];
644 INCL_DEBUG(
"getRadiusParameter: Radius for nucleus A = " << A <<
" Z = " << Z <<
" is not available" << std::endl
645 <<
"returning radius for C12");
646 return positionRMS[6][12];
649 INCL_DEBUG(
"getRadiusParameter: Radius for nucleus A = " << A <<
" Z = " << Z <<
" is not available" << std::endl
650 <<
"returning radius for C12");
651 return positionRMS[6][12];
653 }
else if(A < 28 && A >= 6) {
654 return mediumRadius[A-1];
657 INCL_ERROR(
"getRadiusParameter: No radius for nucleus A = " << A <<
" Z = " << Z << std::endl);
666 }
else if(A < 19 && A >= 6) {
667 return 5.5 + 0.3 * (
G4double(A) - 6.0)/12.0;
671 INCL_ERROR(
"getMaximumNuclearRadius : No maximum radius for nucleus A = " << A <<
" Z = " << Z << std::endl);
680 a += neutronSkinAdditionalDiffuseness;
682 }
else if(A < 28 && A >= 19) {
683 return mediumDiffuseness[A-1];
684 }
else if(A < 19 && A >= 6) {
685 return mediumDiffuseness[A-1];
686 }
else if(A < 6 && A >= 2) {
687 INCL_ERROR(
"getSurfaceDiffuseness: was called for A = " << A <<
" Z = " << Z << std::endl);
690 INCL_ERROR(
"getSurfaceDiffuseness: No diffuseness for nucleus A = " << A <<
" Z = " << Z << std::endl);
702 return theINCLProtonSeparationEnergy;
704 return theINCLNeutronSeparationEnergy;
706 INCL_ERROR(
"ParticleTable::getSeparationEnergyINCL : Unknown particle type." << std::endl);
718 INCL_ERROR(
"ParticleTable::getSeparationEnergyReal : Unknown particle type." << std::endl);
741 INCL_WARN(
"getElementName called with Z<1" << std::endl);
742 return elementTable[0];
743 }
else if(Z<elementTableSize)
744 return elementTable[Z];
750 std::stringstream elementStream;
752 std::string elementName = elementStream.str();
753 std::transform(elementName.begin(), elementName.end(), elementName.begin(), intToIUPAC);
754 elementName[0] = std::toupper(elementName.at(0));
760 std::transform(pS.begin(), pS.end(), pS.begin(), ::tolower);
761 pS[0] = ::toupper(pS[0]);
763 const std::string *iter = std::find(elementTable, elementTable+elementTableSize, pS);
764 if(iter != elementTable+elementTableSize)
765 return iter - elementTable;
772 std::string elementName(s);
773 std::transform(elementName.begin(), elementName.end(), elementName.begin(), ::tolower);
775 if(elementName.find_first_not_of(elementIUPACDigits)!=std::string::npos)
777 std::transform(elementName.begin(), elementName.end(), elementName.begin(), iupacToInt);
778 std::stringstream elementStream(elementName);
785 return getNaturalIsotopicDistributions()->getIsotopicDistribution(Z);
789 return getNaturalIsotopicDistributions()->drawRandomIsotope(Z);
793 return constantFermiMomentum;
807 static const G4double alphaParam = 259.416;
808 static const G4double betaParam = 152.824;
809 static const G4double gammaParam = 9.5157E-2;
810 return alphaParam - betaParam*std::exp(-gammaParam*((
G4double)A));
815 return rpCorrelationCoefficient[t];
The INCL configuration object.
const G4double sqrtThreeFifths
G4double(* ParticleMassFn)(const ParticleType)
G4double getSeparationEnergyReal(const ParticleType t, const G4int A, const G4int Z)
Return the real separation energy.
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const G4int clusterTableASize
G4ThreadLocal ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
G4double getNeutronSeparationEnergy()
Getter for neutronSeparationEnergy.
std::string const & getINCLXXDataFilePath() const
G4double getProtonSeparationEnergy()
Getter for protonSeparationEnergy.
G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2)
Get Q-value (in MeV/c^2)
G4int getChargeNumber(const ParticleType t)
Get charge number from particle type.
G4double getNeutronSkinAdditionalDiffuseness() const
Get the neutron-skin additional diffuseness.
G4double getFermiMomentum() const
Get the Fermi momentum.
G4double(* NuclearMassFn)(const G4int, const G4int)
G4double getFermiMomentumConstant(const G4int, const G4int)
Return the constant value of the Fermi momentum.
void setProtonSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
G4double(* FermiMomentumFn)(const G4int, const G4int)
SeparationEnergyType getSeparationEnergyType() const
Get the separation-energy type.
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
G4int getMassNumber(const ParticleType t)
Get mass number from particle type.
G4IonTable * GetIonTable() const
G4int parseElement(std::string pS)
Get the name of the element from the atomic number.
Class that stores isotopic abundances for a given element.
std::string getIUPACElementName(const G4int Z)
Get the name of an unnamed element from the IUPAC convention.
G4double getLargestNuclearRadius(const G4int A, const G4int Z)
const G4double sqrtFiveThirds
G4bool getUseRealMasses() const
Whether to use real masses.
static const G4double A[nN]
G4double(* SeparationEnergyFn)(const ParticleType, const G4int, const G4int)
Functions that encapsulate a mass table.
G4double getSurfaceDiffuseness(const ParticleType t, const G4int A, const G4int Z)
G4double getRadiusParameter(const ParticleType t, const G4int A, const G4int Z)
G4ThreadLocal SeparationEnergyFn getSeparationEnergy
Static pointer to the separation-energy function.
FermiMomentumType getFermiMomentumType() const
Get the Fermi-momentum type.
std::string getElementName(const G4int Z)
Get the name of the element from the atomic number.
G4double getMaximumNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
G4double getSeparationEnergyRealForLight(const ParticleType t, const G4int A, const G4int Z)
Return the real separation energy only for light nuclei.
G4double getINCLMass(const G4int A, const G4int Z)
Get INCL nuclear mass (in MeV/c^2)
G4int getIsospin(const ParticleType t)
Get the isospin of a particle.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
const G4double Pf
Fermi momentum [MeV/c].
G4double getNeutronSkinThickness() const
Get the neutron-skin thickness.
G4double getNeutronSkinAdditionalDiffuseness()
Get the value of the additional neutron skin diffuseness.
G4int drawRandomNaturalIsotope(const G4int Z)
G4double getTableSpeciesMass(const ParticleSpecies &p)
G4double getMomentumRMS(const G4int A, const G4int Z)
Return the RMS of the momentum distribution (light clusters)
#define INCL_DEFAULT_SEPARATION_ENERGY
IsotopicDistribution const & getNaturalIsotopicDistribution(const G4int Z)
G4double getRPCorrelationCoefficient(const ParticleType t)
Get the value of the r-p correlation coefficient.
G4int parseIUPACElement(std::string const &pS)
Parse a IUPAC element name.
G4ThreadLocal G4double effectiveDeltaDecayThreshold
const G4int clusterTableZSize
G4double getSeparationEnergyINCL(const ParticleType t, const G4int, const G4int)
Return INCL's default separation energy.
G4double getFermiMomentumMassDependent(const G4int A, const G4int)
Return the value Fermi momentum from a fit.
G4double getRPCorrelationCoefficient(const ParticleType t) const
Get the r-p correlation coefficient.
std::string getShortName(const ParticleType t)
Get the short INCL name of the particle.
void initialize(Config const *const theConfig=0)
Initialize the particle table.
void setNeutronSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
G4double getNeutronSkinThickness()
Get the value of the neutron skin thickness.
G4double getFermiMomentumConstantLight(const G4int A, const G4int Z)
Return the constant value of the Fermi momentum - special for light.
std::string getName(const ParticleType t)
Get the native INCL name of the particle.
G4ThreadLocal FermiMomentumFn getFermiMomentum