Geant4 10.7.0
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
71 inline void SetLevelTolerance( G4double x );
73
75 G4int ionJ=0, G4double ionMu=0.0);
77 G4int ionJ=0, G4double ionMu=0.0);
79 G4int ionJ=0, G4double ionMu=0.0);
80
81 inline std::size_t GetSizeOfIsotopeList();
82
86 G4int lvl=0);
87 // It will replace the pure virtual one in the abstract base class.
88 // Z: Atomic Number
89 // A: Atomic Mass
90 // E: Excitaion energy
91 // flb: floating level base (enum defined in G4Ions.hh)
92 // or
93 // 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:
106
108
109 G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
110 G4Ions::G4FloatLevelBase StripFloatLevelBase( const G4String& );
111
112 private:
113
114 G4double threshold_of_half_life = 0.0;
115 // threshold values of half-life of current run
116 G4double minimum_threshold_of_half_life = DBL_MAX;
117 // The minimum value of threshold values of half-life during entire runs
118
119 G4IsotopeList* fUserDefinedList = nullptr;
120
121 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*> > map_pre_load_list;
122 // pre_load_list: having state data for current run defined
123 // by threshold_of_half_life
124 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*> > map_full_list;
125 // full_list: keeping all state data during running application
126 // defined by minimum_threshold_of_half_life
127
128 enum { idxZ=0, idxA, idxEnergy, idxLife, idxSpin, idxMu };
129 // Table of Nuclide Property
130 // 0: Z
131 // 1: A
132 // 2: Energy [keV]
133 // 3: Life Time [ns]
134 // 4: Spin [h_bar/2]
135 // 5: Magnetic Moment [joule/tesla]
136
137 G4IsotopeList* fIsotopeList = nullptr;
138 G4double flevelTolerance = 0.0;
139 G4NuclideTableMessenger* fMessenger = nullptr;
140};
141
142// ------------------------
143// Inline methods
144// ------------------------
145
146inline
148{
149 return threshold_of_half_life;
150}
151
152inline
154{
155 flevelTolerance = x;
156}
157
158inline
160{
161 return flevelTolerance;
162}
163
164inline
166{
167 return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
168}
169
170inline
171std::size_t G4NuclideTable::entries() const
172{
173 return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
174}
175
176inline
178{
179 if ( fIsotopeList && idx<fIsotopeList->size()) return (*fIsotopeList)[idx];
180 else return nullptr;
181}
182
183#endif
double G4double
Definition: G4Types.hh:83
long G4long
Definition: G4Types.hh:87
int G4int
Definition: G4Types.hh:85
G4FloatLevelBase
Definition: G4Ions.hh:83
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