\section{Base\-Soft\-Constraint Class Reference}
\label{classBaseSoftConstraint}\index{Base\-Soft\-Constraint@{Base\-Soft\-Constraint}}


Abstract base class for soft constraints of kinematic fits.  




{\ttfamily \#include $<$Base\-Soft\-Constraint.\-h$>$}

Inheritance diagram for Base\-Soft\-Constraint\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4.000000cm]{classBaseSoftConstraint}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual {\bf $\sim$\-Base\-Soft\-Constraint} ()\label{classBaseSoftConstraint_aba0b1e5b161d8d363c23869b916769d7}

\begin{DoxyCompactList}\small\item\em Virtual destructor. \end{DoxyCompactList}\item 
virtual double {\bf get\-Chi2} () const =0\label{classBaseSoftConstraint_ad455f4c94e3223b9a4b6d7f4b7aadeee}

\begin{DoxyCompactList}\small\item\em Returns the chi2. \end{DoxyCompactList}\item 
virtual void {\bf add2nd\-Derivatives\-To\-Matrix} (double $\ast$M, int idim) const =0
\begin{DoxyCompactList}\small\item\em Adds second order derivatives to global covariance matrix M. \end{DoxyCompactList}\item 
virtual void {\bf add\-To\-Global\-Chi2\-Der\-Vector} (double $\ast$y, int idim) const =0
\begin{DoxyCompactList}\small\item\em Add derivatives of chi squared to global derivative matrix. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
char $\ast$ {\bfseries name}\label{classBaseSoftConstraint_a479e4ac33a301a19f843135754374162}

\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
Abstract base class for soft 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 Fit\-Object) 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 \doxyref{Base\-Fit\-Object}{p.}{classBaseFitObject} and can be either set a whole (set\-F\-O\-List) or enlarged by adding a single \doxyref{Base\-Fit\-Object}{p.}{classBaseFitObject} (add\-To\-F\-O\-List).

From the four--momenta of all concerned fit objects the constraint has to be able to calculate its current value (get\-Value). 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 Fit\-Object 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 Fit\-Object. Thus it is easily possible to use Fit\-Objects with different kinds of parametrisations under the same constraint. Some fit algorithms also need the second derivatives of the constraint, i.\-e. the Newton\-Fitter.

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 (add1st\-Derivatives\-To\-Matrix, add2nd\-Derivatives\-To\-Matrix). This requires the constraint to know its position in the overall list of constraints (global\-Num).

Author\-: Jenny List, Benno List Last update\-: \begin{DoxyParagraph}{Date\-:}
2011/03/03 15\-:03\-:02 
\end{DoxyParagraph}
by\-: \begin{DoxyParagraph}{Author\-:}
blist 
\end{DoxyParagraph}


\subsection{Member Function Documentation}
\index{Base\-Soft\-Constraint@{Base\-Soft\-Constraint}!add2nd\-Derivatives\-To\-Matrix@{add2nd\-Derivatives\-To\-Matrix}}
\index{add2nd\-Derivatives\-To\-Matrix@{add2nd\-Derivatives\-To\-Matrix}!BaseSoftConstraint@{Base\-Soft\-Constraint}}
\subsubsection[{add2nd\-Derivatives\-To\-Matrix}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Base\-Soft\-Constraint\-::add2nd\-Derivatives\-To\-Matrix (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{M, }
\item[{int}]{idim}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [pure virtual]}}\label{classBaseSoftConstraint_a5b7a928b4b725f9cb4259672235af9fb}


Adds second order derivatives to global covariance matrix M. 


\begin{DoxyParams}{Parameters}
{\em M} & Global covariance matrix, dimension at least idim x idim \\
\hline
{\em idim} & First dimension of array der \\
\hline
\end{DoxyParams}


Implemented in {\bf Soft\-Gauss\-Particle\-Constraint} \doxyref{}{p.}{classSoftGaussParticleConstraint_a7b0bc6dff3540d72aba7e2ad44b90868}.

\index{Base\-Soft\-Constraint@{Base\-Soft\-Constraint}!add\-To\-Global\-Chi2\-Der\-Vector@{add\-To\-Global\-Chi2\-Der\-Vector}}
\index{add\-To\-Global\-Chi2\-Der\-Vector@{add\-To\-Global\-Chi2\-Der\-Vector}!BaseSoftConstraint@{Base\-Soft\-Constraint}}
\subsubsection[{add\-To\-Global\-Chi2\-Der\-Vector}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Base\-Soft\-Constraint\-::add\-To\-Global\-Chi2\-Der\-Vector (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{y, }
\item[{int}]{idim}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [pure virtual]}}\label{classBaseSoftConstraint_ac031591b5bcf52ab7acda7c643714d44}


Add derivatives of chi squared to global derivative matrix. 


\begin{DoxyParams}{Parameters}
{\em y} & Vector of chi2 derivatives \\
\hline
{\em idim} & Vector size \\
\hline
\end{DoxyParams}


Implemented in {\bf Soft\-Gauss\-Particle\-Constraint} \doxyref{}{p.}{classSoftGaussParticleConstraint_a0fabfd14becaa7c75384248c9ae67ba5}.



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
{\bf Base\-Soft\-Constraint.\-h}\item 
{\bf Base\-Soft\-Constraint.\-cc}\end{DoxyCompactItemize}
