Belle II Software development
CDCDedxSigmaPred Class Reference

Class to hold the prediction of resolution depending dE/dx, nhit, and cos(theta) More...

#include <CDCDedxSigmaPred.h>

Public Member Functions

std::vector< double > getSigmaVector () const
 Return the resolution vector from payload.
 
double sigmaCurve (double *x, const double *par, int version) const
 resolution functions depending on dE/dx, nhit, and cos(theta)
 
double getSigma (double dedx, double nhit, double cos, double timereso)
 Return the predicted resolution depending on dE/dx, nhit, and cos(theta)
 
double nhitPrediction (double nhit)
 Return sigma from the nhit parameterization.
 
double ionzPrediction (double dedx)
 Return sigma from the ionization parameterization.
 
double cosPrediction (double cos)
 Return sigma from the cos parameterization.
 

Private Attributes

std::vector< double > m_sigmapars
 dE/dx resolution parameters
 
const DBObjPtr< CDCDedxSigmaParsm_DBSigmaPars
 db object for dE/dx resolution parameters
 

Detailed Description

Class to hold the prediction of resolution depending dE/dx, nhit, and cos(theta)

Definition at line 31 of file CDCDedxSigmaPred.h.

Member Function Documentation

◆ cosPrediction()

double cosPrediction ( double  cos)

Return sigma from the cos parameterization.

Definition at line 92 of file CDCDedxSigmaPred.cc.

93{
94
96 double x[1];
97 double corCos;
98
99 if (m_sigmapars.size() == 17) {
100 double cospar[11];
101 cospar[0] = 3;
102 for (int i = 0; i < 10; ++i) {
103 cospar[i + 1] = m_sigmapars[i + 7];
104 }
105 x[0] = cos;
106 corCos = sigmaCurve(x, cospar, 0);
107 }
108
109 else {
110 double sinpar[6];
111
112 sinpar[0] = 2;
113 for (int i = 0; i < 5; ++i) {
114 sinpar[i + 1] = m_sigmapars[i + 7];
115 }
116
117 double sin = sqrt(1 - cos * cos);
118 if (sin > 0.99) sin = 0.99;
119 x[0] = sin;
120
121 corCos = sigmaCurve(x, sinpar, 0);
122 }
123
124 return corCos;
125}
double sigmaCurve(double *x, const double *par, int version) const
resolution functions depending on dE/dx, nhit, and cos(theta)
std::vector< double > m_sigmapars
dE/dx resolution parameters
std::vector< double > getSigmaVector() const
Return the resolution vector from payload.
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ getSigma()

double getSigma ( double  dedx,
double  nhit,
double  cos,
double  timereso 
)

Return the predicted resolution depending on dE/dx, nhit, and cos(theta)

Definition at line 35 of file CDCDedxSigmaPred.cc.

36{
37 double correction = cosPrediction(cos) * nhitPrediction(nhit) * ionzPrediction(dedx) * timereso;
38 return correction;
39}
double ionzPrediction(double dedx)
Return sigma from the ionization parameterization.
double cosPrediction(double cos)
Return sigma from the cos parameterization.
double nhitPrediction(double nhit)
Return sigma from the nhit parameterization.

◆ getSigmaVector()

std::vector< double > getSigmaVector ( ) const
inline

Return the resolution vector from payload.

Definition at line 38 of file CDCDedxSigmaPred.h.

39 {
40
41 // make sure the resolution parameters are reasonable
42 if (!m_DBSigmaPars || m_DBSigmaPars->getSize() == 0) {
43 B2WARNING("No dE/dx sigma parameters!");
44 std::vector<double> sigmapar;
45 for (int i = 0; i < 12; ++i)
46 sigmapar.push_back(1.0);
47 return sigmapar;
48 } else return m_DBSigmaPars->getSigmaPars();
49 }
const DBObjPtr< CDCDedxSigmaPars > m_DBSigmaPars
db object for dE/dx resolution parameters

◆ ionzPrediction()

double ionzPrediction ( double  dedx)

Return sigma from the ionization parameterization.

Definition at line 72 of file CDCDedxSigmaPred.cc.

73{
74
76 double x[1];
77 double dedxpar[3];
78
79 dedxpar[0] = 1;
80
81 for (int i = 0; i < 2; ++i) {
82 dedxpar[i + 1] = m_sigmapars[i];
83
84 }
85 // determine sigma from the parameterization
86 x[0] = dedx;
87 double corDedx = sigmaCurve(x, dedxpar, 0);
88
89 return corDedx;
90}

◆ nhitPrediction()

double nhitPrediction ( double  nhit)

Return sigma from the nhit parameterization.

Definition at line 42 of file CDCDedxSigmaPred.cc.

43{
44
46 double x[1];
47 double nhitpar[6];
48
49 nhitpar[0] = 2;
50 for (int i = 0; i < 5; ++i) {
51 nhitpar[i + 1] = m_sigmapars[i + 2];
52 }
53
54 // determine sigma from the nhit parameterization
55 x[0] = nhit;
56
57 double corNHit;
58 int nhit_min = 8, nhit_max = 37;
59
60 if (nhit < nhit_min) {
61 x[0] = nhit_min;
62 corNHit = sigmaCurve(x, nhitpar, 0) * sqrt(nhit_min / nhit);
63 } else if (nhit > nhit_max) {
64 x[0] = nhit_max;
65 corNHit = sigmaCurve(x, nhitpar, 0) * sqrt(nhit_max / nhit);
66 } else corNHit = sigmaCurve(x, nhitpar, 0);
67
68
69 return corNHit;
70}

◆ sigmaCurve()

double sigmaCurve ( double *  x,
const double *  par,
int  version 
) const

resolution functions depending on dE/dx, nhit, and cos(theta)

Definition at line 13 of file CDCDedxSigmaPred.cc.

14{
15 // calculate the predicted mean value as a function of beta-gamma (bg)
16 // this is done with a different function depending dE/dx, nhit, and cos(theta)
17 double f = 0;
18
19 if (version == 0) {
20 if (par[0] == 1) { // return dedx parameterization
21 f = par[1] + par[2] * x[0];
22 } else if (par[0] == 2) { // return nhit or sin(theta) parameterization
23 f = par[1] * std::pow(x[0], 4) + par[2] * std::pow(x[0], 3) +
24 par[3] * x[0] * x[0] + par[4] * x[0] + par[5];
25 } else if (par[0] == 3) { // return cos(theta) parameterization
26 f = par[1] * exp(-0.5 * pow(((x[0] - par[2]) / par[3]), 2)) +
27 par[4] * pow(x[0], 6) + par[5] * pow(x[0], 5) + par[6] * pow(x[0], 4) +
28 par[7] * pow(x[0], 3) + par[8] * x[0] * x[0] + par[9] * x[0] + par[10];
29 }
30 }
31
32 return f;
33}

Member Data Documentation

◆ m_DBSigmaPars

const DBObjPtr<CDCDedxSigmaPars> m_DBSigmaPars
private

db object for dE/dx resolution parameters

Definition at line 80 of file CDCDedxSigmaPred.h.

◆ m_sigmapars

std::vector<double> m_sigmapars
private

dE/dx resolution parameters

Definition at line 78 of file CDCDedxSigmaPred.h.


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