#include <TrackConstraint.h>
Inheritance diagram for TrackConstraint:
Public Member Functions | |
TrackConstraint () | |
Creates an empty TrackConstraint object. | |
virtual | ~TrackConstraint () |
Virtual destructor. | |
virtual void | setFOList (std::vector< TrackFitObject * > *fitobjects_) |
Adds several TrackFitObject objects to the list. | |
virtual void | addToFOList (TrackFitObject &fitobject, int flag=1) |
Adds one TrackFitObject objects to the list. | |
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 |
Adds first order derivatives to global covariance matrix M. | |
virtual void | add2ndDerivativesToMatrix (int idim, double *M, double lambda) const |
Adds second order derivatives to global covariance matrix M. | |
virtual int | getGlobalNum () const |
Accesses position of constraint in global constraint list. | |
virtual void | setGlobalNum (int iglobal) |
Sets position of constraint in global constraint list. | |
virtual void | invalidateCache () const |
Invalidates any cached values for the next event. | |
Protected Types | |
typedef std::vector< TrackFitObject * > | FitObjectContainer |
Vector of pointers to TrackFitObjects. | |
typedef FitObjectContainer::iterator | FitObjectIterator |
Iterator through vector of pointers to TrackFitObjects. | |
typedef FitObjectContainer::const_iterator | ConstFitObjectIterator |
Constant iterator through vector of pointers to TrackFitObjects. | |
Protected Attributes | |
FitObjectContainer | fitobjects |
The FitObjectContainer. | |
std::vector< double > | derivatives |
The derivatives. | |
std::vector< int > | flags |
std::vector< double > | sign |
int | globalNum |
Position of constraint in global constraint list. |
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 TrackFitObject and can be either set a whole (setFOList) or enlarged by adding a single TrackFitObject (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: Benno List, Jenny List
Definition at line 57 of file TrackConstraint.h.
|
Constant iterator through vector of pointers to TrackFitObjects.
Definition at line 105 of file TrackConstraint.h. Referenced by TrackMomentumConstraint::add1stDerivativesToMatrix(). |
|
Vector of pointers to TrackFitObjects.
Definition at line 101 of file TrackConstraint.h. |
|
Iterator through vector of pointers to TrackFitObjects.
Definition at line 103 of file TrackConstraint.h. |
|
Creates an empty TrackConstraint object.
Definition at line 120 of file TrackConstraint.h. References invalidateCache(). |
|
Virtual destructor.
Definition at line 62 of file TrackConstraint.h. |
|
Adds first order derivatives to global covariance matrix M.
Implements BaseConstraint. Reimplemented in TrackMomentumConstraint. Definition at line 87 of file TrackConstraint.h. |
|
Adds second order derivatives to global covariance matrix M.
Implements BaseConstraint. Reimplemented in TrackMomentumConstraint. Definition at line 89 of file TrackConstraint.h. |
|
Adds one TrackFitObject objects to the list.
Definition at line 74 of file TrackConstraint.h. References fitobjects, flags, and sign. Referenced by VertexFitObject::addMomentumConstraint(). |
|
Get first order derivatives. Call this with a predefined array "der" with the necessary number of entries! Implements BaseConstraint. Implemented in TrackMomentumConstraint. |
|
Accesses position of constraint in global constraint list.
Implements BaseConstraint. Definition at line 92 of file TrackConstraint.h. References globalNum. Referenced by TrackMomentumConstraint::add1stDerivativesToMatrix(). |
|
Returns the value of the constraint.
Implements BaseConstraint. Implemented in TrackMomentumConstraint. |
|
Invalidates any cached values for the next event.
Reimplemented in TrackMomentumConstraint. Definition at line 97 of file TrackConstraint.h. Referenced by TrackConstraint(). |
|
Adds several TrackFitObject objects to the list.
Definition at line 65 of file TrackConstraint.h. References fitobjects, flags, and sign. |
|
Sets position of constraint in global constraint list.
Implements BaseConstraint. Definition at line 94 of file TrackConstraint.h. References globalNum. |
|
The derivatives.
Definition at line 109 of file TrackConstraint.h. |
|
The FitObjectContainer.
Definition at line 107 of file TrackConstraint.h. Referenced by TrackMomentumConstraint::add1stDerivativesToMatrix(), addToFOList(), TrackMomentumConstraint::getDerivatives(), TrackMomentumConstraint::getValue(), setFOList(), and TrackMomentumConstraint::updateCache(). |
|
The flags can be used to divide the FitObjectContainer into several subsets used for example to implement an equal mass constraint (see MassConstraint). Definition at line 112 of file TrackConstraint.h. Referenced by addToFOList(), TrackMomentumConstraint::getDerivatives(), TrackMomentumConstraint::getValue(), and setFOList(). |
|
Position of constraint in global constraint list.
Definition at line 116 of file TrackConstraint.h. Referenced by getGlobalNum(), and setGlobalNum(). |
|
Definition at line 113 of file TrackConstraint.h. Referenced by addToFOList(), TrackMomentumConstraint::getDerivatives(), TrackMomentumConstraint::getValue(), and setFOList(). |