Belle II Software  release-08-01-10
TOPCommonT0BFAlgorithm.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 <TH1F.h>
12 
13 namespace Belle2 {
18  namespace TOP {
19 
25  public:
26 
29 
32 
36  void setMinEntries(int minEntries) {m_minEntries = minEntries;}
37 
44  void setFitInitializers(double sigmaCore, double sigmaTail, double tailFract)
45  {
46  m_sigmaCoreInit = sigmaCore;
47  m_sigmaTailInit = sigmaTail;
48  m_tailFractInit = tailFract;
49  }
50 
56  void setCutoffEntries(int cutoffEntries) {m_cutoffEntries = cutoffEntries;}
57 
62  void setMinError(double minError) {m_minError = minError;}
63 
64  private:
65 
69  virtual EResult calibrate() final;
70 
74  std::shared_ptr<TH1F> getHistogram();
75 
81  int fitSingleGaus(std::shared_ptr<TH1F> h);
82 
88  int fitDoubleGaus(std::shared_ptr<TH1F> h);
89 
90  // algorithm parameters
91  int m_minEntries = 10;
92  double m_sigmaCoreInit = 0.060;
93  double m_sigmaTailInit = 0.120;
94  double m_tailFractInit = 0.20;
95  int m_cutoffEntries = 100;
96  double m_minError = 0.020;
98  // ntuple variables
99  int m_expNo = 0;
100  int m_runNo = 0;
101  int m_runLast = 0;
102  float m_fittedOffset = 0;
103  float m_offset = 0;
104  float m_offsetError = 0;
105  float m_sigmaCore = 0;
106  float m_sigmaTail = 0;
107  float m_tailFract = 0;
108  float m_chi2 = 0;
109  float m_integral = 0;
110  int m_numEvents = 0;
111  int m_fitStatus = -1;
113  // other
114  double m_bunchTimeSep = 0;
116  };
117 
118  } // end namespace TOP
120 } // end namespace Belle2
Base class for calibration algorithms.
EResult
The result of calibration.
Algorithm for common T0 calibration with a fit of bunch finder residuals.
int fitDoubleGaus(std::shared_ptr< TH1F > h)
Fit double gaus w/ same mean + constant.
float m_offsetError
error on fitted offset
int m_minEntries
minimal number of histogram entries to perform fit
float m_offset
wrap-around of fitted offset (= common T0)
void setMinEntries(int minEntries)
Sets minimal number of histogram entries to perform a fit.
virtual EResult calibrate() final
algorithm implementation
float m_tailFract
tail fraction (set to 0 for single gauss fit)
void setCutoffEntries(int cutoffEntries)
Sets cutoff on the number of histogram entries for steering btw.
int m_numEvents
number of all events in the histogram
int m_cutoffEntries
cutoff entries for single/double gaussian fit
double m_sigmaTailInit
tail gaussian sigma [ns]
double m_minError
minimal commonT0 uncertainty [ns] to declare c_OK
double m_tailFractInit
fraction of tail gaussian
double m_sigmaCoreInit
core gaussian sigma [ns]
float m_integral
number of fitted signal events
float m_sigmaTail
tail gaussian sigma (set to 0 for single gauss fit)
double m_bunchTimeSep
bunch separation in time [ns]
int fitSingleGaus(std::shared_ptr< TH1F > h)
Fit single gaus + constant.
void setMinError(double minError)
Sets minimal fitted offset uncertainty to declare this calibration as c_OK.
void setFitInitializers(double sigmaCore, double sigmaTail, double tailFract)
Sets values for the initialization of several fit parameters.
std::shared_ptr< TH1F > getHistogram()
Returns histogram to be fitted.
Abstract base class for different kinds of events.