Belle II Software development
CDCDedxMeanPred Class Reference

Class to hold the prediction of mean as a function of beta-gamma (bg) More...

#include <CDCDedxMeanPred.h>

Public Member Functions

std::vector< double > getMeanVector () const
 Return the mean vector from payload.
 
double getMean (double bg)
 Return the predicted mean value as a function of beta-gamma (bg)
 
double meanCurve (double *x, double *par, int version) const
 beta-gamma (bg) curve function
 

Private Attributes

std::vector< double > m_meanpars
 dE/dx mean parameters
 
const DBObjPtr< CDCDedxMeanParsm_DBMeanPars
 db object for dE/dx mean parameters
 

Detailed Description

Class to hold the prediction of mean as a function of beta-gamma (bg)

Definition at line 26 of file CDCDedxMeanPred.h.

Member Function Documentation

◆ getMean()

double getMean ( double  bg)

Return the predicted mean value as a function of beta-gamma (bg)

Definition at line 32 of file CDCDedxMeanPred.cc.

33{
35
36 // define the section of the mean to use
37 double A = 0, B = 0, C = 0;
38 if (bg < 4.5)
39 A = 1;
40 else if (bg < 10)
41 B = 1;
42 else
43 C = 1;
44
45 double x[1]; x[0] = bg;
46 double parsA[9];
47 double parsB[5];
48 double parsC[5];
49
50 parsA[0] = 1; parsB[0] = 2; parsC[0] = 3;
51 for (int i = 0; i < 15; ++i) {
52 if (i < 7) parsA[i + 1] = m_meanpars[i];
53 else if (i < 11) parsB[i % 7 + 1] = m_meanpars[i];
54 else parsC[i % 11 + 1] = m_meanpars[i];
55 }
56
57 // calculate dE/dx from the Bethe-Bloch mean
58 double partA = meanCurve(x, parsA, 0);
59 double partB = meanCurve(x, parsB, 0);
60 double partC = meanCurve(x, parsC, 0);
61
62 return (A * partA + B * partB + C * partC);
63}
std::vector< double > getMeanVector() const
Return the mean vector from payload.
double meanCurve(double *x, double *par, int version) const
beta-gamma (bg) curve function
std::vector< double > m_meanpars
dE/dx mean parameters

◆ getMeanVector()

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

Return the mean vector from payload.

Definition at line 33 of file CDCDedxMeanPred.h.

34 {
35 if (!m_DBMeanPars || m_DBMeanPars->getSize() == 0) {
36 B2WARNING("No dE/dx mean parameters!");
37 std::vector<double> meanpar;
38 for (int i = 0; i < 15; ++i)
39 meanpar.push_back(1.0);
40 return meanpar;
41 } else
42 return m_DBMeanPars->getMeanPars();
43 }
const DBObjPtr< CDCDedxMeanPars > m_DBMeanPars
db object for dE/dx mean parameters

◆ meanCurve()

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

beta-gamma (bg) curve function

Definition at line 13 of file CDCDedxMeanPred.cc.

14{
15 // calculate the predicted mean value as a function of beta-gamma (bg)
16 // this is done with a different function depending on the value of bg
17 double f = 0;
18
19 if (version == 0) {
20 if (par[0] == 1)
21 f = par[1] * std::pow(std::sqrt(x[0] * x[0] + 1), par[3]) / std::pow(x[0], par[3]) *
22 (par[2] - par[5] * std::log(1 / x[0])) - par[4] + std::exp(par[6] + par[7] * x[0]);
23 else if (par[0] == 2)
24 f = par[1] * std::pow(x[0], 3) + par[2] * x[0] * x[0] + par[3] * x[0] + par[4];
25 else if (par[0] == 3)
26 f = -1.0 * par[1] * std::log(par[4] + std::pow(1 / x[0], par[2])) + par[3];
27 }
28
29 return f;
30}

Member Data Documentation

◆ m_DBMeanPars

const DBObjPtr<CDCDedxMeanPars> m_DBMeanPars
private

db object for dE/dx mean parameters

Definition at line 60 of file CDCDedxMeanPred.h.

◆ m_meanpars

std::vector<double> m_meanpars
private

dE/dx mean parameters

Definition at line 58 of file CDCDedxMeanPred.h.


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