shapefactor_combined#
- class pyhf.modifiers.shapefactor.shapefactor_combined(modifiers, pdfconfig, builder_data, batch_size=None)[source]#
Bases:
object- __init__(modifiers, pdfconfig, builder_data, batch_size=None)[source]#
- Parameters:
modifiers (
listoftuple) – List of tuples of form(modifier, modifier_type).pdfconfig (
_ModelConfig) – Configuration for the model.builder_data (
dict) – Map of keys'modifier_type/modifier'to the channels and bins they are applied to.batch_size (
int) – The number of rows in the resulting tensor. IfNonedefaults to1.
Imagine a situation where we have 2 channels (
SR,CR), 3 samples (sig1,bkg1,bkg2), and 2shapefactormodifiers (coupled_shapefactor,uncoupled_shapefactor). Let’s say this is the set-up:SR(nbins=2) sig1 -> subscribes to normfactor bkg1 -> subscribes to coupled_shapefactor CR(nbins=3) bkg2 -> subscribes to coupled_shapefactor, uncoupled_shapefactor
The
coupled_shapefactorneeds to have 3 nuisance parameters to account for theCR, with 2 of them shared in theSR. Theuncoupled_shapefactorjust has 3 nuisance parameters.self._parindiceswill look like[0, 1, 2, 3, 4, 5, 6]
self._shapefactor_indiceswill look like[0, 1, 2, 3, 4, 5, 6] [[1,2,3],[4,5,6]] ^^^^^^^ = coupled_shapefactor ^^^^^^^ = uncoupled_shapefactor
with the 0th par-index corresponding to the
normfactor. Because theSRchannel has 2 bins, and theCRchannel has 3 bins (withSRbeforeCR),global_concatenated_bin_indiceslooks like[0, 1, 0, 1, 2] ^^^^^ = SR channel ^^^^^^^^^ = CR channel
So now we need to gather the corresponding
shapefactorindices according toglobal_concatenated_bin_indices. Thereforeself._shapefactor_indicesnow looks like[[1, 2, 1, 2, 3], [4, 5, 4, 5, 6]]
and at that point can be used to compute the effect of
shapefactor.
Attributes
- name = 'shapefactor'#
- op_code = 'multiplication'#
Methods