Belle II Software development
SVDMCFudgeFactorFunction Class Reference

class to contain the MC fudge factor formulae More...

#include <SVDMCFudgeFactorFunction.h>

Inheritance diagram for SVDMCFudgeFactorFunction:

Public Types

typedef double(SVDMCFudgeFactorFunction::* fudgeFactorFunction) (double) const
 typedef of the return value of the fudge factor function
 

Public Member Functions

double getFudgeFactor (double trkAngle) const
 returns the fudge factor, depending on the track's angle
 
 SVDMCFudgeFactorFunction ()
 constructor
 
void set_current (int current)
 allows to choose the function version
 
void set_chebyCoeffs (std::vector< double > c)
 Set the vector of Chebyshev coefficients Input:
 
void set_graphPoints (std::vector< double > x, std::vector< double > y)
 Set vectors of TGraph points (x for angles, y for sigmas) Input:
 
 SVDMCFudgeFactorFunction (const Belle2::SVDMCFudgeFactorFunction &a)
 copy constructor
 
SVDMCFudgeFactorFunctionoperator= (const Belle2::SVDMCFudgeFactorFunction &a)
 operator =
 

Private Member Functions

double cheby_v0 (double trkAngle) const
 cheby_v0 implementation
 
double tgraph_v0 (double trkAngle) const
 tgraph_v0 implementation
 
 ClassDef (SVDMCFudgeFactorFunction, 2)
 Do not stream this, please throw it in the WC.
 

Private Attributes

std::vector< double > m_chebyCoeffs
 function parameters & implementations
 
std::vector< double > m_x
 ID = {1}, rel07: fudge factor parametrized with linear interpolation between graph points.
 
std::vector< double > m_y
 Vectors of TGraph points for the sigmas.
 
int m_current
 current function ID
 

Static Private Attributes

static std::vector< fudgeFactorFunctionm_implementations
 vector of functions for fudge factor computation, we use the m_current
 

Detailed Description

class to contain the MC fudge factor formulae

Definition at line 28 of file SVDMCFudgeFactorFunction.h.

Member Typedef Documentation

◆ fudgeFactorFunction

typedef double(SVDMCFudgeFactorFunction::* fudgeFactorFunction) (double) const

typedef of the return value of the fudge factor function

Definition at line 33 of file SVDMCFudgeFactorFunction.h.

Constructor & Destructor Documentation

◆ SVDMCFudgeFactorFunction() [1/2]

constructor

Definition at line 43 of file SVDMCFudgeFactorFunction.h.

44 {
45 // The m_implementations vector is static.
46 // We have to initialize it just once.
47 if (m_implementations.size() == 0) {
50 }
51
52 m_current = m_implementations.size() - 1;
53
54 };
double tgraph_v0(double trkAngle) const
tgraph_v0 implementation
double cheby_v0(double trkAngle) const
cheby_v0 implementation
static std::vector< fudgeFactorFunction > m_implementations
vector of functions for fudge factor computation, we use the m_current

◆ SVDMCFudgeFactorFunction() [2/2]

copy constructor

Definition at line 15 of file SVDMCFudgeFactorFunction.cc.

15 : TObject(a)
16{
17 m_chebyCoeffs = a.m_chebyCoeffs;
18
19 m_x = a.m_x;
20 m_y = a.m_y;
21
22 m_current = a.m_current;
23
24}
std::vector< double > m_chebyCoeffs
function parameters & implementations
std::vector< double > m_y
Vectors of TGraph points for the sigmas.
std::vector< double > m_x
ID = {1}, rel07: fudge factor parametrized with linear interpolation between graph points.

Member Function Documentation

◆ cheby_v0()

double cheby_v0 ( double  trkAngle) const
inlineprivate

cheby_v0 implementation

Parameters
trkAngletrack's incident angle
Returns
fudge factor as a function of the track's angle

Definition at line 105 of file SVDMCFudgeFactorFunction.h.

106 {
107 TF1* f = (TF1*) gROOT->GetFunction(TString::Format("chebyshev%lu", m_chebyCoeffs.size() - 1));
108 f->SetParameters(&m_chebyCoeffs[0]);
109
110 return f->Eval(trkAngle);
111 };

◆ getFudgeFactor()

double getFudgeFactor ( double  trkAngle) const
inline

returns the fudge factor, depending on the track's angle

Definition at line 36 of file SVDMCFudgeFactorFunction.h.

37 {
39 return (this->*f)(trkAngle) ;
40 }
double(SVDMCFudgeFactorFunction::* fudgeFactorFunction)(double) const
typedef of the return value of the fudge factor function

◆ operator=()

operator =

Definition at line 26 of file SVDMCFudgeFactorFunction.cc.

27{
28 if (this == &a)
29 return *this;
30
31 m_chebyCoeffs = a.m_chebyCoeffs;
32
33 m_x = a.m_x;
34 m_y = a.m_y;
35
36 m_current = a.m_current;
37
38 return *this;
39}

◆ set_chebyCoeffs()

void set_chebyCoeffs ( std::vector< double >  c)
inline

Set the vector of Chebyshev coefficients Input:

Parameters
c

Definition at line 68 of file SVDMCFudgeFactorFunction.h.

69 {
70 m_chebyCoeffs = c;
71 }

◆ set_current()

void set_current ( int  current)
inline

allows to choose the function version

Definition at line 57 of file SVDMCFudgeFactorFunction.h.

58 {
59 m_current = current;
60 }

◆ set_graphPoints()

void set_graphPoints ( std::vector< double >  x,
std::vector< double >  y 
)
inline

Set vectors of TGraph points (x for angles, y for sigmas) Input:

Parameters
x
y

Definition at line 80 of file SVDMCFudgeFactorFunction.h.

81 {
82 m_x = x;
83 m_y = y;
84 }

◆ tgraph_v0()

double tgraph_v0 ( double  trkAngle) const
inlineprivate

tgraph_v0 implementation

Parameters
trkAngletrack's incident angle
Returns
fudge factor as a function of the track's angle

Definition at line 125 of file SVDMCFudgeFactorFunction.h.

126 {
127 TGraph* g = new TGraph(m_x.size(), &m_x[0], &m_y[0]);
128 double returnvalue = g->Eval(trkAngle);
129 delete g;
130
131 return returnvalue;
132 };

Member Data Documentation

◆ m_chebyCoeffs

std::vector<double> m_chebyCoeffs
private

function parameters & implementations

ID = {0}, rel07: fudge factor parametrized with Chebyshev polynomial Vector of Chebyshev coefficients

Definition at line 99 of file SVDMCFudgeFactorFunction.h.

◆ m_current

int m_current
private

current function ID

Definition at line 135 of file SVDMCFudgeFactorFunction.h.

◆ m_implementations

std::vector< SVDMCFudgeFactorFunction::fudgeFactorFunction > m_implementations
staticprivate

vector of functions for fudge factor computation, we use the m_current

Definition at line 138 of file SVDMCFudgeFactorFunction.h.

◆ m_x

std::vector<double> m_x
private

ID = {1}, rel07: fudge factor parametrized with linear interpolation between graph points.

Vectors of TGraph points for the angles

Definition at line 117 of file SVDMCFudgeFactorFunction.h.

◆ m_y

std::vector<double> m_y
private

Vectors of TGraph points for the sigmas.

Definition at line 119 of file SVDMCFudgeFactorFunction.h.


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