Some Bugs and their (probably temporary) solution
Hi Albert,
I am using your framework to generate toys and fit them. In the following I report some of the problems I encountered and the solutions that were found to make everything work.
From analysis-tools/analysis/fit/result.py
:
- In L.216 add
.items()
---> pandas_dictConst = {param_name: val for param_name, val in self._result['const-parameters'].items()
} - In L.217 use
'MIGRAD'
instead of'MINIMIZE'
---> pandas_dict['status_migrad'] = self._result['status'].get('MIGRAD'
,-1) - In LL.213-217 the
pandas_dict
is overwritten instead of updated:
pandas_dict = {param_name + suffix: val
for param_name, param in self._result['fit-parameters'].items()
for val, suffix in zip(param, _SUFFIXES)}
pandas_dict = {param_name: val for param_name, val in self._result['const-parameters']}
A possible solution is to use the following:
import itertools
pandas_dictFit = {param_name + suffix: val
for param_name, param in self._result['fit-parameters'].items()
for val, suffix in zip(param, _SUFFIXES)}
# !!! Added .items(), check if we need to add the suffix part too as above.
pandas_dictConst = {param_name: val for param_name, val in self._result['const-parameters'].items()}
pandas_dict = dict(itertools.chain(pandas_dictFit.items(), pandas_dictConst.items()))
I have noticed also a small mismatch in notation (even though it might be on purpose):
while for the normal fits the categories are selected using the Mode
column, fitting the toys they are selected using the column categories
.
Keeping the same name could improve the versatility of the configuration files for the fit, allowing to use almost the same one for the fit of the data and the toys.