58{
59 if ( !std::getenv("G4IONMAGNETICMOMENT")) {
60#ifdef G4VERBOSE
61 if (GetVerboseLevel()>1) {
62 G4cout <<
"G4IsotopeMagneticMomentTable::G4IsotopeMagneticMomentTable(): "
63 << "Please setenv G4IONMAGNETICMOMENT for the magnetic moment data."
66 "File Not Found",
68 "Please setenv G4IONMAGNETICMOMENT");
69 }
70#endif
72 "File Not Found",
74 "Please setenv G4IONMAGNETICMOMENT");
75 return;
76 }
77
78 G4String file = std::getenv(
"G4IONMAGNETICMOMENT");
79 std::ifstream DataFile(file);
80
81 if (!DataFile ) {
82#ifdef G4VERBOSE
83 if (GetVerboseLevel()>0) {
84 G4cout <<
"G4IsotopeMagneticMomentTable::G4IsotopeMagneticMomentTable(): "
85 << file <<
" is not found " <<
G4endl;
86 }
87#endif
89 "File Not Found",
91 "Can not open G4IONMAGNETICMOMENT file");
92 return;
93 }
94
95 char inputChars[80]={' '};
96
97 while ( !DataFile.eof() ) {
98 DataFile.getline(inputChars, 80);
100 G4int ionA, ionZ, ionJ, isomer;
103
104 if (inputChars[0] != '#' && inputLine.length() != 0) {
105 std::istringstream tmpstream(inputLine);
106 tmpstream >> ionZ >> ionName >> ionA
107 >> isomer >> ionE
108 >> ionLife >> ionLifeUnit
109 >> ionJ >> ionMu;
110
112
119
120 fIsotopeList.push_back(fProperty);
121
122
123
124
125
126 }
127 }
128
129 DataFile.close();
130}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void SetAtomicMass(G4int A)
void SetEnergy(G4double E)
void SetAtomicNumber(G4int Z)
void SetIsomerLevel(G4int level)
void SetMagneticMoment(G4double M)