![]() |
Belle II Software development
|
Public Member Functions | |
| __init__ (self, algorithm, data_input=None, pre_algorithm=None) | |
| default_inputdata_setup (self, input_file_paths) | |
Public Attributes | |
| algorithm = algorithm | |
| CalibrationAlgorithm instance (assumed to be true since the Calibration class checks) | |
| name = cppname[cppname.rfind('::') + 2:] | |
| reduced name | |
| data_input = data_input | |
| Function called before the pre_algorithm method to setup the input data that the CalibrationAlgorithm uses. | |
| pre_algorithm = pre_algorithm | |
| Function called after data_input but before algorithm.execute to do any remaining setup. | |
| strategy = strategies.SingleIOV | |
| The algorithm stratgey that will be used when running over the collected data. | |
| dict | params = {} |
| Parameters that could be used in the execution of the algorithm strategy/runner to modify behaviour. | |
Parameters:
algorithm: The CalibrationAlgorithm instance that we want to execute.
Keyword Arguments:
data_input : An optional function that sets the input files of the algorithm.
pre_algorithm : An optional function that runs just prior to execution of the algorithm.
Useful for set up e.g. module initialisation
This is a simple wrapper class around the C++ CalibrationAlgorithm class.
It helps to add functionality to algorithms for use by the Calibration and CAF classes rather
than separating the logic into those classes directly.
This is **not** currently a class that a user should interact with much during `CAF`
setup (unless you're doing something advanced).
The `Calibration` class should be doing the most of the creation of the defaults for these objects.
Setting the `data_input` function might be necessary if you have set the `Calibration.output_patterns`.
Also, setting the `pre_algorithm` to a function that should execute prior to each `strategies.AlgorithmStrategy`
is often useful i.e. by calling for the Geometry module to initialise.
Definition at line 1118 of file framework.py.
| __init__ | ( | self, | |
| algorithm, | |||
| data_input = None, | |||
| pre_algorithm = None ) |
Definition at line 1140 of file framework.py.
| default_inputdata_setup | ( | self, | |
| input_file_paths ) |
Simple setup to set the input file names to the algorithm. Applied to the data_input attribute by default. This simply takes all files returned from the `Calibration.output_patterns` and filters for only the CollectorOutput.root files. Then it sets them as input files to the CalibrationAlgorithm class.
Definition at line 1169 of file framework.py.
| algorithm = algorithm |
CalibrationAlgorithm instance (assumed to be true since the Calibration class checks)
Definition at line 1144 of file framework.py.
| data_input = data_input |
Function called before the pre_algorithm method to setup the input data that the CalibrationAlgorithm uses.
The list of files matching the Calibration.output_patterns from the collector output directories will be passed to it
Definition at line 1152 of file framework.py.
| name = cppname[cppname.rfind('::') + 2:] |
reduced name
Definition at line 1148 of file framework.py.
| dict params = {} |
Parameters that could be used in the execution of the algorithm strategy/runner to modify behaviour.
By default this is empty and not used by the default :py:class:caf.strategies.SingleIOV class. But more complex strategies, or your own custom ones, could use it to configure behaviour. Note that if you modify this inside a subprocess the modification won't persist outside, you would have to change it in the parent process (or dump values to a file and read it in next time).
Definition at line 1167 of file framework.py.
| pre_algorithm = pre_algorithm |
Function called after data_input but before algorithm.execute to do any remaining setup.
It must have the form pre_algorithm(algorithm, iteration) where algorithm can be assumed to be the CalibrationAlgorithm instance about to be executed, and iteration is an int e.g. 0, 1, 2...
Definition at line 1158 of file framework.py.
| strategy = strategies.SingleIOV |
The algorithm stratgey that will be used when running over the collected data.
you can set this here, or from the Calibration.strategies attribute.
Definition at line 1161 of file framework.py.