![]() |
ATLAS Offline Software
|
Public Member Functions | |
| __init__ (self, typeAndName, **kwargs) | |
| getName (self) | |
| getType (self) | |
| addSelfToJob (self, job) | |
| __getattr__ (self, name) | |
| __setattr__ (self, key, value) | |
| __eq__ (self, other) | |
| __str__ (self) | |
| addPrivateTool (self, name, type) | |
| addPrivateToolInArray (self, name, type) | |
Static Public Attributes | |
| int | printHeaderWidth = 80 |
| int | printHeaderPre = 3 |
Static Protected Member Functions | |
| _printHeader (title) | |
| _printFooter (title) | |
Protected Attributes | |
| dict | _props = {} |
Standalone Analysis Component Configuration
This class is used to describe the configuration of an analysis component
(a C++ class inheriting from asg::AsgComponentConfig) in Python. It behaves
similar to an Athena configurable, but is implemented in a much simpler
way.
An example of using it in configuring an EventLoop job could look like:
job = ROOT.EL.Job()
...
from AnaAlgorithm.PythonConfig import PythonConfig
alg = PythonConfig( "EL::UnitTestAlg2/TestAlg",
property = 1.23 )
alg.setComponentType( "AnaAlgorithm" )
alg.string_property = "Foo"
job.algsAdd( alg )
Note that the python code doesn't know what properties can actually be set
on any given C++ algorithm. Any mistake made in the Python configuration
(apart from syntax errors) is only discovered while initialising the
analysis job.
Definition at line 8 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.__init__ | ( | self, | |
| typeAndName, | |||
| ** | kwargs ) |
Constructor for an algorithm configuration object
Keyword arguments:
typeAndName -- The type/instance name of the algorithm
Note that you can pass (initial) properties to the constructor like:
alg = PythonConfig( "EL::UnitTestAlg2/TestAlg",
property = 1.23 )
Definition at line 37 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.__eq__ | ( | self, | |
| other ) |
Check for equality with another object The implementation of this is very simple. We only check that the type and the name of the algorithms would match.
Definition at line 136 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.__getattr__ | ( | self, | |
| name ) |
Get a previously set property value from the configuration This function allows us to retrieve the value of a property that was already set for the algorithm, to possibly use it in some configuration decisions in the Python code itself. Keyword arguments: name -- The name of the property
Definition at line 88 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.__setattr__ | ( | self, | |
| key, | |||
| value ) |
Set an algorithm property on an existing configuration object This function allows us to set/override properties on an algorithm configuration object. Allowing for the following syntax: alg = ... alg.IntProperty = 66 alg.FloatProperty = 3.141592 alg.StringProperty = "Foo" Keyword arguments: key -- The key/name of the property value -- The value to set for the property
Definition at line 112 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.__str__ | ( | self | ) |
Print the algorithm configuration in a user friendly way This is just to help with debugging configurations, allowing the user to get a nice printout of their job configuration.
Definition at line 151 of file PythonConfig.py.
|
staticprotected |
Produce a nice footer when printing the configuration This function is used for printing the footer of both algorithms and tools. Keyword arguments: indentString -- String used as indentation title -- The title of the algorithm/tool
Definition at line 267 of file PythonConfig.py.
|
staticprotected |
Produce a nice header when printing the configuration This function is used for printing the header of both algorithms and tools. Keyword arguments: indentString -- String used as indentation title -- The title of the algorithm/tool
Definition at line 250 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.addPrivateTool | ( | self, | |
| name, | |||
| type ) |
Create a private tool for the algorithm This function is used in 'standalone' mode to declare a private tool for the algorithm, or a private tool for an already declared private tool. Can be used like: config.addPrivateTool( 'tool1', 'ToolType1' ) config.addPrivateTool( 'tool1.tool2', 'ToolType2' ) Keyword arguments: name -- The full name of the private tool type -- The C++ type of the private tool
Definition at line 170 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.addPrivateToolInArray | ( | self, | |
| name, | |||
| type ) |
Create a private tool in an array for the algorithm This function is used in 'standalone' mode to declare a private tool in a tool array for the algorithm, or a private tool in a tool array for an already declared private tool. Can be used like: tool = config.addPrivateToolInArray( 'tool1', 'ToolType1' ) tool = config.addPrivateToolInArray( 'tool1.tool2', 'ToolType2' ) Keyword arguments: name -- The full name of the private tool type -- The C++ type of the private tool
Definition at line 209 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.addSelfToJob | ( | self, | |
| job ) |
add a copy of this config to the EventLoop job object Keyword arguments: job -- The job object to add ourself to
Definition at line 80 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.getName | ( | self | ) |
Get the instance name of the algorithm This is for compatibility with the getName() function of Athena configurables.
Definition at line 62 of file PythonConfig.py.
| python.PythonConfig.PythonConfig.getType | ( | self | ) |
Get the type name of the algorithm This is for compatibility with the getType() function of Athena configurables.
Definition at line 71 of file PythonConfig.py.
|
protected |
Definition at line 55 of file PythonConfig.py.
|
static |
Definition at line 35 of file PythonConfig.py.
|
static |
Definition at line 34 of file PythonConfig.py.