Belle II Software development
SVDPositionErrorFunction Class Reference

class to contain the Cluster Position Error Formulae More...

#include <SVDPositionErrorFunction.h>

Inheritance diagram for SVDPositionErrorFunction:

Public Types

typedef double(SVDPositionErrorFunction::* posErrFunction) (double, int) const
 typedef of the return value of the position error function
 

Public Member Functions

double getPositionError (double snr, int size) const
 returns the position error, depending on the cluster SNR and size
 
 SVDPositionErrorFunction ()
 constructor
 
void set_current (int current)
 allows to choose the function version
 
void set_a1 (double a1_1, double a1_2, double a1_3, double a1_4, double a1_5)
 set the a1 cluster size dependent parameters
 
void set_a2 (double a2_1, double a2_2, double a2_3, double a2_4, double a2_5)
 set the a2 cluster size dependent parameters
 
void set_b1 (double b1_1, double b1_2, double b1_3, double b1_4, double b1_5)
 set the b1 cluster size dependent parameters
 
void set_c1 (double c1_1, double c1_2, double c1_3, double c1_4, double c1_5)
 set the c1 cluster size dependent parameters
 
 SVDPositionErrorFunction (const Belle2::SVDPositionErrorFunction &a)
 copy constructor
 
SVDPositionErrorFunctionoperator= (const Belle2::SVDPositionErrorFunction &a)
 operator =
 

Private Member Functions

double v0 (double clSNR, int clSize) const
 v0 implementation
 
 ClassDef (SVDPositionErrorFunction, 2)
 Do not stream this, please throw it in the WC.
 

Private Attributes

double m_a1 [maxClusterSize] = {3, 3, 3, 3, 3}
 function parameters & implementations
 
double m_a2 [maxClusterSize] = {3, 0, 0, 0, 0}
 size dependent a2-parameter
 
double m_b1 [maxClusterSize] = {0}
 size dependent b1-parameter
 
double m_c1 [maxClusterSize] = {0}
 size dependent c1-parameter
 
int m_current
 current function ID
 

Static Private Attributes

static const int maxClusterSize = 5
 total number of cluster sizes
 
static std::vector< posErrFunctionm_implementations
 vector of functions for position error, we use the m_current
 

Detailed Description

class to contain the Cluster Position Error Formulae

Definition at line 24 of file SVDPositionErrorFunction.h.

Member Typedef Documentation

◆ posErrFunction

typedef double(SVDPositionErrorFunction::* posErrFunction) (double, int) const

typedef of the return value of the position error function

Definition at line 29 of file SVDPositionErrorFunction.h.

Constructor & Destructor Documentation

◆ SVDPositionErrorFunction() [1/2]

constructor

Definition at line 39 of file SVDPositionErrorFunction.h.

40 {
41 // The m_implementations vector is static.
42 // We have to initialize it just once.
43 if (m_implementations.size() == 0) {
45 //m_implementations.push_back(
46 // &SVDPositionErrorFunction::betterVersion);
47 }
48
49 m_current = m_implementations.size() - 1;
50
51 };
static std::vector< posErrFunction > m_implementations
vector of functions for position error, we use the m_current
double v0(double clSNR, int clSize) const
v0 implementation

◆ SVDPositionErrorFunction() [2/2]

copy constructor

Definition at line 15 of file SVDPositionErrorFunction.cc.

15 : TObject(a)
16{
17 for (int i = 0; i < maxClusterSize; i++) {
18 m_a1[i] = a.m_a1[i];
19 m_a2[i] = a.m_a2[i];
20 m_b1[i] = a.m_b1[i];
21 m_c1[i] = a.m_c1[i];
22 }
23
24 m_current = a.m_current;
25
26}
static const int maxClusterSize
total number of cluster sizes
double m_a1[maxClusterSize]
function parameters & implementations
double m_a2[maxClusterSize]
size dependent a2-parameter
double m_c1[maxClusterSize]
size dependent c1-parameter
double m_b1[maxClusterSize]
size dependent b1-parameter

Member Function Documentation

◆ getPositionError()

double getPositionError ( double  snr,
int  size 
) const
inline

returns the position error, depending on the cluster SNR and size

Definition at line 32 of file SVDPositionErrorFunction.h.

33 {
35 return (this->*f)(snr, size) ;
36 }
double(SVDPositionErrorFunction::* posErrFunction)(double, int) const
typedef of the return value of the position error function

◆ operator=()

operator =

Definition at line 28 of file SVDPositionErrorFunction.cc.

