A class to hold all data that is needed ONLY for the most recent single execution of the algorithm.
More...
#include <CalibrationAlgorithm.h>
|
std::vector< Calibration::ExpRun > | m_requestedRuns {} |
| Runs for which the calibration has been last requested, either requested explicitly or generated from the collected data.
|
|
int | m_iteration { -1} |
| current iteration for execution
|
|
EResult | m_result {c_Undefined} |
| Result of execution, default undefined to indicate we haven't run yet.
|
|
IntervalOfValidity | m_iov |
| Current IoV to be executed, default empty. Will be either set by user explicitly or generated from collected/requested runs.
|
|
std::list< Database::DBImportQuery > | m_payloads {} |
| Payloads saved by execution.
|
|
std::map< std::pair< std::string, RunRange >, std::shared_ptr< TNamed > > | m_mapCalibData |
| Map of shared pointers to merged calibration objects created by getObjectPtr() calls.
|
|
A class to hold all data that is needed ONLY for the most recent single execution of the algorithm.
This is then reset upon calling execute() again. All other data members aren't reset unless you do it explicitly.
Definition at line 53 of file CalibrationAlgorithm.h.
◆ ExecutionData()
◆ ~ExecutionData()
◆ clearCalibrationData()
void clearCalibrationData |
( |
| ) |
|
|
inline |
◆ getCalibObj()
std::shared_ptr< TNamed > getCalibObj |
( |
const std::string & | name, |
|
|
const RunRange & | runRange ) const |
|
inline |
Get a previously created object in m_mapCalibData if one exists, otherwise return shared_ptr(nullptr)
Definition at line 98 of file CalibrationAlgorithm.h.
99 {
100 auto it = m_mapCalibData.find(std::make_pair(name, runRange));
101 if (it == m_mapCalibData.end()) {
102 return nullptr;
103 }
104 return it->second;
105 }
◆ getIteration()
int getIteration |
( |
| ) |
const |
|
inline |
◆ getPayloads()
Get constants (in TObjects) for database update from last calibration.
Definition at line 94 of file CalibrationAlgorithm.h.
◆ getPayloadValues()
Get constants (in TObjects) for database update from last calibration but passed by VALUE.
Definition at line 96 of file CalibrationAlgorithm.h.
◆ getRequestedIov()
◆ getRequestedRuns()
const std::vector< Calibration::ExpRun > & getRequestedRuns |
( |
| ) |
const |
|
inline |
◆ getResult()
◆ reset()
Resets this class back to what is needed at the beginning of an execution.
Definition at line 58 of file CalibrationAlgorithm.h.
59 {
60 B2DEBUG(100, "Resetting ExecutionData of algorithm");
61 m_requestedRuns.clear();
62 m_iteration = -1;
63 m_result = c_Undefined;
64 m_payloads.clear();
65 m_iov = IntervalOfValidity();
66 clearCalibrationData();
67 }
◆ setCalibObj()
void setCalibObj |
( |
const std::string & | name, |
|
|
const RunRange & | runRange, |
|
|
const std::shared_ptr< TNamed > & | objectPtr ) |
|
inline |
Insert a newly created object in m_mapCalibData. Overwrites a previous entry if one exists.
Definition at line 107 of file CalibrationAlgorithm.h.
108 {
109 m_mapCalibData[std::make_pair(name, runRange)] = objectPtr;
110 }
◆ setIteration()
void setIteration |
( |
int | iteration | ) |
|
|
inline |
Setter for current iteration.
Definition at line 80 of file CalibrationAlgorithm.h.
81 {
82 B2DEBUG(29, "Setting Iteration of Algorithm to " << iteration);
83 m_iteration = iteration;
84 }
◆ setRequestedIov()
◆ setRequestedRuns()
void setRequestedRuns |
( |
const std::vector< Calibration::ExpRun > & | requestedRuns | ) |
|
|
inline |
◆ setResult()
◆ m_iov
Current IoV to be executed, default empty. Will be either set by user explicitly or generated from collected/requested runs.
Definition at line 120 of file CalibrationAlgorithm.h.
◆ m_iteration
◆ m_mapCalibData
std::map<std::pair<std::string, RunRange>, std::shared_ptr<TNamed> > m_mapCalibData |
|
private |
Map of shared pointers to merged calibration objects created by getObjectPtr() calls.
Used to lookup previously created objects instead of recreating them needlessly. Using shared_ptr allows us to return a shared_ptr so the user knows that they don't own the pointer exclusively, but that they could hold onto a shared_ptr for longer than the reset of this ExecutionData object if they really wanted to i.e. you could hold onto a previous execution's created data if you wish (not recommended), but if you don't care then you can be assured that the memory will clear itself for you upon a new execute().
Definition at line 131 of file CalibrationAlgorithm.h.
◆ m_payloads
◆ m_requestedRuns
std::vector<Calibration::ExpRun> m_requestedRuns {} |
|
private |
Runs for which the calibration has been last requested, either requested explicitly or generated from the collected data.
Definition at line 114 of file CalibrationAlgorithm.h.
◆ m_result
Result of execution, default undefined to indicate we haven't run yet.
Definition at line 118 of file CalibrationAlgorithm.h.
The documentation for this class was generated from the following file: