order.analysis
Contents
order.analysis#
Definition of the central analysis class.
Contents
Class Analysis#
- class Analysis(*args, **kwargs)[source]#
Bases:
order.unique.UniqueObject
,order.mixins.AuxDataMixin
,order.mixins.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 aCampaign
. 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 theAuxDataMixin
, and name and id to theUniqueObject
constructor.Example
For usage examples, see the examples directory.
Members
- configs#
type:
UniqueObjectIndex
(read-only)The
UniqueObjectIndex
of child configs.
Methods:
get_channels
(config)Returns the
UniqueObjectIndex
of channels that belong to a config that was previously added.get_categories
(config)Returns the
UniqueObjectIndex
of categories that belong to a config that was previously added.get_datasets
(config)Returns the
UniqueObjectIndex
of datasets that belong to a config that was previously added.get_processes
(config)Returns the
UniqueObjectIndex
of processes that belong to a config that was previously added.get_variables
(config)Returns the
UniqueObjectIndex
of variables that belong to a config that was previously added.get_shifts
(config)Returns the
UniqueObjectIndex
of shifts that belong to a config that was previously added.add_config
(*args, **kwargs)Adds a child config to the
configs
index and returns it.remove_config
(*args, **kwargs)Removes a child config from the
configs
index and returns the removed object.Removes all child configs from the
configs
index.extend_configs
(objs)Adds multiple child configs to the
configs
index and returns the added objects in a list.get_config
(obj[, default])Returns a child config given by obj, which might be a name, id, or an instance from the
configs
index.has_config
(obj)Checks if the
configs
index contains an obj which might be a name, id, or an instance.Attributes:
Returns True when this config has child configs, False otherwise.
Returns True when this config has no child configs, False otherwise.
- get_channels(config)[source]#
Returns the
UniqueObjectIndex
of channels that belong to a config that was previously added. Shorthand forget_config(config).channels
.
- get_categories(config)[source]#
Returns the
UniqueObjectIndex
of categories that belong to a config that was previously added. Shorthand forget_config(config).categories
.
- get_datasets(config)[source]#
Returns the
UniqueObjectIndex
of datasets that belong to a config that was previously added. Shorthand forget_config(config).datasets
.
- get_processes(config)[source]#
Returns the
UniqueObjectIndex
of processes that belong to a config that was previously added. Shorthand forget_config(config).processes
.
- get_variables(config)[source]#
Returns the
UniqueObjectIndex
of variables that belong to a config that was previously added. Shorthand forget_config(config).variables
.
- get_shifts(config)[source]#
Returns the
UniqueObjectIndex
of shifts that belong to a config that was previously added. Shorthand forget_config(config).shifts
.
- add_config(*args, **kwargs)[source]#
Adds a child config to the
configs
index and returns it. Seeorder.unique.UniqueObjectIndex.add()
for more info. Also sets the analysis of the added config to this instance.
- remove_config(*args, **kwargs)[source]#
Removes a child config from the
configs
index and returns the removed object. Seeorder.unique.UniqueObjectIndex.remove()
for more info. Also resets the analysis of the removed config.
- extend_configs(objs)#
Adds multiple child configs to the
configs
index and returns the added objects in a list.
- get_config(obj, default=no_default)#
Returns a child config given by obj, which might be a name, id, or an instance from the
configs
index. When no config is found, default is returned when set. Otherwise, an error is raised.
- has_config(obj)#
Checks if the
configs
index contains an obj which might be a name, id, or an instance.
- 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.