Belle II Software  release-08-01-10
TOPModuleT0DeltaTAlgorithm.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 
30  public:
31 
34 
37 
41  void setMinEntries(int minEntries) {m_minEntries = minEntries;}
42 
49  void setFitInitializers(double sigmaCore, double sigmaTail, double tailFract)
50  {
51  m_sigmaCoreInit = sigmaCore;
52  m_sigmaTailInit = sigmaTail;
53  m_tailFractInit = tailFract;
54  }
55 
61  void setCutoffEntries(int cutoffEntries) {m_cutoffEntries = cutoffEntries;}
62 
67  void setMinError(double minError) {m_minError = minError;}
68 
69  private:
70 
74  virtual EResult calibrate() final;
75 
81  int fitSingleGaus(std::shared_ptr<TH1F> h);
82 
88  int fitDoubleGaus(std::shared_ptr<TH1F> h);
89 
95  int fitHistogram(std::shared_ptr<TH1F> h);
96 
97  // algorithm parameters
98  int m_minEntries = 10;
99  double m_sigmaCoreInit = 0.120;
100  double m_sigmaTailInit = 0.240;
101  double m_tailFractInit = 0.20;
102  int m_cutoffEntries = 100;
103  double m_minError = 0.100;
105  // temporary store for results of a single fit
106  double m_delT0 = 0;
107  double m_error = 0;
108  double m_chi2 = 0;
109  double m_ndf = 0;
111  };
112 
113  } // end namespace TOP
115 } // end namespace Belle2
Base class for calibration algorithms.
EResult
The result of calibration.
Algorithm for module T0 calibration with chi2 minimization of time differences between slots (method ...
int fitDoubleGaus(std::shared_ptr< TH1F > h)
Fit double gaus w/ same mean + constant.
int m_minEntries
minimal number of histogram entries to perform fit
void setMinEntries(int minEntries)
Sets minimal number of histogram entries to perform a fit.
virtual EResult calibrate() final
algorithm implementation
void setCutoffEntries(int cutoffEntries)
Sets cutoff on the number of histogram entries for steering btw.
int fitHistogram(std::shared_ptr< TH1F > h)
Fit histogram.
int m_cutoffEntries
cutoff entries for single/double gaussian fit
double m_minError
minimal moduleT0 uncertainty [ns] to declare c_OK
double m_tailFractInit
fraction of tail gaussian
double m_sigmaCoreInit
core gaussian sigma [ns]
int fitSingleGaus(std::shared_ptr< TH1F > h)
Fit single gaus + constant.
void setMinError(double minError)
Sets minimal result 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.
Abstract base class for different kinds of events.