Belle II Software light-2406-ragdoll
MomentumConstraint.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 __MOMENTUMCONSTRAINT_H
18#define __MOMENTUMCONSTRAINT_H
19
20#include "analysis/OrcaKinFit/ParticleConstraint.h"
21
22namespace Belle2 {
28 namespace OrcaKinFit {
29
30 class ParticleFitObject;
31
32// Class PConstraint:
34
42 public:
43 MomentumConstraint(double efact_ = 0,
44 double pxfact_ = 0,
45 double pyfact_ = 0,
46 double pzfact_ = 0,
47 double value_ = 0
48 );
49 virtual ~MomentumConstraint();
50 virtual double getValue() const override;
53 virtual void getDerivatives(int idim,
54 double der[]
55 ) const override;
56
57 // not used at all
58 // virtual void addToGlobalDerMatrix (double lambda, int idim, double *M) const;
59
60 virtual void invalidateCache() const override;
61
62 virtual int getVarBasis() const override;
63
64 protected:
65 void updateCache() const;
66
67
68 double efact;
69 double pxfact;
70 double pyfact;
71 double pzfact;
72 double value;
73
74 mutable bool cachevalid;
75 mutable int nparams;
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 enum { VAR_BASIS = 0 }; // this means that the constraint knows about E,px,py,pz
88
89 };
90
91 }// end OrcaKinFit namespace
93} // end Belle2 namespace
94
95#endif // __MOMENTUMCONSTRAINT_H
std::vector< double > derivatives
The derivatives.
Implements a constraint of the form efact*sum(E)+pxfact*sum(px)+pyfact*sum(py)+pzfact*sum(pz)=value.
virtual void getDerivatives(int idim, double der[]) const override
Get first order derivatives.
virtual double getValue() const override
Returns the value of the constraint.
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 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 ...
virtual void invalidateCache() const override
Invalidates any cached values for the next event.
Abstract base class for constraints of kinematic fits.
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:24