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

ParticleConstraint Class Reference

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

#include <ParticleConstraint.h>

Inheritance diagram for ParticleConstraint:

Inheritance graph
[legend]
Collaboration diagram for ParticleConstraint:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ParticleConstraint ()
 Creates an empty ParticleConstraint object.

virtual ~ParticleConstraint ()
 Virtual destructor.

virtual void setFOList (std::vector< ParticleFitObject * > *fitobjects_)
 Adds several ParticleFitObject objects to the list.

virtual void addToFOList (ParticleFitObject &fitobject, int flag=1)
 Adds one ParticleFitObject 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, multiplied by lambda, 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< ParticleFitObject * > FitObjectContainer
 Vector of pointers to ParticleFitObjects.

typedef FitObjectContainer::iterator FitObjectIterator
 Iterator through vector of pointers to ParticleFitObjects.

typedef FitObjectContainer::const_iterator ConstFitObjectIterator
 Constant iterator through vector of pointers to ParticleFitObjects.


Protected Attributes

FitObjectContainer fitobjects
 The FitObjectContainer.

std::vector< double > derivatives
 The derivatives.

std::vector< int > flags
int globalNum
 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 ParticleFitObject and can be either set a whole (setFOList) or enlarged by adding a single ParticleFitObject (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 Böhme, Benno List

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

Definition at line 71 of file ParticleConstraint.h.


Member Typedef Documentation

typedef FitObjectContainer::const_iterator ParticleConstraint::ConstFitObjectIterator [protected]
 

Constant iterator through vector of pointers to ParticleFitObjects.

Definition at line 130 of file ParticleConstraint.h.

Referenced by PzConstraint::add1stDerivativesToMatrix(), PyConstraint::add1stDerivativesToMatrix(), PxConstraint::add1stDerivativesToMatrix(), PConstraint::add1stDerivativesToMatrix(), EConstraint::add1stDerivativesToMatrix(), PzConstraint::add2ndDerivativesToMatrix(), PyConstraint::add2ndDerivativesToMatrix(), PxConstraint::add2ndDerivativesToMatrix(), and EConstraint::add2ndDerivativesToMatrix().

typedef std::vector<ParticleFitObject *> ParticleConstraint::FitObjectContainer [protected]
 

Vector of pointers to ParticleFitObjects.

Definition at line 126 of file ParticleConstraint.h.

typedef FitObjectContainer::iterator ParticleConstraint::FitObjectIterator [protected]
 

Iterator through vector of pointers to ParticleFitObjects.

Definition at line 128 of file ParticleConstraint.h.


Constructor & Destructor Documentation

ParticleConstraint::ParticleConstraint  )  [inline]
 

Creates an empty ParticleConstraint object.

Definition at line 144 of file ParticleConstraint.h.

References invalidateCache().

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

Virtual destructor.

Definition at line 76 of file ParticleConstraint.h.


Member Function Documentation

virtual void ParticleConstraint::add1stDerivativesToMatrix int  idim,
double *  M
const [inline, virtual]
 

Adds first order derivatives to global covariance matrix M.

Parameters:
idim  First dimension of the array
M  Covariance matrix, at least idim x idim

Implements BaseConstraint.

Reimplemented in EConstraint, PConstraint, PxConstraint, PyConstraint, and PzConstraint.

Definition at line 101 of file ParticleConstraint.h.

virtual void ParticleConstraint::add2ndDerivativesToMatrix int  idim,
double *  M,
double  lambda
const [inline, virtual]
 

Adds second order derivatives, multiplied by lambda, to global covariance matrix M.

Parameters:
idim  First dimension of the array
M  Covariance matrix, at least idim x idim
lambda  Factor for derivatives

Implements BaseConstraint.

Reimplemented in EConstraint, PConstraint, PxConstraint, PyConstraint, and PzConstraint.

Definition at line 106 of file ParticleConstraint.h.

