17 #ifdef MARLIN_USE_ROOT
19 #ifndef __SOFTBWPARTICLECONSTRAINT_H
20 #define __SOFTBWPARTICLECONSTRAINT_H
73 SoftBWParticleConstraint(
double gamma_,
74 double emin_ = -std::numeric_limits<double>::infinity(),
75 double emax_ = std::numeric_limits<double>::infinity()
78 virtual ~SoftBWParticleConstraint() {};
81 virtual void setFOList(std::vector <ParticleFitObject*> *fitobjects_
83 for (
int i = 0; i < (int) fitobjects_->size(); i++) {
84 fitobjects.push_back ((*fitobjects_)[i]);
91 fitobjects.push_back (&fitobject);
92 flags.push_back (flag);
105 virtual double getGamma()
const;
108 virtual double setGamma(
double gamma_
128 virtual void invalidateCache()
const;
131 virtual void updateCache()
const;
134 virtual bool cacheValid()
const;
136 void test1stDerivatives ();
137 void test2ndDerivatives ();
140 double num1stDerivative (
int ifo,
145 double num2ndDerivative (
int ifo1,
159 static double erfinv (
double x);
161 static double normal_quantile (
double x);
162 static double normal_quantile_1stderiv (
double x);
163 static double normal_quantile_2ndderiv (
double x);
164 static double normal_pdf (
double x);
165 static double normal_pdf_deriv (
double x);
168 double penalty (
double e)
const;
170 double penalty1stder (
double e)
const;
172 double penalty2ndder (
double e)
const;
174 int getVarBasis()
const;
179 virtual bool secondDerivatives (
int i,
184 virtual bool firstDerivatives (
int i,
190 typedef std::vector <ParticleFitObject *> FitObjectContainer;
192 typedef FitObjectContainer::iterator FitObjectIterator;
194 typedef FitObjectContainer::const_iterator ConstFitObjectIterator;
196 FitObjectContainer fitobjects;
198 std::vector <double> derivatives;
201 std::vector <int> flags;
208 mutable bool cachevalid;
209 mutable double atanxmin;
210 mutable double atanxmax;
211 mutable double diffatanx;
213 enum { VAR_BASIS=BaseDefs::VARBASIS_EPXYZ };
217 #endif // __SOFTBWPARTICLECONSTRAINT_H
219 #endif // MARLIN_USE_ROOT
virtual void getDerivatives(int idim, double der[]) const =0
Get first order derivatives of the constraint function Call this with a predefined array "der" with t...
Abstract base class for particle objects of kinematic fits.
Definition: ParticleFitObject.h:63
virtual double getError() const
Returns the error on the value of the constraint.
Definition: BaseConstraint.cc:58
Abstract base class for soft constraints of kinematic fits.
Definition: BaseSoftConstraint.h:64
virtual double getValue() const =0
Returns the value of the constraint function.
Declares class BaseFitObject.
virtual double getChi2() const =0
Returns the chi2.
virtual void add2ndDerivativesToMatrix(double *M, int idim) const =0
Adds second order derivatives to global covariance matrix M.
virtual void addToGlobalChi2DerVector(double *y, int idim) const =0
Add derivatives of chi squared to global derivative matrix.
Declares class BaseSoftConstraint.