Belle II Software development
SVDCoGCalibrationFunction Class Reference

class to contain the CoG Time calibrations More...

#include <SVDCoGCalibrationFunction.h>

Inheritance diagram for SVDCoGCalibrationFunction:

Public Types

typedef double(SVDCoGCalibrationFunction::* cogFunction) (double, int) const
 typedef of the return value of the calibration function
 
typedef double(SVDCoGCalibrationFunction::* cogFunctionErr) (double, double, int) const
 typedef of the return value of the calibration function ERROR
 

Public Member Functions

double calibratedValue (double raw_time, int trigger_bin) const
 returns the calibrated value of raw_time, depending on the trigger bin
 
double calibratedValueError (double raw_time, double raw_timeErr, int trigger_bin) const
 returns the error of the calibrated value of raw_time, depending on the trigger bin
 
 SVDCoGCalibrationFunction ()
 constructor
 
void set_current (int current)
 allows to choose the function version
 
void set_bias (double tb0, double tb1, double tb2, double tb3)
 set the trigger bin dependent shift
 
void set_scale (double tb0, double tb1, double tb2, double tb3)
 set the trigger bin dependent scale
 
void set_pol3parameters (double a, double b, double c, double d)
 set the pol3 TB independent parameters
 
void set_pol5parameters (double a, double b, double c, double d, double e, double f)
 set the pol5 TB independent parameters
 
void set_elsparameters (double a, double b, double c, double d)
 set the parameters for the ELS TB independent function
 
 SVDCoGCalibrationFunction (const Belle2::SVDCoGCalibrationFunction &a)
 copy constructor
 
SVDCoGCalibrationFunctionoperator= (const Belle2::SVDCoGCalibrationFunction &a)
 operator =
 

Private Member Functions

double pol1TBdep (double raw_time, int tb) const
 pol1 TB dep version implementation
 
double pol1TBdepErr (double, double raw_timeErr, int tb) const
 implementation of pol1 TB dep error
 
double pol3TBindep (double raw_time, int) const
 ID = 1, pol3TBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + t^2 * par[2] + t^3 * par[3].
 
double pol3TBindepErr (double raw_time, double raw_timeErr, int) const
 implementation of pol3 TB indep error
 
double pol5TBindep (double raw_time, int) const
 ID = 2, pol5TBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + t^2 * par[2] + t^3 * par[3] + t^4 * par[4] + t^5*par[5].
 
double pol5TBindepErr (double raw_time, double raw_timeErr, int) const
 implementation of pol5 TB indep error
 
double elsTBindep (double raw_time, int) const
 ID = 3, elsTBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + par[2]/(t - par[3]) if t<=par[3]-sqrt(-par[2])/4 correctedValue = NaN otherwise.
 
double elsTBindepErr (double raw_time, double raw_timeErr, int) const
 implementation of els TB indep error
 

Private Attributes

double m_bias [nTriggerBins] = {0}
 function parameters & implementations
 
double m_scale [nTriggerBins] = {0}
 trigger-bin dependent scale
 
double m_par [m_nPar] = {0}
 vector of parameters
 
int m_current
 current function ID
 

Static Private Attributes

static const int nTriggerBins = 4
 total number of trigger bins
 
static const int m_nPar = 6
 number of parameters of highest-order implemented pol (5)
 
static std::vector< cogFunctionm_implementations
 vector of fuctions for time calibration, we use the m_current
 
static std::vector< cogFunctionErrm_implementationsErr
 Do not stream this, please throw it in the WC.
 

Detailed Description

class to contain the CoG Time calibrations

Definition at line 23 of file SVDCoGCalibrationFunction.h.

Member Typedef Documentation

◆ cogFunction

typedef double(SVDCoGCalibrationFunction::* cogFunction) (double, int) const

typedef of the return value of the calibration function

Definition at line 28 of file SVDCoGCalibrationFunction.h.

◆ cogFunctionErr

typedef double(SVDCoGCalibrationFunction::* cogFunctionErr) (double, double, int) const

typedef of the return value of the calibration function ERROR

