Geant4  10.02.p03
G4NuclideTable Class Reference

#include <G4NuclideTable.hh>

Inheritance diagram for G4NuclideTable:
Collaboration diagram for G4NuclideTable:

Public Types

typedef std::vector< G4IsotopeProperty * > G4IsotopeList
 

Public Member Functions

virtual ~G4NuclideTable ()
 
void GenerateNuclide ()
 
void SetThresholdOfHalfLife (G4double)
 
G4double GetThresholdOfHalfLife ()
 
void SetLevelTolerance (G4double x)
 
G4double GetLevelTolerance ()
 
void AddState (G4int, G4int, G4double, G4double, G4int ionJ=0, G4double ionMu=0.0)
 
size_t GetSizeOfIsotopeList ()
 
virtual G4IsotopeProperty * GetIsotope (G4int Z, G4int A, G4double E)
 
virtual G4IsotopeProperty * GetIsotopeByIsoLvl (G4int Z, G4int A, G4int lvl=0)
 
size_t entries () const
 
G4IsotopeProperty * GetIsotopeByIndex (size_t idx) const
 
- Public Member Functions inherited from G4VIsotopeTable
 G4VIsotopeTable ()
 
 G4VIsotopeTable (const G4String &)
 
 G4VIsotopeTable (const G4VIsotopeTable &)
 
G4VIsotopeTable & operator= (const G4VIsotopeTable &)
 
virtual ~G4VIsotopeTable ()
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int level)
 
void DumpTable (G4int Zmin=1, G4int Zmax=118)
 
const G4String & GetName () const
 

Static Public Member Functions

static G4NuclideTable * GetInstance ()
 
static G4NuclideTable * GetNuclideTable ()
 
static G4double GetTrancationError (G4double eex)
 
static G4double Round (G4double eex)
 
static G4long Trancate (G4double eex)
 
static G4double Tolerance ()
 

Protected Member Functions

void FillHardCodeList ()
 

Private Types

enum  {
  idxZ =0, idxA, idxEnergy, idxLife,
  idxSpin, idxMu
}
 

Private Member Functions

 G4NuclideTable ()
 

Private Attributes

G4double threshold_of_half_life
 
G4double minimum_threshold_of_half_life
 
G4IsotopeList * fUserDefinedList
 
std::map< G4int, std::multimap< G4double, G4IsotopeProperty *> > map_pre_load_list
 
std::map< G4int, std::multimap< G4double, G4IsotopeProperty *> > map_full_list
 
G4IsotopeList * fIsotopeList
 
G4double flevelTolerance
 
G4NuclideTableMessenger * fMessenger
 

Detailed Description

Definition at line 58 of file G4NuclideTable.hh.

Member Typedef Documentation

◆ G4IsotopeList

Definition at line 73 of file G4NuclideTable.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Constructor & Destructor Documentation

◆ G4NuclideTable()

G4NuclideTable::G4NuclideTable ( )
private

Definition at line 61 of file G4NuclideTable.cc.

62  :G4VIsotopeTable("Isomer"),
63  threshold_of_half_life(1000.0*ns),
65  fUserDefinedList(NULL),
66  fIsotopeList(NULL),
67  flevelTolerance(1.0*eV)
68 {
69  //SetVerboseLevel(G4ParticleTable::GetParticleTable()->GetVerboseLevel());
70  //FillHardCodeList();
74 }
std::vector< G4IsotopeProperty * > G4IsotopeList
G4IsotopeList * fUserDefinedList
G4double threshold_of_half_life
G4IsotopeList * fIsotopeList
static const double eV
Definition: G4SIunits.hh:212
G4double flevelTolerance
G4double minimum_threshold_of_half_life
G4NuclideTableMessenger * fMessenger
#define DBL_MAX
Definition: templates.hh:83
#define ns
Definition: xmlparse.cc:614
Here is the call graph for this function:

◆ ~G4NuclideTable()

G4NuclideTable::~G4NuclideTable ( )
virtual

Definition at line 77 of file G4NuclideTable.cc.

