Belle II Software  release-05-01-25
RecoilMassConstraint.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * RecoilMassConstraint for OrcaKinFit. Allows constraints of the type *
6  * mass(P_beam - P) - RecoilMass = 0s *
7  * *
8  * Author: The Belle II Collaboration *
9  * Contributors: Torben Ferber (torben.ferber@desy.de) (TF) *
10  * *
11  * This software is provided "as is" without any warranty. *
12  **************************************************************************/
13 
14 #ifndef __RECOILMASSCONSTRAINT_H
15 #define __RECOILMASSCONSTRAINT_H
16 
17 #include "analysis/OrcaKinFit/ParticleConstraint.h"
18 
19 namespace Belle2 {
24  namespace OrcaKinFit {
25 
26  class ParticleFitObject;
27 
28  class RecoilMassConstraint : public ParticleConstraint {
29  public:
30 
32  RecoilMassConstraint(double recoilmass = 0., double beampx = 0., double beampy = 0., double beampz = 0, double beampe = 0.);
33 
35  virtual ~RecoilMassConstraint();
36 
38  virtual double getValue() const override;
39 
42  virtual void getDerivatives(int idim,
43  double der[]
44  ) const override;
45 
47  virtual double getRecoilMass();
48 
50  virtual void setRecoilMass(double recoilmass);
51 
52  virtual int getVarBasis() const override;
53 
54  protected:
55 
56  double m_recoilMass;
57  double m_beamPx;
58  double m_beamPy;
59  double m_beamPz;
60  double m_beamE;
61 
63  virtual bool secondDerivatives(int i,
64  int j,
65  double* derivatives
66  ) const override;
67 
69  virtual bool firstDerivatives(int i,
70  double* derivatives
71  ) const override;
72 
73  enum { VAR_BASIS = 0 }; // this means that the constraint knows about E,px,py,pz
74 
75  };
76 
77  }// end OrcaKinFit namespace
79 } // end Belle2 namespace
80 
81 #endif // __RECOILMASSCONSTRAINT_H
Belle2::OrcaKinFit::RecoilMassConstraint::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: RecoilMassConstraint.cc:174
Belle2::OrcaKinFit::BaseHardConstraint::derivatives
std::vector< double > derivatives
The derivatives.
Definition: BaseHardConstraint.h:193
Belle2::OrcaKinFit::RecoilMassConstraint::getValue
virtual double getValue() const override
Returns the value of the constraint.
Definition: RecoilMassConstraint.cc:53
Belle2::OrcaKinFit::RecoilMassConstraint::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: RecoilMassConstraint.cc:225
Belle2::OrcaKinFit::RecoilMassConstraint::RecoilMassConstraint
RecoilMassConstraint(double recoilmass=0., double beampx=0., double beampy=0., double beampz=0, double beampe=0.)
Constructor.
Definition: RecoilMassConstraint.cc:42
Belle2::OrcaKinFit::RecoilMassConstraint::getDerivatives
virtual void getDerivatives(int idim, double der[]) const override
Get first order derivatives.
Definition: RecoilMassConstraint.cc:89
Belle2::OrcaKinFit::RecoilMassConstraint::getRecoilMass
virtual double getRecoilMass()
Get the actual recoil mass of the fit objects.
Definition: RecoilMassConstraint.cc:139
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::OrcaKinFit::RecoilMassConstraint::~RecoilMassConstraint
virtual ~RecoilMassConstraint()
Virtual destructor.
Definition: RecoilMassConstraint.cc:47
Belle2::OrcaKinFit::RecoilMassConstraint::setRecoilMass
virtual void setRecoilMass(double recoilmass)
Sets the target recoil mass of the constraint.
Definition: RecoilMassConstraint.cc:169