Definition at line 31 of file SVDCoGCalibrationFunction.h.

Constructor & Destructor Documentation

◆ SVDCoGCalibrationFunction() [1/2]

constructor

Definition at line 47 of file SVDCoGCalibrationFunction.h.

48 {
49 // The m_implementations vector is static.
50 // We have to initialize it just once.
51 if (m_implementations.size() == 0) {
56 //m_implementations.push_back(
57 // &SVDCoGCalibrationFunction::betterVersion);
58 }
59
60 // The m_implementationsErr vector is static.
61 // We have to initialize it just once.
62 if (m_implementationsErr.size() == 0) {
67 //m_implementationsErr.push_back(
68 // &SVDCoGCalibrationFunction::betterVersion);
69 }
70
71 m_current = m_implementations.size() - 1;
72
73 };
static std::vector< cogFunction > m_implementations
vector of fuctions for time calibration, we use the m_current
double pol3TBindep(double raw_time, int) const
ID = 1, pol3TBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + t^2 * par[2] + t...
double pol1TBdep(double raw_time, int tb) const
pol1 TB dep version implementation
double pol5TBindep(double raw_time, int) const
ID = 2, pol5TBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + t^2 * par[2] + t...
double pol3TBindepErr(double raw_time, double raw_timeErr, int) const
implementation of pol3 TB indep error
double pol1TBdepErr(double, double raw_timeErr, int tb) const
implementation of pol1 TB dep error
static std::vector< cogFunctionErr > m_implementationsErr
Do not stream this, please throw it in the WC.
double pol5TBindepErr(double raw_time, double raw_timeErr, int) const
implementation of pol5 TB indep error
double elsTBindep(double raw_time, int) const
ID = 3, elsTBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + par[2]/(t - par[3...
double elsTBindepErr(double raw_time, double raw_timeErr, int) const
implementation of els TB indep error

◆ SVDCoGCalibrationFunction() [2/2]

copy constructor

Definition at line 16 of file SVDCoGCalibrationFunction.cc.

16 : TObject(a)
17{
18 for (int i = 0; i < nTriggerBins; i++) {
19 m_bias[i] = a.m_bias[i];
20 m_scale[i] = a.m_scale[i];
21 }
22 m_current = a.m_current;
23 for (int i = 0; i < m_nPar; i++)
24 m_par[i] = a.m_par[i];
25}
static const int nTriggerBins
total number of trigger bins
double m_bias[nTriggerBins]
function parameters & implementations
double m_scale[nTriggerBins]
trigger-bin dependent scale
static const int m_nPar
number of parameters of highest-order implemented pol (5)
double m_par[m_nPar]
vector of parameters

Member Function Documentation

◆ calibratedValue()

double calibratedValue ( double  raw_time,
int  trigger_bin 
) const
inline

returns the calibrated value of raw_time, depending on the trigger bin

Definition at line 34 of file SVDCoGCalibrationFunction.h.

35 {
37 return (this->*f)(raw_time, trigger_bin) ;
38 }
double(SVDCoGCalibrationFunction::* cogFunction)(double, int) const
typedef of the return value of the calibration function

◆ calibratedValueError()

double calibratedValueError ( double  raw_time,
double  raw_timeErr,
int  trigger_bin 
) const
inline

returns the error of the calibrated value of raw_time, depending on the trigger bin

Definition at line 40 of file SVDCoGCalibrationFunction.h.

41 {
43 return (this->*fErr)(raw_time, raw_timeErr, trigger_bin) ;
44 }
double(SVDCoGCalibrationFunction::* cogFunctionErr)(double, double, int) const
typedef of the return value of the calibration function ERROR

◆ elsTBindep()

double elsTBindep ( double  raw_time,
int   
) const
inlineprivate

ID = 3, elsTBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + par[2]/(t - par[3]) if t<=par[3]-sqrt(-par[2])/4 correctedValue = NaN otherwise.

els TB indep version implementation

Definition at line 196 of file SVDCoGCalibrationFunction.h.

197 {
198 if (raw_time > m_par[3] - sqrt(-m_par[2]) / 4)
199 return std::numeric_limits<float>::quiet_NaN();
200
201 return m_par[0] + m_par[1] * raw_time + m_par[2] / (raw_time - m_par[3]);
202 };
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ elsTBindepErr()

double elsTBindepErr ( double  raw_time,
double  raw_timeErr,
int   
) const
inlineprivate

implementation of els TB indep error

Definition at line 205 of file SVDCoGCalibrationFunction.h.

206 {
207 if (raw_time > m_par[3] - sqrt(-m_par[2]) / 4)
208 return std::numeric_limits<float>::quiet_NaN();
209
210 return raw_timeErr * (m_par[1] - m_par[2] / pow(raw_time - m_par[3], 2));
211 };

◆ operator=()

operator =

Definition at line 27 of file SVDCoGCalibrationFunction.cc.

28{
29 if (this == &a)
30 return *this;
31 for (int i = 0; i < nTriggerBins; i++) {
32 m_bias[i] = a.m_bias[i];
33 m_scale[i] = a.m_scale[i];
34 }
35 m_current = a.m_current;
36 for (int i = 0; i < m_nPar; i++)
37 m_par[i] = a.m_par[i];
38 return *this;
39}

◆ pol1TBdep()

double pol1TBdep ( double  raw_time,
int  tb 
) const
inlineprivate

pol1 TB dep version implementation

Definition at line 149 of file SVDCoGCalibrationFunction.h.

150 {
151 return raw_time * m_scale[ tb % nTriggerBins] +
152 m_bias[ tb % nTriggerBins ];
153 };

◆ pol1TBdepErr()

double pol1TBdepErr ( double  ,
double  raw_timeErr,
int  tb 
) const
inlineprivate

implementation of pol1 TB dep error

Definition at line 155 of file SVDCoGCalibrationFunction.h.

156 {
157 return raw_timeErr * m_scale[ tb % nTriggerBins];
158 };

◆ pol3TBindep()

double pol3TBindep ( double  raw_time,
int   
) const
inlineprivate

ID = 1, pol3TBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + t^2 * par[2] + t^3 * par[3].

pol3 TB indep version implementation

Definition at line 166 of file SVDCoGCalibrationFunction.h.

167 {
168 return m_par[0] + m_par[1] * raw_time + m_par[2] * pow(raw_time, 2) + m_par[3] * pow(raw_time, 3);
169 };

◆ pol3TBindepErr()

double pol3TBindepErr ( double  raw_time,
double  raw_timeErr,
int   
) const
inlineprivate

implementation of pol3 TB indep error

Definition at line 171 of file SVDCoGCalibrationFunction.h.

172 {
173 return raw_timeErr * (m_par[1] + 2 * m_par[2] * raw_time + 3 * m_par[3] * pow(raw_time, 2));
174 };

◆ pol5TBindep()

double pol5TBindep ( double  raw_time,
int   
) const
inlineprivate

ID = 2, pol5TBindep VERSION: (TB independent) correctedValue = par[0] + t * par[1] + t^2 * par[2] + t^3 * par[3] + t^4 * par[4] + t^5*par[5].

pol5 TB indep version implementation

Definition at line 179 of file SVDCoGCalibrationFunction.h.

180 {
181 return m_par[0] + m_par[1] * raw_time + m_par[2] * pow(raw_time, 2) + m_par[3] * pow(raw_time, 3) + m_par[4] * pow(raw_time,
182 4) + m_par[5] * pow(raw_time, 5);
183 };

◆ pol5TBindepErr()

double pol5TBindepErr ( double  raw_time,
double  raw_timeErr,
int   
) const
inlineprivate

implementation of pol5 TB indep error

Definition at line 185 of file SVDCoGCalibrationFunction.h.

186 {
187 return raw_timeErr * (m_par[1] + 2 * m_par[2] * raw_time + 3 * m_par[3] * pow(raw_time, 2) + 4 * m_par[4] * pow(raw_time,
188 3) + 5 * m_par[5] * pow(raw_time, 4));
189 };

◆ set_bias()

void set_bias ( double  tb0,
double  tb1,
double  tb2,
double  tb3 
)
inline

set the trigger bin dependent shift

Definition at line 83 of file SVDCoGCalibrationFunction.h.

84 {
85 m_bias[0] = tb0;
86 m_bias[1] = tb1;
87 m_bias[2] = tb2;
88 m_bias[3] = tb3;
89 }

◆ set_current()

void set_current ( int  current)
inline

allows to choose the function version

Definition at line 76 of file SVDCoGCalibrationFunction.h.

77 {
78 m_current = current;
79 }

◆ set_elsparameters()

void set_elsparameters ( double  a,
double  b,
double  c,
double  d 
)
inline

set the parameters for the ELS TB independent function

Definition at line 124 of file SVDCoGCalibrationFunction.h.

125 {
126 m_par[ 0 ] = a;
127 m_par[ 1 ] = b;
128 m_par[ 2 ] = c;
129 m_par[ 3 ] = d;
130 }

◆ set_pol3parameters()

void set_pol3parameters ( double  a,
double  b,
double  c,
double  d 
)
inline

set the pol3 TB independent parameters

Definition at line 102 of file SVDCoGCalibrationFunction.h.

103 {
104 m_par[ 0 ] = a;
105 m_par[ 1 ] = b;
106 m_par[ 2 ] = c;
107 m_par[ 3 ] = d;
108 }

◆ set_pol5parameters()

void set_pol5parameters ( double  a,
double  b,
double  c,
double  d,
double  e,
double  f 
)
inline

set the pol5 TB independent parameters

Definition at line 112 of file SVDCoGCalibrationFunction.h.

113 {
114 m_par[ 0 ] = a;
115 m_par[ 1 ] = b;
116 m_par[ 2 ] = c;
117 m_par[ 3 ] = d;
118 m_par[ 4 ] = e;
119 m_par[ 5 ] = f;
120 }

◆ set_scale()

void set_scale ( double  tb0,
double  tb1,
double  tb2,
double  tb3 
)
inline

set the trigger bin dependent scale

Definition at line 91 of file SVDCoGCalibrationFunction.h.

92 {
93 m_scale[0] = tb0;
94 m_scale[1] = tb1;
95 m_scale[2] = tb2;
96 m_scale[3] = tb3;
97 }

Member Data Documentation

◆ m_bias

double m_bias[nTriggerBins] = {0}
private

function parameters & implementations

ID = {0}, pol1TBdep VERSION: correctedValue = t * scale[tb] + bias[tb] trigger-bin dependent bias

Definition at line 146 of file SVDCoGCalibrationFunction.h.

◆ m_current

int m_current
private

current function ID

Definition at line 214 of file SVDCoGCalibrationFunction.h.

◆ m_implementations

std::vector< SVDCoGCalibrationFunction::cogFunction > m_implementations
staticprivate

vector of fuctions for time calibration, we use the m_current

Definition at line 217 of file SVDCoGCalibrationFunction.h.

◆ m_implementationsErr

std::vector< SVDCoGCalibrationFunction::cogFunctionErr > m_implementationsErr
staticprivate

Do not stream this, please throw it in the WC.

vector of fuctions for time error calibration, we use the m_current

Definition at line 220 of file SVDCoGCalibrationFunction.h.

◆ m_nPar

const int m_nPar = 6
staticprivate

number of parameters of highest-order implemented pol (5)

Definition at line 161 of file SVDCoGCalibrationFunction.h.

◆ m_par

double m_par[m_nPar] = {0}
private

vector of parameters

Definition at line 162 of file SVDCoGCalibrationFunction.h.

◆ m_scale

double m_scale[nTriggerBins] = {0}
private

trigger-bin dependent scale

Definition at line 147 of file SVDCoGCalibrationFunction.h.

◆ nTriggerBins

const int nTriggerBins = 4
staticprivate

total number of trigger bins

Definition at line 141 of file SVDCoGCalibrationFunction.h.


The documentation for this class was generated from the following files: