9#include <cdc/dbobjects/CDCDedxSigmaPars.h>
10#include <framework/logging/Logger.h>
11#include <framework/utilities/MathHelpers.h>
28 f = par[1] + par[2] * x;
29 }
else if (par[0] == 2) {
30 f = par[1] * x * x * x * x + par[2] * x * x * x + par[3] * x * x + par[4] * x + par[5];
31 }
else if (par[0] == 3) {
32 f = par[1] * std::exp(-0.5 *
square(((x - par[2]) / par[3]))) +
33 par[4] * (
pow5(x) * x) + par[5] *
pow5(x) + par[6] *
pow4(x) +
34 par[7] * x * x * x + par[8] * x * x + par[9] * x + par[10];
44 if (params.size() < 17) B2FATAL(
"CDCDedxSigmaPars: vector of parameters too short");
49 dedxpar[0] = 1; nhitpar[0] = 2; cospar[0] = 3;
50 for (
int i = 0; i < 10; ++i) {
51 if (i < 2) dedxpar[i + 1] = params[i];
52 if (i < 5) nhitpar[i + 1] = params[i + 2];
53 cospar[i + 1] = params[i + 7];
59 double nhit_min = 8, nhit_max = 37;
61 if (nhit < nhit_min) {
62 corNHit =
sigmaCurve(nhit_min, nhitpar, 0) * std::sqrt(nhit_min / nhit);
63 }
else if (nhit > nhit_max) {
64 corNHit =
sigmaCurve(nhit_max, nhitpar, 0) * std::sqrt(nhit_max / nhit);
69 double corCos =
sigmaCurve(cosTheta, cospar, 0);
71 return (corDedx * corCos * corNHit * timereso);
std::vector< double > m_sigmapars
dE/dx resolution parameters
double sigmaCurve(double x, const double *par, int version) const
parameterized resolution for predictions
double getSigma(double dedx, double nhit, double cosTheta, double timeReso) const
Returns predicted dE/dx sigma.
constexpr T square(const T &x)
Calculate the square of the input.
constexpr T pow5(const T &x)
Calculate the fifth power of the input.
constexpr T pow4(const T &x)
Calculate the fourth power of the input.
Abstract base class for different kinds of events.