Belle II Software  release-08-01-10
SoftGaussMassConstraint.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * Forked from https://github.com/iLCSoft/MarlinKinfit *
6  * *
7  * Further information about the fit engine and the user interface *
8  * provided in MarlinKinfit can be found at *
9  * https://www.desy.de/~blist/kinfit/doc/html/ *
10  * and in the LCNotes LC-TOOL-2009-001 and LC-TOOL-2009-004 available *
11  * from http://www-flc.desy.de/lcnotes/ *
12  * *
13  * See git log for contributors and copyright holders. *
14  * This file is licensed under LGPL-3.0, see LICENSE.md. *
15  **************************************************************************/
16 
17 #ifndef __SOFTGAUSSMASSCONSTRAINT_H
18 #define __SOFTGAUSSMASSCONSTRAINT_H
19 
20 #include "analysis/OrcaKinFit/SoftGaussParticleConstraint.h"
21 
22 namespace Belle2 {
27  namespace OrcaKinFit {
28 
29  class ParticleFitObject;
30 
31 // Class SoftGaussMassConstraint:
33 
46  public:
47 
49  explicit SoftGaussMassConstraint(double sigma_,
50  double mass_ = 0.
51  );
54 
56  virtual double getValue() const override;
57 
60  virtual void getDerivatives(int idim,
61  double der[]
62  ) const override;
63 
65  virtual double getMass(int flag = 1
66  );
67 
69  virtual void setMass(double mass_
70  );
71 
72 
73  protected:
74  double mass;
75 
76 
78  virtual bool secondDerivatives(int i,
79  int j,
80  double* derivatives
81  ) const override;
83  virtual bool firstDerivatives(int i,
84  double* derivatives
85  ) const override;
86  };
87 
88  }// end OrcaKinFit namespace
90 } // end Belle2 namespace
91 
92 
93 #endif // __SOFTGAUSSMASSCONSTRAINT_H
Implements constraint 0 = mass1 - mass2 - m.
virtual void getDerivatives(int idim, double der[]) const override
Get first order derivatives.
double mass
The mass difference between object sets 1 and 2.
virtual ~SoftGaussMassConstraint()
Virtual destructor.
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 void setMass(double mass_)
Sets the target mass of the constraint.
SoftGaussMassConstraint(double sigma_, double mass_=0.)
Constructor.
virtual double getMass(int flag=1)
Get the actual invariant mass of the fit objects with a given flag.
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 ...
Abstract base class for constraints of kinematic fits.
Abstract base class for different kinds of events.