util
#
General producers that might be utilized in various places.
Data:
Information on behavior of certain collections to (re-)attach it via attach_coffea_behavior. |
Classes:
|
- 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:
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:
events (
Array
) – Array containing the eventscollections (
Union
[dict
,Sequence
,None
], default:None
) – Attach behavior for these collections. Ifdict
, thedefault_collections
are updated with the information in collections. Iflist
, only update this set of collections as specified in thedefault_collections
.
- Return type:
- Returns:
Array with correct behavior attached for collections
- data_only = False#
- mc_only = False#
- nominal_only = False#
- shifts_only = None#