Belle II Software  release-08-01-10
TOPAsicShiftsBS13dAlgorithm.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 #include <TH1F.h>
13 #include <vector>
14 
15 namespace Belle2 {
20  namespace TOP {
21 
26 
27  public:
28 
31 
34 
39  void setMinValue(double minVal) {m_minVal = minVal;}
40 
46  void setWindowSize(int size) {m_winSize = size;}
47 
53  void setShiftRange(int begin, int end) {m_shiftBegin = begin; m_shiftEnd = end;}
54 
60 
61  private:
62 
66  virtual EResult calibrate() final;
67 
72  void setWindow();
73 
78  double fun(int x);
79 
84  std::vector<double> getPDF(int shift);
85 
91  double logL(std::shared_ptr<TH1F> h, int shift);
92 
93  // parameters
94  double m_minVal = 1.0;
95  int m_shiftBegin = -20;
96  int m_shiftEnd = 20;
97  double m_minSignificance = 5;
99  // other
100  std::vector<double> m_timeReference;
101  int m_winSize = 21;
102  int m_i0 = 0;
103  int m_i1 = 0;
104  std::vector<int> m_lastEntries;
106  };
107 
108  } // end namespace TOP
110 } // end namespace Belle2
Base class for calibration algorithms.
EResult
The result of calibration.
Calibration algorithm for carrier shifts of BS13d.
double fun(int x)
Returns measured time distribution at x or minVal for outside-range or empty bins.
void setWindow()
Sets the position of a window containing maximum number of entries of reference time distribution.
std::vector< double > getPDF(int shift)
Returns normalized time distribution at a given shift (PDF)
void setShiftRange(int begin, int end)
Sets the search range.
int m_winSize
size of the window on reference time distribution
void setWindowSize(int size)
Sets size of the window on reference time distribution.
std::vector< int > m_lastEntries
number of histogram entries
std::vector< double > m_timeReference
reference time distribution
virtual EResult calibrate() final
algorithm implementation
void setMinimalSignificance(double s)
Set minimal significance of the result to declare calibration as OK.
void setMinValue(double minVal)
Sets minimal function value.
double m_minSignificance
minimal result significance to declare c_OK
int m_i1
last bin of the window on reference time distribution
double logL(std::shared_ptr< TH1F > h, int shift)
Returns log likelihood of a histogram with respect to PDF at a given shift.
int m_i0
first bin of the window on reference time distribution
Abstract base class for different kinds of events.