Belle II Software development
SVD3SampleCoGTimeCalibrationAlgorithm.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
11#include <calibration/CalibrationAlgorithm.h>
12
13#include <optional>
14
15namespace Belle2 {
24 public:
25
27 explicit SVD3SampleCoGTimeCalibrationAlgorithm(const std::string& str);
28
31
33 void setAllowedTimeShift(float value) {m_allowedTimeShift = value;}
34
37
39 void setMinEntries(int minEntries) {m_minEntries = minEntries;}
40
43
45 void setTwoLineSelectionParameters(bool linearCutsOnCoG3, float interceptUpperLine, float angularCoefficientUpperLine,
46 float interceptLowerLine,
47 float angularCoefficientLowerLine)
48 {
49 m_applyLinearCutsToRemoveBkg = linearCutsOnCoG3;
50 m_interceptUpperLine = interceptUpperLine;
51 m_angularCoefficientUpperLine = angularCoefficientUpperLine;
52 m_interceptLowerLine = interceptLowerLine;
53 m_angularCoefficientLowerLine = angularCoefficientLowerLine;
54 }
55
57 std::vector<float> getTwoLineSelectionParameters()
58 {
59 std::vector<float> twoLineSelectionParameters;
60 twoLineSelectionParameters.push_back(m_interceptUpperLine);
61 twoLineSelectionParameters.push_back(m_angularCoefficientUpperLine);
62 twoLineSelectionParameters.push_back(m_interceptLowerLine);
63 twoLineSelectionParameters.push_back(m_angularCoefficientLowerLine);
64
65 return twoLineSelectionParameters;
66 }
67
68 protected:
69
71 virtual EResult calibrate() override;
72
75 virtual bool isBoundaryRequired(const Calibration::ExpRun& currentRun) override;
76
78 virtual void boundaryFindingSetup(std::vector<Calibration::ExpRun> /*runs*/, int /*iteration = 0*/) override
79 {
81 }
82
83
84 private:
85
86 std::string m_id;
87 std::optional<float> m_previousRawTimeMeanL3V;
88 float m_allowedTimeShift = 2.;
89 float m_minEntries = 10000;
91 // straight lines used to reject off-time clusters from 2D-distribution
94 -94.0;
96 1.264;
98 -134.0;
100 1.264;
101 };
103} // namespace Belle2
Base class for calibration algorithms.
EResult
The result of calibration.
Class implementing SVD3SampleCoGTimeCalibration calibration algorithm.
void setMinEntries(int minEntries)
Set the minimum entries required in the histograms.
bool m_applyLinearCutsToRemoveBkg
if true turns on the selection to remove background clusters from CoG3 calibration
std::string m_id
Parameter given to set the UniqueID of the payload.
float m_angularCoefficientUpperLine
Angular coefficient of one of the two lines that define the signal region used in the CoG3 calibratio...
std::optional< float > m_previousRawTimeMeanL3V
Raw CoG of the previous run.
virtual void boundaryFindingSetup(std::vector< Calibration::ExpRun >, int) override
setup the boundary finding
float m_interceptUpperLine
Intercept of one of the two lines that define the signal region used in the CoG3 calibration (to remo...
void setTwoLineSelectionParameters(bool linearCutsOnCoG3, float interceptUpperLine, float angularCoefficientUpperLine, float interceptLowerLine, float angularCoefficientLowerLine)
Set the parameters of the two-line-based selection to remove background clusters from CoG3 calibratio...
float m_minEntries
Set the minimun number of entries required in the histograms of layer 3.
float m_angularCoefficientLowerLine
Angulat coefficienct of one of the two lines that define the signal region used in the CoG3 calibrati...
std::vector< float > getTwoLineSelectionParameters()
Get the parameters of the two-line-based selection to remove background clusters from CoG3 calibratio...
virtual bool isBoundaryRequired(const Calibration::ExpRun &currentRun) override
If the event T0 changes significantly return true.
void setAllowedTimeShift(float value)
Setter for m_allowedTimeShift.
float m_interceptLowerLine
Intercept of one of the two lines that define the signal region used in the CoG3 calibration (to remo...
int getMinEntries()
Get the minimum entries required in the histograms.
Abstract base class for different kinds of events.