normalization#
Column production methods related to sample normalization event weights.
Functions:
|
Helper function to obtain the inclusive dataset from a list of datasets that are required to stitch this dataset_inst. |
|
Helper function to obtain all datasets that are required to stitch this dataset_inst. |
|
Helper function to compute the branching ratios from the inclusive sample. |
Classes:
|
|
|
|
- get_inclusive_dataset(self)[source]#
Helper function to obtain the inclusive dataset from a list of datasets that are required to stitch this dataset_inst.
- Return type:
- get_stitching_datasets(self)[source]#
Helper function to obtain all datasets that are required to stitch this dataset_inst.
- get_br_from_inclusive_dataset(self, inclusive_dataset, stats)[source]#
Helper function to compute the branching ratios from the inclusive sample. This is done with ratios of event weights isolated per dataset and thus independent of the overall mc weight normalization.
- class normalization_weights(*args, **kwargs)[source]#
Bases:
ProducerAttributes:
Methods:
call_func(events, **kwargs)Uses luminosity information of internal py:attr:config_inst, the cross section of a process obtained through
category_idsand the sum of event weights from the py:attr:selection_stats attribute to assign each event a normalization weight.Helper function to compute the branching ratios from the inclusive sample.
Helper function to obtain the inclusive dataset from a list of datasets that are required to stitch this dataset_inst.
Helper function to obtain all datasets that are required to stitch this dataset_inst.
init_func(**kwargs)Initializes the normalization weights producer by setting up the normalization weight column.
requires_func(task, reqs, **kwargs)Adds the requirements needed by the underlying py:attr:task to access selection stats into reqs.
setup_func(task, reqs, inputs, ...)Sets up objects required by the computation of normalization weights and stores them as instance attributes: :rtype:
Noneskip_func(**kwargs)update_cls_dict(cls_name, cls_dict, get_attr)- allow_stitching = False#
- cache_instances = True#
- call_func(events, **kwargs)#
Uses luminosity information of internal py:attr:config_inst, the cross section of a process obtained through
category_idsand the sum of event weights from the py:attr:selection_stats attribute to assign each event a normalization weight. The normalization weight is stored in a new column named after the py:attr:weight_name attribute.The computation of all weights requires that the selection statistics (“stats” output of
SelectEvents) contains a field"sum_mc_weight_per_process"which itself is a dictionary mapping process ids to the sum of event weights for that process.luminosity is used to scale the yield of the simulation. When None, the
luminosityauxiliary field of the config is used.When py:attr`allow_stitching` is set to True, the sum of event weights is computed for all datasets with a leaf process contained in the leaf processes of the py:attr:dataset_inst. For stitching, the process_id needs to be reconstructed for each leaf process on a per event basis. Moreover, when stitching is enabled, an additional normalization weight is computed for the inclusive dataset only and stored in a column named <weight_name>_inclusive_only. This weight resembles the normalization weight for the inclusive dataset, as if it were unstitched and should therefore only be applied, when using the inclusive dataset as a standalone dataset.
- Return type:
- data_only = False#
- get_br_from_inclusive_dataset(inclusive_dataset, stats)#
Helper function to compute the branching ratios from the inclusive sample. This is done with ratios of event weights isolated per dataset and thus independent of the overall mc weight normalization.
- get_inclusive_dataset()#
Helper function to obtain the inclusive dataset from a list of datasets that are required to stitch this dataset_inst.
- Return type:
- get_stitching_datasets()#
Helper function to obtain all datasets that are required to stitch this dataset_inst.
- get_xsecs_from_inclusive_dataset = False#
- init_func(**kwargs)#
Initializes the normalization weights producer by setting up the normalization weight column.
- Return type:
- luminosity = None#
- mc_only = True#
- requires_func(task, reqs, **kwargs)#
Adds the requirements needed by the underlying py:attr:task to access selection stats into reqs.
- Return type:
- setup_func(task, reqs, inputs, reader_targets, **kwargs)#
Sets up objects required by the computation of normalization weights and stores them as instance attributes: :rtype:
None- py: attr: process_weight_table: A sparse array serving as a lookup table for the calculated process weights.
This weight is defined as the product of the luminosity, the cross section, divided by the sum of event weights per process.
- static update_cls_dict(cls_name, cls_dict, get_attr)#
- uses = {'mc_weight', 'process_id'}#
- weight_name = 'normalization_weight'#