util#

General producers that might be utilized in various places.

Data:

default_collections

Information on behavior of certain collections to (re-)attach it via attach_coffea_behavior.

Classes:

attach_coffea_behavior(*args[, ...])

default_collections = {'Electron': {'check_attr': 'metric_table', 'skip_fields': '*Idx*G', 'type_name': 'Electron'}, 'FatJet': {'check_attr': 'metric_table', 'skip_fields': '*Idx*G', 'type_name': 'FatJet'}, 'Jet': {'check_attr': 'metric_table', 'skip_fields': '*Idx*G', 'type_name': 'Jet'}, 'Muon': {'check_attr': 'metric_table', 'skip_fields': '*Idx*G', 'type_name': 'Muon'}, 'SubJet': {'check_attr': 'metric_table', 'skip_fields': '*Idx*G', 'type_name': 'Jet'}, 'Tau': {'check_attr': 'metric_table', 'skip_fields': '*Idx*G', 'type_name': 'Tau'}}#

Information on behavior of certain collections to (re-)attach it via attach_coffea_behavior.

class attach_coffea_behavior(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)[source]#

Bases: Producer

Attributes:

call_force

data_only

mc_only

nominal_only

shifts_only

Methods:

call_func(events[, collections])

Add coffea's NanoEvents behavior to collections.

call_force = True#
call_func(events, collections=None, **kwargs)#

Add coffea’s NanoEvents behavior to collections.

This might become relevant in case some of the collections have been invalidated in a potential previous step. All information on source collection names, coffea - Columnar Object Framework For Effective Analysis type names, attributes to check whether the correct behavior is already attached, and fields to potentially skip is taken from default_collections.

However, this information is updated by collections when it is a dict. In case it is a list, its items are interpreted as names of collections defined as keys in default_collections for which the behavior should be attached.

Parameters:
Return type:

Array

Returns:

Array with correct behavior attached for collections

data_only = False#
mc_only = False#
nominal_only = False#
shifts_only = None#