Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #define INCLXX_IN_GEANT4_MODE 1
34 
35 #include "globals.hh"
36 
37 #ifndef G4INCLParticleTable_hh
38 #define G4INCLParticleTable_hh 1
39 
40 #include <string>
41 #include <vector>
42 // #include <cassert>
43 
44 #include "G4INCLParticleType.hh"
45 #include "G4INCLParticleSpecies.hh"
46 #include "G4INCLLogger.hh"
47 #include "G4INCLConfig.hh"
48 
49 #ifdef INCLXX_IN_GEANT4_MODE
50 #include "G4IonTable.hh"
51 #include "G4ParticleTable.hh"
52 #endif
53 #include "G4INCLGlobals.hh"
55 
56 namespace G4INCL {
57  class ParticleTable {
58  public:
60  static void initialize(Config const * const theConfig = 0);
61 
63  static G4int getIsospin(const ParticleType t);
64 
66  static std::string getName(const ParticleType t);
67 
69  static std::string getShortName(const ParticleType t);
70 
72  static std::string getName(const ParticleSpecies s);
73 
75  static std::string getShortName(const ParticleSpecies s);
76 
78  static std::string getName(const G4int A, const G4int Z);
79 
81  static std::string getShortName(const G4int A, const G4int Z);
82 
84  static G4double getINCLMass(const G4int A, const G4int Z);
85 
87  static G4double getINCLMass(const ParticleType t);
88 
89 #ifndef INCLXX_IN_GEANT4_MODE
90  static G4double hasMassTable(const unsigned int A, const unsigned int Z) {
92  return ( Z > 0 && A > 0
93  && Z < massTableMask.size() && A < massTableMask.at(Z).size()
94  && massTableMask.at(Z).at(A));
95  }
96 
106  static G4double getWeizsaeckerMass(const G4int A, const G4int Z) {
107  const G4int Npairing = (A-Z)%2; // pairing
108  const G4int Zpairing = Z%2;
109  const G4double fA = (G4double) A;
110  const G4double fZ = (G4double) Z;
111  G4double binding =
112  - 15.67*fA // nuclear volume
113  + 17.23*Math::pow23(fA) // surface energy
114  + 93.15*((fA/2.-fZ)*(fA/2.-fZ))/fA // asymmetry
115  + 0.6984523*fZ*fZ*Math::powMinus13(fA); // coulomb
116  if( Npairing == Zpairing ) binding += (Npairing+Zpairing-1) * 12.0 / std::sqrt(fA); // pairing
117 
118  return fZ*getRealMass(Proton)+((G4double)(A-Z))*getRealMass(Neutron)+binding;
119  }
120 #endif
121 
123  static G4double getRealMass(const G4INCL::ParticleType t);
125  static G4double getRealMass(const G4int A, const G4int Z);
126 
133  static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2) {
134  return getTableMass(A1,Z1) + getTableMass(A2,Z2) - getTableMass(A1+A2,Z1+Z2);
135  }
136 
143  static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2, const G4int A3, const G4int Z3) {
144  return getTableMass(A1,Z1) + getTableMass(A2,Z2) - getTableMass(A3,Z3) - getTableMass(A1+A2-A3,Z1+Z2-Z3);
145  }
146 
147  // Typedefs and pointers for transparent handling of mass functions
148  typedef G4double (*NuclearMassFn)(const G4int, const G4int);
152 
154  if(p.theType == Composite)
155  return (*getTableMass)(p.theA, p.theZ);
156  else
157  return (*getTableParticleMass)(p.theType);
158  }
159 
160  // Typedefs and pointers for transparent handling of separation energies
161  typedef G4double (*SeparationEnergyFn)(const ParticleType, const G4int, const G4int);
163 
165  static G4int getMassNumber(const ParticleType t) {
166  switch(t) {
167  case Proton:
168  case Neutron:
169  case DeltaPlusPlus:
170  case DeltaPlus:
171  case DeltaZero:
172  case DeltaMinus:
173  return 1;
174  break;
175  case PiPlus:
176  case PiMinus:
177  case PiZero:
178  return 0;
179  break;
180  default:
181  return 0;
182  break;
183  }
184  }
185 
188  switch(t) {
189  case DeltaPlusPlus:
190  return 2;
191  break;
192  case Proton:
193  case DeltaPlus:
194  case PiPlus:
195  return 1;
196  break;
197  case Neutron:
198  case DeltaZero:
199  case PiZero:
200  return 0;
201  break;
202  case DeltaMinus:
203  case PiMinus:
204  return -1;
205  break;
206  default:
207  return 0;
208  break;
209  }
210  }
211 
212  static G4double getNuclearRadius(const G4int A, const G4int Z);
213  static G4double getRadiusParameter(const G4int A, const G4int Z);
214  static G4double getMaximumNuclearRadius(const G4int A, const G4int Z);
215  static G4double getSurfaceDiffuseness(const G4int A, const G4int Z);
216 
218  static G4double getMomentumRMS(const G4int A, const G4int Z) {
219 // assert(Z>=0 && A>=0 && Z<=A);
221  return momentumRMS[Z][A];
222  else
224  }
225 
227  static G4double getSeparationEnergyINCL(const ParticleType t, const G4int /*A*/, const G4int /*Z*/) {
228  if(t==Proton)
229  return theINCLProtonSeparationEnergy;
230  else if(t==Neutron)
231  return theINCLNeutronSeparationEnergy;
232  else {
233  ERROR("ParticleTable::getSeparationEnergyINCL : Unknown particle type." << std::endl);
234  return 0.0;
235  }
236  }
237 
239  static G4double getSeparationEnergyReal(const ParticleType t, const G4int A, const G4int Z) {
240  // Real separation energies for all nuclei
241  if(t==Proton)
242  return (*getTableParticleMass)(Proton) + (*getTableMass)(A-1,Z-1) - (*getTableMass)(A,Z);
243  else if(t==Neutron)
244  return (*getTableParticleMass)(Neutron) + (*getTableMass)(A-1,Z) - (*getTableMass)(A,Z);
245  else {
246  ERROR("ParticleTable::getSeparationEnergyReal : Unknown particle type." << std::endl);
247  return 0.0;
248  }
249  }
250 
253  // Real separation energies for light nuclei, fixed values for heavy nuclei
255  return getSeparationEnergyReal(t, A, Z);
256  else
257  return getSeparationEnergyINCL(t, A, Z);
258  }
259 
261  static G4double getProtonSeparationEnergy() { return protonSeparationEnergy; }
262 
264  static G4double getNeutronSeparationEnergy() { return neutronSeparationEnergy; }
265 
267  static void setProtonSeparationEnergy(const G4double s) { protonSeparationEnergy = s; }
268 
270  static void setNeutronSeparationEnergy(const G4double s) { neutronSeparationEnergy = s; }
271 
273  static std::string getElementName(const G4int Z);
275  static std::string getIUPACElementName(const G4int Z);
276 
284  static G4int parseIUPACElement(std::string const &pS);
285 
286  const static G4int elementTableSize = 113; // up to Cn
287 
293 
294  static const G4int maxClusterMass = 12;
295  static const G4int maxClusterCharge = 8;
296 
301  const static G4int clusterZMin[maxClusterMass+1]; // Lower limit of Z for cluster of mass A
302  const static G4int clusterZMax[maxClusterMass+1]; // Upper limit of Z for cluster of mass A
304 
305 #ifdef INCLXX_IN_GEANT4_MODE
307 #else
308  static std::vector< std::vector <G4bool> > massTableMask;
309  static std::vector< std::vector <G4double> > massTable;
310 #endif
311 
312  // Enumerator for cluster-decay channels
322  };
324 
329  static const G4double eSquared;
330 
332  return getNaturalIsotopicDistributions()->getIsotopicDistribution(Z);
333  }
334 
336  return getNaturalIsotopicDistributions()->drawRandomIsotope(Z);
337  }
338 
339  protected:
342 
343  private:
344  static const G4double theINCLNucleonMass;
345  static const G4double theINCLPionMass;
346  static const G4double theINCLNeutronSeparationEnergy;
347  static const G4double theINCLProtonSeparationEnergy;
348  static G4double protonMass;
349  static G4double neutronMass;
350  static G4double neutronSeparationEnergy;
351  static G4double protonSeparationEnergy;
352  static G4double piPlusMass, piMinusMass, piZeroMass;
353  static G4double theRealProtonMass;
354  static G4double theRealNeutronMass;
355  static G4double theRealChargedPiMass;
356  static G4double theRealPiZeroMass;
357 
358  const static G4int mediumNucleiTableSize = 30;
359  const static G4double mediumDiffuseness[mediumNucleiTableSize];
360  const static G4double mediumRadius[mediumNucleiTableSize];
361  const static G4double positionRMS[clusterTableZSize][clusterTableASize];
362  const static G4double momentumRMS[clusterTableZSize][clusterTableASize];
363 
364  const static std::string elementTable[elementTableSize];
365 
366 #ifndef INCLXX_IN_GEANT4_MODE
367  static void readRealMasses(std::string const &path);
369 #endif
370 
371  const static std::string elementIUPACDigits;
372 
374  static char iupacToInt(char c) {
375  return (char)(((G4int)'0')+elementIUPACDigits.find(c));
376  }
377 
379  static char intToIUPAC(char n) { return elementIUPACDigits.at(n); }
380 
382  static const NaturalIsotopicDistributions *theNaturalIsotopicDistributions;
383 
385  static const NaturalIsotopicDistributions *getNaturalIsotopicDistributions() {
386  if(!theNaturalIsotopicDistributions)
387  theNaturalIsotopicDistributions = new NaturalIsotopicDistributions;
388  return theNaturalIsotopicDistributions;
389  }
390 
391  };
392 }
393 
394 #endif