Belle II Software  release-05-02-19
JetFitObject.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 __JETFITOBJECT_H
18 #define __JETFITOBJECT_H
19 
20 #include "analysis/OrcaKinFit/ParticleFitObject.h"
21 
22 namespace Belle2 {
28  namespace OrcaKinFit {
29 
30 // Class JetFitObject
32 
43  class JetFitObject : public ParticleFitObject {
44  public:
45  JetFitObject(double E, double theta, double phi,
46  double DE, double Dtheta, double Dphi,
47  double m = 0);
48 
50  JetFitObject(const JetFitObject& rhs
51  );
53  JetFitObject& operator= (const JetFitObject& rhs
54  );
55 
56  virtual ~JetFitObject();
57 
59  virtual JetFitObject* copy() const override;
60 
62  virtual JetFitObject& assign(const BaseFitObject& source
63  ) override;
64 
66  virtual const char* getParamName(int ilocal
67  ) const override;
68 
70  virtual bool updateParams(double p[],
71  int idim
72  ) override;
73 
74  virtual int getNPar() const override {return NPAR;}
75 
76  // these depend on actual parametrisation!
77 
78  virtual double getDPx(int ilocal) const override;
79  virtual double getDPy(int ilocal) const override;
80  virtual double getDPz(int ilocal) const override;
81  virtual double getDE(int ilocal) const override;
82 
83  virtual double getCov(int
84  ilocal,
85  int jlocal
86  ) const override;
87 
89  virtual double getError(int ilocal
90  ) const override;
91 
92 
95 // virtual void addToDerivatives (double der[], ///< Derivatives vector, length idim
96 // int idim, ///< Length of derivatives vector
97 // double efact=0, ///< Factor for dE/dx_i
98 // double pxfact=0, ///< Factor for dpx/dx_i
99 // double pyfact=0, ///< Factor for dpy/dx_i
100 // double pzfact=0 ///< Factor for dpz/dx_i
101 // ) const;
102 
103  // daniel's new method
104  // derivatives of intermediate variable wrt local variable
105  virtual double getFirstDerivative_Meta_Local(int iMeta, int ilocal , int metaSet) const override;
106  virtual double getSecondDerivative_Meta_Local(int iMeta, int ilocal , int jlocal , int metaSet) const override;
107 
109  // virtual double getChi2() const;
110 
111  protected:
112 
113  enum {NPAR = 3};
114 
115  void updateCache() const override;
116 
117  mutable double ctheta, stheta, cphi, sphi,
118  p2, p, pt, px, py, pz, dpdE, dptdE,
119  dpxdE, dpydE, dpzdE, dpxdtheta, dpydtheta,
120  chi2;
121  // d2pdE2, d2ptsE2;
122 
124  static bool adjustEThetaPhi(const double& m, double& E, double& theta, double& phi);
125 
127  // double calcChi2 () const;
128 
129  };
130 
131 
132  }// end OrcaKinFit namespace
134 } // end Belle2 namespace
135 
136 
137 #endif // __JETFITOBJECT_H
138 
Belle2::OrcaKinFit::JetFitObject::adjustEThetaPhi
static bool adjustEThetaPhi(const double &m, double &E, double &theta, double &phi)
Adjust E, theta and phi such that E>=m, 0<=theta<=pi, -pi <= phi < pi; returns true if anything was c...
Definition: JetFitObject.cc:371
Belle2::OrcaKinFit::JetFitObject::updateParams
virtual bool updateParams(double p[], int idim) override
Read values from global vector, readjust vector; return: significant change.
Definition: JetFitObject.cc:127
Belle2::OrcaKinFit::JetFitObject::getParamName
virtual const char * getParamName(int ilocal) const override
Get name of parameter ilocal.
Definition: JetFitObject.cc:116
Belle2::OrcaKinFit::JetFitObject::getDE
virtual double getDE(int ilocal) const override
Return d E / d par_ilocal (derivative of E w.r.t. local parameter ilocal)
Definition: JetFitObject.cc:201
Belle2::OrcaKinFit::JetFitObject::operator=
JetFitObject & operator=(const JetFitObject &rhs)
Assignment.
Definition: JetFitObject.cc:90
Belle2::OrcaKinFit::JetFitObject::getError
virtual double getError(int ilocal) const override
Get error of parameter ilocal.
Definition: JetFitObject.cc:212
Belle2::OrcaKinFit::JetFitObject::getFirstDerivative_Meta_Local
virtual double getFirstDerivative_Meta_Local(int iMeta, int ilocal, int metaSet) const override
add derivatives to vector der of size idim pxfact*dpx/dx_i + pyfact*dpy/dx_i + pzfact*dpz/dx_i + efac...
Definition: JetFitObject.cc:250
Belle2::OrcaKinFit::JetFitObject::assign
virtual JetFitObject & assign(const BaseFitObject &source) override
Assign from anther object, if of same type.
Definition: JetFitObject.cc:103
Belle2::OrcaKinFit::JetFitObject::copy
virtual JetFitObject * copy() const override
Return a new copy of itself.
Definition: JetFitObject.cc:98
Belle2::OrcaKinFit::JetFitObject::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: JetFitObject.cc:189
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::OrcaKinFit::JetFitObject::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: JetFitObject.cc:177
Belle2::OrcaKinFit::JetFitObject::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: JetFitObject.cc:165
Belle2::OrcaKinFit::JetFitObject
Class for jets with (E, eta, phi) in kinematic fits.
Definition: JetFitObject.h:57
Belle2::OrcaKinFit::JetFitObject::getCov
virtual double getCov(int ilocal, int jlocal) const override
Definition: JetFitObject.cc:219