columnflow.categorization#

Event categorization tools.

Classes:

Categorizer(*args[, requires_func, ...])

Base class for all categorizers.

Functions:

categorizer([func, bases])

Decorator for creating a new Categorizer subclass with additional, optional bases and attaching the decorated function to it as call_func.

class Categorizer(*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: TaskArrayFunction

Base class for all categorizers.

Attributes:

exposed

Methods:

categorizer([func, bases])

Decorator for creating a new Categorizer subclass with additional, optional bases and attaching the decorated function to it as call_func.

exposed = True#
classmethod categorizer(func=None, bases=(), **kwargs)[source]#

Decorator for creating a new Categorizer subclass with additional, optional bases and attaching the decorated function to it as call_func.

All additional kwargs are added as class members of the new subclasses.

Parameters:
  • func (Callable | None, default: None) – Function to be wrapped and integrated into new Categorizer class.

  • bases (tuple, default: ()) – Additional base classes for new Categorizer.

Return type:

DerivableMeta | Callable

Returns:

The new Categorizer subclass.

categorizer(func=None, bases=(), **kwargs)#

Decorator for creating a new Categorizer subclass with additional, optional bases and attaching the decorated function to it as call_func.

All additional kwargs are added as class members of the new subclasses.

Parameters:
  • func (Callable | None, default: None) – Function to be wrapped and integrated into new Categorizer class.

  • bases (tuple, default: ()) – Additional base classes for new Categorizer.

Return type:

DerivableMeta | Callable

Returns:

The new Categorizer subclass.