#include <BaseFunctionFitter.h>
|
void | init (void) |
| default initialization method More...
|
|
void | init (const int &nb_coefficients) |
| initialization method: the number of fit parameters (coefficients) is set to nb_coefficients More...
|
|
This class performs a fit of a linear combination of base functions to a set of sample points.
- Author
- Olive.nosp@m.r.Ko.nosp@m.rtner.nosp@m.@cer.nosp@m.n.ch
- Date
- 05.04.2005
Definition at line 47 of file BaseFunctionFitter.h.
◆ BaseFunctionFitter() [1/2]
MuonCalib::BaseFunctionFitter::BaseFunctionFitter |
( |
void |
| ) |
|
|
inline |
default constructor, the number of fit parameters will be set to 5
Definition at line 65 of file BaseFunctionFitter.h.
◆ BaseFunctionFitter() [2/2]
MuonCalib::BaseFunctionFitter::BaseFunctionFitter |
( |
const int & |
nb_coefficients | ) |
|
|
inline |
constructor, the number of fit parameters is set to nb_coefficients
Definition at line 69 of file BaseFunctionFitter.h.
70 init(nb_coefficients);
◆ coefficients()
Amg::VectorX MuonCalib::BaseFunctionFitter::coefficients |
( |
void |
| ) |
const |
|
inline |
get the coefficients determined by the fit to the sample points
◆ fit_parameters()
bool MuonCalib::BaseFunctionFitter::fit_parameters |
( |
const std::vector< SamplePoint > & |
sample_point, |
|
|
const unsigned int & |
first_point, |
|
|
const unsigned int & |
last_point, |
|
|
BaseFunction * |
base_function |
|
) |
| |
perform a fit of the base functions (base_function) to the sample points as given in "sample_point" starting at the sample point first_point and stopping at the point last_point, 1 <= first_point < last_point <= size of the sample_point vector; the method returns true, if the fit failed
Definition at line 18 of file BaseFunctionFitter.cxx.
28 if (first_point<1 || first_point>sample_point.size()) {
29 throw std::runtime_error(Form(
"File: %s, Line: %d\nBaseFunctionFitter::fit_parameters() - ERROR: Illegal first point %d, must be >=1 and <=%lu", __FILE__, __LINE__, first_point, sample_point.size()));
31 if (last_point<first_point || last_point>sample_point.size()) {
32 throw std::runtime_error(Form(
"File: %s, Line: %d\nBaseFunctionFitter::fit_parameters() - ERROR: Illegal last point %d, must be >=%d and <=%lu", __FILE__, __LINE__, last_point, first_point, sample_point.size()));
45 for (
unsigned int k=first_point-1;
k<last_point;
k++) {
46 m_A.fillSymmetric(j,
p,
m_A(j,
p)+base_function->value(j,sample_point[
k].x1())
47 *base_function->value(
p,sample_point[
k].x1())/
54 for (
unsigned int k=first_point-1;
k<last_point;
k++) {
55 m_b[j] =
m_b[j]+sample_point[
k].x2()*
56 base_function->value(j,
57 sample_point[
k].
x1())/
◆ init() [1/2]
void MuonCalib::BaseFunctionFitter::init |
( |
const int & |
nb_coefficients | ) |
|
|
inlineprivate |
initialization method: the number of fit parameters (coefficients) is set to nb_coefficients
◆ init() [2/2]
void MuonCalib::BaseFunctionFitter::init |
( |
void |
| ) |
|
|
inlineprivate |
default initialization method
◆ number_of_coefficients()
int MuonCalib::BaseFunctionFitter::number_of_coefficients |
( |
void |
| ) |
const |
|
inline |
get the number of fit parameters (coefficients) of the base functions to be fitted
◆ set_number_of_coefficients()
void MuonCalib::BaseFunctionFitter::set_number_of_coefficients |
( |
const int & |
nb_coefficients | ) |
|
|
inline |
set the number of fit parameters (coefficients) of the base functions to nb_coefficients
◆ m_A
◆ m_alpha
◆ m_b
◆ m_nb_coefficients
int MuonCalib::BaseFunctionFitter::m_nb_coefficients |
|
private |
The documentation for this class was generated from the following files: