Belle II Software  release-05-02-19
PxPyPzMFitObject.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * PxPyPzE fit object *
6  * *
7  * Author: The Belle II Collaboration *
8  * Contributors: Torben Ferber (torben.ferber@desy.de) (TF) *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 
13 #ifndef __PXPYPZMFITOBJECT_H
14 #define __PXPYPZMFITOBJECT_H
15 
16 #include "analysis/OrcaKinFit/ParticleFitObject.h"
17 
18 // CLHEP
19 #include <CLHEP/Matrix/Matrix.h>
20 #include <CLHEP/Matrix/SymMatrix.h>
21 #include <CLHEP/Vector/LorentzVector.h>
22 
23 namespace Belle2 {
28  namespace OrcaKinFit {
29 
30  class PxPyPzMFitObject : public ParticleFitObject {
31  public:
32 
33  PxPyPzMFitObject(CLHEP::HepLorentzVector& particle, const CLHEP::HepSymMatrix& covmatrix);
34 
35  // Copy constructor
36  PxPyPzMFitObject(const PxPyPzMFitObject& rhs
37  );
38  // Assignment
39  PxPyPzMFitObject& operator= (const PxPyPzMFitObject& rhs
40  );
41 
42  virtual ~PxPyPzMFitObject();
43 
44  // Return a new copy of itself
45  virtual PxPyPzMFitObject* copy() const override;
46 
47  // Assign from anther object, if of same type
48  virtual PxPyPzMFitObject& assign(const BaseFitObject& source
49  ) override;
50 
51  // Get name of parameter ilocal
52  virtual const char* getParamName(int ilocal
53  ) const override;
54 
55  // Read values from global vector, readjust vector; return: significant change
56  virtual bool updateParams(double p[],
57  int idim
58  ) override;
59 
60  // these depend on actual parametrisation!
61  virtual double getDPx(int ilocal) const override;
62  virtual double getDPy(int ilocal) const override;
63  virtual double getDPz(int ilocal) const override;
64  virtual double getDE(int ilocal) const override;
65 
66  virtual double getFirstDerivative_Meta_Local(int iMeta, int ilocal ,
67  int metaSet) const override; // derivative of intermediate variable iMeta wrt local parameter ilocal
68  virtual double getSecondDerivative_Meta_Local(int iMeta, int ilocal , int jlocal,
69  int metaSet) const override; // derivative of intermediate variable iMeta wrt local parameter ilocal
70 
71  virtual int getNPar() const override {return NPAR;}
72 
73  protected:
74 
75  void updateCache() const override;
76 
77  mutable bool cachevalid;
78 
79  mutable double chi2,
80  dEdpx, dEdpy, dEdpz,
81  dE2dpxdpx, dE2dpxdpy, dE2dpxdpz,
82  dE2dpydpy, dE2dpydpz,
83  dE2dpzdpz;
84 
85  enum {NPAR = 3};
86 
87  };
88 
89  }// end OrcaKinFit namespace
91 } // end Belle2 namespace
92 
93 
94 
95 #endif // __PXPYPZMFITOBJECT_H
Belle2::OrcaKinFit::PxPyPzMFitObject::getDPz
virtual double getDPz(int ilocal) const override
Return d p_z / d par_ilocal (derivative of pz w.r.t. local parameter ilocal)
Definition: PxPyPzMFitObject.cc:162
Belle2::OrcaKinFit::PxPyPzMFitObject::getDPx
virtual double getDPx(int ilocal) const override
Return d p_x / d par_ilocal (derivative of px w.r.t. local parameter ilocal)
Definition: PxPyPzMFitObject.cc:137
Belle2::OrcaKinFit::PxPyPzMFitObject::getParamName
virtual const char * getParamName(int ilocal) const override
Definition: PxPyPzMFitObject.cc:96
Belle2::OrcaKinFit::PxPyPzMFitObject::getDPy
virtual double getDPy(int ilocal) const override
Return d p_y / d par_ilocal (derivative of py w.r.t. local parameter ilocal)
Definition: PxPyPzMFitObject.cc:149
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::OrcaKinFit::PxPyPzMFitObject::assign
virtual PxPyPzMFitObject & assign(const BaseFitObject &source) override
Assign from anther object, if of same type.
Definition: PxPyPzMFitObject.cc:83
Belle2::OrcaKinFit::PxPyPzMFitObject::operator=
PxPyPzMFitObject & operator=(const PxPyPzMFitObject &rhs)
Definition: PxPyPzMFitObject.cc:70
Belle2::OrcaKinFit::PxPyPzMFitObject::updateParams
virtual bool updateParams(double p[], int idim) override
Definition: PxPyPzMFitObject.cc:107
Belle2::OrcaKinFit::PxPyPzMFitObject
Definition: PxPyPzMFitObject.h:40
Belle2::OrcaKinFit::PxPyPzMFitObject::getDE
virtual double getDE(int ilocal) const override
Return d E / d par_ilocal (derivative of E w.r.t. local parameter ilocal)
Definition: PxPyPzMFitObject.cc:174