Belle II Software development
TestBoundarySettingAlgorithm.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10#include <calibration/CalibrationAlgorithm.h>
11#include <algorithm>
12
13namespace Belle2 {
22 public:
23
26
29
31 void setMinEntries(const int minEntries) {m_minEntries = minEntries;}
32
34 int getMinEntries() const {return m_minEntries;}
35
37 void setBoundaries(const std::vector<Calibration::ExpRun>& boundaries) {m_requestedBoundaries = boundaries;}
38
40 std::vector<Calibration::ExpRun> getBoundaries() const {return m_requestedBoundaries;}
41
42 protected:
43
45 virtual EResult calibrate() override;
46
48 virtual bool isBoundaryRequired(const Calibration::ExpRun& /*currentRun*/) override;
49
51 // We reset the temporary boundaries list to be the same as the requested one.
52 virtual void boundaryFindingSetup(std::vector<Calibration::ExpRun> /*runs*/, int /*iteration = 0*/) override
53 {
55 };
56
57 private:
58
60 int m_minEntries = 100;
61
63 std::vector<Calibration::ExpRun> m_requestedBoundaries;
64
65 };
67} // namespace Belle2
Base class for calibration algorithms.
std::vector< Calibration::ExpRun > m_boundaries
When using the boundaries functionality from isBoundaryRequired, this is used to store the boundaries...
EResult
The result of calibration.
Test class implementing calibration algorithm.
int m_minEntries
Set when c_NotEnoughData will be returned.
TestBoundarySettingAlgorithm()
Constructor set the prefix to TestCalibration.
virtual void boundaryFindingSetup(std::vector< Calibration::ExpRun >, int) override
What we do before isBoundaryRequired gets called.
std::vector< Calibration::ExpRun > getBoundaries() const
getter for current boundaries
void setBoundaries(const std::vector< Calibration::ExpRun > &boundaries)
Setter for boundaries.
int getMinEntries() const
getter for m_minEntries
virtual EResult calibrate() override
Run algo on data.
std::vector< Calibration::ExpRun > m_requestedBoundaries
During findPayloadBoundaries and isBoundaryRequired this is used to define the boundaries we want.
virtual bool isBoundaryRequired(const Calibration::ExpRun &) override
Decide if a run should be a payload boundary. Only used in certain Python Algorithm Starategies.
void setMinEntries(const int minEntries)
setter for m_minEntries
Abstract base class for different kinds of events.