 |
Belle II Software
release-05-02-19
|
1 #include <calibration/example_caf_lib/TestBoundarySettingAlgorithm.h>
7 #include <calibration/dbobjects/TestCalibMean.h>
10 using namespace Calibration;
15 " -------------------------- Test Calibration Algoritm -------------------------\n"
17 " Testing algorithm which just gets mean of a test histogram collected by \n"
18 " CaTest module and provides a DB object with another histogram with one \n"
19 " entry at calibrated value. \n"
20 " ------------------------------------------------------------------------------\n"
28 auto hist = getObjectPtr<TH1F>(
"MyHisto");
30 B2INFO(
"Number of Entries in MyHisto was " << hist->GetEntries());
32 float mean = hist->GetMean();
33 float meanError = hist->GetMeanError();
35 B2INFO(
"Mean of MyHisto was " << mean);
36 B2INFO(
"Mean Error of MyHisto was " << meanError);
38 if (hist->GetEntries() < 100)
46 if (mean - 42. >= 1.) {
58 if (m_boundaries.empty()) {
59 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.
@ c_Iterate
Needs iteration =1 in Python.
@ c_OK
Finished successfuly =0 in Python.
void setDescription(const std::string &description)
Set algorithm description (in constructor)
TestBoundarySettingAlgorithm()
Constructor set the prefix to TestCalibration.
virtual EResult calibrate() override
Run algo on data.
Abstract base class for different kinds of events.
@ c_Failure
Failed =3 in Python.
Struct containing exp number and run number.
EResult
The result of calibration.
@ c_NotEnoughData
Needs more data =2 in Python.
Base class for calibration algorithms.
virtual bool isBoundaryRequired(const Calibration::ExpRun &) override
Decide if a run should be a payload boundary. Only used in certain Python Algorithm Starategies.