![]() |
Belle II Software release-09-00-03
|
Implements constraint 0 = mass1 - mass2 - m. More...
#include <MassConstraint.h>


Public Member Functions | |
| MassConstraint (double mass_=0.) | |
| Constructor. | |
| virtual | ~MassConstraint () |
| Virtual destructor. | |
| virtual double | getValue () const override |
| Returns the value of the constraint. | |
| virtual void | getDerivatives (int idim, double der[]) const override |
| Get first order derivatives. | |
| virtual double | getMass (int flag=1) |
| Get the actual invariant mass of the fit objects with a given flag. | |
| virtual void | setMass (double mass_) |
| Sets the target mass of the constraint. | |
| virtual int | getVarBasis () const override |
| virtual void | setFOList (std::vector< ParticleFitObject * > *fitobjects_) |
| Adds several ParticleFitObject objects to the list. | |
| virtual void | addToFOList (ParticleFitObject &fitobject, int flag=1) |
| Adds one ParticleFitObject objects to the list. | |
| virtual void | resetFOList () |
| Resests ParticleFitObject list. | |
| virtual void | invalidateCache () const |
| Invalidates any cached values for the next event. | |
| virtual void | add1stDerivativesToMatrix (double *M, int idim) const |
| Adds first order derivatives to global covariance matrix M. | |
| virtual void | add2ndDerivativesToMatrix (double *M, int idim, double lambda) const |
| Adds second order derivatives to global covariance matrix M. | |
| virtual void | addToGlobalChi2DerVector (double *y, int idim, double lambda) const |
| Add lambda times derivatives of chi squared to global derivative vector. | |
| virtual double | dirDer (double *p, double *w, int idim, double mu=1) |
| Calculate directional derivative. | |
| virtual double | dirDerAbs (double *p, double *w, int idim, double mu=1) |
| Calculate directional derivative for abs(c) | |
| virtual double | getError () const override |
| Returns the error on the value of the constraint. | |
| virtual int | getGlobalNum () const |
| Accesses position of constraint in global constraint list. | |
| virtual void | setGlobalNum (int iglobal) |
| Sets position of constraint in global constraint list. | |
| virtual void | printFirstDerivatives () const |
| virtual void | printSecondDerivatives () const |
| virtual void | test1stDerivatives () |
| virtual void | test2ndDerivatives () |
| virtual double | num1stDerivative (int ifo, int ilocal, double eps) |
| Evaluates numerically the 1st derivative w.r.t. a parameter. | |
| virtual double | num2ndDerivative (int ifo1, int ilocal1, double eps1, int ifo2, int ilocal2, double eps2) |
| Evaluates numerically the 2nd derivative w.r.t. 2 parameters. | |
| virtual const char * | getName () const |
| Returns the name of the constraint. | |
| void | setName (const char *name_) |
| Set object's name. | |
| virtual std::ostream & | print (std::ostream &os) const |
| print object to ostream | |
Protected Types | |
| enum | { VAR_BASIS = 0 } |
| typedef std::vector< BaseFitObject * > | FitObjectContainer |
| Vector of pointers to ParticleFitObjects. | |
| typedef FitObjectContainer::iterator | FitObjectIterator |
| Iterator through vector of pointers to ParticleFitObjects. | |
| typedef FitObjectContainer::const_iterator | ConstFitObjectIterator |
| Constant iterator through vector of pointers to ParticleFitObjects. | |
Protected Member Functions | |
| 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 derivatives are zero. | |
| 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 zero. | |
Protected Attributes | |
| double | mass |
| The mass difference between object sets 1 and 2. | |
| FitObjectContainer | fitobjects |
| The FitObjectContainer. | |
| std::vector< double > | derivatives |
| The derivatives. | |
| std::vector< int > | flags |
| The flags can be used to divide the FitObjectContainer into several subsets used for example to implement an equal mass constraint (see MassConstraint). | |
| int | globalNum |
| Position of constraint in global constraint list. | |
| char * | name |
Related Functions | |
(Note that these are not member functions.) | |
| std::ostream & | operator<< (std::ostream &os, const BaseConstraint &bc) |
| Prints out a BaseConstraint, using its print method. | |
Implements constraint 0 = mass1 - mass2 - m.
This class implements different mass constraints:
Author: Jenny List, Benno List Last update:
by:
Definition at line 46 of file MassConstraint.h.
|
protectedinherited |
Constant iterator through vector of pointers to ParticleFitObjects.
Definition at line 175 of file BaseHardConstraint.h.
|
protectedinherited |
Vector of pointers to ParticleFitObjects.
Definition at line 171 of file BaseHardConstraint.h.
|
protectedinherited |
Iterator through vector of pointers to ParticleFitObjects.
Definition at line 173 of file BaseHardConstraint.h.
|
protected |
Definition at line 89 of file MassConstraint.h.
|
explicit |
Constructor.
| mass_ | The mass difference between object sets 1 and 2 |
Definition at line 36 of file MassConstraint.cc.
|
virtualinherited |
Adds first order derivatives to global covariance matrix M.
| M | Global covariance matrix, dimension at least idim x idim |
| idim | First dimension of array der |
Definition at line 37 of file BaseHardConstraint.cc.
|
virtualinherited |
Adds second order derivatives to global covariance matrix M.
Calculates the second derivative of the constraint g w.r.t.
the various parameters, multiplies it by lambda and adds it to the global covariance matrix
in case of particlefitobject: We denote with P_i the 4-vector of the i-th ParticleFitObject, then
![\[
\frac{\partial ^2 g}{\partial a_k \partial a_l}
= \sum_i \sum_j \frac{\partial ^2 g}{\partial P_i \partial P_j} \cdot
\frac{\partial P_i}{\partial a_k} \cdot \frac{\partial P_j}{\partial a_l}
+ \sum_i \frac{\partial g}{\partial P_i} \cdot
\frac{\partial^2 P_i}{\partial a_k \partial a_l}
\]](form_13.png)
Here, 







