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