Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

BaseConstraint Class Reference

Abstract base class for constraints of kinematic fits. More...

#include <BaseConstraint.h>

Inheritance diagram for BaseConstraint:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BaseConstraint ()
 Creates an empty BaseConstraint object.

virtual ~BaseConstraint ()
 Virtual destructor.

virtual double getValue () const=0
 Returns the value of the constraint.

virtual void getDerivatives (int idim, double der[]) const=0
virtual void add1stDerivativesToMatrix (int idim, double *M) const=0
 Adds first order derivatives to global covariance matrix M.

virtual void add2ndDerivativesToMatrix (int idim, double *M, double lambda) const=0
 Adds second order derivatives to global covariance matrix M.

virtual int getGlobalNum () const=0
 Accesses position of constraint in global constraint list.

virtual void setGlobalNum (int iglobal)=0
 Sets position of constraint in global constraint list.


Detailed Description

Abstract base class for constraints of kinematic fits.

This class defines the minimal functionality any constraint class must provide. First of all a constraint should know on with particles (or FitObject) it is applied. Where as for example a constraint on the total transvese momentum takes into account all particles in the event, an invariant mass constraint usually applies only to a subset of particles.

The particle list is implemented as a vector containing pointers to objects derived from BaseFitObject and can be either set a whole (setFOList) or enlarged by adding a single BaseFitObject (addToFOList).

From the four--momenta of all concerned fit objects the constraint has to be able to calculate its current value (getValue). Constraints should be formulated such that a value of zero corresponds to a perfectly fulfilled constraint.

In order to find a solution to the constrained minimisation problem, fit algorithms usually need the first order derivatives of the constraint with respect to the fit parameters. Since many constraints can be most easily expressed in terms of E, px, py, pz, the constraints supply their derivatives w.r.t. these parameters. If a FitObject uses a different parametrisation, it is its own task to provide the additional derivatives of E, px, py, pz w.r.t. the parameters of the FitObject. Thus it is easily possible to use FitObjects with different kinds of parametrisations under the same constraint. Some fit algorithms also need the second derivatives of the constraint, i.e. the NewtonFitter.

First and second order derivatives of each constraint can be added directly to the global covariance matrix containing the derivatives of all constraints w.r.t. to all parameters (add1stDerivativesToMatrix, add2ndDerivativesToMatrix). This requires the constraint to know its position in the overall list of constraints (globalNum).

Author: Jenny List, Benno List Last update:

Date
2007/09/14 10:58:42
by:
Author
blist

Definition at line 61 of file BaseConstraint.h.


Constructor & Destructor Documentation

BaseConstraint::BaseConstraint  )  [inline]
 

Creates an empty BaseConstraint object.

Definition at line 64 of file BaseConstraint.h.

virtual BaseConstraint::~BaseConstraint  )  [inline, virtual]
 

Virtual destructor.

Definition at line 66 of file BaseConstraint.h.


Member Function Documentation

virtual void BaseConstraint::add1stDerivativesToMatrix int  idim,
double *  M
const [pure virtual]
 

Adds first order derivatives to global covariance matrix M.

Parameters:
idim  First dimension of array der
M  Global covariance matrix, dimension at least idim x idim

Implemented in EConstraint, ParticleConstraint, PConstraint, PxConstraint, PyConstraint, PzConstraint, TrackConstraint, TrackMomentumConstraint, TTVertexConstraint, and VertexConstraint.

virtual void BaseConstraint::add2ndDerivativesToMatrix int  idim,
double *  M,
double  lambda
const [pure virtual]
 

Adds second order derivatives to global covariance matrix M.

Parameters:
idim  First dimension of array der
M  Global covariance matrix, dimension at least idim x idim
lambda  Lagrange multiplier for this constraint

Implemented in EConstraint, ParticleConstraint, PConstraint, PxConstraint, PyConstraint, PzConstraint, TrackConstraint, TrackMomentumConstraint, TTVertexConstraint, and VertexConstraint.

virtual void BaseConstraint::getDerivatives int  idim,
double  der[]
const [pure virtual]
 

Get first order derivatives. Call this with a predefined array "der" with the necessary number of entries!

Parameters:
idim  First dimension of array der
der  Array of derivatives, dimension at least idim x idim

Implemented in EConstraint, MassConstraint, ParticleConstraint, PConstraint, PxConstraint, PyConstraint, PzConstraint, TrackConstraint, TrackMomentumConstraint, TTVertexConstraint, and VertexConstraint.

virtual int BaseConstraint::getGlobalNum  )  const [pure virtual]
 

Accesses position of constraint in global constraint list.

Implemented in ParticleConstraint, TrackConstraint, TTVertexConstraint, and VertexConstraint.

virtual double BaseConstraint::getValue  )  const [pure virtual]
 

Returns the value of the constraint.

Implemented in EConstraint, MassConstraint, ParticleConstraint, PConstraint, PxConstraint, PyConstraint, PzConstraint, TrackConstraint, TrackMomentumConstraint, TTVertexConstraint, and VertexConstraint.

Referenced by main().

virtual void BaseConstraint::setGlobalNum int  iglobal  )  [pure virtual]
 

Sets position of constraint in global constraint list.

Parameters:
iglobal  The global constraint number

Implemented in ParticleConstraint, TrackConstraint, TTVertexConstraint, and VertexConstraint.


The documentation for this class was generated from the following file:
Generated on Fri Sep 14 17:38:35 2007 for Kinfit by doxygen 1.3.2