CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Friends
hitfit::Base_Constrainer Class Referenceabstract

Base class for $\chi^{2}$ constrained fitter. More...

#include <Base_Constrainer.h>

Inheritance diagram for hitfit::Base_Constrainer:
hitfit::Chisq_Constrainer

Public Member Functions

 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 $\chi^{2}$ constrained fit. More...
 
virtual std::ostream & print (std::ostream &s) const
 Print out internal state to output stream. More...
 
virtual ~Base_Constrainer ()
 

Protected Member Functions

bool call_constraint_fcn (Constraint_Calculator &constraint_calculator, const Column_Vector &x, const Column_Vector &y, Row_Vector &F, Matrix &Bx, Matrix &By) const
 Helper function to evaluate constraints. This takes care of checking what the user function returns againts numerical derivatives, it that was requested. More...
 

Private Attributes

const Base_Constrainer_Args _args
 

Friends

std::ostream & operator<< (std::ostream &s, const Base_Constrainer &f)
 Output stream operator, print the content of this Base_Constrainer to an output stream. More...
 

Detailed Description

Base class for $\chi^{2}$ constrained fitter.

Definition at line 228 of file Base_Constrainer.h.

Constructor & Destructor Documentation

hitfit::Base_Constrainer::Base_Constrainer ( const Base_Constrainer_Args args)

Constructor.

Parameters
argsContains the parameter settings for this instance.

Definition at line 174 of file Base_Constrainer.cc.

virtual hitfit::Base_Constrainer::~Base_Constrainer ( )
inlinevirtual

Destructor.

Definition at line 246 of file Base_Constrainer.h.

Member Function Documentation

bool hitfit::Base_Constrainer::call_constraint_fcn ( Constraint_Calculator constraint_calculator,
const Column_Vector x,
const Column_Vector y,
Row_Vector F,
Matrix Bx,
Matrix By 
) const
protected

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_calculatorthe User-supplied object to evaluate the constraints.
xVector of well-measured quantities where we evaluate the constraints. Has dimension of Nw.
yVector of poorly-measured quantities where we evaluate the the constraints. Has dimension of Np.
FResults of the constraint functions.
BxGradients of F with respect to x, has dimension (Nw,Nc).
ByGradients 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 $\chi^{2}$ constrained fit.

Parameters
constraint_calculatorThe object that will be used to evaluate the constraints.
xmMeasured values of the well-measured variables, has dimension Nw.
xBefore 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.
ymMeasured values of the poorly-measured variables, has dimension Np.
yBefore 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_iError matrix for the well-measured variables, has dimension Nw,Nw.
YInverse error matrix for the poorly-measured variables, has dimension Np,Np.
pullxPull quantities for the well-measured variables, has dimension Nw.
pullyPull quantities for the poorly-measured variables, has dimension Np.
QError matrix for the well-measured variables, has dimension Nw,Nw.
RError matrix for the poorly-measured variables, has dimension Np,Np.
SError 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:
$\chi^{2}$ 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

Print out internal state to output stream.

Parameters
sOutput stream to which to write.
Return:
The stream s;

Reimplemented in hitfit::Chisq_Constrainer.

Definition at line 186 of file Base_Constrainer.cc.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const Base_Constrainer f 
)
friend

Output stream operator, print the content of this Base_Constrainer to an output stream.

Parameters
sThe output stream to which to write.
fThe instance of Base_Constrainer to be printed.

Definition at line 214 of file Base_Constrainer.cc.

Member Data Documentation

const Base_Constrainer_Args hitfit::Base_Constrainer::_args
private

Parameter settings for this instance of Base_Constrainer.

Definition at line 355 of file Base_Constrainer.h.