57 if (std::getenv(
"G4IONMAGNETICMOMENT") ==
nullptr) {
59 if (GetVerboseLevel() > 1) {
60 G4cout <<
"G4IsotopeMagneticMomentTable::G4IsotopeMagneticMomentTable(): "
61 <<
"Please setenv G4IONMAGNETICMOMENT for the magnetic moment data." <<
G4endl;
63 "Please setenv G4IONMAGNETICMOMENT");
67 "Please setenv G4IONMAGNETICMOMENT");
71 G4String file = std::getenv(
"G4IONMAGNETICMOMENT");
72 std::ifstream DataFile(file);
76 if (GetVerboseLevel() > 0) {
77 G4cout <<
"G4IsotopeMagneticMomentTable::G4IsotopeMagneticMomentTable(): " << file
78 <<
" is not found " <<
G4endl;
82 "Can not open G4IONMAGNETICMOMENT file");
86 char inputChars[80] = {
' '};
88 while (!DataFile.eof()) {
89 DataFile.getline(inputChars, 80);
91 G4int ionA, ionZ, ionJ, isomer;
95 if (inputChars[0] !=
'#' && inputLine.length() != 0) {
96 std::istringstream tmpstream(inputLine);
97 tmpstream >> ionZ >> ionName >> ionA >> isomer >> ionE >> ionLife >> ionLifeUnit >> ionJ
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);
109 fIsotopeList.push_back(fProperty);