virtual void ParticleConstraint::addToFOList ParticleFitObject fitobject,
int  flag = 1
[inline, virtual]
 

Adds one ParticleFitObject objects to the list.

Definition at line 87 of file ParticleConstraint.h.

References fitobjects, and flags.

Referenced by TopEvent::genEvent(), and main().

virtual void ParticleConstraint::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 the array
der  Array of derivatives, at least idim x idim

Implements BaseConstraint.

Implemented in EConstraint, MassConstraint, PConstraint, PxConstraint, PyConstraint, and PzConstraint.

virtual int ParticleConstraint::getGlobalNum  )  const [inline, virtual]
 

Accesses position of constraint in global constraint list.

Implements BaseConstraint.

Definition at line 113 of file ParticleConstraint.h.

References globalNum.

Referenced by PzConstraint::add1stDerivativesToMatrix(), PyConstraint::add1stDerivativesToMatrix(), PxConstraint::add1stDerivativesToMatrix(), PConstraint::add1stDerivativesToMatrix(), and EConstraint::add1stDerivativesToMatrix().

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

Returns the value of the constraint.

Implements BaseConstraint.

Implemented in EConstraint, MassConstraint, PConstraint, PxConstraint, PyConstraint, and PzConstraint.

virtual void ParticleConstraint::invalidateCache  )  const [inline, virtual]
 

Invalidates any cached values for the next event.

Reimplemented in PConstraint.

Definition at line 121 of file ParticleConstraint.h.

Referenced by ParticleConstraint().

virtual void ParticleConstraint::setFOList std::vector< ParticleFitObject * > *  fitobjects_  )  [inline, virtual]
 

Adds several ParticleFitObject objects to the list.

Parameters:
fitobjects_  A list of BaseFitObject objects

Definition at line 79 of file ParticleConstraint.h.

References fitobjects, and flags.

virtual void ParticleConstraint::setGlobalNum int  iglobal  )  [inline, virtual]
 

Sets position of constraint in global constraint list.

Parameters:
iglobal  Global constraint number

Implements BaseConstraint.

Definition at line 116 of file ParticleConstraint.h.

References globalNum.


Member Data Documentation

std::vector<double> ParticleConstraint::derivatives [protected]
 

The derivatives.

Definition at line 134 of file ParticleConstraint.h.

FitObjectContainer ParticleConstraint::fitobjects [protected]
 

The FitObjectContainer.

Definition at line 132 of file ParticleConstraint.h.

Referenced by PzConstraint::add1stDerivativesToMatrix(), PyConstraint::add1stDerivativesToMatrix(), PxConstraint::add1stDerivativesToMatrix(), PConstraint::add1stDerivativesToMatrix(), EConstraint::add1stDerivativesToMatrix(), PzConstraint::add2ndDerivativesToMatrix(), PyConstraint::add2ndDerivativesToMatrix(), PxConstraint::add2ndDerivativesToMatrix(), EConstraint::add2ndDerivativesToMatrix(), addToFOList(), PzConstraint::getDerivatives(), PyConstraint::getDerivatives(), PxConstraint::getDerivatives(), PConstraint::getDerivatives(), MassConstraint::getDerivatives(), EConstraint::getDerivatives(), MassConstraint::getMass(), PzConstraint::getValue(), PyConstraint::getValue(), PxConstraint::getValue(), PConstraint::getValue(), MassConstraint::getValue(), EConstraint::getValue(), setFOList(), and PConstraint::updateCache().

std::vector<int> ParticleConstraint::flags [protected]
 

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 137 of file ParticleConstraint.h.

Referenced by addToFOList(), MassConstraint::getDerivatives(), MassConstraint::getMass(), MassConstraint::getValue(), and setFOList().

int ParticleConstraint::globalNum [protected]
 

Position of constraint in global constraint list.

Definition at line 140 of file ParticleConstraint.h.

Referenced by getGlobalNum(), and setGlobalNum().


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