56{
57 if (std::getenv("G4IONMAGNETICMOMENT") == nullptr) {
58#ifdef G4VERBOSE
59 if (GetVerboseLevel() > 1) {
60 G4cout <<
"G4IsotopeMagneticMomentTable::G4IsotopeMagneticMomentTable(): "
61 <<
"Please setenv G4IONMAGNETICMOMENT for the magnetic moment data." <<
G4endl;
63 "Please setenv G4IONMAGNETICMOMENT");
64 }
65#endif
67 "Please setenv G4IONMAGNETICMOMENT");
68 return;
69 }
70
71 G4String file = std::getenv(
"G4IONMAGNETICMOMENT");
72 std::ifstream DataFile(file);
73
74 if (!DataFile) {
75#ifdef G4VERBOSE
76 if (GetVerboseLevel() > 0) {
77 G4cout <<
"G4IsotopeMagneticMomentTable::G4IsotopeMagneticMomentTable(): " << file
78 <<
" is not found " <<
G4endl;
79 }
80#endif
82 "Can not open G4IONMAGNETICMOMENT file");
83 return;
84 }
85
86 char inputChars[80] = {' '};
87
88 while (!DataFile.eof()) {
89 DataFile.getline(inputChars, 80);
91 G4int ionA, ionZ, ionJ, isomer;
94
95 if (inputChars[0] != '#' && inputLine.length() != 0) {
96 std::istringstream tmpstream(inputLine);
97 tmpstream >> ionZ >> ionName >> ionA >> isomer >> ionE >> ionLife >> ionLifeUnit >> ionJ
98 >> ionMu;
99
101
102 fProperty->SetAtomicNumber(ionZ);
103 fProperty->SetAtomicMass(ionA);
104 fProperty->SetIsomerLevel(isomer);
105 fProperty->SetEnergy(ionE * MeV);
106 fProperty->SetiSpin(ionJ);
107 fProperty->SetMagneticMoment(ionMu * nuclearMagneton);
108
109 fIsotopeList.push_back(fProperty);
110
111
112
113
114 }
115 }
116
117 DataFile.close();
118}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
G4VIsotopeTable()=default