Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
90  G4double GetThresholdOfHalfLife() { return threshold_of_half_life; };
91 
92  void SetLevelTolerance( G4double x ) { flevelTolerance=x;};
93  G4double GetLevelTolerance() { return flevelTolerance; };
94 
95  void AddState(G4int,G4int,G4double,G4double,G4int ionJ=0,G4double ionMu=0.0);
96  void AddState(G4int,G4int,G4double,G4int,G4double,G4int ionJ=0,G4double ionMu=0.0);
98 
99  //G4bool Exists(G4double,G4double,G4double);
100 
101  //Use GetIsotope(G4int Z, G4int A, G4double E)
102  //void FillProperty(G4ParticleDefinition*);
103 
105  { return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0)) ; };
106 
107  //
108  // with description
109  //
113  //
114  // again it will replace the pure virtual one in the abstract base class.
115  //
116  // Z: Atomic Number
117  // A: Atomic Mass
118  // E: Excitaion energy
119  // flb: floating level base (enum defined in G4Ions.hh)
120  // or
121  // lvl: isomer level
122  //
123 
124  size_t entries() const;
125  G4IsotopeProperty* GetIsotopeByIndex(size_t idx) const;
126 
127 public:
128  // utility methods
129  static inline G4double GetTrancationError( G4double eex )
131  return eex - (G4long)(eex/tolerance)*tolerance; }
132  static inline G4double Round( G4double eex )
134  return round(eex/tolerance)*tolerance; }
135  static inline G4long Trancate( G4double eex )
137  return (G4long)(eex/tolerance); }
138  static inline G4double Tolerance()
140 
141 private:
142 
143  G4double threshold_of_half_life; //threshold values of half-life of current run
144  G4double minimum_threshold_of_half_life; //The minimum value of threshold values of half-life during entire runs
145  G4IsotopeList* fUserDefinedList;
146 
147  //Design Change on v10.02
148  //pre_load_list: Having state data for current run defined by threshold_of_half_life
149  //full_list:Keeping all state data during running application defined by minimum_threshold_of_half_life
150  // ionCode Ex. Energy
151  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > map_pre_load_list;
152  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > map_full_list;
153 
154  // Table of Nuclide Property
155  // 0: Z
156  // 1: A
157  // 2: Energy [keV]
158  // 3: Life Time [ns]
159  // 4: Spin [h_bar/2]
160  // 5: Magnetic Moment [joule/tesla]
161  enum {idxZ=0, idxA,idxEnergy, idxLife, idxSpin, idxMu };
162 
163  G4IsotopeList* fIsotopeList;
164  G4double flevelTolerance;
165  G4NuclideTableMessenger* fMessenger;
166 
167 private:
168  G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
169  G4Ions::G4FloatLevelBase StripFloatLevelBase( G4String );
170 };
171 
172 inline
173  size_t G4NuclideTable::entries() const
174 {
175  return (fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
176 }
177 
178 inline
180 {
181  if ( fIsotopeList && idx<fIsotopeList->size()) return (*fIsotopeList)[idx];
182  else return 0;
183 }
184 
185 #endif
void SetThresholdOfHalfLife(G4double)
std::vector< G4IsotopeProperty * > G4IsotopeList
G4double GetLevelTolerance()
static G4double Tolerance()
long G4long
Definition: G4Types.hh:80
G4double GetThresholdOfHalfLife()
tuple x
Definition: test.py:50
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)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)
void AddState(G4int, G4int, G4double, G4double, G4int ionJ=0, G4double ionMu=0.0)
double A(double temperature)
static G4long Trancate(G4double eex)
static G4NuclideTable * GetNuclideTable()
void SetLevelTolerance(G4double x)
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
G4FloatLevelBase
Definition: G4Ions.hh:95