34 #define INCLXX_IN_GEANT4_MODE 1
45 #ifdef INCLXX_IN_GEANT4_MODE
49 #ifdef INCLXX_IN_GEANT4_MODE
56 namespace ParticleTable {
61 const NaturalIsotopicDistributions *theNaturalIsotopicDistributions = NULL;
63 const G4double theINCLNucleonMass = 938.2796;
64 const G4double theINCLPionMass = 138.0;
65 const G4double theINCLEtaMass = 547.862;
66 const G4double theINCLOmegaMass = 782.65;
67 const G4double theINCLEtaPrimeMass = 957.78;
68 const G4double theINCLPhotonMass = 0.0;
90 const G4double theChargedPiWidth = 2.6033e-08;
91 const G4double thePiZeroWidth = 8.52e-17;
92 const G4double theEtaWidth = 5.025e-19;
93 const G4double theOmegaWidth = 7.7528e-23;
94 const G4double theEtaPrimeWidth = 3.3243e-21;
103 const G4int mediumNucleiTableSize = 30;
105 const G4double mediumDiffuseness[mediumNucleiTableSize] =
106 {0.0,0.0,0.0,0.0,0.0,1.78,1.77,1.77,1.77,1.71,
107 1.69,1.69,1.635,1.730,1.81,1.833,1.798,
108 1.841,0.567,0.571, 0.560,0.549,0.550,0.551,
109 0.580,0.575,0.569,0.537,0.0,0.0};
110 const G4double mediumRadius[mediumNucleiTableSize] =
111 {0.0,0.0,0.0,0.0,0.0,0.334,0.327,0.479,0.631,0.838,
112 0.811,1.07,1.403,1.335,1.25,1.544,1.498,1.513,
113 2.58,2.77, 2.775,2.78,2.88,2.98,3.22,3.03,2.84,
118 {-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},
119 {-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},
120 {-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},
121 {-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},
122 {-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},
123 {-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},
124 {-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},
125 {-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},
126 {-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}
131 {-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},
132 {-1.0, -1.0, 77.0, 110., 153., 100., 100., 100., -1.0, -1.0, -1.0, -1.0, -1.0},
133 {-1.0, -1.0, -1.0, 110., 153., 100., 100., 100., 100., 100., 100., -1.0, -1.0},
134 {-1.0, -1.0, -1.0, -1.0, 153., 100., 100., 100., 100., 100., 100., 100., 100.},
135 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100., 100., 100., 100., 100.},
136 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100., 100., 100., 100., 100.},
137 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100., 100., 100.},
138 {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 100., 100., 100.},
139 {-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.}
142 const G4int elementTableSize = 113;
145 const std::string elementTable[elementTableSize] = {
262 const std::string elementIUPACDigits =
"nubtqphsoe";
264 #define INCL_DEFAULT_SEPARATION_ENERGY 6.83
269 #undef INCL_DEFAULT_SEPARATION_ENERGY
276 #ifdef INCLXX_IN_GEANT4_MODE
284 char iupacToInt(
char c) {
285 return (
char)(((
G4int)
'0')+elementIUPACDigits.find(c));
289 char intToIUPAC(
char n) {
return elementIUPACDigits.at(n); }
292 const NaturalIsotopicDistributions *getNaturalIsotopicDistributions() {
293 if(!theNaturalIsotopicDistributions)
294 theNaturalIsotopicDistributions =
new NaturalIsotopicDistributions;
295 return theNaturalIsotopicDistributions;
301 protonMass = theINCLNucleonMass;
302 neutronMass = theINCLNucleonMass;
303 piPlusMass = theINCLPionMass;
304 piMinusMass = theINCLPionMass;
305 piZeroMass = theINCLPionMass;
306 etaMass = theINCLEtaMass;
307 omegaMass = theINCLOmegaMass;
308 etaPrimeMass = theINCLEtaPrimeMass;
309 photonMass = theINCLPhotonMass;
319 #ifndef INCLXX_IN_GEANT4_MODE
320 std::string dataFilePath;
326 #ifdef INCLXX_IN_GEANT4_MODE
339 minDeltaMass = theRealNeutronMass + theRealChargedPiMass + 0.5;
343 piPlusWidth = theChargedPiWidth;
344 piMinusWidth = theChargedPiWidth;
345 piZeroWidth = thePiZeroWidth;
346 etaWidth = theEtaWidth;
347 omegaWidth = theOmegaWidth;
348 etaPrimeWidth = theEtaPrimeWidth;
368 if(aFermiMomentum>0.)
369 constantFermiMomentum = aFermiMomentum;
385 std::fill(rpCorrelationCoefficient, rpCorrelationCoefficient +
UnknownParticle, 1.);
419 }
else if(t ==
Eta) {
421 }
else if(t ==
Omega) {
429 INCL_ERROR(
"Requested isospin of an unknown particle!");
448 std::stringstream stream;
454 std::stringstream stream;
463 return std::string(
"proton");
465 return std::string(
"neutron");
467 return std::string(
"delta++");
469 return std::string(
"delta+");
471 return std::string(
"delta0");
473 return std::string(
"delta-");
475 return std::string(
"pi+");
477 return std::string(
"pi0");
479 return std::string(
"pi-");
481 return std::string(
"composite");
483 return std::string(
"eta");
485 return std::string(
"omega");
487 return std::string(
"etaprime");
489 return std::string(
"photon");
491 return std::string(
"unknown");
496 return std::string(
"p");
498 return std::string(
"n");
500 return std::string(
"d++");
502 return std::string(
"d+");
504 return std::string(
"d0");
506 return std::string(
"d-");
508 return std::string(
"pi+");
510 return std::string(
"pi0");
512 return std::string(
"pi-");
514 return std::string(
"comp");
516 return std::string(
"eta");
518 return std::string(
"omega");
520 return std::string(
"etap");
522 return std::string(
"photon");
524 return std::string(
"unknown");
538 }
else if(pt ==
Eta) {
540 }
else if(pt ==
Omega) {
547 INCL_ERROR(
"getMass : Unknown particle type." <<
'\n');
555 return theRealProtonMass;
558 return theRealNeutronMass;
562 return theRealChargedPiMass;
565 return theRealPiZeroMass;
568 return theRealEtaMass;
571 return theRealOmegaMass;
574 return theRealEtaPrimeMass;
577 return theRealPhotonMass;
580 INCL_ERROR(
"Particle::getRealMass : Unknown particle type." <<
'\n');
598 #ifndef INCLXX_IN_GEANT4_MODE
599 return ::G4INCL::NuclearMassTable::getMass(A,Z);
601 return theG4IonTable->GetNucleusMass(Z,A) /
MeV;
615 return Z*(protonMass - protonSeparationEnergy) + (A-Z)*(neutronMass - neutronSeparationEnergy);
616 else if(A==1 && Z==0)
618 else if(A==1 && Z==1)
695 if(A >= 19 || (A < 6 && A >= 2)) {
699 }
else if(A < clusterTableASize && Z>=0 && Z < clusterTableZSize && A >= 6) {
704 INCL_DEBUG(
"getNuclearRadius: Radius for nucleus A = " << A <<
" Z = " << Z <<
" is not available" <<
'\n'
705 <<
"returning radius for C12");
706 return positionRMS[6][12];
713 return 1.225*theDiffusenessParameter*
714 std::sqrt((2.+5.*theRadiusParameter)/(2.+3.*theRadiusParameter));
716 INCL_ERROR(
"getNuclearRadius: No radius for nucleus A = " << A <<
" Z = " << Z <<
'\n');
729 G4double r0 = (2.745e-4 * A + 1.063) * std::pow(A, 1.0/3.0);
733 }
else if(A < 6 && A >= 2) {
734 if(Z<clusterTableZSize && Z>=0) {
739 INCL_DEBUG(
"getRadiusParameter: Radius for nucleus A = " << A <<
" Z = " << Z <<
" is not available" <<
'\n'
740 <<
"returning radius for C12");
741 return positionRMS[6][12];
744 INCL_DEBUG(
"getRadiusParameter: Radius for nucleus A = " << A <<
" Z = " << Z <<
" is not available" <<
'\n'
745 <<
"returning radius for C12");
746 return positionRMS[6][12];
748 }
else if(A < 28 && A >= 6) {
749 return mediumRadius[A-1];
752 INCL_ERROR(
"getRadiusParameter: No radius for nucleus A = " << A <<
" Z = " << Z <<
'\n');
761 }
else if(A < 19 && A >= 6) {
762 return 5.5 + 0.3 * (
G4double(A) - 6.0)/12.0;
766 INCL_ERROR(
"getMaximumNuclearRadius : No maximum radius for nucleus A = " << A <<
" Z = " << Z <<
'\n');
777 }
else if(A < 28 && A >= 19) {
778 return mediumDiffuseness[A-1];
779 }
else if(A < 19 && A >= 6) {
780 return mediumDiffuseness[A-1];
781 }
else if(A < 6 && A >= 2) {
782 INCL_ERROR(
"getSurfaceDiffuseness: was called for A = " << A <<
" Z = " << Z <<
'\n');
785 INCL_ERROR(
"getSurfaceDiffuseness: No diffuseness for nucleus A = " << A <<
" Z = " << Z <<
'\n');
797 return theINCLProtonSeparationEnergy;
799 return theINCLNeutronSeparationEnergy;
801 INCL_ERROR(
"ParticleTable::getSeparationEnergyINCL : Unknown particle type." <<
'\n');
813 INCL_ERROR(
"ParticleTable::getSeparationEnergyReal : Unknown particle type." <<
'\n');
836 INCL_WARN(
"getElementName called with Z<1" <<
'\n');
837 return elementTable[0];
838 }
else if(Z<elementTableSize)
839 return elementTable[
Z];
845 std::stringstream elementStream;
847 std::string elementName = elementStream.str();
848 std::transform(elementName.begin(), elementName.end(), elementName.begin(), intToIUPAC);
849 elementName[0] = std::toupper(elementName.at(0));
855 std::transform(pS.begin(), pS.end(), pS.begin(), ::tolower);
856 pS[0] = ::toupper(pS[0]);
858 const std::string *iter = std::find(elementTable, elementTable+elementTableSize, pS);
859 if(iter != elementTable+elementTableSize)
860 return iter - elementTable;
867 std::string elementName(s);
868 std::transform(elementName.begin(), elementName.end(), elementName.begin(), ::tolower);
870 if(elementName.find_first_not_of(elementIUPACDigits)!=std::string::npos)
872 std::transform(elementName.begin(), elementName.end(), elementName.begin(), iupacToInt);
873 std::stringstream elementStream(elementName);
880 return getNaturalIsotopicDistributions()->getIsotopicDistribution(Z);
884 return getNaturalIsotopicDistributions()->drawRandomIsotope(Z);
888 return constantFermiMomentum;
902 static const G4double alphaParam = 259.416;
903 static const G4double betaParam = 152.824;
904 static const G4double gammaParam = 9.5157E-2;
905 return alphaParam - betaParam*std::exp(-gammaParam*((
G4double)A));
910 return rpCorrelationCoefficient[t];
930 else if (isosp == 0) {
953 else if (isosp == -1) {
956 else if (isosp == 1) {
972 }
else if(pt ==
Eta) {
974 }
else if(pt ==
Omega) {
977 return etaPrimeWidth;
979 INCL_ERROR(
"getWidth : Unknown particle type." <<
'\n');
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.
G4ThreadLocal G4double minDeltaMassRndm
G4double getNeutronSkin()
Get the thickness of the neutron skin.
G4double getNeutronSeparationEnergy()
Getter for neutronSeparationEnergy.
G4double getNeutronSkin() const
Get the neutron-skin thickness.
std::string const & getINCLXXDataFilePath() const
G4ThreadLocal G4double minDeltaMass2
G4double getProtonSeparationEnergy()
Getter for protonSeparationEnergy.
std::vector< ExP01TrackerHit * > a
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 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.
ParticleType getNucleonType(const G4int isosp)
Get the type of nucleon.
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)
ParticleType getPionType(const G4int isosp)
Get the type of pion.
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
double A(double temperature)
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.
void initialize(Config const *const theConfig)
Initialize the clustering model based on the Config object.
ParticleType getDeltaType(const G4int isosp)
Get the type of delta.
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.
G4double getNeutronHalo() const
Get the neutron-halo size.
G4double getWidth(const ParticleType t)
Get particle width (in s)
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
const G4double effectiveDeltaWidth
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)
G4ThreadLocal G4double minDeltaMass
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].
G4int drawRandomNaturalIsotope(const G4int Z)
static constexpr double MeV
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.
const G4double effectiveDeltaMass
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 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.
G4double getNeutronHalo()
Get the size of the neutron halo.
G4ThreadLocal FermiMomentumFn getFermiMomentum