58G4NuclideTable::G4NuclideTable()
60 threshold_of_half_life(1000.0*
ns),
61 flevelTolerance(1.0*eV)
71 for (
auto it=map_pre_load_list.begin(); it!=map_pre_load_list.end(); ++it)
75 map_pre_load_list.clear();
77 for (
auto it=map_full_list.begin(); it!=map_full_list.end(); ++it)
81 map_full_list.clear();
83 if (fIsotopeList !=
nullptr)
85 for (std::size_t i = 0 ; i<fIsotopeList->size(); ++i)
87 delete (*fIsotopeList)[i];
89 fIsotopeList->clear();
91 fIsotopeList =
nullptr;
103 if ( fUserDefinedList )
105 for (
auto it=fUserDefinedList->cbegin(); it!=fUserDefinedList->cend(); ++it)
107 if ( Z == (*it)->GetAtomicNumber() &&
A == (*it)->GetAtomicMass() )
110 if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 )
112 if( flb == (*it)->GetFloatLevelBase() ) {
return *it; }
121 G4int ionCode = 1000*Z +
A;
122 auto itf = map_pre_load_list.find( ionCode );
124 if ( itf != map_pre_load_list.cend() )
126 auto lower_bound_itr = itf -> second.lower_bound ( E - flevelTolerance/2 );
129 while ( lower_bound_itr != itf -> second.cend() )
131 levelE = lower_bound_itr->first;
132 if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 )
134 if ( flb == (lower_bound_itr->second)->GetFloatLevelBase() )
136 return lower_bound_itr->second;
154 return eex - (
G4long)(eex/tolerance)*tolerance;
161 return round(eex/tolerance)*tolerance;
168 return (
G4long)(eex/tolerance);
188 if ( threshold_of_half_life < minimum_threshold_of_half_life )
191 char* path = std::getenv(
"G4ENSDFSTATEDATA");
193 if ( path ==
nullptr )
196 "G4ENSDFSTATEDATA environment variable must be set");
202 filename +=
"/ENSDFSTATE.dat";
204 ifs.open( filename.c_str() );
208 "ENSDFSTATE.dat is not found.");
222 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu;
226 if ( ionCode != 1000*ionZ + ionA )
229 ionCode = 1000*ionZ + ionA;
235 ionMu *= (joule/tesla);
238 || ( threshold_of_half_life <= ionLife*std::log(2.0)
239 && ionLife*std::log(2.0) < minimum_threshold_of_half_life ) )
241 if ( ionE > 0 ) ++iLevel;
242 if ( iLevel > 9 ) iLevel=9;
257 fIsotopeList->push_back(fProperty);
259 auto itf = map_full_list.find( ionCode );
260 if ( itf == map_full_list.cend() )
262 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
263 itf = ( map_full_list.insert(
267 itf -> second.insert(
268 std::pair< G4double, G4IsotopeProperty* >(ionE, fProperty) );
270 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu;
273 minimum_threshold_of_half_life = threshold_of_half_life;
278 for (
auto it=map_pre_load_list.begin(); it!=map_pre_load_list.end(); ++it )
282 map_pre_load_list.clear();
285 for (
auto it = map_full_list.cbegin(); it != map_full_list.cend(); ++it )
287 G4int ionCode = it->first;
288 auto itf = map_pre_load_list.find( ionCode );
289 if ( itf == map_pre_load_list.cend() )
291 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
292 itf = ( map_pre_load_list.insert(
297 for (
auto itt = it->second.cbegin(); itt != it->second.cend(); ++itt )
300 G4double meanLife = itt->second->GetLifeTime();
301 if ( exEnergy == 0.0 || meanLife*std::log(2.0) > threshold_of_half_life )
303 if ( itt->first != 0.0 ) ++iLevel;
304 if ( iLevel > 9 ) iLevel=9;
305 itt->second->SetIsomerLevel( iLevel );
307 std::pair< G4double, G4IsotopeProperty* >(exEnergy, itt->second) );
320 ionE = StripFloatLevelBase( ionE, flbIndex );
321 AddState(ionZ,ionA,ionE,flbIndex,ionLife,ionJ,ionMu);
332 if ( fUserDefinedList ==
nullptr ) fUserDefinedList =
new G4IsotopeList();
347 fUserDefinedList->push_back(fProperty);
348 fIsotopeList->push_back(fProperty);
359 if ( fUserDefinedList ==
nullptr ) fUserDefinedList =
new G4IsotopeList();
374 fUserDefinedList->push_back(fProperty);
375 fIsotopeList->push_back(fProperty);
384 threshold_of_half_life=t;
392 G4double rem = std::fmod(E/(1.0E-3*eV),10.0);
393 flbIndex =
G4int(rem);
399G4NuclideTable::StripFloatLevelBase(
const G4String& sFLB )
401 if ( sFLB.size() < 1 || 2 < sFLB.size() )
405 text +=
" is not valid indicator of G4Ions::G4FloatLevelBase.\n";
406 text +=
"You may use a wrong version of ENSDFSTATE data.\n";
407 text +=
"Please use G4ENSDFSTATE-2.0 or later.";
412 if ( !(sFLB ==
'-') )
double A(double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
void SetAtomicMass(G4int A)
void SetDecayTable(G4DecayTable *table)
void SetFloatLevelBase(G4Ions::G4FloatLevelBase flb)
void SetEnergy(G4double E)
void SetAtomicNumber(G4int Z)
void SetIsomerLevel(G4int level)
G4double GetEnergy() const
void SetLifeTime(G4double T)
void SetMagneticMoment(G4double M)
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)
static G4NuclideTable * GetNuclideTable()
static G4long Truncate(G4double eex)
G4double GetLevelTolerance()
std::vector< G4IsotopeProperty * > G4IsotopeList
static G4double Tolerance()
static G4double Round(G4double eex)
virtual G4IsotopeProperty * GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0)
virtual ~G4NuclideTable()