Geant4 11.1.1
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 <vector>
40#include <cmath>
41
42#include "globals.hh"
43#include "G4IsotopeProperty.hh"
44#include "G4VIsotopeTable.hh"
45#include "G4Ions.hh"
46#include "G4ParticleTable.hh"
47#include "G4IonTable.hh"
48#include "G4DecayTable.hh"
49
51
53{
54 public:
55
56 using G4IsotopeList = std::vector<G4IsotopeProperty*>;
57
58 virtual ~G4NuclideTable();
59
60 G4NuclideTable (const G4NuclideTable&) = delete;
62
63 static G4NuclideTable* GetInstance();
65
66 void GenerateNuclide();
67
70
73
74 inline void SetLevelTolerance(G4double x);
76
78 G4int ionJ=0, G4double ionMu=0.0);
80 G4int ionJ=0, G4double ionMu=0.0);
82 G4int ionJ=0, G4double ionMu=0.0);
83
84 inline std::size_t GetSizeOfIsotopeList();
85
89 G4int lvl=0);
90 // It will replace the pure virtual one in the abstract base class.
91 // Z: Atomic Number
92 // A: Atomic Mass
93 // E: Excitaion energy
94 // flb: floating level base (enum defined in G4Ions.hh)
95 // or
96 // lvl: isomer level
97
98 inline std::size_t entries() const;
99 inline G4IsotopeProperty* GetIsotopeByIndex(std::size_t idx) const;
100
101 // utility methods
102
104 static G4double Round(G4double eex);
105 static G4long Truncate(G4double eex);
106 static G4double Tolerance();
107
108 private:
109
111
112 G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
113 G4Ions::G4FloatLevelBase StripFloatLevelBase(const G4String&);
114
115 private:
116
117 G4double mean_life_threshold = 0.0;
118 G4double minimum_mean_life_threshold = DBL_MAX;
119
120 G4IsotopeList* fUserDefinedList = nullptr;
121
122 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*> > map_pre_load_list;
123 // pre_load_list: contains state data for current run defined
124 // by mean_life_threshold
125 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*> > map_full_list;
126 // full_list: keeps all state data during running application
127 // defined by minimum_mean_life_threshold
128
129 enum { idxZ=0, idxA, idxEnergy, idxLife, idxSpin, idxMu };
130 // Table of Nuclide Property
131 // 0: Z
132 // 1: A
133 // 2: Energy [keV]
134 // 3: Life Time [ns]
135 // 4: Spin [h_bar/2]
136 // 5: Magnetic Moment [joule/tesla]
137
138 G4IsotopeList* fIsotopeList = nullptr;
139 G4double flevelTolerance = 0.0;
140 G4NuclideTableMessenger* fMessenger = nullptr;
141};
142
143// ------------------------
144// Inline methods
145// ------------------------
146
147inline
149{
150 return mean_life_threshold*0.69314718;
151}
152
153inline
155{
156 return mean_life_threshold;
157}
158
159inline
161{
162 flevelTolerance = x;
163}
164
165inline
167{
168 return flevelTolerance;
169}
170
171inline
173{
174 return (fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
175}
176
177inline
178std::size_t G4NuclideTable::entries() const
179{
180 return (fIsotopeList ? fIsotopeList->size() : std::size_t(0) );
181}
182
183inline
185{
186 if (fIsotopeList && idx<fIsotopeList->size() ) return (*fIsotopeList)[idx];
187 else return nullptr;
188}
189
190#endif
double G4double
Definition: G4Types.hh:83
long G4long
Definition: G4Types.hh:87
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
G4FloatLevelBase
Definition: G4Ions.hh:83
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)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)
std::size_t GetSizeOfIsotopeList()
void SetLevelTolerance(G4double x)
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)
virtual G4IsotopeProperty * GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0)
virtual ~G4NuclideTable()
#define DBL_MAX
Definition: templates.hh:62