49 const G4double G4NuclideTable::levelTolerance = 1.0*
eV;
61 G4NuclideTable::G4NuclideTable()
63 threshold_of_half_life(1000.0*
ns),
64 fUserDefinedList(NULL),
74 if (fIsotopeList!=0) {
75 for (
size_t i = 0 ; i<fIsotopeList->size(); i++) {
76 delete (*fIsotopeList)[i];
78 fIsotopeList->clear();
83 for ( std::map<
G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
84 it = map_pre_load_list.begin(); it != map_pre_load_list.end(); it++ ) {
87 map_pre_load_list.clear();
89 for ( std::map<
G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
90 it = map_hard_code_list.begin(); it != map_hard_code_list.end(); it++ ) {
91 for ( std::multimap< G4double , G4IsotopeProperty* >::iterator
92 itt = it->second.begin(); itt != it->second.end(); itt++ ) {
97 map_hard_code_list.clear();
99 for ( std::map<
G4int , std::multimap< G4double , G4IsotopeProperty* > >::iterator
100 it = map_full_list.begin(); it != map_full_list.end(); it++ ) {
101 for ( std::multimap< G4double , G4IsotopeProperty* >::iterator
102 itt = it->second.begin(); itt != it->second.end(); itt++ ) {
107 map_full_list.clear();
116 G4int ionCode = 1000*Z + A;
120 if ( map_pre_load_list.find( ionCode ) != map_pre_load_list.end() ) {
122 std::multimap< G4double , G4IsotopeProperty* >::iterator lower_bound_itr =
123 map_pre_load_list.find( ionCode ) ->
second.lower_bound ( E - levelTolerance/2 );
129 if ( lower_bound_itr != map_pre_load_list.find( ionCode ) ->
second.end() ) {
130 levelE = lower_bound_itr->first;
131 if ( levelE - levelTolerance/2 <= E && E < levelE + levelTolerance/2 ) {
132 return lower_bound_itr->second;
138 if ( map_hard_code_list.find( ionCode ) != map_hard_code_list.end() ) {
139 std::multimap< G4double , G4IsotopeProperty* >::iterator lower_bound_itr =
140 map_hard_code_list.find( ionCode ) ->
second.lower_bound ( E - levelTolerance/2 );
146 if ( lower_bound_itr != map_hard_code_list.find( ionCode ) ->
second.end() ) {
147 levelE = lower_bound_itr->first;
148 if ( levelE - levelTolerance/2 <= E && E < levelE + levelTolerance/2 ) {
149 return lower_bound_itr->second;
155 char* path = getenv(
"G4ENSDFSTATEDATA");
161 if ( map_full_list.find( ionCode ) == map_full_list.end() ) {
163 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
164 map_full_list.insert( std::pair<
G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) );
168 filename +=
"/ENSDFSTATE.dat";
169 ifs.open( filename.c_str() );
171 G4bool reading_target =
false;
180 ifs >> ionZ >> ionA >> ionE >> ionLife >> ionJ >> ionMu;
182 while ( ifs.good() ) {
184 if ( ionZ == Z && ionA == A ) {
186 reading_target =
true;
195 property->SetAtomicNumber(ionZ);
196 property->SetAtomicMass(ionA);
197 property->SetIsomerLevel(iLevel);
198 property->SetEnergy(ionE);
199 property->SetiSpin(ionJ);
200 property->SetLifeTime(ionLife);
201 property->SetMagneticMoment(ionMu);
203 map_full_list.find ( ionCode ) ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , property ) );
205 }
else if ( reading_target ==
true ) {
210 ifs >> ionZ >> ionA >> ionE >> ionLife >> ionJ >> ionMu;
217 if ( map_full_list.find( ionCode ) != map_full_list.end() ) {
219 std::multimap< G4double , G4IsotopeProperty* >::iterator lower_bound_itr =
220 map_full_list.find( ionCode ) ->
second.lower_bound ( E - levelTolerance/2 );
226 if ( lower_bound_itr != map_full_list.find( ionCode ) ->
second.end() ) {
227 levelE = lower_bound_itr->first;
228 if ( levelE - levelTolerance/2 < E && E < levelE + levelTolerance/2 ) {
229 return lower_bound_itr->second;
248 for (
size_t i=0; i<nEntries_ground_state; i++) {
250 G4int ionZ = (
G4int)groundStateTable[i][idxZ];
251 G4int ionA = (
G4int)groundStateTable[i][idxA];
253 G4double ionE = groundStateTable[i][idxEnergy]*
keV;
254 G4double ionLife = groundStateTable[i][idxLife]*
ns;
255 G4int ionJ = (
G4int)(groundStateTable[i][idxSpin]);
258 G4int ionCode = 1000*ionZ + ionA;
272 if ( map_hard_code_list.find ( ionCode ) == map_hard_code_list.end() ) {
273 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
274 map_hard_code_list.insert( std::pair<
G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) );
276 map_hard_code_list.find ( ionCode ) ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , fProperty ) );
280 for (
size_t i=0; i<nEntries_excite_state; i++) {
282 G4int ionZ = (
G4int)exciteStateTable[i][idxZ];
283 G4int ionA = (
G4int)exciteStateTable[i][idxA];
284 G4double ionE = exciteStateTable[i][idxEnergy]*
keV;
285 G4double ionLife = exciteStateTable[i][idxLife]*
ns;
286 G4int ionJ = (
G4int)(exciteStateTable[i][idxSpin]);
289 G4int ionCode = 1000*ionZ + ionA;
303 if ( map_hard_code_list.find ( ionCode ) == map_hard_code_list.end() ) {
304 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
305 map_hard_code_list.insert( std::pair<
G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) );
307 map_hard_code_list.find ( ionCode ) ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , fProperty ) );
316 if( fIsotopeList !=0 )
return;
319 for (
size_t i=0; i<nEntries_ground_state; i++) {
321 G4int ionZ = (
G4int)groundStateTable[i][idxZ];
322 G4int ionA = (
G4int)groundStateTable[i][idxA];
324 G4double ionE = groundStateTable[i][idxEnergy]*
keV;
325 G4double ionLife = groundStateTable[i][idxLife]*
ns;
326 G4int ionJ = (
G4int)(groundStateTable[i][idxSpin]);
329 if ( ionLife < 0.0 || ionLife*std::log(2.0) > threshold_of_half_life ) {
344 fIsotopeList->push_back(fProperty);
346 G4int ionCode = 1000*ionZ + ionA;
347 if ( map_pre_load_list.find ( ionCode ) == map_pre_load_list.end() ) {
348 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
349 map_pre_load_list.insert( std::pair<
G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) );
351 map_pre_load_list.find ( ionCode ) ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , fProperty ) );
356 if ( threshold_of_half_life >= 1.0*
ns ) {
362 for (
size_t i=0; i<nEntries_excite_state; i++) {
364 G4int ionZ = (
G4int)exciteStateTable[i][idxZ];
365 G4int ionA = (
G4int)exciteStateTable[i][idxA];
366 if ( ionCode != 1000*ionZ + ionA ) {
369 ionCode = 1000*ionZ + ionA;
372 G4double ionE = exciteStateTable[i][idxEnergy]*
keV;
373 G4double ionLife = exciteStateTable[i][idxLife]*
ns;
374 G4int ionJ = (
G4int)(exciteStateTable[i][idxSpin]);
377 if (( ionLife < 0.0 || ionLife > threshold_of_half_life )
378 && (ionE > levelTolerance+previousE)) {
381 if ( iLevel > 9 ) iLevel=9;
396 fIsotopeList->push_back(fProperty);
398 if ( map_pre_load_list.find ( ionCode ) == map_pre_load_list.end() ) {
399 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
400 map_pre_load_list.insert( std::pair<
G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) );
402 map_pre_load_list.find ( ionCode ) ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , fProperty ) );
408 char* path = getenv(
"G4ENSDFSTATEDATA");
412 FatalException,
"G4ENSDFSTATEDATA environment variable must be set");
417 filename +=
"/ENSDFSTATE.dat";
419 ifs.open( filename.c_str() );
437 ifs >> ionZ >> ionA >> ionE >> ionLife >> ionJ >> ionMu;
439 while ( ifs.good() ) {
441 if ( ionCode != 1000*ionZ + ionA ) {
443 ionCode = 1000*ionZ + ionA;
451 if ( ionLife*std::log(2.0) > threshold_of_half_life && ionE != 0 ) {
454 if ( iLevel > 9 ) iLevel=9;
469 fIsotopeList->push_back(fProperty);
471 if ( map_pre_load_list.find ( ionCode ) == map_pre_load_list.end() ) {
472 std::multimap<G4double, G4IsotopeProperty*> aMultiMap;
473 map_pre_load_list.insert( std::pair<
G4int , std::multimap< G4double , G4IsotopeProperty* > > ( ionCode , aMultiMap ) );
475 map_pre_load_list.find ( ionCode ) ->
second.insert( std::pair< G4double, G4IsotopeProperty* >( ionE , fProperty ) );
479 ifs >> ionZ >> ionA >> ionE >> ionLife >> ionJ >> ionMu;
484 if ( fUserDefinedList != NULL ) {
485 for ( G4IsotopeList::iterator it = fUserDefinedList->begin() ; it != fUserDefinedList->end() ; it++ ) {
486 fIsotopeList->push_back( *it );
494 if ( fUserDefinedList == NULL ) fUserDefinedList =
new G4IsotopeList();
508 fUserDefinedList->push_back(fProperty);
void SetAtomicMass(G4int A)
std::vector< G4IsotopeProperty * > G4IsotopeList
virtual G4IsotopeProperty * GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0)
void SetMagneticMoment(G4double M)
void SetLifeTime(G4double T)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetEnergy(G4double E)
void SetDecayTable(G4DecayTable *table)
static G4ParticleTable * GetParticleTable()
G4int GetVerboseLevel() const
void AddState(G4int, G4int, G4double, G4double, G4int, G4double)
static G4NuclideTable * GetInstance()
void SetVerboseLevel(G4int level)
virtual ~G4NuclideTable()
void SetAtomicNumber(G4int Z)
void SetIsomerLevel(G4int level)