Skip to content

Commit 32c7756

Browse files
author
Arthur Glowacki
committed
Fixed issue where reseting branching ratio's would not save properly
1 parent 036e30b commit 32c7756

1 file changed

Lines changed: 30 additions & 29 deletions

File tree

src/io/file/aps/aps_fit_params_import.h

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -997,35 +997,7 @@ DLL_EXPORT bool save_parameters_override(std::string path, Params_Override<T_rea
997997
out_stream << " minimum energy value [keV]\n";
998998
out_stream << "MIN_ENERGY_TO_FIT: " << params_override->fit_params.at(STR_MIN_ENERGY_TO_FIT).value << "\n";
999999

1000-
1001-
for (const auto& itr : params_override->elements_to_fit)
1002-
{
1003-
for (float ratio : itr.second->energy_ratio_multipliers())
1004-
{
1005-
if (ratio != 1.0)
1006-
{
1007-
branching_ratios_updated.push_back(itr.first + ",");
1008-
if (itr.second->shell_type() == data_struct::Electron_Shell::K_SHELL)
1009-
{
1010-
out_stream << "BRANCHING_RATIO_ADJUSTMENT_K: " << itr.first;
1011-
}
1012-
else if (itr.second->shell_type() == data_struct::Electron_Shell::L_SHELL)
1013-
{
1014-
out_stream << "BRANCHING_RATIO_ADJUSTMENT_L: " << itr.first;
1015-
}
1016-
else if (itr.second->shell_type() == data_struct::Electron_Shell::M_SHELL)
1017-
{
1018-
out_stream << "BRANCHING_RATIO_ADJUSTMENT_M: " << itr.first;
1019-
}
1020-
for (float r : itr.second->energy_ratio_multipliers())
1021-
{
1022-
out_stream << "," << r;
1023-
}
1024-
out_stream << "\n";
1025-
break;
1026-
}
1027-
}
1028-
}
1000+
/*
10291001
// we still need these to be saved if not included above
10301002
out_stream << " this allows manual adjustment of the branhcing ratios between the different lines of L1, L2, and L3.\n";
10311003
out_stream << " note, the numbers that are put in should be RELATIVE modifications, i.e., a 1 will correspond to exactly the literature value,\n";
@@ -1109,6 +1081,35 @@ DLL_EXPORT bool save_parameters_override(std::string path, Params_Override<T_rea
11091081
out_stream << itr << "\n";
11101082
}
11111083
}
1084+
*/
1085+
for (const auto& itr : params_override->elements_to_fit)
1086+
{
1087+
for (T_real ratio : itr.second->energy_ratio_multipliers())
1088+
{
1089+
if (ratio != 1.0)
1090+
{
1091+
branching_ratios_updated.push_back(itr.first + ",");
1092+
if (itr.second->shell_type() == data_struct::Electron_Shell::K_SHELL)
1093+
{
1094+
out_stream << "BRANCHING_RATIO_ADJUSTMENT_K: " << itr.first;
1095+
}
1096+
else if (itr.second->shell_type() == data_struct::Electron_Shell::L_SHELL)
1097+
{
1098+
out_stream << "BRANCHING_RATIO_ADJUSTMENT_L: " << itr.first;
1099+
}
1100+
else if (itr.second->shell_type() == data_struct::Electron_Shell::M_SHELL)
1101+
{
1102+
out_stream << "BRANCHING_RATIO_ADJUSTMENT_M: " << itr.first;
1103+
}
1104+
for (T_real r : itr.second->energy_ratio_multipliers())
1105+
{
1106+
out_stream << "," << r;
1107+
}
1108+
out_stream << "\n";
1109+
break;
1110+
}
1111+
}
1112+
}
11121113

11131114
out_stream << " the parameter adds the escape peaks (offset) to the fit if larger than 0. You should not enable Si and Ge at the same time, ie, one of these two values should be zero\n";
11141115
if (params_override->fit_params.contains(STR_SI_ESCAPE) && params_override->fit_params.value(STR_SI_ESCAPE) > 0.0)

0 commit comments

Comments
 (0)