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.TagMixinThe analysis class which represents the central object of a physics analysis. Yet, it is quite lightweight as most information is contained in
Configobjects 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 theUniqueObjectconstructor.Example
For usage examples, see the examples directory.
Members
- configs#
type:
UniqueObjectIndex(read-only)The
UniqueObjectIndexof child configs.
Methods:
get_channels(config)Returns the
UniqueObjectIndexof channels that belong to a config that was previously added.get_categories(config)Returns the
UniqueObjectIndexof categories that belong to a config that was previously added.get_datasets(config)Returns the
UniqueObjectIndexof datasets that belong to a config that was previously added.get_processes(config)Returns the
UniqueObjectIndexof processes that belong to a config that was previously added.get_variables(config)Returns the
UniqueObjectIndexof variables that belong to a config that was previously added.get_shifts(config)Returns the
UniqueObjectIndexof shifts that belong to a config that was previously added.add_config(*args, **kwargs)Adds a child config to the
configsindex and returns it.remove_config(*args, **kwargs)Removes a child config from the
configsindex and returns the removed object.Removes all child configs from the
configsindex.extend_configs(objs)Adds multiple child configs to the
configsindex 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
configsindex.has_config(obj)Checks if the
configsindex 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
UniqueObjectIndexof channels that belong to a config that was previously added. Shorthand forget_config(config).channels.
- get_categories(config)[source]#
Returns the
UniqueObjectIndexof categories that belong to a config that was previously added. Shorthand forget_config(config).categories.
- get_datasets(config)[source]#
Returns the
UniqueObjectIndexof datasets that belong to a config that was previously added. Shorthand forget_config(config).datasets.
- get_processes(config)[source]#
Returns the
UniqueObjectIndexof processes that belong to a config that was previously added. Shorthand forget_config(config).processes.
- get_variables(config)[source]#
Returns the
UniqueObjectIndexof variables that belong to a config that was previously added. Shorthand forget_config(config).variables.
- get_shifts(config)[source]#
Returns the
UniqueObjectIndexof 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
configsindex 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
configsindex 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
configsindex 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
configsindex. When no config is found, default is returned when set. Otherwise, an error is raised.
- has_config(obj)#
Checks if the
configsindex 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.