columnflow.calibration#

Object and event calibration tools.

Classes:

TaskArrayFunctionWithCalibratorRequirements(...)

Calibrator(*args, **kwargs)

Base class for all calibrators.

Functions:

calibrator([func, bases, mc_only, ...])

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

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

Bases: TaskArrayFunction

Attributes:

Methods:

requires_func(task, reqs, **kwargs)

Default requires function.

setup_func(task, reqs, inputs, ...)

Default setup function.

require_calibrators: Sequence[str] | set[str] | None = None#
requires_func(task, reqs, **kwargs)[source]#

Default requires function.

Return type:

None

setup_func(task, reqs, inputs, reader_targets, **kwargs)[source]#

Default setup function.

Return type:

None

cache_instances = True#
class Calibrator(*args, **kwargs)[source]#

Bases: TaskArrayFunctionWithCalibratorRequirements

Base class for all calibrators.

Attributes:

Methods:

calibrator([func, bases, mc_only, ...])

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

exposed = True#
mc_only: bool = False#
data_only: bool = False#
classmethod calibrator(func=None, bases=(), mc_only=<object object>, data_only=<object object>, require_calibrators=<object object>, **kwargs)[source]#

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

When mc_only (data_only) is True, the calibrator is skipped and not considered by other calibrators, selectors and producers in case they are evalauted on a order.Dataset (using the dataset_inst attribute) whose is_mc (is_data) attribute is False.

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 Calibrator class.

  • bases (tuple, default: ()) – Additional bases for the new Calibrator.

  • mc_only (bool | UNSET_TYPE, default: <object object at 0x7d22b4d86760>) – Boolean flag indicating that this Calibrator should only run on Monte Carlo simulation and skipped for real data.

  • data_only (bool | UNSET_TYPE, default: <object object at 0x7d22b4d86760>) – Boolean flag indicating that this Calibrator should only run on real data and skipped for Monte Carlo simulation.

  • require_calibrators (Sequence[str] | set[str] | None | UNSET_TYPE, default: <object object at 0x7d22b4d86760>) – Sequence of names of other calibrators to add to the requirements.

Return type:

DerivableMeta | Callable

Returns:

New Calibrator subclass.

cache_instances = True#
calibrator(func=None, bases=(), mc_only=<object object>, data_only=<object object>, require_calibrators=<object object>, **kwargs)#

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

When mc_only (data_only) is True, the calibrator is skipped and not considered by other calibrators, selectors and producers in case they are evalauted on a order.Dataset (using the dataset_inst attribute) whose is_mc (is_data) attribute is False.

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 Calibrator class.

  • bases (tuple, default: ()) – Additional bases for the new Calibrator.

  • mc_only (bool | UNSET_TYPE, default: <object object at 0x7d22b4d86760>) – Boolean flag indicating that this Calibrator should only run on Monte Carlo simulation and skipped for real data.

  • data_only (bool | UNSET_TYPE, default: <object object at 0x7d22b4d86760>) – Boolean flag indicating that this Calibrator should only run on real data and skipped for Monte Carlo simulation.

  • require_calibrators (Sequence[str] | set[str] | None | UNSET_TYPE, default: <object object at 0x7d22b4d86760>) – Sequence of names of other calibrators to add to the requirements.

Return type:

DerivableMeta | Callable

Returns:

New Calibrator subclass.