49const G4double G4IsotopeMagneticMomentTable::levelTolerance = 2.0 * keV;
52const G4double G4IsotopeMagneticMomentTable::nuclearMagneton =
53 eplus * hbar_Planck / 2. / (proton_mass_c2 / c_squared);
57 if (std::getenv(
"G4IONMAGNETICMOMENT") ==
nullptr) {
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);
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);
122 for (
const auto& i : fIsotopeList) {
125 fIsotopeList.clear();
141 for (
const auto fP : fIsotopeList) {
165 if (std::fabs(fP->GetEnergy() - pP->
GetEnergy()) < levelTolerance) {
177 for (
const auto fP : fIsotopeList) {
179 if (fP->GetAtomicNumber() > Z) {
183 if (fP->GetAtomicNumber() < Z) {
189 if (fP->GetAtomicMass() !=
A) {
195 if (std::fabs(fP->GetEnergy() - E) < levelTolerance) {
209 for (
const auto fP : fIsotopeList) {
211 if (fP->GetAtomicNumber() > Z) {
215 if (fP->GetAtomicNumber() < Z) {
220 if (fP->GetAtomicMass() !=
A) {
226 if (fP->GetIsomerLevel() == lvl) {
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
~G4IsotopeMagneticMomentTable() override
G4IsotopeMagneticMomentTable()
virtual G4bool FindIsotope(G4IsotopeProperty *property)
G4IsotopeMagneticMomentTable & operator=(const G4IsotopeMagneticMomentTable &right)
G4IsotopeProperty * GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0) override
G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float) override
G4double GetEnergy() const
G4int GetAtomicMass() const
G4int GetAtomicNumber() const
G4int GetIsomerLevel() const
G4VIsotopeTable()=default
G4int GetVerboseLevel() const