order.analysis

Definition of the central analysis class.

Class Analysis

class Analysis(*args, **kwargs)

Bases: UniqueObject, AuxDataMixin, TagMixin

The analysis class which represents the central object of a physics analysis. Yet, it is quite lightweight as most information is contained in Config objects in the scope of a Campaign. In addition, it provides some convenience methods to directly access objects in deeper data structures.

Arguments

The configuration objects are initialized with configs. tags are forwarded to the TagMixin, aux to the AuxDataMixin, and name, id and context to the UniqueObject constructor.

Example

For usage examples, see the examples directory.

Members

configs
type: UniqueObjectIndex
read-only

The UniqueObjectIndex of child configs.

get_channels(config)

Returns the UniqueObjectIndex of channels that belong to a config that was previously added. Shorthand for get_config(config).channels.

get_categories(config)

Returns the UniqueObjectIndex of categories that belong to a config that was previously added. Shorthand for get_config(config).categories.

get_datasets(config)

Returns the UniqueObjectIndex of datasets that belong to a config that was previously added. Shorthand for get_config(config).datasets.

get_processes(config)

Returns the UniqueObjectIndex of processes that belong to a config that was previously added. Shorthand for get_config(config).processes.

get_variables(config)

Returns the UniqueObjectIndex of variables that belong to a config that was previously added. Shorthand for get_config(config).variables.

get_shifts(config)

Returns the UniqueObjectIndex of shifts that belong to a config that was previously added. Shorthand for get_config(config).shifts.

add_config(*args, **kwargs)

Adds a child config. See order.unique.UniqueObjectIndex.add() for more info. Also sets the analysis of the added config to this instance. Returns the added config object.

remove_config(*args, **kwargs)

Removes a child config. See order.unique.UniqueObjectIndex.remove() for more info. Also resets the analysis of the added config. Returns the removed config object.

clear_configs(context=None)

Removes all child configs from the configs index for context. When context is None, the default_context of the configs index is used.

extend_configs(objs, context=None)

Adds multiple child configs to the configs index for context and returns the added objects in a list. When context is None, the default_context of the configs index is used.

get_config(obj, default=no_default, context=None)

Returns a child config given by obj, which might be a name, id, or an instance from the configs index for context. When no config is found, default is returned when set. Otherwise, an error is raised. When context is None, the default_context of the configs index is used.

has_config(obj, context=None)

Checks if the configs index for context contains an obj which might be a name, id, or an instance. When context is None, the default_context of the configs index is used.

property has_configs

Returns True when this config has child configs, False otherwise.

property is_leaf_config

Returns True when this config has no child configs, False otherwise.