|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GeoModelKernel/throwExcept.h"
14 init(nb_coefficients);
34 init(nb_coefficients);
37 const unsigned int first_point,
38 const unsigned int last_point,
40 if (first_point<1 || first_point>sample_point.size()) {
41 THROW_EXCEPTION(
"BaseFunctionFitter::fit_parameters() - ERROR: Illegal first point "
42 <<first_point<<
", must be >=1 and <="<<sample_point.size());
44 if (last_point<first_point || last_point>sample_point.size()) {
45 THROW_EXCEPTION(
"BaseFunctionFitter::fit_parameters() - ERROR: Illegal last point "<<last_point
46 <<
", must be >="<<first_point<<
" and <="<<sample_point.size());
53 for (
unsigned k=first_point-1;
k<last_point; ++
k) {
54 m_A.fillSymmetric(j,
p,
m_A(j,
p)+base_function.
value(j,sample_point[
k].x1())
55 *base_function.
value(
p,sample_point[
k].x1()) /
59 for (
unsigned k=first_point-1;
k<last_point;
k++) {
60 m_b[j] =
m_b[j]+sample_point[
k].x2()* base_function.
value(j, sample_point[
k].
x1()) /
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
const Amg::VectorX & coefficients() const
get the coefficients determined by the fit to the sample points
virtual double value(const int k, const double x) const =0
get the value of the k-th base function at x
#define THROW_EXCEPTION(MSG)
void init()
default initialization method
Amg::MatrixX m_A
coefficient matrix for the fit
void set_number_of_coefficients(const unsigned nb_coefficients)
set the number of fit parameters (coefficients) of the base functions to nb_coefficients
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
void fit_parameters(const std::vector< SamplePoint > &sample_point, const unsigned int first_point, const unsigned int last_point, const BaseFunction &base_function)
perform a fit of the base functions (base_function) to the sample points as given in "sample_point" s...
Amg::VectorX m_alpha
coefficients of the base functions after the fit
BaseFunctionFitter()
default constructor, the number of fit parameters will be set to 5
unsigned int m_nb_coefficients
number of coefficients
Amg::VectorX m_b
m_A*m_alpha = m_b;
constexpr int pow(int base, int exp) noexcept
int number_of_coefficients() const
get the number of fit parameters (coefficients) of the base functions to be fitted