Base class for constrained fitter.
More...
#include <Base_Constrainer.h>
|
| Base_Constrainer (const Base_Constrainer_Args &args) |
|
virtual double | fit (Constraint_Calculator &constraint_calculator, const Column_Vector &xm, Column_Vector &x, const Column_Vector &ym, Column_Vector &y, const Matrix &G_i, const Diagonal_Matrix &Y, Column_Vector &pullx, Column_Vector &pully, Matrix &Q, Matrix &R, Matrix &S)=0 |
| Perform the constrained fit. More...
|
|
virtual std::ostream & | print (std::ostream &s) const |
| Print out internal state to output stream. More...
|
|
virtual | ~Base_Constrainer () |
|
Base class for constrained fitter.
Definition at line 228 of file Base_Constrainer.h.
Constructor.
- Parameters
-
args | Contains the parameter settings for this instance. |
Definition at line 174 of file Base_Constrainer.cc.
virtual hitfit::Base_Constrainer::~Base_Constrainer |
( |
| ) |
|
|
inlinevirtual |
Helper function to evaluate constraints. This takes care of checking what the user function returns againts numerical derivatives, it that was requested.
- Purpose
- Call the constraint function for the point (x,y). Return F, Bx, By, and a boolean flag saying if the point is acceptable. If test_gradient is on, we verify the gradients returned by also computing them numerically.
- Parameters
-
constraint_calculator | the User-supplied object to evaluate the constraints. |
x | Vector of well-measured quantities where we evaluate the constraints. Has dimension of Nw. |
y | Vector of poorly-measured quantities where we evaluate the the constraints. Has dimension of Np. |
F | Results of the constraint functions. |
Bx | Gradients of F with respect to x, has dimension (Nw,Nc). |
By | Gradients of F with respect to y, has dimension (Np,Nc). |
- Input:
- constraint_calculator, x, y.
- Output:
- F, Bx, By.
- Return:
- true if the point (x,y) is accepted.
false if the point (x,y) is rejected
Definition at line 230 of file Base_Constrainer.cc.
virtual double hitfit::Base_Constrainer::fit |
( |
Constraint_Calculator & |
constraint_calculator, |
|
|
const Column_Vector & |
xm, |
|
|
Column_Vector & |
x, |
|
|
const Column_Vector & |
ym, |
|
|
Column_Vector & |
y, |
|
|
const Matrix & |
G_i, |
|
|
const Diagonal_Matrix & |
Y, |
|
|
Column_Vector & |
pullx, |
|
|
Column_Vector & |
pully, |
|
|
Matrix & |
Q, |
|
|
Matrix & |
R, |
|
|
Matrix & |
S |
|
) |
| |
|
pure virtual |
Perform the constrained fit.
- Parameters
-
constraint_calculator | The object that will be used to evaluate the constraints. |
xm | Measured values of the well-measured variables, has dimension Nw. |
x | Before the fit: starting value of the well-measured variables for the fit, has dimension Nw. After the fit: final values of the well-measured variables. |
ym | Measured values of the poorly-measured variables, has dimension Np. |
y | Before the fit: starting value of the poorly-measured variables for the fit, has dimension Np. After the fit: final values of the poorly-measured variables. |
G_i | Error matrix for the well-measured variables, has dimension Nw,Nw. |
Y | Inverse error matrix for the poorly-measured variables, has dimension Np,Np. |
pullx | Pull quantities for the well-measured variables, has dimension Nw. |
pully | Pull quantities for the poorly-measured variables, has dimension Np. |
Q | Error matrix for the well-measured variables, has dimension Nw,Nw. |
R | Error matrix for the poorly-measured variables, has dimension Np,Np. |
S | Error matrix for the correlation between well-measured variables and poorly-measured variables, has dimension Nw,Np. |
- Input:
- constraint_calculator, xm, x, ym, y, G_i, y.
- Output:
- x, y, pullx, pully, Q, R, S.
- Return:
- of the fit. Should returns a negative value if the fit does not converge.
Implemented in hitfit::Chisq_Constrainer.
std::ostream & hitfit::Base_Constrainer::print |
( |
std::ostream & |
s | ) |
const |
|
virtual |