Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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)
 
void AddState (G4int, G4int, G4double, G4int, G4double, G4int ionJ=0, G4double ionMu=0.0)
 
void AddState (G4int, G4int, G4double, G4Ions::G4FloatLevelBase, G4double, G4int ionJ=0, G4double ionMu=0.0)
 
size_t GetSizeOfIsotopeList ()
 
virtual G4IsotopePropertyGetIsotope (G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)
 
virtual G4IsotopePropertyGetIsotopeByIsoLvl (G4int Z, G4int A, G4int lvl=0)
 
size_t entries () const
 
G4IsotopePropertyGetIsotopeByIndex (size_t idx) const
 
- Public Member Functions inherited from G4VIsotopeTable
 G4VIsotopeTable ()
 
 G4VIsotopeTable (const G4String &)
 
 G4VIsotopeTable (const G4VIsotopeTable &)
 
G4VIsotopeTableoperator= (const G4VIsotopeTable &)
 
virtual ~G4VIsotopeTable ()
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int level)
 
void DumpTable (G4int Zmin=1, G4int Zmax=118)
 
const G4StringGetName () const
 

Static Public Member Functions

static G4NuclideTableGetInstance ()
 
static G4NuclideTableGetNuclideTable ()
 
static G4double GetTrancationError (G4double eex)
 
static G4double Round (G4double eex)
 
static G4long Trancate (G4double eex)
 
static G4double Tolerance ()
 

Protected Member Functions

void FillHardCodeList ()
 

Detailed Description

Definition at line 58 of file G4NuclideTable.hh.

Member Typedef Documentation

Definition at line 73 of file G4NuclideTable.hh.

Constructor & Destructor Documentation

G4NuclideTable::~G4NuclideTable ( )
virtual

Definition at line 78 of file G4NuclideTable.cc.

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

Member Function Documentation

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

Definition at line 311 of file G4NuclideTable.cc.

312 {
313  if ( G4Threading::IsMasterThread() ) {
314  G4int flbIndex = 0;
315  ionE = StripFloatLevelBase( ionE, flbIndex );
316  AddState(ionZ,ionA,ionE,flbIndex,ionLife,ionJ,ionMu);
317  }
318 }
int G4int
Definition: G4Types.hh:78
void AddState(G4int, G4int, G4double, G4double, G4int ionJ=0, G4double ionMu=0.0)
G4bool IsMasterThread()
Definition: G4Threading.cc:146

Here is the call graph for this function:

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

Definition at line 320 of file G4NuclideTable.cc.

322 {
323  if ( G4Threading::IsMasterThread() ) {
324 
325  if ( fUserDefinedList == NULL ) fUserDefinedList = new G4IsotopeList();
326 
327  G4IsotopeProperty* fProperty = new G4IsotopeProperty();
328 
329  // Set Isotope Property
330  fProperty->SetAtomicNumber(ionZ);
331  fProperty->SetAtomicMass(ionA);
332  fProperty->SetIsomerLevel(9);
333  fProperty->SetEnergy(ionE);
334  fProperty->SetiSpin(ionJ);
335  fProperty->SetLifeTime(ionLife);
336  fProperty->SetDecayTable(0);
337  fProperty->SetMagneticMoment(ionMu);
338  fProperty->SetFloatLevelBase(flbIndex);
339 
340  fUserDefinedList->push_back(fProperty);
341  fIsotopeList->push_back(fProperty);
342 
343  }
344 }
void SetAtomicMass(G4int A)
std::vector< G4IsotopeProperty * > G4IsotopeList
void SetiSpin(G4int J)
void SetMagneticMoment(G4double M)
void SetLifeTime(G4double T)
void SetFloatLevelBase(G4Ions::G4FloatLevelBase flb)
void SetEnergy(G4double E)
void SetDecayTable(G4DecayTable *table)
G4bool IsMasterThread()
Definition: G4Threading.cc:146
void SetAtomicNumber(G4int Z)
void SetIsomerLevel(G4int level)

Here is the call graph for this function:

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

Definition at line 346 of file G4NuclideTable.cc.

348 {
349  if ( G4Threading::IsMasterThread() ) {
350 
351  if ( fUserDefinedList == NULL ) fUserDefinedList = new G4IsotopeList();
352 
353  G4IsotopeProperty* fProperty = new G4IsotopeProperty();
354 
355  // Set Isotope Property
356  fProperty->SetAtomicNumber(ionZ);
357  fProperty->SetAtomicMass(ionA);
358  fProperty->SetIsomerLevel(9);
359  fProperty->SetEnergy(ionE);
360  fProperty->SetiSpin(ionJ);
361  fProperty->SetLifeTime(ionLife);
362  fProperty->SetDecayTable(0);
363  fProperty->SetMagneticMoment(ionMu);
364  fProperty->SetFloatLevelBase( flb );
365 
366  fUserDefinedList->push_back(fProperty);
367  fIsotopeList->push_back(fProperty);
368 
369  }
370 }
void SetAtomicMass(G4int A)
std::vector< G4IsotopeProperty * > G4IsotopeList
void SetiSpin(G4int J)
void SetMagneticMoment(G4double M)
void SetLifeTime(G4double T)
void SetFloatLevelBase(G4Ions::G4FloatLevelBase flb)
void SetEnergy(G4double E)
void SetDecayTable(G4DecayTable *table)
G4bool IsMasterThread()
Definition: G4Threading.cc:146
void SetAtomicNumber(G4int Z)
void SetIsomerLevel(G4int level)

Here is the call graph for this function:

size_t G4NuclideTable::entries ( ) const
inline

Definition at line 173 of file G4NuclideTable.hh.

