Geant4  10.02.p02
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 #ifndef G4NuclideTable_h
27 #define G4NuclideTable_h 1
28 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29 //
30 // MODULE: G4NuclideTable.hh
31 //
32 // Date: 10/10/13
33 // Author: T.Koi
34 //
35 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 //
37 // HISTORY
38 // Based on G4IsomerTable
39 //
41 
42 //
43 #include "globals.hh"
44 #include "G4IsotopeProperty.hh"
45 #include "G4VIsotopeTable.hh"
46 #include "G4Ions.hh"
47 #include "G4ParticleTable.hh"
48 #include "G4IonTable.hh"
49 #include "G4DecayTable.hh"
50 
51 #include <vector>
52 #include <cmath>
53 
55 
57 //
59 {
60  // class description
61  // G4NuclideTable is the table of pointers to G4IsotopeProperty,
62  // which has magnetic moment and spin.
63  // Data File name is given by G4ENSDFSTATEDATA
64  //
65  //
66  private:
68  //G4NuclideTable ( const G4NuclideTable& p ){};
69  //G4NuclideTable& operator=( const G4NuclideTable& p ){};
70 
71  public:
72  static G4NuclideTable* GetInstance();
73  static G4NuclideTable* GetNuclideTable() { return GetInstance(); };
74 public:
75  typedef std::vector<G4IsotopeProperty*> G4IsotopeList;
76 
77 protected:
78  void FillHardCodeList();
79 
80 public:
81  // destructor
82  virtual ~G4NuclideTable();
83 
84 public:
85 
86  //
87  void GenerateNuclide();
88 
91 
94 
95  void AddState(G4int,G4int,G4double,G4double,G4int ionJ=0,G4double ionMu=0.0);
96 
97 
98  //G4bool Exists(G4double,G4double,G4double);
99 
100  //Use GetIsotope(G4int Z, G4int A, G4double E)
101  //void FillProperty(G4ParticleDefinition*);
102 
103  size_t GetSizeOfIsotopeList(){ return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0)) ; };
104 
105  //
106  // with description
107  //
110  //
111  // again it will replace the pure virtual one in the abstract base class.
112  //
113  // Z: Atomic Number
114  // A: Atomic Mass
115  // E: Excitaion energy
116  // or
117  // lvl: isomer level
118  //
119 
120  size_t entries() const;
121  G4IsotopeProperty* GetIsotopeByIndex(size_t idx) const;
122 
123 public:
124  // utility methods
125  static inline G4double GetTrancationError( G4double eex )
127  return eex - (G4long)(eex/tolerance)*tolerance; }
128  static inline G4double Round( G4double eex )
130  return round(eex/tolerance)*tolerance; }
131  static inline G4long Trancate( G4double eex )
133  return (G4long)(eex/tolerance); }
134  static inline G4double Tolerance()
136 
137 private:
138 
139  G4double threshold_of_half_life; //threshold values of half-life of current run
140  G4double minimum_threshold_of_half_life; //The minimum value of threshold values of half-life during entire runs
141  G4IsotopeList* fUserDefinedList;
142 
143  //Design Change on v10.02
144  //pre_load_list: Having state data for current run defined by threshold_of_half_life
145  //full_list:Keeping all state data during running application defined by minimum_threshold_of_half_life
146  // ionCode Ex. Energy
147  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > map_pre_load_list;
148  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > map_full_list;
149 
150  // Table of Nuclide Property
151  // 0: Z
152  // 1: A
153  // 2: Energy [keV]
154  // 3: Life Time [ns]
155  // 4: Spin [h_bar/2]
156  // 5: Magnetic Moment [joule/tesla]
158 
159  G4IsotopeList* fIsotopeList;
162 };
163 
164 
165 inline
166  size_t G4NuclideTable::entries() const
167 {
168  return (fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
169 }
170 
171 inline
173 {
174  if ( fIsotopeList && idx<fIsotopeList->size()) return (*fIsotopeList)[idx];
175  else return 0;
176 }
177 #endif
void SetThresholdOfHalfLife(G4double)
std::vector< G4IsotopeProperty * > G4IsotopeList
G4double GetLevelTolerance()
std::map< G4int, std::multimap< G4double, G4IsotopeProperty * > > map_full_list
G4IsotopeList * fUserDefinedList
static G4double Tolerance()
static const G4float tolerance
long G4long
Definition: G4Types.hh:80
G4double GetThresholdOfHalfLife()
G4double threshold_of_half_life
G4IsotopeProperty * GetIsotopeByIndex(size_t idx) const
int G4int
Definition: G4Types.hh:78
size_t GetSizeOfIsotopeList()
virtual G4IsotopeProperty * GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0)
void AddState(G4int, G4int, G4double, G4double, G4int ionJ=0, G4double ionMu=0.0)
G4IsotopeList * fIsotopeList
double A(double temperature)
static G4long Trancate(G4double eex)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E)
std::map< G4int, std::multimap< G4double, G4IsotopeProperty * > > map_pre_load_list
static G4NuclideTable * GetNuclideTable()
void SetLevelTolerance(G4double x)
G4double flevelTolerance
G4double minimum_threshold_of_half_life
const G4double x[NPOINTSGL]
G4NuclideTableMessenger * fMessenger
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76
static G4double Round(G4double eex)
virtual ~G4NuclideTable()
static G4double GetTrancationError(G4double eex)
size_t entries() const