17#include "analysis/OrcaKinFit/SoftGaussMomentumConstraint.h"
18#include "analysis/OrcaKinFit/ParticleFitObject.h"
30 namespace OrcaKinFit {
34 double pyfact_,
double pzfact_,
double value_)
54 if (pxfact != 0) totpx += fitobject->getPx();
55 if (pyfact != 0) totpy += fitobject->getPy();
56 if (pzfact != 0) totpz += fitobject->getPz();
57 if (efact != 0) totE += fitobject->getE();
59 return pxfact * totpx + pyfact * totpy + pzfact * totpz + efact * totE - value;
70 for (
int ilocal = 0; ilocal < fitobject->getNPar(); ilocal++) {
71 if (!fitobject->isParamFixed(ilocal)) {
72 int iglobal = fitobject->getGlobalParNum(ilocal);
73 assert(iglobal >= 0 && iglobal < idim);
75 if (pxfact != 0) d += pxfact * fitobject->getDPx(ilocal);
76 if (pyfact != 0) d += pyfact * fitobject->getDPy(ilocal);
77 if (pzfact != 0) d += pzfact * fitobject->getDPz(ilocal);
78 if (efact != 0) d += efact * fitobject->getDE(ilocal);
89 derivativesf[0] = efact;
90 derivativesf[1] = pxfact;
91 derivativesf[2] = pyfact;
92 derivativesf[3] = pzfact;
virtual void getDerivatives(int idim, double der[]) const override
Get first order derivatives.
virtual double getValue() const override
Returns the value of the constraint function.
virtual bool secondDerivatives(int i, int j, double *derivatives) const override
Second derivatives with respect to the 4-vectors of Fit objects i and j; result false if all derivati...
virtual bool firstDerivatives(int i, double *derivatives) const override
First derivatives with respect to the 4-vector of Fit objects i; result false if all derivatives are ...
virtual ~SoftGaussMomentumConstraint()
Virtual destructor.
SoftGaussMomentumConstraint(double sigma_=0, double efact_=0, double pxfact_=0, double pyfact_=0, double pzfact_=0, double value_=0)
Constructor.
Abstract base class for constraints of kinematic fits.
FitObjectContainer fitobjects
The FitObjectContainer.
Abstract base class for different kinds of events.