62 G4NuclideTable::G4NuclideTable()
64 threshold_of_half_life(1000.0*
ns),
65 minimum_threshold_of_half_life(
DBL_MAX),
66 fUserDefinedList(NULL),
68 flevelTolerance(1.0*
eV)
81 for ( std::map<
G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
82 it = map_pre_load_list.begin(); it != map_pre_load_list.end(); it++ ) {
85 map_pre_load_list.clear();
88 for ( std::map<
G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
89 it = map_full_list.begin(); it != map_full_list.end(); it++ ) {
92 map_full_list.clear();
94 if (fIsotopeList!=0) {
95 for (
size_t i = 0 ; i<fIsotopeList->size(); i++) {
97 delete (*fIsotopeList)[i];
99 fIsotopeList->clear();
115 if ( fUserDefinedList ) {
116 for ( G4IsotopeList::iterator it = fUserDefinedList->begin() ; it != fUserDefinedList->end() ; it++ ) {
118 if ( Z == (*it)->GetAtomicNumber() && A == (*it)->GetAtomicMass() ) {
120 if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) {
121 if( flb == (*it)->GetFloatLevelBase() )
131 G4int ionCode = 1000*Z +
A;
132 std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator itf = map_pre_load_list.find( ionCode );
134 if ( itf != map_pre_load_list.end() ) {
135 std::multimap< G4double , G4IsotopeProperty* >::iterator lower_bound_itr = itf ->
second.lower_bound ( E - flevelTolerance/2 );
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;
179 if ( threshold_of_half_life < minimum_threshold_of_half_life ) {
183 char* path = getenv(
"G4ENSDFSTATEDATA");
187 FatalException,
"G4ENSDFSTATEDATA environment variable must be set");
193 filename +=
"/ENSDFSTATE.dat";
195 ifs.open( filename.c_str() );
216 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu;
218 while ( ifs.good() ) {
220 if ( ionCode != 1000*ionZ + ionA ) {
222 ionCode = 1000*ionZ + ionA;
236 || ( threshold_of_half_life <= ionLife*std::log(2.0) && ionLife*std::log(2.0) < minimum_threshold_of_half_life ) ) {
238 if ( ionE > 0 ) iLevel++;
239 if ( iLevel > 9 ) iLevel=9;
254 fIsotopeList->push_back(fProperty);
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;
260 itf = ( map_full_list.insert( std::pair<
G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) ) ).
first;
262 itf ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , fProperty ) );
265 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu;
268 minimum_threshold_of_half_life = threshold_of_half_life;
274 for ( std::map<
G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
275 it = map_pre_load_list.begin(); it != map_pre_load_list.end(); it++ ) {
278 map_pre_load_list.clear();
281 for ( std::map<
G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
282 it = map_full_list.begin(); it != map_full_list.end(); it++ ) {
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;
291 for ( std::multimap< G4double , G4IsotopeProperty* >::iterator
292 itt = it->second.begin(); itt != it->second.end(); itt++ ) {
295 G4double meanLife = itt->second->GetLifeTime();
298 || meanLife*std::log(2.0) > threshold_of_half_life ) {
300 if ( itt->first != 0.0 ) iLevel++;
301 if ( iLevel > 9 ) iLevel=9;
302 itt->second->SetIsomerLevel( iLevel );
304 itf ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( exEnergy , itt->second ) );
315 ionE = StripFloatLevelBase( ionE, flbIndex );
316 AddState(ionZ,ionA,ionE,flbIndex,ionLife,ionJ,ionMu);
325 if ( fUserDefinedList == NULL ) fUserDefinedList =
new G4IsotopeList();
340 fUserDefinedList->push_back(fProperty);
341 fIsotopeList->push_back(fProperty);
351 if ( fUserDefinedList == NULL ) fUserDefinedList =
new G4IsotopeList();
366 fUserDefinedList->push_back(fProperty);
367 fIsotopeList->push_back(fProperty);
376 threshold_of_half_life=t;
390 if ( sFLB.size() < 1 || 2 < sFLB.size() ) {
393 text +=
" is not valid indicator of G4Ions::G4FloatLevelBase. You may use a wrong version of ENSDFSTATE data. Please use G4ENSDFSTATE2.0 or later.";
399 if ( !(sFLB ==
'-') ) {
static constexpr double tesla
void SetThresholdOfHalfLife(G4double)
void SetAtomicMass(G4int A)
std::vector< G4IsotopeProperty * > G4IsotopeList
static constexpr double second
virtual G4IsotopeProperty * GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0)
void SetMagneticMoment(G4double M)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)
void SetLifeTime(G4double T)
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
void AddState(G4int, G4int, G4double, G4double, G4int ionJ=0, G4double ionMu=0.0)
double A(double temperature)
G4double GetEnergy() const
void SetFloatLevelBase(G4Ions::G4FloatLevelBase flb)
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
static constexpr double eV
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetEnergy(G4double E)
void SetDecayTable(G4DecayTable *table)
static constexpr double joule
static G4NuclideTable * GetInstance()
static constexpr double keV
virtual ~G4NuclideTable()
void SetAtomicNumber(G4int Z)
void SetIsomerLevel(G4int level)