Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4NuclideTable class implementation 26 // G4NuclideTable class implementation 27 // 27 // 28 // Author: T.Koi, SLAC - 10 October 2013 28 // Author: T.Koi, SLAC - 10 October 2013 29 // ------------------------------------------- 29 // -------------------------------------------------------------------- 30 30 31 #include "G4NuclideTable.hh" 31 #include "G4NuclideTable.hh" 32 << 33 #include "G4NuclideTableMessenger.hh" 32 #include "G4NuclideTableMessenger.hh" 34 #include "G4PhysicalConstants.hh" << 33 35 #include "G4String.hh" << 36 #include "G4SystemOfUnits.hh" << 37 #include "G4ios.hh" 34 #include "G4ios.hh" >> 35 #include "G4String.hh" 38 #include "globals.hh" 36 #include "globals.hh" >> 37 #include "G4PhysicalConstants.hh" >> 38 #include "G4SystemOfUnits.hh" 39 39 40 #include <fstream> << 41 #include <iomanip> 40 #include <iomanip> >> 41 #include <fstream> 42 #include <sstream> 42 #include <sstream> 43 << 43 >> 44 // -------------------------------------------------------------------- 44 G4NuclideTable* G4NuclideTable::GetInstance() 45 G4NuclideTable* G4NuclideTable::GetInstance() 45 { 46 { 46 static G4NuclideTable instance; 47 static G4NuclideTable instance; 47 return &instance; 48 return &instance; 48 } 49 } 49 50 >> 51 // -------------------------------------------------------------------- 50 G4NuclideTable* G4NuclideTable::GetNuclideTabl 52 G4NuclideTable* G4NuclideTable::GetNuclideTable() 51 { 53 { 52 return GetInstance(); 54 return GetInstance(); 53 } 55 } 54 56 >> 57 // -------------------------------------------------------------------- 55 G4NuclideTable::G4NuclideTable() 58 G4NuclideTable::G4NuclideTable() 56 : G4VIsotopeTable("Isomer"), mean_life_thres << 59 : G4VIsotopeTable("Isomer"), >> 60 mean_life_threshold(1.0*ns), >> 61 flevelTolerance(1.0*eV) 57 { 62 { 58 fMessenger = new G4NuclideTableMessenger(thi 63 fMessenger = new G4NuclideTableMessenger(this); 59 fIsotopeList = new G4IsotopeList(); 64 fIsotopeList = new G4IsotopeList(); 60 GenerateNuclide(); 65 GenerateNuclide(); 61 } 66 } 62 67 >> 68 // -------------------------------------------------------------------- 63 G4NuclideTable::~G4NuclideTable() 69 G4NuclideTable::~G4NuclideTable() 64 { 70 { 65 for (auto& it : map_pre_load_list) { << 71 for (auto it=map_pre_load_list.begin(); it!=map_pre_load_list.end(); ++it) 66 it.second.clear(); << 72 { >> 73 it->second.clear(); 67 } 74 } 68 map_pre_load_list.clear(); 75 map_pre_load_list.clear(); 69 76 70 for (auto& it : map_full_list) { << 77 for (auto it=map_full_list.begin(); it!=map_full_list.end(); ++it) 71 it.second.clear(); << 78 { >> 79 it->second.clear(); 72 } 80 } 73 map_full_list.clear(); 81 map_full_list.clear(); 74 82 75 if (fIsotopeList != nullptr) { << 83 if (fIsotopeList != nullptr) 76 for (const auto& i : *fIsotopeList) { << 84 { 77 delete i; << 85 for (std::size_t i = 0 ; i<fIsotopeList->size(); ++i) >> 86 { >> 87 delete (*fIsotopeList)[i]; 78 } 88 } 79 fIsotopeList->clear(); 89 fIsotopeList->clear(); 80 delete fIsotopeList; 90 delete fIsotopeList; 81 fIsotopeList = nullptr; 91 fIsotopeList = nullptr; 82 } 92 } 83 delete fMessenger; 93 delete fMessenger; 84 } 94 } 85 95 >> 96 // -------------------------------------------------------------------- 86 G4IsotopeProperty* G4NuclideTable::GetIsotope( 97 G4IsotopeProperty* G4NuclideTable::GetIsotope(G4int Z, G4int A, G4double E, 87 98 G4Ions::G4FloatLevelBase flb) 88 { 99 { 89 G4IsotopeProperty* fProperty = nullptr; 100 G4IsotopeProperty* fProperty = nullptr; 90 101 91 // At first searching UserDefined 102 // At first searching UserDefined 92 if (fUserDefinedList != nullptr) { << 103 if ( fUserDefinedList ) 93 for (const auto it : *fUserDefinedList) { << 104 { 94 if (Z == it->GetAtomicNumber() && A == i << 105 for (auto it=fUserDefinedList->cbegin(); it!=fUserDefinedList->cend(); ++it) 95 G4double levelE = it->GetEnergy(); << 106 { 96 if (levelE - flevelTolerance / 2 <= E << 107 if ( Z == (*it)->GetAtomicNumber() && A == (*it)->GetAtomicMass() ) 97 if (flb == it->GetFloatLevelBase()) << 108 { 98 return it; << 109 G4double levelE = (*it)->GetEnergy(); 99 } // found << 110 if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) >> 111 { >> 112 if( flb == (*it)->GetFloatLevelBase() ) { return *it; } //found 100 } 113 } 101 } 114 } 102 } 115 } 103 } << 116 } 104 117 105 // Searching pre-load 118 // Searching pre-load 106 // Note: isomer level is properly set only f 119 // Note: isomer level is properly set only for pre_load_list 107 // 120 // 108 G4int ionCode = 1000 * Z + A; << 121 G4int ionCode = 1000*Z + A; 109 auto itf = map_pre_load_list.find(ionCode); << 122 auto itf = map_pre_load_list.find( ionCode ); 110 123 111 if (itf != map_pre_load_list.cend()) { << 124 if ( itf != map_pre_load_list.cend() ) 112 auto lower_bound_itr = itf->second.lower_b << 125 { >> 126 auto lower_bound_itr = itf -> second.lower_bound ( E - flevelTolerance/2 ); 113 G4double levelE = DBL_MAX; 127 G4double levelE = DBL_MAX; 114 128 115 while (lower_bound_itr != itf->second.cend << 129 while ( lower_bound_itr != itf -> second.cend() ) >> 130 { 116 levelE = lower_bound_itr->first; 131 levelE = lower_bound_itr->first; 117 if (levelE - flevelTolerance / 2 <= E && << 132 if ( levelE - flevelTolerance/2 <= E && E < levelE + flevelTolerance/2 ) 118 if (flb == (lower_bound_itr->second)-> << 133 { 119 return lower_bound_itr->second; // << 134 if ( flb == (lower_bound_itr->second)->GetFloatLevelBase() ) >> 135 { >> 136 return lower_bound_itr->second; // found 120 } 137 } 121 } 138 } 122 else { << 139 else >> 140 { 123 break; 141 break; 124 } << 142 } 125 ++lower_bound_itr; << 143 ++lower_bound_itr; 126 } 144 } 127 } 145 } 128 146 129 return fProperty; // not found << 147 return fProperty; // not found 130 } 148 } 131 149 132 G4double G4NuclideTable::GetTruncationError(G4 << 150 // -------------------------------------------------------------------- >> 151 G4double G4NuclideTable::GetTruncationError( G4double eex ) 133 { 152 { 134 G4double tolerance = G4NuclideTable::GetInst << 153 G4double tolerance= G4NuclideTable::GetInstance()->GetLevelTolerance(); 135 return eex - (G4long)(eex / tolerance) * tol << 154 return eex - (G4long)(eex/tolerance)*tolerance; 136 } 155 } 137 156 138 G4double G4NuclideTable::Round(G4double eex) << 157 // -------------------------------------------------------------------- >> 158 G4double G4NuclideTable::Round( G4double eex ) 139 { 159 { 140 G4double tolerance = G4NuclideTable::GetInst << 160 G4double tolerance= G4NuclideTable::GetInstance()->GetLevelTolerance(); 141 return round(eex / tolerance) * tolerance; << 161 return round(eex/tolerance)*tolerance; 142 } 162 } 143 163 144 G4long G4NuclideTable::Truncate(G4double eex) << 164 // -------------------------------------------------------------------- >> 165 G4long G4NuclideTable::Truncate( G4double eex ) 145 { 166 { 146 G4double tolerance = G4NuclideTable::GetInst << 167 G4double tolerance= G4NuclideTable::GetInstance()->GetLevelTolerance(); 147 return (G4long)(eex / tolerance); << 168 return (G4long)(eex/tolerance); 148 } 169 } 149 170 >> 171 // -------------------------------------------------------------------- 150 G4double G4NuclideTable::Tolerance() 172 G4double G4NuclideTable::Tolerance() 151 { 173 { 152 return G4NuclideTable::GetInstance()->GetLev 174 return G4NuclideTable::GetInstance()->GetLevelTolerance(); 153 } 175 } 154 176 155 G4IsotopeProperty* G4NuclideTable::GetIsotopeB << 177 // -------------------------------------------------------------------- >> 178 G4IsotopeProperty* >> 179 G4NuclideTable::GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl) 156 { 180 { 157 if (lvl == 0) return GetIsotope(Z, A, 0.0); << 181 if(lvl==0) return GetIsotope(Z,A,0.0); 158 return nullptr; 182 return nullptr; 159 } 183 } 160 184 >> 185 // -------------------------------------------------------------------- 161 void G4NuclideTable::GenerateNuclide() 186 void G4NuclideTable::GenerateNuclide() 162 { 187 { 163 if (mean_life_threshold < minimum_mean_life_ 188 if (mean_life_threshold < minimum_mean_life_threshold) { 164 // Need to update full list 189 // Need to update full list 165 const char* path = G4FindDataDir("G4ENSDFS 190 const char* path = G4FindDataDir("G4ENSDFSTATEDATA"); 166 191 167 if (path == nullptr) { 192 if (path == nullptr) { 168 G4Exception("G4NuclideTable", "PART70000 193 G4Exception("G4NuclideTable", "PART70000", FatalException, 169 "G4ENSDFSTATEDATA environmen 194 "G4ENSDFSTATEDATA environment variable must be set"); 170 return; 195 return; 171 } 196 } 172 197 173 std::ifstream ifs; 198 std::ifstream ifs; 174 G4String filename(path); 199 G4String filename(path); 175 filename += "/ENSDFSTATE.dat"; 200 filename += "/ENSDFSTATE.dat"; 176 201 177 ifs.open(filename.c_str()); << 202 ifs.open(filename.c_str() ); 178 if (!ifs.good()) { << 203 if (!ifs.good() ) { 179 G4Exception("G4NuclideTable", "PART70001 << 204 G4Exception("G4NuclideTable", "PART70001", FatalException, >> 205 "ENSDFSTATE.dat is not found."); 180 return; 206 return; 181 } 207 } 182 208 183 G4int ionCode = 0; 209 G4int ionCode = 0; 184 G4int iLevel = 0; 210 G4int iLevel = 0; 185 G4int ionZ; 211 G4int ionZ; 186 G4int ionA; 212 G4int ionA; 187 G4double ionE; 213 G4double ionE; 188 G4String ionFL; 214 G4String ionFL; 189 G4double ionLife; 215 G4double ionLife; 190 G4int ionJ; 216 G4int ionJ; 191 G4double ionMu; 217 G4double ionMu; 192 218 193 // Lifetimes read from ENSDFSTATE are mean 219 // Lifetimes read from ENSDFSTATE are mean lives 194 ifs >> ionZ >> ionA >> ionE >> ionFL >> io 220 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu; 195 221 196 while (ifs.good()) // Loop checking, 09.0 << 222 while (ifs.good() ) // Loop checking, 09.08.2015, K.Kurashige 197 { 223 { 198 if (ionCode != 1000 * ionZ + ionA) { << 224 if (ionCode != 1000*ionZ + ionA ) { 199 iLevel = 0; 225 iLevel = 0; 200 ionCode = 1000 * ionZ + ionA; << 226 ionCode = 1000*ionZ + ionA; 201 } 227 } 202 228 203 ionE *= keV; 229 ionE *= keV; 204 G4Ions::G4FloatLevelBase flb = StripFloa 230 G4Ions::G4FloatLevelBase flb = StripFloatLevelBase(ionFL); 205 ionLife *= ns; 231 ionLife *= ns; 206 ionMu *= (joule / tesla); << 232 ionMu *= (joule/tesla); 207 233 208 if ((ionE == 0 && flb == G4Ions::G4Float << 234 if ((ionE == 0 && flb == G4Ions::G4FloatLevelBase::no_Float) || 209 || (mean_life_threshold <= ionLife & << 235 (mean_life_threshold <= ionLife && 210 { << 236 ionLife < minimum_mean_life_threshold) ) { 211 if (ionE > 0) ++iLevel; 237 if (ionE > 0) ++iLevel; 212 if (iLevel > 9) iLevel = 9; 238 if (iLevel > 9) iLevel = 9; 213 239 214 auto fProperty = new G4IsotopeProperty << 240 G4IsotopeProperty* fProperty = new G4IsotopeProperty(); 215 241 216 // Set Isotope Property 242 // Set Isotope Property 217 fProperty->SetAtomicNumber(ionZ); 243 fProperty->SetAtomicNumber(ionZ); 218 fProperty->SetAtomicMass(ionA); 244 fProperty->SetAtomicMass(ionA); 219 fProperty->SetIsomerLevel(iLevel); 245 fProperty->SetIsomerLevel(iLevel); 220 fProperty->SetEnergy(ionE); 246 fProperty->SetEnergy(ionE); 221 fProperty->SetiSpin(ionJ); 247 fProperty->SetiSpin(ionJ); 222 fProperty->SetLifeTime(ionLife); 248 fProperty->SetLifeTime(ionLife); 223 fProperty->SetDecayTable(nullptr); 249 fProperty->SetDecayTable(nullptr); 224 fProperty->SetMagneticMoment(ionMu); 250 fProperty->SetMagneticMoment(ionMu); 225 fProperty->SetFloatLevelBase(flb); << 251 fProperty->SetFloatLevelBase( flb ); 226 252 227 fIsotopeList->push_back(fProperty); 253 fIsotopeList->push_back(fProperty); 228 254 229 auto itf = map_full_list.find(ionCode) 255 auto itf = map_full_list.find(ionCode); 230 if (itf == map_full_list.cend()) { << 256 if (itf == map_full_list.cend() ) { 231 std::multimap<G4double, G4IsotopePro 257 std::multimap<G4double, G4IsotopeProperty*> aMultiMap; 232 itf = (map_full_list.insert(std::pai << 258 itf = (map_full_list.insert( 233 ionCode, aMultiMap))) << 259 std::pair<G4int, std::multimap<G4double, 234 .first; << 260 G4IsotopeProperty*> > (ionCode, aMultiMap) ) ).first; 235 } 261 } 236 itf->second.insert(std::pair<G4double, << 262 itf->second.insert( >> 263 std::pair<G4double, G4IsotopeProperty*>(ionE, fProperty) ); 237 } 264 } 238 265 239 ifs >> ionZ >> ionA >> ionE >> ionFL >> 266 ifs >> ionZ >> ionA >> ionE >> ionFL >> ionLife >> ionJ >> ionMu; 240 } // End while 267 } // End while 241 268 242 minimum_mean_life_threshold = mean_life_th 269 minimum_mean_life_threshold = mean_life_threshold; 243 } 270 } 244 271 245 // Clear current map 272 // Clear current map 246 for (auto& it : map_pre_load_list) { << 273 for (auto it = map_pre_load_list.begin(); it != map_pre_load_list.end(); ++it) { 247 it.second.clear(); << 274 it->second.clear(); 248 } 275 } 249 map_pre_load_list.clear(); 276 map_pre_load_list.clear(); 250 277 251 // Build map based on current threshold valu 278 // Build map based on current threshold value 252 for (const auto& it : map_full_list) { << 279 for (auto it = map_full_list.cbegin(); it != map_full_list.cend(); ++it) { 253 G4int ionCode = it.first; << 280 G4int ionCode = it->first; 254 auto itf = map_pre_load_list.find(ionCode) 281 auto itf = map_pre_load_list.find(ionCode); 255 if (itf == map_pre_load_list.cend()) { << 282 if (itf == map_pre_load_list.cend() ) { 256 std::multimap<G4double, G4IsotopePropert 283 std::multimap<G4double, G4IsotopeProperty*> aMultiMap; 257 itf = (map_pre_load_list.insert( 284 itf = (map_pre_load_list.insert( 258 std::pair<G4int, std::multimap< << 285 std::pair<G4int, std::multimap<G4double, 259 .first; << 286 G4IsotopeProperty*> > (ionCode, aMultiMap) ) ).first; 260 } 287 } 261 288 262 G4int iLevel = 0; 289 G4int iLevel = 0; 263 for (const auto& itt : it.second) { << 290 for (auto itt = it->second.cbegin(); itt != it->second.cend(); ++itt) { 264 G4double exEnergy = itt.first; << 291 G4double exEnergy = itt->first; 265 G4double meanLife = itt.second->GetLifeT << 292 G4double meanLife = itt->second->GetLifeTime(); 266 if (exEnergy == 0.0 || meanLife > mean_l 293 if (exEnergy == 0.0 || meanLife > mean_life_threshold) { 267 if (itt.first != 0.0) ++iLevel; << 294 if (itt->first != 0.0) ++iLevel; 268 if (iLevel > 9) iLevel = 9; 295 if (iLevel > 9) iLevel = 9; 269 itt.second->SetIsomerLevel(iLevel); << 296 itt->second->SetIsomerLevel(iLevel); 270 itf->second.insert(std::pair<G4double, << 297 itf->second.insert( >> 298 std::pair<G4double, G4IsotopeProperty*>(exEnergy, itt->second) ); 271 } 299 } 272 } 300 } 273 } 301 } 274 } 302 } 275 303 276 void G4NuclideTable::AddState(G4int ionZ, G4in << 304 // -------------------------------------------------------------------- 277 G4double ionMu) << 305 void G4NuclideTable::AddState( G4int ionZ, G4int ionA, G4double ionE, >> 306 G4double ionLife, G4int ionJ, G4double ionMu ) 278 { 307 { 279 if (G4Threading::IsMasterThread()) { << 308 if ( G4Threading::IsMasterThread() ) >> 309 { 280 G4int flbIndex = 0; 310 G4int flbIndex = 0; 281 ionE = StripFloatLevelBase(ionE, flbIndex) << 311 ionE = StripFloatLevelBase( ionE, flbIndex ); 282 AddState(ionZ, ionA, ionE, flbIndex, ionLi << 312 AddState(ionZ,ionA,ionE,flbIndex,ionLife,ionJ,ionMu); 283 } 313 } 284 } 314 } 285 315 286 void G4NuclideTable::AddState(G4int ionZ, G4in << 316 // -------------------------------------------------------------------- 287 G4double ionLife << 317 void G4NuclideTable::AddState( G4int ionZ, G4int ionA, G4double ionE, >> 318 G4int flbIndex, G4double ionLife, G4int ionJ, >> 319 G4double ionMu ) 288 { 320 { 289 if (G4Threading::IsMasterThread()) { << 321 if ( G4Threading::IsMasterThread() ) 290 if (fUserDefinedList == nullptr) fUserDefi << 322 { >> 323 if ( fUserDefinedList == nullptr ) fUserDefinedList = new G4IsotopeList(); 291 324 292 auto fProperty = new G4IsotopeProperty(); << 325 G4IsotopeProperty* fProperty = new G4IsotopeProperty(); 293 326 294 // Set Isotope Property 327 // Set Isotope Property 295 fProperty->SetAtomicNumber(ionZ); 328 fProperty->SetAtomicNumber(ionZ); 296 fProperty->SetAtomicMass(ionA); 329 fProperty->SetAtomicMass(ionA); 297 fProperty->SetIsomerLevel(9); 330 fProperty->SetIsomerLevel(9); 298 fProperty->SetEnergy(ionE); 331 fProperty->SetEnergy(ionE); 299 fProperty->SetiSpin(ionJ); 332 fProperty->SetiSpin(ionJ); 300 fProperty->SetLifeTime(ionLife); 333 fProperty->SetLifeTime(ionLife); 301 fProperty->SetDecayTable(nullptr); 334 fProperty->SetDecayTable(nullptr); 302 fProperty->SetMagneticMoment(ionMu); 335 fProperty->SetMagneticMoment(ionMu); 303 fProperty->SetFloatLevelBase(flbIndex); 336 fProperty->SetFloatLevelBase(flbIndex); 304 337 305 fUserDefinedList->push_back(fProperty); 338 fUserDefinedList->push_back(fProperty); 306 fIsotopeList->push_back(fProperty); 339 fIsotopeList->push_back(fProperty); 307 } << 340 } 308 } 341 } 309 342 310 void G4NuclideTable::AddState(G4int ionZ, G4in << 343 // -------------------------------------------------------------------- 311 G4double ionLife << 344 void G4NuclideTable::AddState( G4int ionZ, G4int ionA, G4double ionE, >> 345 G4Ions::G4FloatLevelBase flb, G4double ionLife, >> 346 G4int ionJ, G4double ionMu ) 312 { 347 { 313 if (G4Threading::IsMasterThread()) { << 348 if ( G4Threading::IsMasterThread() ) 314 if (fUserDefinedList == nullptr) fUserDefi << 349 { >> 350 if ( fUserDefinedList == nullptr ) fUserDefinedList = new G4IsotopeList(); 315 351 316 auto fProperty = new G4IsotopeProperty(); << 352 G4IsotopeProperty* fProperty = new G4IsotopeProperty(); 317 353 318 // Set Isotope Property 354 // Set Isotope Property 319 fProperty->SetAtomicNumber(ionZ); 355 fProperty->SetAtomicNumber(ionZ); 320 fProperty->SetAtomicMass(ionA); 356 fProperty->SetAtomicMass(ionA); 321 fProperty->SetIsomerLevel(9); 357 fProperty->SetIsomerLevel(9); 322 fProperty->SetEnergy(ionE); 358 fProperty->SetEnergy(ionE); 323 fProperty->SetiSpin(ionJ); 359 fProperty->SetiSpin(ionJ); 324 fProperty->SetLifeTime(ionLife); 360 fProperty->SetLifeTime(ionLife); 325 fProperty->SetDecayTable(nullptr); << 361 fProperty->SetDecayTable(0); 326 fProperty->SetMagneticMoment(ionMu); 362 fProperty->SetMagneticMoment(ionMu); 327 fProperty->SetFloatLevelBase(flb); 363 fProperty->SetFloatLevelBase(flb); 328 364 329 fUserDefinedList->push_back(fProperty); 365 fUserDefinedList->push_back(fProperty); 330 fIsotopeList->push_back(fProperty); 366 fIsotopeList->push_back(fProperty); 331 } 367 } 332 } 368 } 333 369 334 void G4NuclideTable::SetThresholdOfHalfLife(G4 << 370 // -------------------------------------------------------------------- 335 { << 371 void G4NuclideTable::SetThresholdOfHalfLife(G4double t) { 336 if (G4Threading::IsMasterThread()) { << 372 if (G4Threading::IsMasterThread() ) { 337 mean_life_threshold = t / 0.69314718; << 373 mean_life_threshold = t/0.69314718; 338 GenerateNuclide(); 374 GenerateNuclide(); 339 } 375 } 340 } 376 } 341 377 342 // Set the mean life threshold for nuclides 378 // Set the mean life threshold for nuclides 343 // All nuclides with mean lives greater than t << 379 // All nuclides with mean lives greater than this value are created 344 // for this run << 380 // for this run 345 void G4NuclideTable::SetMeanLifeThreshold(G4do 381 void G4NuclideTable::SetMeanLifeThreshold(G4double t) 346 { 382 { 347 if (G4Threading::IsMasterThread()) { << 383 if (G4Threading::IsMasterThread() ) >> 384 { 348 mean_life_threshold = t; 385 mean_life_threshold = t; 349 GenerateNuclide(); 386 GenerateNuclide(); 350 } 387 } 351 } 388 } 352 389 >> 390 // -------------------------------------------------------------------- 353 G4double G4NuclideTable::StripFloatLevelBase(G 391 G4double G4NuclideTable::StripFloatLevelBase(G4double E, G4int& flbIndex) 354 { 392 { 355 G4double rem = std::fmod(E / (1.0E-3 * eV), << 393 G4double rem = std::fmod(E/(1.0E-3*eV),10.0); 356 flbIndex = G4int(rem); 394 flbIndex = G4int(rem); 357 return E - rem; << 395 return E-rem; 358 } 396 } 359 397 360 G4Ions::G4FloatLevelBase G4NuclideTable::Strip << 398 // -------------------------------------------------------------------- 361 { << 399 G4Ions::G4FloatLevelBase 362 if (sFLB.empty() || 2 < sFLB.size()) { << 400 G4NuclideTable::StripFloatLevelBase( const G4String& sFLB ) 363 G4String text; << 401 { 364 text += sFLB; << 402 if ( sFLB.size() < 1 || 2 < sFLB.size() ) 365 text += " is not valid indicator of G4Ions << 403 { 366 text += "You may use a wrong version of EN << 404 G4String text; 367 text += "Please use G4ENSDFSTATE-2.0 or la << 405 text += sFLB; 368 << 406 text += " is not valid indicator of G4Ions::G4FloatLevelBase.\n"; 369 G4Exception("G4NuclideTable", "PART70002", << 407 text += "You may use a wrong version of ENSDFSTATE data.\n"; 370 } << 408 text += "Please use G4ENSDFSTATE-2.0 or later."; 371 G4Ions::G4FloatLevelBase flb = noFloat; << 409 372 if (!(sFLB == "-")) { << 410 G4Exception( "G4NuclideTable", "PART70002", FatalException, text ); 373 flb = G4Ions::FloatLevelBase(sFLB.back()); << 411 } 374 } << 412 G4Ions::G4FloatLevelBase flb = noFloat; 375 return flb; << 413 if ( !(sFLB == "-") ) >> 414 { >> 415 flb = G4Ions::FloatLevelBase( sFLB.back() ); >> 416 } >> 417 return flb; 376 } 418 } 377 419