Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NuclideTable.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// G4NuclideTable
27//
28// Class description:
29//
30// Table of pointers to G4IsotopeProperty, which has magnetic moment
31// and spin. Data File name is given by G4ENSDFSTATEDATA.
32// Table based on G4IsomerTable.
33
34// Author: T.Koi, SLAC - 10 October 2013
35// --------------------------------------------------------------------
36#ifndef G4NuclideTable_hh
37#define G4NuclideTable_hh 1
38
39#include "G4DecayTable.hh"
40#include "G4IonTable.hh"
41#include "G4Ions.hh"
42#include "G4IsotopeProperty.hh"
43#include "G4ParticleTable.hh"
44#include "G4VIsotopeTable.hh"
45#include "globals.hh"
46
47#include <cmath>
48#include <vector>
49
51
53{
54 public:
55 using G4IsotopeList = std::vector<G4IsotopeProperty*>;
56
57 ~G4NuclideTable() override;
58
61
64
65 void GenerateNuclide();
66
69
72
73 inline void SetLevelTolerance(G4double x);
75
76 void AddState(G4int, G4int, G4double, G4double, G4int ionJ = 0, G4double ionMu = 0.0);
77 void AddState(G4int, G4int, G4double, G4int, G4double, G4int ionJ = 0, G4double ionMu = 0.0);
79 G4double ionMu = 0.0);
80
81 inline std::size_t GetSizeOfIsotopeList();
82
83 // It will replace the pure virtual one in the abstract base class.
84 // Z: Atomic Number
85 // A: Atomic Mass
86 // E: Excitaion energy
87 // flb: floating level base (enum defined in G4Ions.hh)
88 // or
89 // lvl: isomer level
94
95 inline std::size_t entries() const;
96 inline G4IsotopeProperty* GetIsotopeByIndex(std::size_t idx) const;
97
98 // utility methods
99
101 static G4double Round(G4double eex);
102 static G4long Truncate(G4double eex);
103 static G4double Tolerance();
104
105 private:
107
108 G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
109 G4Ions::G4FloatLevelBase StripFloatLevelBase(const G4String&);
110
111 private:
112 G4double mean_life_threshold = 0.0;
113 G4double minimum_mean_life_threshold = DBL_MAX;
114
115 G4IsotopeList* fUserDefinedList = nullptr;
116
117 // pre_load_list: contains state data for current run defined
118 // by mean_life_threshold
119 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*>> map_pre_load_list;
120
121 // full_list: keeps all state data during running application
122 // defined by minimum_mean_life_threshold
123 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*>> map_full_list;
124
125 // Table of Nuclide Property
126 // 0: Z
127 // 1: A
128 // 2: Energy [keV]
129 // 3: Life Time [ns]
130 // 4: Spin [h_bar/2]
131 // 5: Magnetic Moment [joule/tesla]
132 enum
133 {
134 idxZ = 0,
135 idxA,
136 idxEnergy,
137 idxLife,
138 idxSpin,
139 idxMu
140 };
141
142 G4IsotopeList* fIsotopeList = nullptr;
143 G4double flevelTolerance = 0.0;
144 G4NuclideTableMessenger* fMessenger = nullptr;
145};
146
147// ------------------------
148// Inline methods
149// ------------------------
150
152{
153 return mean_life_threshold * 0.69314718;
154}
155
157{
158 return mean_life_threshold;
159}
160
162{
163 flevelTolerance = x;
164}
165
167{
168 return flevelTolerance;
169}
170
172{
173 return (fIsotopeList != nullptr ? fIsotopeList->size() : static_cast<size_t>(0));
174}
175
176inline std::size_t G4NuclideTable::entries() const
177{
178 return (fIsotopeList != nullptr ? fIsotopeList->size() : std::size_t(0));
179}
180
182{
183 if ((fIsotopeList != nullptr) && idx < fIsotopeList->size()) return (*fIsotopeList)[idx];
184 return nullptr;
185}
186
187#endif
double G4double
Definition G4Types.hh:83
long G4long
Definition G4Types.hh:87
int G4int
Definition G4Types.hh:85
const G4double A[17]
G4FloatLevelBase
Definition G4Ions.hh:80
G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float) override
G4double GetMeanLifeThreshold()
void SetMeanLifeThreshold(G4double)
G4IsotopeProperty * GetIsotopeByIndex(std::size_t idx) const
static G4double GetTruncationError(G4double eex)
void AddState(G4int, G4int, G4double, G4double, G4int ionJ=0, G4double ionMu=0.0)
static G4NuclideTable * GetInstance()
void SetThresholdOfHalfLife(G4double)
std::size_t GetSizeOfIsotopeList()
void SetLevelTolerance(G4double x)
~G4NuclideTable() override
G4NuclideTable & operator=(const G4NuclideTable &)=delete
static G4NuclideTable * GetNuclideTable()
static G4long Truncate(G4double eex)
G4double GetLevelTolerance()
std::size_t entries() const
std::vector< G4IsotopeProperty * > G4IsotopeList
static G4double Tolerance()
G4NuclideTable(const G4NuclideTable &)=delete
G4double GetThresholdOfHalfLife()
static G4double Round(G4double eex)
G4IsotopeProperty * GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0) override
#define DBL_MAX
Definition templates.hh:62