8#include <calibration/example_caf_lib/TestBoundarySettingAlgorithm.h>
14#include <calibration/dbobjects/TestCalibMean.h>
17using namespace Calibration;
22 " -------------------------- Test Calibration Algoritm -------------------------\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"
35 auto hist = getObjectPtr<TH1F>(
"MyHisto");
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.");
Base class for calibration algorithms.
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 successfuly =0 in Python.
@ c_Iterate
Needs iteration =1 in Python.
@ c_NotEnoughData
Needs more data =2 in Python.
@ c_Failure
Failed =3 in Python.
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.
Abstract base class for different kinds of events.
Struct containing exp number and run number.