80const G4double G4RIsotopeTable::levelTolerance = 2.0*keV;
88 theUserRadioactiveDataFiles.clear();
96 fIsotopeNameList.clear();
100G4int G4RIsotopeTable::GetVerboseLevel()
const
116 G4String fname = GetIsotopeName(Z, A, E);
118 for (
G4int i = 0 ; i< Entries(); i++) {
119 if(fIsotopeNameList[i] == fname) j = i;}
121 if (GetVerboseLevel()>1) {
122 G4cout <<
"G4RIsotopeTable::GetIsotope No. : ";
128 G4double meanlife = GetMeanLifeTime(Z, A, E);
147 fIsotopeList.push_back(fProperty);
148 fname = GetIsotopeName(Z, A, E);
149 fIsotopeNameList.push_back(fname);
150 if (GetVerboseLevel()>1) {
151 G4cout <<
"G4RIsotopeTable::GetIsotope create: ";
162 std::ostringstream os;
163 os.setf(std::ios::fixed);
164 os <<
"A"<< A <<
"Z" << Z <<
'[' << std::setprecision(1) << E/keV <<
']';
166 if (GetVerboseLevel()>1) {
167 G4cout <<
"G4RIsotopeTable::GetIsotope Name: ";
181 G4String file= theUserRadioactiveDataFiles[1000*A+Z];
183 if (!getenv(
"G4RADIOACTIVEDATA")) {
184 G4cout <<
"Please setenv G4RADIOACTIVEDATA to point to the radioactive decay data files." <<
G4endl;
186 "Please setenv G4RADIOACTIVEDATA to point to the radioactive decay data files.");
188 G4String dirName = getenv(
"G4RADIOACTIVEDATA");
190 std::ostringstream os;
191 os <<dirName <<
"/z" <<Z <<
".a" <<A ;
194 std::ifstream DecaySchemeFile(file);
196 G4bool found_in_raddecay_data(
false);
197 if (!DecaySchemeFile) {
198 if (GetVerboseLevel()>1) {
199 G4cout <<
"G4RIsotopeTable::GetMeanLife() : "
200 <<
"cannot find ion radioactive decay file: "
204 char inputChars[100]={
' '};
210 while (!found_in_raddecay_data && !DecaySchemeFile.getline(inputChars, 100).eof()) {
211 inputLine = inputChars;
212 inputLine = inputLine.
strip(1);
214 if (inputChars[0] !=
'#' && inputLine.length() != 0) {
215 std::istringstream tmpstream(inputLine);
216 tmpstream >> recordType >> a >> b;
217 if (recordType ==
"P") {
218 if (std::abs(a*keV-aE) < levelTolerance) {
219 found_in_raddecay_data =
true;
220 lifetime = b/0.693147*s ;
225 DecaySchemeFile.close();
228 if (!found_in_raddecay_data && aE) {
230 lifetime = 1.0E-20*s;
240 lifetime = half_life/0.693147;
243 if (GetVerboseLevel()>1 && half_life<0) {
244 G4cout <<
"G4RIsotopeTable::GetMeanLife() : ";
245 G4cout <<
"cannot find ion of required excitation E = " << aE <<
G4endl;
246 G4cout <<
"state in radioactive or photoevaporation data file " <<
G4endl;
247 G4cout <<
"The nucleus is assumed to be IT decayed with life = 1E-20 s" <<
G4endl;
248 G4cout <<
" -----------* THIS MAY CAUSE PROBLEM IN ITS DECAY-----------" <<
G4endl;
252 if (!found_in_raddecay_data && !aE) {
253 if (GetVerboseLevel()>1) {
254 G4cout <<
"G4RIsotopeTable::GetMeanLife() : ";
255 G4cout <<
"cannot find ion of required excitation E = " << aE <<
G4endl;
256 G4cout <<
"state in radioactive or photoevaporation data file" <<
G4endl;
257 G4cout <<
"The nucleus is assumed to be stable" <<
G4endl;
262 if (GetVerboseLevel()>1) {
263 G4cout <<
"G4RIsotopeTable::GetMeanLifeTime: ";
264 G4cout <<lifetime <<
" for " << GetIsotopeName(Z, A, aE) <<
G4endl;
275 std::ifstream DecaySchemeFile(filename);
276 if (DecaySchemeFile){
277 G4int ID_ion=A*1000+Z;
278 theUserRadioactiveDataFiles[ID_ion]=filename;
281 G4cout<<
"The file "<<filename<<
" does not exist!"<<
G4endl;
G4DLLIMPORT std::ostream G4cout
void SetAtomicMass(G4int A)
void SetDecayTable(G4DecayTable *table)
void SetEnergy(G4double E)
void SetAtomicNumber(G4int Z)
void SetLifeTime(G4double T)
const G4NuclearLevel * NearestLevel(G4double energy, G4double eDiffMax=9999.*CLHEP::GeV) const
G4NuclearLevelManager * GetManager(G4int Z, G4int A)
static G4NuclearLevelStore * GetInstance()
G4double HalfLife() const
G4int GetVerboseLevel() const
static G4ParticleTable * GetParticleTable()
virtual G4bool FindIsotope(G4IsotopeProperty *property)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E)
void AddUserDecayDataFile(G4int Z, G4int A, G4String filename)
virtual ~G4RIsotopeTable()
G4String strip(G4int strip_Type=trailing, char c=' ')