Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCLParticleTable.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// INCL++ intra-nuclear cascade model
27// Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
28// Davide Mancusi, CEA
29// Alain Boudard, CEA
30// Sylvie Leray, CEA
31// Joseph Cugnon, University of Liege
32//
33// INCL++ revision: v5.1.8
34//
35#define INCLXX_IN_GEANT4_MODE 1
36
37#include "globals.hh"
38
39#ifndef G4INCLParticleTable_hh
40#define G4INCLParticleTable_hh 1
41
42#include <string>
43#include <vector>
44// #include <cassert>
45
46#include "G4INCLParticleType.hh"
48#include "G4INCLLogger.hh"
49#include "G4INCLConfig.hh"
50
51#ifdef INCLXX_IN_GEANT4_MODE
52#include "G4IonTable.hh"
53#include "G4ParticleTable.hh"
54#include "globals.hh"
55#endif
56#include "G4INCLGlobals.hh"
58
59namespace G4INCL {
61 public:
62 /// \brief Initialize the particle table
63 static void initialize(Config const * const theConfig = 0);
64
65 /// Get the isospin of a particle
66 static G4int getIsospin(const ParticleType t);
67
68 /// Get the native INCL name of the particle
69 static std::string getName(const ParticleType t);
70
71 /// Get the short INCL name of the particle
72 static std::string getShortName(const ParticleType t);
73
74 /// Get the native INCL name of the particle
75 static std::string getName(const ParticleSpecies s);
76
77 /// Get the short INCL name of the particle
78 static std::string getShortName(const ParticleSpecies s);
79
80 /// Get the native INCL name of the ion
81 static std::string getName(const G4int A, const G4int Z);
82
83 /// Get the short INCL name of the ion
84 static std::string getShortName(const G4int A, const G4int Z);
85
86 ///\brief Get INCL nuclear mass (in MeV/c^2)
87 static G4double getINCLMass(const G4int A, const G4int Z);
88
89 ///\brief Get INCL particle mass (in MeV/c^2)
90 static G4double getINCLMass(const ParticleType t);
91
92#ifndef INCLXX_IN_GEANT4_MODE
93 ///\brief Do we have this particle mass?
94 static G4double hasMassTable(const unsigned int A, const unsigned int Z) {
95 return ( Z > 0 && A > 0
96 && Z < massTableMask.size() && A < massTableMask.at(Z).size()
97 && massTableMask.at(Z).at(A));
98 }
99
100 /** \brief Weizsaecker mass formula
101 *
102 * Return the nuclear mass, as calculated from Weizsaecker's mass formula.
103 * Adapted from the Geant4 source.
104 *
105 * \param A the mass number
106 * \param Z the charge number
107 * \return the nuclear mass [MeV/c^2]
108 */
109 static G4double getWeizsaeckerMass(const G4int A, const G4int Z) {
110 const G4int Npairing = (A-Z)%2; // pairing
111 const G4int Zpairing = Z%2;
112 const G4double fA = (G4double) A;
113 const G4double fZ = (G4double) Z;
115 - 15.67*fA // nuclear volume
116 + 17.23*Math::pow23(fA) // surface energy
117 + 93.15*((fA/2.-fZ)*(fA/2.-fZ))/fA // asymmetry
118 + 0.6984523*fZ*fZ*Math::powMinus13(fA); // coulomb
119 if( Npairing == Zpairing ) binding += (Npairing+Zpairing-1) * 12.0 / std::sqrt(fA); // pairing
120
122 }
123#endif
124
125 ///\brief Get particle mass (in MeV/c^2)
127 ///\brief Get nuclear mass (in MeV/c^2)
128 static G4double getRealMass(const G4int A, const G4int Z);
129
130 /**\brief Get Q-value (in MeV/c^2)
131 *
132 * Uses the getTableMass function to compute the Q-value for the
133 * following reaction:
134 * \f[ (A_1,Z_1) + (A_2, Z_2) --> (A_1+A_2,Z_1+Z_2) \f]
135 */
136 static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2) {
137 return getTableMass(A1,Z1) + getTableMass(A2,Z2) - getTableMass(A1+A2,Z1+Z2);
138 }
139
140 /**\brief Get Q-value (in MeV/c^2)
141 *
142 * Uses the getTableMass function to compute the Q-value for the
143 * following reaction:
144 * \f[ (A_1,Z_1) + (A_2, Z_2) --> (A_3,Z_3) + (A1+A2-A3,Z1+Z2-Z3) \f]
145 */
146 static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2, const G4int A3, const G4int Z3) {
147 return getTableMass(A1,Z1) + getTableMass(A2,Z2) - getTableMass(A3,Z3) - getTableMass(A1+A2-A3,Z1+Z2-Z3);
148 }
149
150 // Typedefs and pointers for transparent handling of mass functions
151 typedef G4double (*NuclearMassFn)(const G4int, const G4int);
155
157 if(p.theType == Composite)
158 return (*getTableMass)(p.theA, p.theZ);
159 else
160 return (*getTableParticleMass)(p.theType);
161 }
162
163 // Typedefs and pointers for transparent handling of separation energies
164 typedef G4double (*SeparationEnergyFn)(const ParticleType, const G4int, const G4int);
166
167 /// \brief Get mass number from particle type
169 switch(t) {
170 case Proton:
171 case Neutron:
172 case DeltaPlusPlus:
173 case DeltaPlus:
174 case DeltaZero:
175 case DeltaMinus:
176 return 1;
177 break;
178 case PiPlus:
179 case PiMinus:
180 case PiZero:
181 return 0;
182 break;
183 default:
184/* FATAL("Can't determine mass number for particle type " << t << std::endl);
185 std::abort();*/
186 return 0;
187 break;
188 }
189 }
190
191 /// \brief Get charge number from particle type
193 switch(t) {
194 case DeltaPlusPlus:
195 return 2;
196 break;
197 case Proton:
198 case DeltaPlus:
199 case PiPlus:
200 return 1;
201 break;
202 case Neutron:
203 case DeltaZero:
204 case PiZero:
205 return 0;
206 break;
207 case DeltaMinus:
208 case PiMinus:
209 return -1;
210 break;
211 default:
212/* FATAL("Can't determine charge number for particle type " << t << std::endl);
213 std::abort();*/
214 return 0;
215 break;
216 }
217 }
218
219 static G4double getNuclearRadius(const G4int A, const G4int Z);
220 static G4double getRadiusParameter(const G4int A, const G4int Z);
221 static G4double getMaximumNuclearRadius(const G4int A, const G4int Z);
222 static G4double getSurfaceDiffuseness(const G4int A, const G4int Z);
223
224 /// \brief Return the RMS of the momentum distribution (light clusters)
225 static G4double getMomentumRMS(const G4int A, const G4int Z) {
226// assert(Z>=0 && A>=0 && Z<=A);
228 return momentumRMS[Z][A];
229 else
231 }
232
233 /// \brief Return INCL's default separation energy
234 static G4double getSeparationEnergyINCL(const ParticleType t, const G4int /*A*/, const G4int /*Z*/) {
235 if(t==Proton)
236 return theINCLProtonSeparationEnergy;
237 else if(t==Neutron)
238 return theINCLNeutronSeparationEnergy;
239 else {
240 ERROR("ParticleTable::getSeparationEnergyINCL : Unknown particle type." << std::endl);
241 return 0.0;
242 }
243 }
244
245 /// \brief Return the real separation energy
246 static G4double getSeparationEnergyReal(const ParticleType t, const G4int A, const G4int Z) {
247 // Real separation energies for all nuclei
248 if(t==Proton)
249 return (*getTableParticleMass)(Proton) + (*getTableMass)(A-1,Z-1) - (*getTableMass)(A,Z);
250 else if(t==Neutron)
251 return (*getTableParticleMass)(Neutron) + (*getTableMass)(A-1,Z) - (*getTableMass)(A,Z);
252 else {
253 ERROR("ParticleTable::getSeparationEnergyReal : Unknown particle type." << std::endl);
254 return 0.0;
255 }
256 }
257
258 /// \brief Return the real separation energy only for light nuclei
260 // Real separation energies for light nuclei, fixed values for heavy nuclei
262 return getSeparationEnergyReal(t, A, Z);
263 else
264 return getSeparationEnergyINCL(t, A, Z);
265 }
266
267 /// \brief Getter for protonSeparationEnergy
268 static G4double getProtonSeparationEnergy() { return protonSeparationEnergy; }
269
270 /// \brief Getter for neutronSeparationEnergy
271 static G4double getNeutronSeparationEnergy() { return neutronSeparationEnergy; }
272
273 /// \brief Setter for protonSeparationEnergy
274 static void setProtonSeparationEnergy(const G4double s) { protonSeparationEnergy = s; }
275
276 /// \brief Setter for protonSeparationEnergy
277 static void setNeutronSeparationEnergy(const G4double s) { neutronSeparationEnergy = s; }
278
279 /// \brief Get the name of the element from the atomic number
280 static std::string getElementName(const G4int Z);
281 /// \brief Get the name of an unnamed element from the IUPAC convention
282 static std::string getIUPACElementName(const G4int Z);
283
284 /** \brief Parse a IUPAC element name
285 *
286 * Note: this function is UGLY. Look at it at your own peril.
287 *
288 * \param pS a normalised string (lowercase)
289 * \return the charge number of the nuclide, or zero on fail
290 */
291 static G4int parseIUPACElement(std::string const &pS);
292
293 const static G4int elementTableSize = 113; // up to Cn
294
300
301 static const G4int maxClusterMass = 12;
302 static const G4int maxClusterCharge = 8;
303
308 const static G4int clusterZMin[maxClusterMass+1]; // Lower limit of Z for cluster of mass A
309 const static G4int clusterZMax[maxClusterMass+1]; // Upper limit of Z for cluster of mass A
311
312#ifdef INCLXX_IN_GEANT4_MODE
314#else
315 static std::vector< std::vector <G4bool> > massTableMask;
316 static std::vector< std::vector <G4double> > massTable;
317#endif
318
319 // Enumerator for cluster-decay channels
329 };
331
332 /** \brief Coulomb conversion factor, in MeV*fm.
333 *
334 * \f[ e^2/(4 pi epsilon_0) \f]
335 */
336 static const G4double eSquared;
337
339 return getNaturalIsotopicDistributions()->getIsotopicDistribution(Z);
340 }
341
343 return getNaturalIsotopicDistributions()->drawRandomIsotope(Z);
344 }
345
346 protected:
349
350 private:
351 static const G4double theINCLNucleonMass;
352 static const G4double theINCLPionMass;
353 static const G4double theINCLNeutronSeparationEnergy;
354 static const G4double theINCLProtonSeparationEnergy;
355 static G4double protonMass;
356 static G4double neutronMass;
357 static G4double neutronSeparationEnergy;
358 static G4double protonSeparationEnergy;
359 static G4double piPlusMass, piMinusMass, piZeroMass;
360 static G4double theRealProtonMass;
361 static G4double theRealNeutronMass;
362 static G4double theRealChargedPiMass;
363 static G4double theRealPiZeroMass;
364
365 const static G4int mediumNucleiTableSize = 30;
366 const static G4double mediumDiffuseness[mediumNucleiTableSize];
367 const static G4double mediumRadius[mediumNucleiTableSize];
368 const static G4double positionRMS[clusterTableZSize][clusterTableASize];
369 const static G4double momentumRMS[clusterTableZSize][clusterTableASize];
370
371 const static std::string elementTable[elementTableSize];
372
373#ifndef INCLXX_IN_GEANT4_MODE
374 /// \brief Read nuclear masses from a data file
375 static void readRealMasses(std::string const &path);
376#endif
377
378 const static std::string elementIUPACDigits;
379
380 /// \brief Transform a IUPAC char to an char representing an integer digit
381 static char iupacToInt(char c) {
382 return (char)(((G4int)'0')+elementIUPACDigits.find(c));
383 }
384
385 /// \brief Transform an integer digit (represented by a char) to a IUPAC char
386 static char intToIUPAC(char n) { return elementIUPACDigits.at(n); }
387
388 /// \brief Array of natural isotopic distributions
389 static const NaturalIsotopicDistributions *theNaturalIsotopicDistributions;
390
391 /// \brief Get the singleton instance of the natural isotopic distributions
392 static const NaturalIsotopicDistributions *getNaturalIsotopicDistributions() {
393 if(!theNaturalIsotopicDistributions)
394 theNaturalIsotopicDistributions = new NaturalIsotopicDistributions;
395 return theNaturalIsotopicDistributions;
396 }
397
398 };
399}
400
401#endif
#define ERROR(x)
Classes that stores isotopic abundances.
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
Class that stores isotopic abundances for a given element.
G4int drawRandomIsotope(G4int const Z) const
Draw a random isotope.
IsotopicDistribution const & getIsotopicDistribution(G4int const Z) const
Get an isotopic distribution.
static const G4double clusterPosFact2[maxClusterMass+1]
static G4double getNeutronSeparationEnergy()
Getter for neutronSeparationEnergy.
static G4double getINCLMass(const G4int A, const G4int Z)
Get INCL nuclear mass (in MeV/c^2)
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
static G4double getMomentumRMS(const G4int A, const G4int Z)
Return the RMS of the momentum distribution (light clusters)
static const G4int clusterZMin[maxClusterMass+1]
static const G4double eSquared
Coulomb conversion factor, in MeV*fm.
static G4double getRadiusParameter(const G4int A, const G4int Z)
static IsotopicDistribution const & getNaturalIsotopicDistribution(const G4int Z)
static void initialize(Config const *const theConfig=0)
Initialize the particle table.
static const G4double effectiveDeltaMass
static SeparationEnergyFn getSeparationEnergy
Static pointer to the separation-energy function.
static ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
static const G4double clusterPosFact[maxClusterMass+1]
static const G4int clusterTableZSize
static G4double getProtonSeparationEnergy()
Getter for protonSeparationEnergy.
static G4double getNuclearRadius(const G4int A, const G4int Z)
G4double(* NuclearMassFn)(const G4int, const G4int)
static G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
static G4IonTable * theG4IonTable
static G4double getTableSpeciesMass(const ParticleSpecies &p)
G4double(* ParticleMassFn)(const ParticleType)
static G4double getMaximumNuclearRadius(const G4int A, const G4int Z)
static G4int getMassNumber(const ParticleType t)
Get mass number from particle type.
static const G4double effectiveDeltaDecayThreshold
static G4double getSeparationEnergyReal(const ParticleType t, const G4int A, const G4int Z)
Return the real separation energy.
static G4int parseIUPACElement(std::string const &pS)
Parse a IUPAC element name.
static std::string getName(const ParticleType t)
Get the native INCL name of the particle.
G4double(* SeparationEnergyFn)(const ParticleType, const G4int, const G4int)
static void setNeutronSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
static const G4int elementTableSize
static const G4double effectiveNucleonMass2
static G4int getChargeNumber(const ParticleType t)
Get charge number from particle type.
static void setProtonSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
static std::string getIUPACElementName(const G4int Z)
Get the name of an unnamed element from the IUPAC convention.
static G4double getSeparationEnergyRealForLight(const ParticleType t, const G4int A, const G4int Z)
Return the real separation energy only for light nuclei.
static G4int getIsospin(const ParticleType t)
Get the isospin of a particle.
static const G4double effectiveNucleonMass
static const G4double effectivePionMass
static const G4int clusterTableASize
static const G4int maxClusterCharge
static const G4double clusterPhaseSpaceCut[maxClusterMass+1]
static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2)
Get Q-value (in MeV/c^2)
static const G4int clusterZMax[maxClusterMass+1]
static G4double getSeparationEnergyINCL(const ParticleType t, const G4int, const G4int)
Return INCL's default separation energy.
static G4int drawRandomNaturalIsotope(const G4int Z)
static std::string getShortName(const ParticleType t)
Get the short INCL name of the particle.
static G4double getSurfaceDiffuseness(const G4int A, const G4int Z)
static const G4int maxClusterMass
static std::string getElementName(const G4int Z)
Get the name of the element from the atomic number.
static const ClusterDecayType clusterDecayMode[clusterTableZSize][clusterTableASize]
static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2, const G4int A3, const G4int Z3)
Get Q-value (in MeV/c^2)
G4double pow23(G4double x)
const G4double sqrtThreeFifths
G4double powMinus13(G4double x)
const G4double Pf
Fermi momentum [MeV/c].