58G4NuclideTable::G4NuclideTable()
60 mean_life_threshold(1.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; }
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 (mean_life_threshold < minimum_mean_life_threshold) {
192 if (path ==
nullptr) {
194 "G4ENSDFSTATEDATA environment variable must be set");
200 filename +=
"/ENSDFSTATE.dat";
202 ifs.open(filename.c_str() );
205 "ENSDFSTATE.dat is not found.");
220 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu;
224 if (ionCode != 1000*ionZ + ionA ) {
226 ionCode = 1000*ionZ + ionA;
232 ionMu *= (joule/tesla);
235 (mean_life_threshold <= ionLife &&
236 ionLife < minimum_mean_life_threshold) ) {
237 if (ionE > 0) ++iLevel;
238 if (iLevel > 9) iLevel = 9;
253 fIsotopeList->push_back(fProperty);
255 auto itf = map_full_list.find(ionCode);
256 if (itf == map_full_list.cend() ) {
257 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
258 itf = (map_full_list.insert(
263 std::pair<G4double, G4IsotopeProperty*>(ionE, fProperty) );
266 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu;
269 minimum_mean_life_threshold = mean_life_threshold;
273 for (
auto it = map_pre_load_list.begin(); it != map_pre_load_list.end(); ++it) {
276 map_pre_load_list.clear();
279 for (
auto it = map_full_list.cbegin(); it != map_full_list.cend(); ++it) {
280 G4int ionCode = it->first;
281 auto itf = map_pre_load_list.find(ionCode);
282 if (itf == map_pre_load_list.cend() ) {
283 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
284 itf = (map_pre_load_list.insert(
290 for (
auto itt = it->second.cbegin(); itt != it->second.cend(); ++itt) {
292 G4double meanLife = itt->second->GetLifeTime();
293 if (exEnergy == 0.0 || meanLife > mean_life_threshold) {
294 if (itt->first != 0.0) ++iLevel;
295 if (iLevel > 9) iLevel = 9;
296 itt->second->SetIsomerLevel(iLevel);
298 std::pair<G4double, G4IsotopeProperty*>(exEnergy, itt->second) );
311 ionE = StripFloatLevelBase( ionE, flbIndex );
312 AddState(ionZ,ionA,ionE,flbIndex,ionLife,ionJ,ionMu);
323 if ( fUserDefinedList ==
nullptr ) fUserDefinedList =
new G4IsotopeList();
338 fUserDefinedList->push_back(fProperty);
339 fIsotopeList->push_back(fProperty);
350 if ( fUserDefinedList ==
nullptr ) fUserDefinedList =
new G4IsotopeList();
365 fUserDefinedList->push_back(fProperty);
366 fIsotopeList->push_back(fProperty);
373 mean_life_threshold = t/0.69314718;
385 mean_life_threshold = t;
393 G4double rem = std::fmod(E/(1.0E-3*eV),10.0);
394 flbIndex =
G4int(rem);
400G4NuclideTable::StripFloatLevelBase(
const G4String& sFLB )
402 if ( sFLB.size() < 1 || 2 < sFLB.size() )
406 text +=
" is not valid indicator of G4Ions::G4FloatLevelBase.\n";
407 text +=
"You may use a wrong version of ENSDFSTATE data.\n";
408 text +=
"Please use G4ENSDFSTATE-2.0 or later.";
413 if ( !(sFLB ==
"-") )
const char * G4FindDataDir(const char *)
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)
void SetMeanLifeThreshold(G4double)
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()