78 {
79 
80  for ( std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
81  it = map_pre_load_list.begin(); it != map_pre_load_list.end(); it++ ) {
82  it->second.clear();
83  }
84  map_pre_load_list.clear();
85 
86 
87  for ( std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
88  it = map_full_list.begin(); it != map_full_list.end(); it++ ) {
89  it->second.clear();
90  }
91  map_full_list.clear();
92 
93  if (fIsotopeList!=0) {
94  for (size_t i = 0 ; i<fIsotopeList->size(); i++) {
95  //G4IsotopeProperty* fProperty = (*fIsotopeList)[i]; std::cout << fProperty->GetAtomicNumber() << " " << fProperty->GetAtomicMass() << " " << fProperty->GetEnergy() << std::endl;
96  delete (*fIsotopeList)[i];
97  }
98  fIsotopeList->clear();
99  delete fIsotopeList;
100  fIsotopeList = 0;
101  }
102 
103 }
std::map< G4int, std::multimap< G4double, G4IsotopeProperty *> > map_full_list
int G4int
Definition: G4Types.hh:78
G4IsotopeList * fIsotopeList
std::map< G4int, std::multimap< G4double, G4IsotopeProperty *> > map_pre_load_list
Here is the caller graph for this function:

Member Function Documentation

◆ AddState()

void G4NuclideTable::AddState ( G4int  ionZ,
G4int  ionA,
G4double  ionE,
G4double  ionLife,
G4int  ionJ = 0,
G4double  ionMu = 0.0 
)

Definition at line 287 of file G4NuclideTable.cc.

288 {
289  if ( G4Threading::IsMasterThread() ) {
290 
291  if ( fUserDefinedList == NULL ) fUserDefinedList = new G4IsotopeList();
292 
293  G4IsotopeProperty* fProperty = new G4IsotopeProperty();
294 
295  // Set Isotope Property
296  fProperty->SetAtomicNumber(ionZ);
297  fProperty->SetAtomicMass(ionA);
298  fProperty->SetIsomerLevel(9);
299  fProperty->SetEnergy(ionE);
300  fProperty->SetiSpin(ionJ);
301  fProperty->SetLifeTime(ionLife);
302  fProperty->SetDecayTable(0);
303  fProperty->SetMagneticMoment(ionMu);
304 
305  fUserDefinedList->push_back(fProperty);
306  fIsotopeList->push_back(fProperty);
307 
308  }
309 }
void SetAtomicMass(G4int A)
std::vector< G4IsotopeProperty * > G4IsotopeList
G4IsotopeList * fUserDefinedList
void SetiSpin(G4int J)
void SetMagneticMoment(G4double M)
void SetLifeTime(G4double T)
G4IsotopeList * fIsotopeList
void SetEnergy(G4double E)
void SetDecayTable(G4DecayTable *table)
G4bool IsMasterThread()
Definition: G4Threading.cc:136
void SetAtomicNumber(G4int Z)
void SetIsomerLevel(G4int level)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ entries()

size_t G4NuclideTable::entries ( ) const
inline

Definition at line 166 of file G4NuclideTable.hh.

167 {
168  return (fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
169 }
G4IsotopeList * fIsotopeList
Here is the caller graph for this function:

◆ FillHardCodeList()

void G4NuclideTable::FillHardCodeList ( )
protected

Definition at line 155 of file G4NuclideTable.cc.

156 {
157  ;
158 }
Here is the caller graph for this function:

◆ GenerateNuclide()

void G4NuclideTable::GenerateNuclide ( )

Definition at line 161 of file G4NuclideTable.cc.

162 {
163 
165 
166  // Need to update full list
167 
168  char* path = getenv("G4ENSDFSTATEDATA");
169 
170  if ( !path ) {
171  G4Exception("G4NuclideTable", "PART70000",
172  FatalException, "G4ENSDFSTATEDATA environment variable must be set");
173  return;
174  }
175 
176  std::ifstream ifs;
177  G4String filename(path);
178  filename += "/ENSDFSTATE.dat";
179 
180  ifs.open( filename.c_str() );
181 
182  if ( !ifs.good() ) {
183  G4Exception("G4NuclideTable", "PART70001",
184  FatalException, "ENSDFSTATE.dat is not found.");
185  return;
186  }
187 
188 
189  G4int ionCode=0;
190  G4int iLevel=0;
191 
192  G4int ionZ;
193  G4int ionA;
194  G4double ionE;
195  G4double ionLife;
196  G4int ionJ;
197  G4double ionMu;
198 
199  ifs >> ionZ >> ionA >> ionE >> ionLife >> ionJ >> ionMu;
200 
201  while ( ifs.good() ) {// Loop checking, 09.08.2015, K.Kurashige
202 
203  if ( ionCode != 1000*ionZ + ionA ) {
204  iLevel = 0;
205  ionCode = 1000*ionZ + ionA;
206  }
207 
208  ionE *= keV;
209  ionLife *= ns;
210  ionMu *= (joule/tesla);
211 
212  if ( ( ionE == 0 && minimum_threshold_of_half_life == DBL_MAX ) // ground state is alwyas build in very first attempt
213  || ( threshold_of_half_life <= ionLife*std::log(2.0) && ionLife*std::log(2.0) < minimum_threshold_of_half_life && ionE != 0 ) ) {
214 
215  if ( ionE > 0 ) iLevel++;
216  if ( iLevel > 9 ) iLevel=9;
217 
218  G4IsotopeProperty* fProperty = new G4IsotopeProperty();
219 
220  // Set Isotope Property
221  fProperty->SetAtomicNumber(ionZ);
222  fProperty->SetAtomicMass(ionA);
223  fProperty->SetIsomerLevel(iLevel);
224  fProperty->SetEnergy(ionE);
225  fProperty->SetiSpin(ionJ);
226  fProperty->SetLifeTime(ionLife);
227  fProperty->SetDecayTable(0);
228  fProperty->SetMagneticMoment(ionMu);
229 
230  fIsotopeList->push_back(fProperty);
231 
232  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator itf = map_full_list.find( ionCode );
233  if ( itf == map_full_list.end() ) {
234  std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
235  //itf = map_full_list.insert( std::pair< G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) );
236  itf = ( map_full_list.insert( std::pair< G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) ) ).first;
237  }
238  itf -> second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , fProperty ) );
239  }
240 
241  ifs >> ionZ >> ionA >> ionE >> ionLife >> ionJ >> ionMu;
242  }
243 
245 
246  }
247 
248 
249  // Clear current map
250  for ( std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
251  it = map_pre_load_list.begin(); it != map_pre_load_list.end(); it++ ) {
252  it->second.clear();
253  }
254  map_pre_load_list.clear();
255 
256  // Build map based on current threshold value
257  for ( std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
258  it = map_full_list.begin(); it != map_full_list.end(); it++ ) {
259 
260  G4int ionCode = it->first;
261  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator itf = map_pre_load_list.find( ionCode );
262  if ( itf == map_pre_load_list.end() ) {
263  std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
264  itf = ( map_pre_load_list.insert( std::pair< G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) ) ).first;
265  }
266  G4int iLevel = 0;
267  for ( std::multimap< G4double , G4IsotopeProperty* >::iterator
268  itt = it->second.begin(); itt != it->second.end(); itt++ ) {
269 
270  G4double exEnergy = itt->first;
271  G4double meanLife = itt->second->GetLifeTime();
272 
273  if ( exEnergy == 0.0
274  || meanLife*std::log(2.0) > threshold_of_half_life ) {
275 
276  if ( itt->first != 0.0 ) iLevel++;
277  if ( iLevel > 9 ) iLevel=9;
278  itt->second->SetIsomerLevel( iLevel );
279 
280  itf -> second.insert( std::pair< G4double, G4IsotopeProperty* >( exEnergy , itt->second ) );
281  }
282  }
283  }
284 
285 }
void SetAtomicMass(G4int A)
std::map< G4int, std::multimap< G4double, G4IsotopeProperty *> > map_full_list
static const double joule
Definition: G4SIunits.hh:201
G4double threshold_of_half_life
int G4int
Definition: G4Types.hh:78
void SetiSpin(G4int J)
void SetMagneticMoment(G4double M)
void SetLifeTime(G4double T)
G4IsotopeList * fIsotopeList
static const double second
Definition: G4SIunits.hh:156
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::map< G4int, std::multimap< G4double, G4IsotopeProperty *> > map_pre_load_list
void SetEnergy(G4double E)
void SetDecayTable(G4DecayTable *table)
G4double minimum_threshold_of_half_life
static const double keV
Definition: G4SIunits.hh:213
static const double tesla
Definition: G4SIunits.hh:265
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
void SetAtomicNumber(G4int Z)
#define ns
Definition: xmlparse.cc:614
void SetIsomerLevel(G4int level)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstance()

G4NuclideTable * G4NuclideTable::GetInstance ( void  )
static

Definition at line 55 of file G4NuclideTable.cc.

55  {
56  static G4NuclideTable instance;
57  return &instance;
58 }
static MCTruthManager * instance
Here is the caller graph for this function:

◆ GetIsotope()

G4IsotopeProperty * G4NuclideTable::GetIsotope ( G4int  Z,
G4int  A,
G4double  E 
)
virtual

Implements G4VIsotopeTable.

Definition at line 107 of file G4NuclideTable.cc.

108 {
109 
110  G4IsotopeProperty* fProperty = NULL;
111 
112  // At first searching UserDefined
113  if ( fUserDefinedList != NULL ) {
114  for ( G4IsotopeList::iterator it = fUserDefinedList->begin() ; it != fUserDefinedList->end() ; it++ ) {
115 
116  if ( Z == (*it)->GetAtomicNumber() && A == (*it)->GetAtomicMass() ) {
117  G4double levelE = (*it)->GetEnergy();
118  if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) {
119  return *it; //found
120  }
121  }
122 
123  }
124  }
125 
126  //Serching pre-load
127  //Note: isomer level is properly set only for pre_load_list.
128  //
129  G4int ionCode = 1000*Z + A;
130  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator itf = map_pre_load_list.find( ionCode );
131 
132  if ( itf != map_pre_load_list.end() ) {
133  std::multimap< G4double , G4IsotopeProperty* >::iterator lower_bound_itr = itf -> second.lower_bound ( E - flevelTolerance/2 );
134  G4double levelE = DBL_MAX;
135  if ( lower_bound_itr != itf -> second.end() ) {
136  levelE = lower_bound_itr->first;
137  if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) {
138  return lower_bound_itr->second; // found
139  }
140  }
141  }
142 
143  return fProperty; // not found;
144 }
G4IsotopeList * fUserDefinedList
int G4int
Definition: G4Types.hh:78
double A(double temperature)
Float_t Z
static const double second
Definition: G4SIunits.hh:156
std::map< G4int, std::multimap< G4double, G4IsotopeProperty *> > map_pre_load_list
G4double flevelTolerance
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4double GetEnergy() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIsotopeByIndex()

G4IsotopeProperty * G4NuclideTable::GetIsotopeByIndex ( size_t  idx) const
inline

Definition at line 172 of file G4NuclideTable.hh.

173 {
174  if ( fIsotopeList && idx<fIsotopeList->size()) return (*fIsotopeList)[idx];
175  else return 0;
176 }
G4IsotopeList * fIsotopeList
Here is the caller graph for this function:

◆ GetIsotopeByIsoLvl()

G4IsotopeProperty * G4NuclideTable::GetIsotopeByIsoLvl ( G4int  Z,
G4int  A,
G4int  lvl = 0 
)
virtual

Reimplemented from G4VIsotopeTable.

Definition at line 148 of file G4NuclideTable.cc.

149 {
150  if(lvl==0) return GetIsotope(Z,A,0.0);
151  return (G4IsotopeProperty*)0;
152 }
double A(double temperature)
Float_t Z
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLevelTolerance()

