34 const char *_quadrupole_filename,
38 const char *_quadrupole_filename,
41 const char *_corrections_filename);
56 {
return fIncompatibleAlternativeMomentRows; }
59 struct level_candidate {
63 std::string spin_parity;
65 std::string lifetime_unit;
66 bool has_lifetime =
false;
73 std::string adopted_spin;
76 struct parsed_energy {
82 struct parsed_moment {
84 double uncertainty = 0.;
85 double uncertainty_low = 0.;
86 double uncertainty_high = 0.;
87 bool asymmetric =
false;
88 bool has_uncertainty =
false;
90 std::string source_fix;
91 std::string alternative;
92 bool alternative_incompatible =
false;
96 using nucleus_key = std::pair<int, int>;
98 tkdatabase *fDataBase =
nullptr;
99 bool fHasLevelTable =
false;
100 std::map<nucleus_key, int> fIsotopeIds;
101 std::map<nucleus_key, bool> fIsotopeStable;
102 std::map<nucleus_key, std::vector<level_candidate>> fAdoptedLevels;
103 std::map<int, std::string> fLevelSpins;
105 int fImportedGroundStates = 0;
106 int fImportedLevels = 0;
107 int fSkippedValues = 0;
108 int fUnmatchedLevels = 0;
110 int fLevelCandidateRows = 0;
111 int fPhysicallyForbidden = 0;
112 int fRelaxedLevelMatches = 0;
113 int fParityRelaxedMatches = 0;
114 int fRepairedSpinMatches = 0;
115 int fCorrectedSourceFields = 0;
116 int fAlternativeMomentRows = 0;
117 int fIncompatibleAlternativeMomentRows = 0;
120 bool clear_existing_moments(
int _only_charge,
int _only_mass)
const;
121 int import_file(
const char *_filename,
122 const std::string &_moment_column,
123 const std::string &_property_name,
124 const std::string &_unit,
127 const char *_corrections_filename);
129 static parsed_energy parse_energy(
const std::string &_text);
130 static parsed_moment parse_moment(
const std::string &_text);
131 static std::string normalize_spin(
const std::string &_text);
132 static bool spin_matches(
const std::string &_stone_spin,
133 const std::string &_ensdf_spin);
134 static bool static_moment_allowed(
const std::string &_property_name,
135 const std::string &_spin);
136 static bool lifetime_matches(
const std::string &_stone_lifetime,
137 const level_candidate &_candidate);
139 level_match find_level(
const nucleus_key &_nucleus,
140 const parsed_energy &_energy,
141 const std::string &_spin,
142 const std::string &_lifetime)
const;
143 bool update_measure(
const std::string &_table,
144 const std::string &_prefix,
145 const std::string &_id_column,
147 const parsed_moment &_moment,
148 const std::string &_unit,
149 const std::string &_provenance)
const;