174 {
175  return (fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
176 }

Here is the caller graph for this function:

void G4NuclideTable::FillHardCodeList ( )
protected

Definition at line 170 of file G4NuclideTable.cc.

171 {
172  ;
173 }
void G4NuclideTable::GenerateNuclide ( )

Definition at line 176 of file G4NuclideTable.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4NuclideTable * G4NuclideTable::GetInstance ( )
static

Definition at line 56 of file G4NuclideTable.cc.

56  {
57  static G4NuclideTable instance;
58  return &instance;
59 }

Here is the caller graph for this function:

G4IsotopeProperty * G4NuclideTable::GetIsotope ( G4int  Z,
G4int  A,
G4double  E,
G4Ions::G4FloatLevelBase  flb = G4Ions::G4FloatLevelBase::no_Float 
)
virtual

Implements G4VIsotopeTable.

Definition at line 108 of file G4NuclideTable.cc.

110 {
111 
112  G4IsotopeProperty* fProperty = nullptr;
113 
114  // At first searching UserDefined
115  if ( fUserDefinedList ) {
116  for ( G4IsotopeList::iterator it = fUserDefinedList->begin() ; it != fUserDefinedList->end() ; it++ ) {
117 
118  if ( Z == (*it)->GetAtomicNumber() && A == (*it)->GetAtomicMass() ) {
119  G4double levelE = (*it)->GetEnergy();
120  if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) {
121  if( flb == (*it)->GetFloatLevelBase() )
122  { return *it; } //found
123  }
124  }
125  }
126  }
127 
128  //Serching pre-load
129  //Note: isomer level is properly set only for pre_load_list.
130  //
131  G4int ionCode = 1000*Z + A;
132  std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator itf = map_pre_load_list.find( ionCode );
133 
134  if ( itf != map_pre_load_list.end() ) {
135  std::multimap< G4double , G4IsotopeProperty* >::iterator lower_bound_itr = itf -> second.lower_bound ( E - flevelTolerance/2 );
136  G4double levelE = DBL_MAX;
137 /*
138  if ( lower_bound_itr != itf -> second.end() ) {
139  levelE = lower_bound_itr->first;
140  if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) {
141  if( flb == (lower_bound_itr->second)->GetFloatLevelBase() )
142  { return lower_bound_itr->second; } // found
143  }
144  }
145 */
146  while ( lower_bound_itr != itf -> second.end() ) {
147  levelE = lower_bound_itr->first;
148  if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) {
149  if ( flb == (lower_bound_itr->second)->GetFloatLevelBase() ) return lower_bound_itr->second; // found
150  } else {
151  break;
152  }
153  lower_bound_itr++;
154  }
155 
156  }
157 
158  return fProperty; // not found
159 }
static constexpr double second
Definition: G4SIunits.hh:157
int G4int
Definition: G4Types.hh:78
double A(double temperature)
G4double GetEnergy() const
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 179 of file G4NuclideTable.hh.

180 {
181  if ( fIsotopeList && idx<fIsotopeList->size()) return (*fIsotopeList)[idx];
182  else return 0;
183 }

Here is the caller graph for this function:

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

Reimplemented from G4VIsotopeTable.

Definition at line 163 of file G4NuclideTable.cc.

164 {
165  if(lvl==0) return GetIsotope(Z,A,0.0);
166  return (G4IsotopeProperty*)0;
167 }
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)
double A(double temperature)

Here is the call graph for this function:

G4double G4NuclideTable::GetLevelTolerance ( )
inline

Definition at line 93 of file G4NuclideTable.hh.

93 { return flevelTolerance; };

Here is the caller graph for this function:

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:

size_t G4NuclideTable::GetSizeOfIsotopeList ( )
inline

Definition at line 104 of file G4NuclideTable.hh.

105  { return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0)) ; };
G4double G4NuclideTable::GetThresholdOfHalfLife ( )
inline

Definition at line 90 of file G4NuclideTable.hh.

90 { return threshold_of_half_life; };
static G4double G4NuclideTable::GetTrancationError ( G4double  eex)
inlinestatic

Definition at line 129 of file G4NuclideTable.hh.

131  return eex - (G4long)(eex/tolerance)*tolerance; }
G4double GetLevelTolerance()
long G4long
Definition: G4Types.hh:80
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

static G4double G4NuclideTable::Round ( G4double  eex)
inlinestatic

Definition at line 132 of file G4NuclideTable.hh.

134  return round(eex/tolerance)*tolerance; }
G4double GetLevelTolerance()
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4NuclideTable::SetLevelTolerance ( G4double  x)
inline

Definition at line 92 of file G4NuclideTable.hh.

92 { flevelTolerance=x;};

Here is the caller graph for this function:

void G4NuclideTable::SetThresholdOfHalfLife ( G4double  t)

Definition at line 373 of file G4NuclideTable.cc.

374 {
375  if ( G4Threading::IsMasterThread() ) {
376  threshold_of_half_life=t;
377  GenerateNuclide();
378  }
379 }
G4bool IsMasterThread()
Definition: G4Threading.cc:146

Here is the call graph for this function:

Here is the caller graph for this function:

static G4double G4NuclideTable::Tolerance ( )
inlinestatic

Definition at line 138 of file G4NuclideTable.hh.

G4double GetLevelTolerance()
static G4NuclideTable * GetInstance()

Here is the call graph for this function:

static G4long G4NuclideTable::Trancate ( G4double  eex)
inlinestatic

Definition at line 135 of file G4NuclideTable.hh.

137  return (G4long)(eex/tolerance); }
G4double GetLevelTolerance()
long G4long
Definition: G4Types.hh:80
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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