8#include <calibration/example_caf_lib/TestBoundarySettingAlgorithm.h>
14#include <calibration/dbobjects/TestCalibMean.h>
17using namespace Calibration;
22 " -------------------------- Test Calibration Algorithm -------------------------\n"
24 " Testing algorithm which just gets mean of a test histogram collected by \n"
25 " CaTest module and provides a DB object with another histogram with one \n"
26 " entry at calibrated value. \n"
27 " ------------------------------------------------------------------------------\n"
37 B2INFO(
"Number of Entries in MyHisto was " << hist->GetEntries());
39 float mean = hist->GetMean();
40 float meanError = hist->GetMeanError();
42 B2INFO(
"Mean of MyHisto was " << mean);
43 B2INFO(
"Mean Error of MyHisto was " << meanError);
45 if (hist->GetEntries() < 100)
53 if (mean - 42. >= 1.) {
66 B2INFO(
"This is the first run encountered, let's say it is a boundary.");
void saveCalibration(TClonesArray *data, const std::string &name)
Store DBArray payload with given name with default IOV.
std::vector< Calibration::ExpRun > m_boundaries
When using the boundaries functionality from isBoundaryRequired, this is used to store the boundaries...
void setDescription(const std::string &description)
Set algorithm description (in constructor)
EResult
The result of calibration.
@ c_OK
Finished successfully =0 in Python.
@ c_Iterate
Needs iteration =1 in Python.
@ c_NotEnoughData
Needs more data =2 in Python.
@ c_Failure
Failed =3 in Python.
CalibrationAlgorithm(const std::string &collectorModuleName)
Constructor - sets the prefix for collected objects (won't be accesses until execute(....
TestBoundarySettingAlgorithm()
Constructor set the prefix to TestCalibration.
virtual EResult calibrate() override
Run algo on data.
virtual bool isBoundaryRequired(const Calibration::ExpRun &) override
Decide if a run should be a payload boundary. Only used in certain Python Algorithm Starategies.
std::shared_ptr< T > getObjectPtr(const std::string &name, const std::vector< Calibration::ExpRun > &requestedRuns)
Get calibration data object by name and list of runs, the Merge function will be called to generate t...
Abstract base class for different kinds of events.
Struct containing exp number and run number.