G4double G4NuclideTable::GetLevelTolerance ( )
inline

Definition at line 93 of file G4NuclideTable.hh.

93 { return flevelTolerance; };
G4double flevelTolerance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNuclideTable()

static G4NuclideTable* G4NuclideTable::GetNuclideTable ( )
inlinestatic

Definition at line 73 of file G4NuclideTable.hh.

73 { return GetInstance(); };
static G4NuclideTable * GetInstance()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSizeOfIsotopeList()

size_t G4NuclideTable::GetSizeOfIsotopeList ( )
inline

Definition at line 103 of file G4NuclideTable.hh.

103 { return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0)) ; };
G4IsotopeList * fIsotopeList
Here is the call graph for this function:

◆ GetThresholdOfHalfLife()

G4double G4NuclideTable::GetThresholdOfHalfLife ( )
inline

Definition at line 90 of file G4NuclideTable.hh.

90 { return threshold_of_half_life; };
G4double threshold_of_half_life

◆ GetTrancationError()

static G4double G4NuclideTable::GetTrancationError ( G4double  eex)
inlinestatic

Definition at line 125 of file G4NuclideTable.hh.

127  return eex - (G4long)(eex/tolerance)*tolerance; }
G4double GetLevelTolerance()
long G4long
Definition: G4Types.hh:80
static const G4double tolerance
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ Round()

static G4double G4NuclideTable::Round ( G4double  eex)
inlinestatic

Definition at line 128 of file G4NuclideTable.hh.

130  return round(eex/tolerance)*tolerance; }
G4double GetLevelTolerance()
static const G4double tolerance
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ SetLevelTolerance()

void G4NuclideTable::SetLevelTolerance ( G4double  x)
inline

Definition at line 92 of file G4NuclideTable.hh.

Here is the caller graph for this function:

◆ SetThresholdOfHalfLife()

void G4NuclideTable::SetThresholdOfHalfLife ( G4double  t)

Definition at line 312 of file G4NuclideTable.cc.

313 {
314  if ( G4Threading::IsMasterThread() ) {
316  GenerateNuclide();
317  }
318 }
G4double threshold_of_half_life
G4bool IsMasterThread()
Definition: G4Threading.cc:136
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Tolerance()

static G4double G4NuclideTable::Tolerance ( )
inlinestatic

Definition at line 134 of file G4NuclideTable.hh.

G4double GetLevelTolerance()
static G4NuclideTable * GetInstance()
Here is the call graph for this function:

◆ Trancate()

static G4long G4NuclideTable::Trancate ( G4double  eex)
inlinestatic

Definition at line 131 of file G4NuclideTable.hh.

133  return (G4long)(eex/tolerance); }
G4double GetLevelTolerance()
long G4long
Definition: G4Types.hh:80
static const G4double tolerance
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ fIsotopeList

G4IsotopeList* G4NuclideTable::fIsotopeList
private

Definition at line 159 of file G4NuclideTable.hh.

◆ flevelTolerance

G4double G4NuclideTable::flevelTolerance
private

Definition at line 160 of file G4NuclideTable.hh.

◆ fMessenger

G4NuclideTableMessenger* G4NuclideTable::fMessenger
private

Definition at line 161 of file G4NuclideTable.hh.

◆ fUserDefinedList

G4IsotopeList* G4NuclideTable::fUserDefinedList
private

Definition at line 141 of file G4NuclideTable.hh.

◆ map_full_list

std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > G4NuclideTable::map_full_list
private

Definition at line 148 of file G4NuclideTable.hh.

◆ map_pre_load_list

std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > G4NuclideTable::map_pre_load_list
private

Definition at line 147 of file G4NuclideTable.hh.

◆ minimum_threshold_of_half_life

G4double G4NuclideTable::minimum_threshold_of_half_life
private

Definition at line 140 of file G4NuclideTable.hh.

◆ threshold_of_half_life

G4double G4NuclideTable::threshold_of_half_life
private

Definition at line 139 of file G4NuclideTable.hh.


The documentation for this class was generated from the following files: