Belle II Software  release-05-02-19
MassConstraint.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * See https://github.com/tferber/OrcaKinfit, forked from *
4  * https://github.com/iLCSoft/MarlinKinfit *
5  * *
6  * Further information about the fit engine and the user interface *
7  * provided in MarlinKinfit can be found at *
8  * https://www.desy.de/~blist/kinfit/doc/html/ *
9  * and in the LCNotes LC-TOOL-2009-001 and LC-TOOL-2009-004 available *
10  * from http://www-flc.desy.de/lcnotes/ *
11  * *
12  * Adopted by: Torben Ferber (torben.ferber@desy.de) (TF) *
13  * *
14  * This software is provided "as is" without any warranty. *
15  **************************************************************************/
16 
17 #ifndef __MASSCONSTRAINT_H
18 #define __MASSCONSTRAINT_H
19 
20 #include "analysis/OrcaKinFit/ParticleConstraint.h"
21 
22 namespace Belle2 {
28  namespace OrcaKinFit {
29 
30  class ParticleFitObject;
31 
32 // Class MassConstraint:
34 
46  class MassConstraint : public ParticleConstraint {
47  public:
48 
50  explicit MassConstraint(double mass_ = 0.
51  );
53  virtual ~MassConstraint();
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  virtual int getVarBasis() const override;
73 
74  protected:
75 
76  double mass;
77 
79  virtual bool secondDerivatives(int i,
80  int j,
81  double* derivatives
82  ) const override;
83 
85  virtual bool firstDerivatives(int i,
86  double* derivatives
87  ) const override;
88 
89  enum { VAR_BASIS = 0 }; // this means that the constraint knows about E,px,py,pz
90 
91  };
92 
93  }// end OrcaKinFit namespace
95 } // end Belle2 namespace
96 
97 
98 #endif // __MASSCONSTRAINT_H
Belle2::OrcaKinFit::MassConstraint::~MassConstraint
virtual ~MassConstraint()
Virtual destructor.
Belle2::OrcaKinFit::MassConstraint::getMass
virtual double getMass(int flag=1)
Get the actual invariant mass of the fit objects with a given flag.
Definition: MassConstraint.cc:151
Belle2::OrcaKinFit::BaseHardConstraint::derivatives
std::vector< double > derivatives
The derivatives.
Definition: BaseHardConstraint.h:193
Belle2::OrcaKinFit::MassConstraint::getValue
virtual double getValue() const override
Returns the value of the constraint.
Definition: MassConstraint.cc:58
Belle2::OrcaKinFit::MassConstraint::setMass
virtual void setMass(double mass_)
Sets the target mass of the constraint.
Definition: MassConstraint.cc:171
Belle2::OrcaKinFit::MassConstraint::firstDerivatives
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 ...
Definition: MassConstraint.cc:222
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::OrcaKinFit::MassConstraint::MassConstraint
MassConstraint(double mass_=0.)
Constructor.
Definition: MassConstraint.cc:50
Belle2::OrcaKinFit::MassConstraint::mass
double mass
The mass difference between object sets 1 and 2.
Definition: MassConstraint.h:90
Belle2::OrcaKinFit::MassConstraint::getDerivatives
virtual void getDerivatives(int idim, double der[]) const override
Get first order derivatives.
Definition: MassConstraint.cc:84
Belle2::OrcaKinFit::MassConstraint::secondDerivatives
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...
Definition: MassConstraint.cc:176