17#ifndef __BASEHARDCONSTRAINT_H
18#define __BASEHARDCONSTRAINT_H
20#include "analysis/OrcaKinFit/BaseDefs.h"
21#include "analysis/OrcaKinFit/BaseConstraint.h"
22#include "analysis/OrcaKinFit/BaseFitObject.h"
32 namespace OrcaKinFit {
99 virtual double dirDer(
double* p,
122 virtual int getVarBasis()
const = 0;
128 virtual double getError()
const override;
134 )
const override = 0;
144 virtual void printFirstDerivatives()
const;
145 virtual void printSecondDerivatives()
const;
147 virtual void test1stDerivatives();
148 virtual void test2ndDerivatives();
189 BaseHardConstraint::BaseHardConstraint()
190 : fitobjects(FitObjectContainer()), derivatives(
std::vector <double> ()), flags(
std::vector <int> ()), globalNum(0)
Abstract base class for constraints of kinematic fits.
Abstract base class for constraints of kinematic fits.
FitObjectContainer::iterator FitObjectIterator
Iterator through vector of pointers to ParticleFitObjects.
virtual ~BaseHardConstraint()
Virtual destructor.
virtual int getGlobalNum() const
Accesses position of constraint in global constraint list.
virtual double getValue() const override=0
Returns the value of the constraint.
std::vector< double > derivatives
The derivatives.
int globalNum
Position of constraint in global constraint list.
FitObjectContainer fitobjects
The FitObjectContainer.
virtual void add1stDerivativesToMatrix(double *M, int idim) const
Adds first order derivatives to global covariance matrix M.
virtual double getError() const override
Returns the error on the value of the constraint.
virtual void addToGlobalChi2DerVector(double *y, int idim, double lambda) const
Add lambda times derivatives of chi squared to global derivative vector.
virtual double dirDerAbs(double *p, double *w, int idim, double mu=1)
Calculate directional derivative for abs(c)
virtual void setGlobalNum(int iglobal)
Sets position of constraint in global constraint list.
virtual double dirDer(double *p, double *w, int idim, double mu=1)
Calculate directional derivative.
virtual bool secondDerivatives(int i, int j, double *derivatives) const =0
Second derivatives with respect to the meta-variables of Fit objects i and j; result false if all der...
virtual void getDerivatives(int idim, double der[]) const override=0
Get first order derivatives.
virtual bool firstDerivatives(int i, double *derivatives) const =0
First derivatives with respect to the meta-variables of Fit objects i; result false if all derivative...
std::vector< BaseFitObject * > FitObjectContainer
Vector of pointers to ParticleFitObjects.
virtual void add2ndDerivativesToMatrix(double *M, int idim, double lambda) const
Adds second order derivatives to global covariance matrix M.
FitObjectContainer::const_iterator ConstFitObjectIterator
Constant iterator through vector of pointers to ParticleFitObjects.
virtual double num2ndDerivative(int ifo1, int ilocal1, double eps1, int ifo2, int ilocal2, double eps2)
Evaluates numerically the 2nd derivative w.r.t. 2 parameters.
std::vector< int > flags
The flags can be used to divide the FitObjectContainer into several subsets used for example to imple...
virtual double num1stDerivative(int ifo, int ilocal, double eps)
Evaluates numerically the 1st derivative w.r.t. a parameter.
Abstract base class for different kinds of events.