columnflow.production

columnflow.production#

Tools for producing new array columns (e.g. high-level variables).

Classes:

Producer(*args[, requires_func, setup_func, ...])

Base class for all producers.

Functions:

producer([func, bases, mc_only, data_only, ...])

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

class Producer(*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 producers.

Attributes:

exposed

Methods:

producer([func, bases, mc_only, data_only, ...])

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

exposed = True#
classmethod producer(func=None, bases=(), mc_only=False, data_only=False, nominal_only=False, shifts_only=None, **kwargs)[source]#

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

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

When nominal_only is True or shifts_only is set, the producer is skipped and not considered by other calibrators, selectors and producers in case they are evaluated on a order.Shift (using the global_shift_inst attribute) whose name does not match.

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

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

  • mc_only (bool, default: False) – Boolean flag indicating that this Producer should only run on Monte Carlo simulation and skipped for real data.

  • data_only (bool, default: False) – Boolean flag indicating that this Producer should only run on real data and skipped for Monte Carlo simulation.

  • nominal_only (bool, default: False) – Boolean flag indicating that this Producer should only run on the nominal shift and skipped on any other shifts.

  • shifts_only (Sequence[str] | set[str] | None, default: None) – Shift names that this Producer should only run on, skipping all other shifts.

Return type:

DerivableMeta | Callable

Returns:

New Producer subclass.

producer(func=None, bases=(), mc_only=False, data_only=False, nominal_only=False, shifts_only=None, **kwargs)#

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

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

When nominal_only is True or shifts_only is set, the producer is skipped and not considered by other calibrators, selectors and producers in case they are evaluated on a order.Shift (using the global_shift_inst attribute) whose name does not match.

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

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

  • mc_only (bool, default: False) – Boolean flag indicating that this Producer should only run on Monte Carlo simulation and skipped for real data.

  • data_only (bool, default: False) – Boolean flag indicating that this Producer should only run on real data and skipped for Monte Carlo simulation.

  • nominal_only (bool, default: False) – Boolean flag indicating that this Producer should only run on the nominal shift and skipped on any other shifts.

  • shifts_only (Sequence[str] | set[str] | None, default: None) – Shift names that this Producer should only run on, skipping all other shifts.

Return type:

DerivableMeta | Callable

Returns:

New Producer subclass.