|
def | __init__ (self) |
|
def | setBlockName (self, name) |
|
def | getBlockName (self) |
|
def | factoryName (self) |
|
def | setFactoryName (self, name) |
|
def | instanceName (self) |
|
def | isUsedForConfig (self, config) |
|
def | applyConfigOverrides (self, config) |
|
def | addDependency (self, dependencyName, required=True) |
|
def | hasDependencies (self) |
|
def | getDependencies (self) |
|
def | addOption (self, name, defaultValue, *type, info='', noneAction='ignore', required=False) |
|
def | setOptionValue (self, name, value) |
|
def | getOptionValue (self, name) |
|
def | getOptions (self) |
|
def | printOptions (self, verbose=False, width=60, indent=" ") |
|
def | hasOption (self, name) |
|
def | __eq__ (self, blockName) |
|
def | __str__ (self) |
|
def | get_instance_count (cls) |
|
def | __new__ (cls, name, bases, dct) |
|
the base class for classes implementing individual blocks of
configuration
A configuration block is a sequence of one or more algorithms that
should always be scheduled together, e.g. the muon four momentum
corrections could be a single block, muon selection could then be
another block. The blocks themselves generally have their own
configuration options/properties specific to the block, and will
perform a dynamic configuration based on those options as well as
the overall job.
The actual configuration of the algorithms in the block will
depend on what other blocks are scheduled before and afterwards,
most importantly some algorithms will introduce shallow copies
that subsequent algorithms will need to run on, and some
algorithms will add selection decorations that subquent algorithms
should use as preselections.
The algorithms get created in a multi-step process (that may be
extended in the future): As a first step each block retrieves
references to the containers it uses (essentially marking its spot
in the processing chain) and also registering any shallow copies
that will be made. In the second/last step each block then
creates the fully configured algorithms.
One goal is that when the algorithms get created they will have
their final configuration and there needs to be no
meta-configuration data attached to the algorithms, essentially an
inversion of the approach in AnaAlgSequence in which the
algorithms got created first with associated meta-configuration
and then get modified in susequent configuration steps.
For now this is mostly an empty base class, but another goal of
this approach is to make it easier to build another configuration
layer on top of this one, and this class will likely be extended
and get data members at that point.
The child class needs to implement the method `makeAlgs` which is
given a single `ConfigAccumulator` type argument. This is meant to
create the sequence of algorithms that this block configures. This
is currently (28 Jul 2025) called twice and should do the same thing
during both calls, but the plan is to change that to a single call.
The child class should also implement the method `getInstanceName`
which should return a string that is used to distinguish between
multiple instances of the same block. This is used to append the
instance name to the names of all algorithms created by this block,
and may in the future also be used to distinguish between multiple
instances of the block.
Definition at line 88 of file ConfigBlock.py.
def python.ConfigBlock.ConfigBlock.instanceName |
( |
|
self | ) |
|
Get the name of the instance
The name of the instance is used to distinguish between multiple
instances of the same block. Most importantly, this will be
appended to the names of all algorithms created by this block.
This defaults to an empty string, but block implementations
should override it with an appropriate name based on identifying
options set on this instance. A typical example would be the
name of the (main) container, plus potentially the selection or
working point.
Ideally all blocks should override this method, but for backward
compatibility (28 Jul 25) it defaults to an empty string.
Definition at line 229 of file ConfigBlock.py.
229 def instanceName(self):
230 """Get the name of the instance
232 The name of the instance is used to distinguish between multiple
233 instances of the same block. Most importantly, this will be
234 appended to the names of all algorithms created by this block.
235 This defaults to an empty string, but block implementations
236 should override it with an appropriate name based on identifying
237 options set on this instance. A typical example would be the
238 name of the (main) container, plus potentially the selection or
241 Ideally all blocks should override this method, but for backward
242 compatibility (28 Jul 25) it defaults to an empty string.