Belle II Software development
ECLTimeWalkCorrection.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 <TObject.h>
12#include <limits>
13
14namespace Belle2 {
26 class ECLTimeWalkCorrection : public TObject {
27 public:
28
34 {
35 }
36
41
43 double getParam(int n) const
44 {
45 return m_par.at(n);
46 }
48 void setParam(int n, double newval)
49 {
50 if (n < 0 || n >= c_expectedParametersCount) {
51 B2FATAL("Parameter index should be within [0, " <<
52 c_expectedParametersCount - 1 << "]." <<
53 LogVar("parameter index", n));
54 }
55 m_par[n] = newval;
56 }
57
63 std::vector<double> getParams() const
64 {
65 return m_par;
66 }
72 void setParams(const std::vector<double>& new_params)
73 {
74 if (new_params.size() != c_expectedParametersCount) {
75 B2FATAL("Count of parameters must always be equal to " <<
77 LogVar("count of parameters", new_params.size()));
78 }
79 m_par = new_params;
80 }
81
86 {
87 return m_parFormat;
88 }
89
93 void setParamFormat(int newval)
94 {
95 m_parFormat = newval;
96 }
97
98 private:
104 int m_parFormat = 0;
106 std::vector<double> m_par;
107
111 const static int c_expectedParametersCount = 6;
112
114 };
116} // end namespace Belle2
117
This object contain parameters of the Time-Walk correction function of the ECL.
void setParamFormat(int newval)
Set parameter format ID.
int m_parFormat
Format of the correction parameters 0 - same set of (c_expectedParametersCount) parameters for all Ce...
ClassDef(ECLTimeWalkCorrection, 1)
tells ROOT not to write it to file
ECLTimeWalkCorrection()
Default constructor.
static const int c_expectedParametersCount
Number of values expected to be in the m_par vector.
std::vector< double > m_par
List of time walk correction parameters.
void setParam(int n, double newval)
set nth parameter of the time-walk correction.
std::vector< double > getParams() const
Return std::vector containing all parameters of the time walk correction function.
double getParam(int n) const
return nth parameter of the time-walk correction.
int getParamFormat()
Get parameter format ID.
void setParams(const std::vector< double > &new_params)
Set std::vector containing all parameters of the time walk correction function.
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.