but here it's been generalised
First, treat the part
![\[
\frac{\partial ^2 g}{\partial P_i \partial P_j} \cdot
\frac{\partial P_i}{\partial a_k} \cdot \frac{\partial P_j}{\partial a_l}
\]](form_22.png)
Second, treat the part
![\[
\sum_i \frac{\partial g}{\partial P_i} \cdot
\frac{\partial^2 P_i}{\partial a_k \partial a_l}
\]](form_23.png)
Here, 
| M | Global covariance matrix, dimension at least idim x idim |
| idim | First dimension of array der |
| lambda | Lagrange multiplier for this constraint |
Definition at line 76 of file BaseHardConstraint.cc.
|
inlinevirtualinherited |
Adds one ParticleFitObject objects to the list.
Definition at line 90 of file ParticleConstraint.h.
|
virtualinherited |
Add lambda times derivatives of chi squared to global derivative vector.
| y | Vector of chi2 derivatives |
| idim | Vector size |
Definition at line 204 of file BaseHardConstraint.cc.
|
virtualinherited |
Calculate directional derivative.
| p | Vector of direction |
| w | Work vector |
| idim | Vector size |
| mu | optional multiplier |
Definition at line 232 of file BaseHardConstraint.cc.
|
virtualinherited |
Calculate directional derivative for abs(c)
| p | Vector of direction |
| w | Work vector |
| idim | Vector size |
| mu | optional multiplier |
Definition at line 242 of file BaseHardConstraint.cc.
|
overrideprotectedvirtual |
First derivatives with respect to the 4-vector of Fit objects i; result false if all derivatives are zero.
| i | number of 1st FitObject |
| derivatives | The result 4-vector |
Implements BaseHardConstraint.
Definition at line 208 of file MassConstraint.cc.
|
overridevirtual |
Get first order derivatives.
Call this with a predefined array "der" with the necessary number of entries!
| idim | First dimension of the array |
| der | Array of derivatives, at least idim x idim |
Implements BaseHardConstraint.
Definition at line 70 of file MassConstraint.cc.
|
overridevirtualinherited |
Returns the error on the value of the constraint.
Reimplemented from BaseConstraint.
Definition at line 217 of file BaseHardConstraint.cc.
|
inlinevirtualinherited |
Accesses position of constraint in global constraint list.
Definition at line 137 of file BaseHardConstraint.h.
|
virtual |
Get the actual invariant mass of the fit objects with a given flag.
| flag | The flag |
Definition at line 137 of file MassConstraint.cc.
|
virtualinherited |
Returns the name of the constraint.
Definition at line 56 of file BaseConstraint.cc.
|
overridevirtual |
Returns the value of the constraint.
Implements BaseHardConstraint.
Definition at line 44 of file MassConstraint.cc.
|
overridevirtual |
Implements BaseHardConstraint.
Definition at line 241 of file MassConstraint.cc.
|
inlinevirtualinherited |
Invalidates any cached values for the next event.
Reimplemented in MomentumConstraint.
Definition at line 104 of file ParticleConstraint.h.
|
virtualinherited |
Evaluates numerically the 1st derivative w.r.t. a parameter.
| ifo | Number of FitObject |
| ilocal | Local parameter number |
| eps | variation of local parameter |
Definition at line 307 of file BaseHardConstraint.cc.
|
virtualinherited |
Evaluates numerically the 2nd derivative w.r.t. 2 parameters.
| ifo1 | Number of 1st FitObject |
| ilocal1 | 1st local parameter number |
| eps1 | variation of 1st local parameter |
| ifo2 | Number of 1st FitObject |
| ilocal2 | 1st local parameter number |
| eps2 | variation of 2nd local parameter |
Definition at line 321 of file BaseHardConstraint.cc.
|
virtualinherited |
print object to ostream
| os | The output stream |
Definition at line 76 of file BaseConstraint.cc.
|
virtualinherited |
Definition at line 360 of file BaseHardConstraint.cc.
|
virtualinherited |
Definition at line 379 of file BaseHardConstraint.cc.
|
inlinevirtualinherited |
Resests ParticleFitObject list.
Definition at line 97 of file ParticleConstraint.h.
|
overrideprotectedvirtual |
Second derivatives with respect to the 4-vectors of Fit objects i and j; result false if all derivatives are zero.
| i | number of 1st FitObject |
| j | number of 2nd FitObject |
| derivatives | The result 4x4 matrix |
Implements BaseHardConstraint.
Definition at line 162 of file MassConstraint.cc.
|
inlinevirtualinherited |
Adds several ParticleFitObject objects to the list.
| fitobjects_ | A list of BaseFitObject objects |
Definition at line 81 of file ParticleConstraint.h.
|
inlinevirtualinherited |
Sets position of constraint in global constraint list.
| iglobal | Global constraint number |
Definition at line 140 of file BaseHardConstraint.h.
|
virtual |
Sets the target mass of the constraint.
| mass_ | The new mass |
Definition at line 157 of file MassConstraint.cc.
|
inherited |
Set object's name.
Definition at line 61 of file BaseConstraint.cc.
|
virtualinherited |
Definition at line 251 of file BaseHardConstraint.cc.
|
virtualinherited |
Definition at line 272 of file BaseHardConstraint.cc.
|
related |
Prints out a BaseConstraint, using its print method.
| os | The output stream |
| bc | The object to print |
Definition at line 114 of file BaseConstraint.h.
|
protectedinherited |
The derivatives.
Definition at line 179 of file BaseHardConstraint.h.
|
protectedinherited |
The FitObjectContainer.
Definition at line 177 of file BaseHardConstraint.h.
|
protectedinherited |
The flags can be used to divide the FitObjectContainer into several subsets used for example to implement an equal mass constraint (see MassConstraint).
Definition at line 182 of file BaseHardConstraint.h.
|
protectedinherited |
Position of constraint in global constraint list.
Definition at line 185 of file BaseHardConstraint.h.
|
protected |
The mass difference between object sets 1 and 2.
Definition at line 76 of file MassConstraint.h.
|
protectedinherited |
Definition at line 108 of file BaseConstraint.h.