29{
30 if (this == &a)
31 return *this;
32
33 for (int i = 0; i < maxClusterSize; i++) {
34 m_a1[i] = a.m_a1[i];
35 m_a2[i] = a.m_a2[i];
36 m_b1[i] = a.m_b1[i];
37 m_c1[i] = a.m_c1[i];
38 }
39
40 m_current = a.m_current;
41
42 return *this;
43}

◆ set_a1()

void set_a1 ( double  a1_1,
double  a1_2,
double  a1_3,
double  a1_4,
double  a1_5 
)
inline

set the a1 cluster size dependent parameters

Definition at line 61 of file SVDPositionErrorFunction.h.

62 {
63 m_a1[0] = a1_1;
64 m_a1[1] = a1_2;
65 m_a1[2] = a1_3;
66 m_a1[3] = a1_4;
67 m_a1[4] = a1_5;
68 }

◆ set_a2()

void set_a2 ( double  a2_1,
double  a2_2,
double  a2_3,
double  a2_4,
double  a2_5 
)
inline

set the a2 cluster size dependent parameters

Definition at line 70 of file SVDPositionErrorFunction.h.

71 {
72 m_a2[0] = a2_1;
73 m_a2[1] = a2_2;
74 m_a2[2] = a2_3;
75 m_a2[3] = a2_4;
76 m_a2[4] = a2_5;
77 }

◆ set_b1()

void set_b1 ( double  b1_1,
double  b1_2,
double  b1_3,
double  b1_4,
double  b1_5 
)
inline

set the b1 cluster size dependent parameters

Definition at line 79 of file SVDPositionErrorFunction.h.

80 {
81 m_b1[0] = b1_1;
82 m_b1[1] = b1_2;
83 m_b1[2] = b1_3;
84 m_b1[3] = b1_4;
85 m_b1[4] = b1_5;
86 }

◆ set_c1()

void set_c1 ( double  c1_1,
double  c1_2,
double  c1_3,
double  c1_4,
double  c1_5 
)
inline

set the c1 cluster size dependent parameters

Definition at line 89 of file SVDPositionErrorFunction.h.

90 {
91 m_c1[0] = c1_1;
92 m_c1[1] = c1_2;
93 m_c1[2] = c1_3;
94 m_c1[3] = c1_4;
95 m_c1[4] = c1_5;
96 }

◆ set_current()

void set_current ( int  current)
inline

allows to choose the function version

Definition at line 54 of file SVDPositionErrorFunction.h.

55 {
56 m_current = current;
57 }

◆ v0()

double v0 ( double  clSNR,
int  clSize 
) const
inlineprivate

v0 implementation

Parameters
clSNRcluster SNR
clSizecluster size
Returns
final cluster position error, including scale factor

Definition at line 128 of file SVDPositionErrorFunction.h.

129 {
130
131 double x = sqrt(clSize) * clSNR;
132
133 if (clSize > maxClusterSize)
134 clSize = maxClusterSize;
135
136 double A = m_a1[clSize - 1] / (x + m_a2[clSize - 1]);
137 double B = m_b1[clSize - 1] * x;
138 double C = m_c1[clSize - 1];
139
140 return sqrt(A * A + B * B + C * C);
141 };
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

Member Data Documentation

◆ m_a1

double m_a1[maxClusterSize] = {3, 3, 3, 3, 3}
private

function parameters & implementations

ID = {0}, rel05: error is the sum in quadrature of A = a1/(x+a2) B = b1 * x C = c1 with x = S_cl / N_cl * sqrt(size) size dependent a1-parameter

Definition at line 118 of file SVDPositionErrorFunction.h.

◆ m_a2

double m_a2[maxClusterSize] = {3, 0, 0, 0, 0}
private

size dependent a2-parameter

Definition at line 119 of file SVDPositionErrorFunction.h.

◆ m_b1

double m_b1[maxClusterSize] = {0}
private

size dependent b1-parameter

Definition at line 120 of file SVDPositionErrorFunction.h.

◆ m_c1

double m_c1[maxClusterSize] = {0}
private

size dependent c1-parameter

Definition at line 121 of file SVDPositionErrorFunction.h.

◆ m_current

int m_current
private

current function ID

Definition at line 144 of file SVDPositionErrorFunction.h.

◆ m_implementations

std::vector< SVDPositionErrorFunction::posErrFunction > m_implementations
staticprivate

vector of functions for position error, we use the m_current

Definition at line 147 of file SVDPositionErrorFunction.h.

◆ maxClusterSize

const int maxClusterSize = 5
staticprivate

total number of cluster sizes

Definition at line 108 of file SVDPositionErrorFunction.h.


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