 |
Belle II Software
release-05-01-25
|
17 #ifndef __SOFTGAUSSPARTICLECONSTRAINT_H
18 #define __SOFTGAUSSPARTICLECONSTRAINT_H
22 #include "analysis/OrcaKinFit/BaseSoftConstraint.h"
23 #include "analysis/OrcaKinFit/BaseFitObject.h"
31 namespace OrcaKinFit {
33 class ParticleFitObject;
74 class SoftGaussParticleConstraint:
public BaseSoftConstraint {
83 virtual void setFOList(std::vector <ParticleFitObject*>* fitobjects_
86 for (
int i = 0; i < (int) fitobjects_->size(); i++) {
92 virtual void addToFOList(ParticleFitObject& fitobject,
int flag = 1
96 flags.push_back(flag);
109 virtual double getChi2()
const override;
112 virtual double getError()
const override;
118 virtual double setSigma(
double sigma_
125 )
const override = 0;
140 void test1stDerivatives();
141 void test2ndDerivatives();
157 int getVarBasis()
const;
184 std::vector <int>
flags;
189 enum { VAR_BASIS = BaseDefs::VARBASIS_EPXYZ };
197 #endif // __SOFTGAUSSPARTICLECONSTRAINT_H
virtual void resetFOList()
Resests ParticleFitObject list.
SoftGaussParticleConstraint(double sigma_)
Creates an empty SoftGaussParticleConstraint object.
virtual void addToGlobalChi2DerVector(double *y, int idim) const override
Add derivatives of chi squared to global derivative matrix.
virtual double getSigma() const
Returns the sigma.
virtual void addToFOList(ParticleFitObject &fitobject, int flag=1)
Adds one ParticleFitObject objects to the list.
virtual void add2ndDerivativesToMatrix(double *M, int idim) const override
Adds second order derivatives to global covariance matrix M.
FitObjectContainer::iterator FitObjectIterator
Iterator through vector of pointers to ParticleFitObjects.
double num2ndDerivative(int ifo1, int ilocal1, double eps1, int ifo2, int ilocal2, double eps2)
Evaluates numerically the 2nd derivative w.r.t. 2 parameters.
double sigma
The sigma of the Gaussian.
FitObjectContainer fitobjects
The FitObjectContainer.
virtual double getChi2() const override
Returns the chi2.
virtual double setSigma(double sigma_)
Sets the sigma.
Abstract base class for different kinds of events.
std::vector< int > flags
The flags can be used to divide the FitObjectContainer into several subsets used for example to imple...
virtual bool firstDerivatives(int i, double *derivatives) const =0
First derivatives with respect to the 4-vector of Fit objects i; result false if all derivatives are ...
std::vector< double > derivatives
The derivatives.
virtual double getError() const override
Returns the error on the value of the constraint.
virtual double getValue() const override=0
Returns the value of the constraint function.
virtual void getDerivatives(int idim, double der[]) const override=0
Get first order derivatives.
virtual void setFOList(std::vector< ParticleFitObject * > *fitobjects_)
Adds several ParticleFitObject objects to the list.
double num1stDerivative(int ifo, int ilocal, double eps)
Evaluates numerically the 1st derivative w.r.t. a parameter.
virtual bool secondDerivatives(int i, int j, double *derivatives) const =0
Second derivatives with respect to the 4-vectors of Fit objects i and j; result false if all derivati...
void invalidateCache() const
Invalidates any cached values for the next event.
FitObjectContainer::const_iterator ConstFitObjectIterator
Constant iterator through vector of pointers to ParticleFitObjects.
std::vector< ParticleFitObject * > FitObjectContainer
Vector of pointers to ParticleFitObjects.
virtual ~SoftGaussParticleConstraint()
Virtual destructor.