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 (
list
oftuple
) – 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. IfNone
defaults to1
.
Imagine a situation where we have 2 channels (
SR
,CR
), 3 samples (sig1
,bkg1
,bkg2
), and 2shapefactor
modifiers (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_shapefactor
needs to have 3 nuisance parameters to account for theCR
, with 2 of them shared in theSR
. Theuncoupled_shapefactor
just has 3 nuisance parameters.self._parindices
will look like[0, 1, 2, 3, 4, 5, 6]
self._shapefactor_indices
will 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 theSR
channel has 2 bins, and theCR
channel has 3 bins (withSR
beforeCR
),global_concatenated_bin_indices
looks like[0, 1, 0, 1, 2] ^^^^^ = SR channel ^^^^^^^^^ = CR channel
So now we need to gather the corresponding
shapefactor
indices according toglobal_concatenated_bin_indices
. Thereforeself._shapefactor_indices
now 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