Skip to content

Commit

Permalink
add efficiecnies back to source shape parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
hammannr committed Oct 11, 2024
1 parent 98a9a2b commit 7a5d797
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions blueice/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,17 @@ def __init__(self, pdf_base_config, likelihood_config=None, **kwargs):
def source_shape_parameters(self):
"""Dict of sources with shape parameters. source name -> dict of shape parameters."""
source_shape_parameters = OrderedDict()
for sn, source in zip(self.source_name_list, self.base_model.sources):
dont_hash_settings = source.config['dont_hash_settings']
shape_parameters = OrderedDict({k: v for k, v in self.shape_parameters.items() if k not in dont_hash_settings})
for sn, source, apply_eff, eff_name in zip(
self.source_name_list,
self.base_model.sources,
self.source_apply_efficiency,
self.source_efficiency_names
):
ignore_parameters = source.config['dont_hash_settings']
# The efficiecny parameter doesn't need to be hashed but it needs to be passed to the morpher
if apply_eff:
ignore_parameters.pop(eff_name, None)
shape_parameters = OrderedDict({k: v for k, v in self.shape_parameters.items() if k not in ignore_parameters})
if shape_parameters:
source_shape_parameters[sn] = shape_parameters
return source_shape_parameters
Expand Down

0 comments on commit 7a5d797

Please sign in to comment.