![]() |
Belle II Software development
|
Public Member Functions | |
__init__ (self, name, input_files=None) | |
run (self) | |
is_valid (self) | |
depends_on (self, calibration) | |
dependencies_met (self) | |
failed_dependencies (self) | |
Public Attributes | |
name = name | |
Name of calibration object. | |
list | future_dependencies = [] |
List of calibration objects that depend on this one. | |
list | dependencies = [] |
List of calibration objects, where each one is a dependency of this one. | |
dict | files_to_iovs = {} |
File -> Iov dictionary, should be : | |
list | input_files = input_files |
Files used for collection procedure. | |
iov = None | |
IoV which will be calibrated. | |
str | output_database_dir = "" |
The directory where we'll store the local database payloads from this calibration. | |
bool | save_payloads = True |
Marks this Calibration as one which has payloads that should be copied and uploaded. | |
list | jobs_to_submit = [] |
A simple list of jobs that this Calibration wants submitted at some point. | |
Static Public Attributes | |
str | end_state = "completed" |
The name of the successful completion state. | |
str | fail_state = "failed" |
The name of the failure state. | |
Protected Member Functions | |
_apply_calibration_defaults (self, defaults) | |
Abstract base class of Calibration types. The CAF implements the :py:class:`Calibration` class which inherits from this and runs the C++ CalibrationCollectorModule and CalibrationAlgorithm classes. But by inheriting from this class and providing the minimal necessary methods/attributes you could plug in your own Calibration types that doesn't depend on the C++ CAF at all and run everything in your own way. .. warning:: Writing your own class inheriting from :py:class:`CalibrationBase` class is not recommended! But it's there if you really need it. Parameters: name (str): Name of this calibration object. Should be unique if you are going to run it. Keyword Arguments: input_files (list[str]): Input files for this calibration. May contain wildcard expressions usable by `glob.glob`.
Definition at line 317 of file framework.py.
__init__ | ( | self, | |
name, | |||
input_files = None ) |
Definition at line 340 of file framework.py.
|
protected |
We pass in default calibration options from the `CAF` instance here if called. Won't overwrite any options already set.
Definition at line 431 of file framework.py.
dependencies_met | ( | self | ) |
Checks if all of the Calibrations that this one depends on have reached a successful end state.
Definition at line 415 of file framework.py.
depends_on | ( | self, | |
calibration ) |
Parameters: calibration (`CalibrationBase`): The Calibration object which will produce constants that this one depends on. Adds dependency of this calibration on another i.e. This calibration will not run until the dependency has completed, and the constants produced will be used via the database chain. You can define multiple dependencies for a single calibration simply by calling this multiple times. Be careful when adding the calibration into the `CAF` not to add a circular/cyclic dependency. If you do the sort will return an empty order and the `CAF` processing will fail. This function appends to the `CalibrationBase.dependencies` and `CalibrationBase.future_dependencies` attributes of this `CalibrationBase` and the input one respectively. This prevents us having to do too much recalculation later on.
Definition at line 387 of file framework.py.
failed_dependencies | ( | self | ) |
Returns the list of calibrations in our dependency list that have failed.
Definition at line 421 of file framework.py.
is_valid | ( | self | ) |
A simple method you should implement that will return True or False depending on whether the Calibration has been set up correctly and can be run safely.
Reimplemented in Calibration.
Definition at line 381 of file framework.py.
run | ( | self | ) |
The most important method. Runs inside a new Thread and is called from `CalibrationBase.start` once the dependencies of this `CalibrationBase` have returned with state == end_state i.e. "completed".
Reimplemented in Calibration.
Definition at line 374 of file framework.py.
list dependencies = [] |
List of calibration objects, where each one is a dependency of this one.
Definition at line 349 of file framework.py.
|
static |
The name of the successful completion state.
The :py:class:CAF
will use this as the state to decide when the Calibration is completed.
Definition at line 335 of file framework.py.
|
static |
The name of the failure state.
The :py:class:CAF
will use this as the state to decide when the Calibration failed.
Definition at line 338 of file framework.py.
dict files_to_iovs = {} |
File -> Iov dictionary, should be :
{absolute_file_path:iov} : Where iov is a :py:class:
IoV <caf.utils.IoV>
object. Will be filled duringCAF.run()
if empty. To improve performance you can fill this yourself before callingCAF.run()
Reimplemented in Calibration, and Calibration.
Definition at line 356 of file framework.py.
list future_dependencies = [] |
List of calibration objects that depend on this one.
Definition at line 347 of file framework.py.
list input_files = input_files |
Files used for collection procedure.
Reimplemented in Calibration, and Calibration.
Definition at line 359 of file framework.py.
iov = None |
IoV which will be calibrated.
This is set by the CAF
itself when calling CAF.run()
Definition at line 364 of file framework.py.
list jobs_to_submit = [] |
A simple list of jobs that this Calibration wants submitted at some point.
Definition at line 371 of file framework.py.
name = name |
Name of calibration object.
This must be unique when adding into the py:class:CAF
.
Definition at line 345 of file framework.py.
str output_database_dir = "" |
The directory where we'll store the local database payloads from this calibration.
Definition at line 366 of file framework.py.
bool save_payloads = True |
Marks this Calibration as one which has payloads that should be copied and uploaded.
Defaults to True, and should only be False if this is an intermediate Calibration who's payloads are never needed.
Definition at line 369 of file framework.py.