matching#

Distance-based methods.

Functions:

cleaning_factory(selector_name, to_clean, ...)

Factory to generate a function with name selector_name that cleans the field to_clean in an array following the NanoAODSchema against the field(s) clean_against.

Classes:

delta_r_jet_lepton

alias of func

jet_lepton_delta_r_cleaning(*args, **kwargs)

cleaning_factory(selector_name, to_clean, clean_against, metric=None)[source]#

Factory to generate a function with name selector_name that cleans the field to_clean in an array following the NanoAODSchema against the field(s) clean_against. First, the necessary column names to construct four-momenta for the different object fields are constructed, i.e. pt, eta, phi and e for the different objects. Finally, the actual selector function is generated, which uses these columns.

Parameters:
  • selector_name (str) – Name of the Selector class to be initialized.

  • to_clean (str) – Name of the field to be cleaned (e.g. "Jet").

  • clean_against (list[str]) – Names of the fields of object to clean field to_clean against (e.g. ["Muon"]).

  • metric (Optional[Callable], default: None) – Function to use for the cleaning. If None, use delta_r().

Return type:

Selector

Returns:

Instance of Selector.

delta_r_jet_lepton#

alias of func Methods:

call_func(events, to_clean, clean_against[, ...])

Abstract function to perform a cleaning of field to_clean against a (list of) field(s) clean_against based on an abitrary metric metric (e.g.

Attributes:

data_only

mc_only

name

nominal_only

shifts_only

uses

class jet_lepton_delta_r_cleaning(*args, **kwargs)[source]#

Bases: Selector

Methods:

call_func(events, stats[, threshold])

Function to apply the selection requirements necessary for a cleaning of jets against leptons.

Attributes:

data_only

mc_only

nominal_only

shifts_only

uses

call_func(events, stats, threshold=0.4, **kwargs)#

Function to apply the selection requirements necessary for a cleaning of jets against leptons.

The function calls the requirements to clean the field Jet against the concatination of the fields [Muon, Electron], i.e. all leptons and passes the desired threshold for the selection

Parameters:
  • events (Array) – Array containing events in the NanoAOD format

  • stats (dict[str, Union[int, float]]) – dictionary containing selection stats (not used here).

  • threshold (float, default: 0.4) – Threshold value for decision which objects to keep and which to reject.

Return type:

tuple[Array, SelectionResult]

Returns:

Tuple containing the events array and a SelectionResult with indices of cleaned jets in the “Jet” object field.

data_only = False#
mc_only = False#
nominal_only = False#
shifts_only = None#
uses = {<class 'columnflow.selection.matching.func'>}#