Belle II Software  release-06-01-15
SingleIOV Class Reference
Inheritance diagram for SingleIOV:
Collaboration diagram for SingleIOV:

Public Member Functions

def __init__ (self, algorithm)
 
def run (self, iov, iteration, queue)
 
def setup_from_dict (self, params)
 
def is_valid (self)
 
def find_iov_gaps (self)
 
def any_failed_iov (self)
 
def send_result (self, result)
 
def send_final_state (self, state)
 

Public Attributes

 machine
 :py:class:caf.state_machines.AlgorithmMachine used to help set up and execute CalibrationAlgorithm It gets setup properly in :py:func:run
 
 queue
 
 algorithm
 Algorithm() class that we're running.
 
 input_files
 Collector output files, will contain all files retured by the output patterns.
 
 output_dir
 The algorithm output directory which is mostly used to store the stdout file.
 
 output_database_dir
 The output database directory for the localdb that the algorithm will commit to.
 
 database_chain
 User defined database chain i.e. More...
 
 dependent_databases
 CAF created local databases from previous calibrations that this calibration/algorithm depends on.
 
 ignored_runs
 Runs that will not be included in ANY execution of the algorithm. More...
 
 results
 The list of results objects which will be sent out before the end.
 

Static Public Attributes

dictionary usable_params = {"apply_iov": IoV}
 The params that you could set on the Algorithm object which this Strategy would use. More...
 
list required_attrs
 Required attributes that must exist before the strategy can run properly. More...
 
list required_true_attrs
 Attributes that must have a value that returns True when tested by :py:meth:is_valid. More...
 
list allowed_granularities = ["run", "all"]
 Granularity of collector that can be run by this algorithm properly.
 
string FINISHED_RESULTS = "DONE"
 Signal value that is put into the Queue when there are no more results left.
 
string COMPLETED = "COMPLETED"
 Completed state.
 
string FAILED = "FAILED"
 Failed state.
 

Detailed Description

The fastest and simplest Algorithm strategy. Runs the algorithm only once over all of the input
data or only the data corresponding to the requested IoV. The payload IoV is the set to the same as the one
that was executed.

This uses a `caf.state_machines.AlgorithmMachine` to actually execute the various steps rather than operating on
a CalibrationAlgorithm C++ class directly.

Definition at line 180 of file strategies.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  algorithm 
)
 

Reimplemented from AlgorithmStrategy.

Definition at line 192 of file strategies.py.

Member Function Documentation

◆ any_failed_iov()

def any_failed_iov (   self)
inherited
Returns:
    bool: If any result in the current results list has a failed algorithm code we return True

Definition at line 153 of file strategies.py.

◆ find_iov_gaps()

def find_iov_gaps (   self)
inherited
Finds and prints the current gaps between the IoVs of the strategy results. Basically these are the IoVs
not covered by any payload. It CANNOT find gaps if they exist across an experiment boundary. Only gaps
within the same experiment are found.

Returns:
    iov_gaps(list[IoV])

Definition at line 133 of file strategies.py.

◆ is_valid()

def is_valid (   self)
inherited
Returns:
    bool: Whether or not this strategy has been set up correctly with all its necessary attributes.

Definition at line 115 of file strategies.py.

◆ run()

def run (   self,
  iov,
  iteration,
  queue 
)
Runs the algorithm machine over the collected data and fills the results.

Reimplemented from AlgorithmStrategy.

Definition at line 200 of file strategies.py.

◆ setup_from_dict()

def setup_from_dict (   self,
  params 
)
inherited
Parameters:
    params (dict): Dictionary containing values to be assigned to the strategy attributes of the same name.

Definition at line 107 of file strategies.py.

Member Data Documentation

◆ database_chain

database_chain
inherited

User defined database chain i.e.

the default global tag, or if you have localdb's/tags for custom alignment etc

Definition at line 89 of file strategies.py.

◆ ignored_runs

ignored_runs
inherited

Runs that will not be included in ANY execution of the algorithm.

Usually set by Calibration.ignored_runs. The different strategies may handle the resulting run gaps differently.

Definition at line 94 of file strategies.py.

◆ required_attrs

list required_attrs
staticinherited
Initial value:
= ["algorithm",
"database_chain",
"dependent_databases",
"output_dir",
"output_database_dir",
"input_files",
"ignored_runs"
]

Required attributes that must exist before the strategy can run properly.

Base class for Algorithm strategies. These do the actual execution of a single
algorithm on collected data. Each strategy may be quite different in terms of how fast it may be,
how database payloads are passed between executions, and whether or not final payloads have an IoV
that is independent to the actual runs used to calculates them.

Parameters:
    algorithm (:py:class:`caf.framework.Algorithm`): The algorithm we will run

This base class defines the basic attributes and methods that will be automatically used by the selected AlgorithmRunner.
When defining a derived class you are free to use these attributes or to implement as much functionality as you want.

If you define your derived class with an __init__ method, then you should first call the base class
`AlgorithmStrategy.__init__()`  method via super() e.g.

>>> def __init__(self):
>>>     super().__init__()

The most important method to implement is :py:meth:`AlgorithmStrategy.run` which will take an algorithm and execute it
in the required way defined by the options you have selected/attributes set.

Some are allowed be values that return False whe tested e.g. "" or []

Definition at line 49 of file strategies.py.

◆ required_true_attrs

list required_true_attrs
staticinherited
Initial value:
= ["algorithm",
"output_dir",
"output_database_dir",
"input_files"
]

Attributes that must have a value that returns True when tested by :py:meth:is_valid.

Definition at line 59 of file strategies.py.

◆ usable_params

dictionary usable_params = {"apply_iov": IoV}
static

The params that you could set on the Algorithm object which this Strategy would use.

Just here for documentation reasons.

Definition at line 190 of file strategies.py.


The documentation for this class was generated from the following file: