@@ -468,6 +468,31 @@ DLL_EXPORT bool load_parameters_override(std::string path, Params_Override<T_rea
468468 fit_map->set_width_multi (factor);
469469 }
470470 }
471+ else if (tag == STR_CUSTOM_EL_REGION)
472+ {
473+ std::string element_symb;
474+ std::string energy_value;
475+ std::string width_value;
476+
477+ std::getline (strstream, element_symb, ' ,' );
478+ element_symb.erase (std::remove_if (element_symb.begin (), element_symb.end (), ::isspace), element_symb.end ());
479+
480+ T_real center = 1.0 ;
481+ std::getline (strstream, energy_value, ' ,' );
482+ center = parse_input_real<T_real>(energy_value);
483+
484+ T_real width_multi = 1.0 ;
485+ std::getline (strstream, width_value, ' ,' );
486+ width_multi = parse_input_real<T_real>(width_value);
487+
488+ Fit_Element_Map<T_real>* fit_map;
489+ if (params_override->elements_to_fit .count (element_symb) < 1 )
490+ {
491+
492+ fit_map = new Fit_Element_Map<T_real>(element_symb, center, width_multi);
493+ params_override->elements_to_fit [element_symb] = fit_map;
494+ }
495+ }
471496 else if (tag == " BRANCHING_FAMILY_ADJUSTMENT_L" || tag == " BRANCHING_RATIO_ADJUSTMENT_L" || tag == " BRANCHING_RATIO_ADJUSTMENT_K" || tag == " BRANCHING_RATIO_ADJUSTMENT_M" )
472497 {
473498 unsigned int cnt = 0 ;
@@ -954,12 +979,24 @@ DLL_EXPORT bool save_parameters_override(std::string path, Params_Override<T_rea
954979 for (const auto & itr : params_override->elements_to_fit )
955980 {
956981 // if not pileup
957- if (itr.second ->pileup_element () == nullptr && ( itr.first != " COHERENT_SCT_AMPLITUDE " || itr. first != " COMPTON_AMPLITUDE " ))
982+ if (itr.second ->pileup_element () == nullptr && itr.second -> has_element_info ( ))
958983 {
959984 out_stream << itr.first << " , " ;
960985 }
961986 }
962987 out_stream << " \n " ;
988+ for (const auto & itr : params_override->elements_to_fit )
989+ {
990+ // if not pileup
991+ if (itr.second ->pileup_element () == nullptr && false == itr.second ->has_element_info ())
992+ {
993+ if (itr.first == STR_COHERENT_SCT_AMPLITUDE || itr.first == STR_COMPTON_AMPLITUDE)
994+ {
995+ continue ;
996+ }
997+ out_stream << STR_CUSTOM_EL_REGION<<" : " << itr.first << " ," << itr.second ->center () << " ," << itr.second ->width_multi () << " \n " ;
998+ }
999+ }
9631000 out_stream << " list the element combinations you want to fit for pileup, e.g., Si_Si, Si_Si_Si, Si_Cl, etc\n " ;
9641001 out_stream << " ELEMENTS_WITH_PILEUP: " ;
9651002 for (const auto & itr : params_override->elements_to_fit )
0 commit comments