CMS 3D CMS Logo

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

Minimize a $\chi^{2}$ subject to a set of constraints. Based on the SQUAW algorithm. More...

#include <Chisq_Constrainer.h>

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

Public Member Functions

 Chisq_Constrainer (const Chisq_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)
 
virtual std::ostream & print (std::ostream &s) const
 Print the state of this instance of Chisq_Constrainer. More...
 
virtual ~Chisq_Constrainer ()
 
- Public Member Functions inherited from hitfit::Base_Constrainer
 Base_Constrainer (const Base_Constrainer_Args &args)
 
virtual ~Base_Constrainer ()
 

Private Attributes

const Chisq_Constrainer_Args _args
 

Additional Inherited Members

- Protected Member Functions inherited from hitfit::Base_Constrainer
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...
 

Detailed Description

Minimize a $\chi^{2}$ subject to a set of constraints. Based on the SQUAW algorithm.

Definition at line 252 of file Chisq_Constrainer.h.

Constructor & Destructor Documentation

hitfit::Chisq_Constrainer::Chisq_Constrainer ( const Chisq_Constrainer_Args args)

Constructor. Create an instance of Chisq_Constrainer from a Chisq_Constrainer_Args object.

Parameters
argsThe parameter settings for this instance.

Definition at line 307 of file Chisq_Constrainer.cc.

virtual hitfit::Chisq_Constrainer::~Chisq_Constrainer ( )
inlinevirtual

Destructor.

Definition at line 274 of file Chisq_Constrainer.h.

Member Function Documentation

double hitfit::Chisq_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 
)
virtual

@ brief Do a constrained fit. Call the number of well-measured variables Nw, the number of poorly-measured variables Np, and the number of constraints Nc.

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.

cout << "singular matrix!";

Implements hitfit::Base_Constrainer.

Definition at line 320 of file Chisq_Constrainer.cc.

std::ostream & hitfit::Chisq_Constrainer::print ( std::ostream &  s) const
virtual

Print the state of this instance of Chisq_Constrainer.

Parameters
sThe output stream to which the output is sent.

Reimplemented from hitfit::Base_Constrainer.

Definition at line 673 of file Chisq_Constrainer.cc.

Member Data Documentation

const Chisq_Constrainer_Args hitfit::Chisq_Constrainer::_args
private

Parameter settings for this instance of Chisq_Constrainer.

Definition at line 376 of file Chisq_Constrainer.h.