pyhf.compat.interpret_rootname#

pyhf.compat.interpret_rootname(rootname)[source]#

Interprets a ROOT-generated name as best as possible.

Possible properties of a ROOT parameter are:

  • "constrained": bool representing if parameter is a member of a constrained paramset.

  • "is_scalar": bool representing if parameter is a member of a scalar paramset.

  • "name": The name of the param set.

  • "element": The index in a non-scalar param set.

It is possible that some of the parameter names might not be determinable and will then hold the string value "n/a".

Parameters:

rootname (str) – The ROOT-generated name of the parameter.

Returns:

The interpreted key-value pairs.

Return type:

dict

Example

>>> import pyhf
>>> interpreted_name = pyhf.compat.interpret_rootname("gamma_foo_0")
>>> pyhf.compat.interpret_rootname("gamma_foo_0")
{'constrained': 'n/a', 'is_scalar': False, 'name': 'foo', 'element': 0}
>>> pyhf.compat.interpret_rootname("alpha_foo")
{'constrained': True, 'is_scalar': True, 'name': 'foo', 'element': 'n/a'}
>>> pyhf.compat.interpret_rootname("Lumi")
{'constrained': False, 'is_scalar': True, 'name': 'lumi', 'element': 'n/a'}