Belle II Software  release-05-01-25
KFitTrack.h
1 /**************************************************************************
2  * Copyright(C) 1997 - J. Tanaka *
3  * *
4  * Author: J. Tanaka *
5  * Contributor: J. Tanaka and *
6  * conversion to Belle II structure by T. Higuchi *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <CLHEP/Matrix/Matrix.h>
14 #include <CLHEP/Matrix/SymMatrix.h>
15 #include <CLHEP/Vector/LorentzVector.h>
16 #include <CLHEP/Geometry/Point3D.h>
17 
18 #include <framework/logging/Logger.h>
19 
20 #include <analysis/VertexFitting/KFit/KFitConst.h>
21 
22 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
24 #endif
25 
26 
27 namespace Belle2 {
33  namespace analysis {
34 
39  class KFitTrack {
40  public:
44  struct KFitPXE {
46  CLHEP::HepLorentzVector m_P;
50  CLHEP::HepSymMatrix m_E;
51  };
52 
54  KFitTrack(void);
56  KFitTrack(const KFitTrack& kp);
64  KFitTrack(
65  const CLHEP::HepLorentzVector& p,
66  const HepPoint3D& x,
67  const CLHEP::HepSymMatrix& e,
68  const double q,
69  const int flag = KFitConst::kBeforeFit
70  );
71 
73  ~KFitTrack(void);
74 
75 
76  public:
79 
80 
81  public:
86  void setMomentum(const CLHEP::HepLorentzVector& p, const int flag = KFitConst::kBeforeFit);
91  void setPosition(const HepPoint3D& x, const int flag = KFitConst::kBeforeFit);
96  void setError(const CLHEP::HepSymMatrix& e, const int flag = KFitConst::kBeforeFit);
100  void setCharge(const double q);
104  void setVertex(const HepPoint3D& v);
108  void setVertexError(const CLHEP::HepSymMatrix& ve);
109 
114  const CLHEP::HepLorentzVector getMomentum(const int flag = KFitConst::kAfterFit) const;
119  const HepPoint3D getPosition(const int flag = KFitConst::kAfterFit) const;
124  const CLHEP::HepSymMatrix getError(const int flag = KFitConst::kAfterFit) const;
127  double getCharge(void) const;
130  double getMass(void) const;
133  const HepPoint3D getVertex(void) const;
136  const CLHEP::HepSymMatrix getVertexError(void) const;
137 
143  double getFitParameter(const int which, const int flag) const;
148  const CLHEP::HepMatrix getFitParameter(const int flag) const;
153  const CLHEP::HepSymMatrix getFitError(const int flag) const;
158  const CLHEP::HepMatrix getMomPos(const int flag) const;
159 
160 
161  private:
165  inline void checkFlag(const int flag) const
166  {
167  if (flag != KFitConst::kBeforeFit && flag != KFitConst::kAfterFit) B2FATAL("checkFlag");
168  }
169 
174  inline void checkMatrixDimension(const CLHEP::HepSymMatrix& m, const int dim) const
175  {
176  if (m.num_row() != dim) B2FATAL("checkMatrixDimension");
177  }
178 
179 
180  private:
183 
186 
188  double m_Charge;
190  double m_Mass;
191 
195  CLHEP::HepSymMatrix m_VertexError;
196  };
197 
198  } // namespace analysis
200 } // namespace Belle2
Belle2::analysis::KFitTrack::getError
const CLHEP::HepSymMatrix getError(const int flag=KFitConst::kAfterFit) const
Get an error matrix of the track.
Definition: KFitTrack.cc:173
Belle2::analysis::KFitTrack::getPosition
const HepPoint3D getPosition(const int flag=KFitConst::kAfterFit) const
Get a position of the track.
Definition: KFitTrack.cc:165
Belle2::analysis::KFitTrack::getFitParameter
double getFitParameter(const int which, const int flag) const
Get a parameter of the track.
Definition: KFitTrack.cc:209
Belle2::analysis::KFitConst::kBeforeFit
static const int kBeforeFit
Input parameter to specify before-fit when setting/getting a track attribute.
Definition: KFitConst.h:43
Belle2::analysis::KFitTrack::m_VertexError
CLHEP::HepSymMatrix m_VertexError
Vertex error matrix associated to the track.
Definition: KFitTrack.h:195
Belle2::analysis::KFitTrack::getCharge
double getCharge(void) const
Get a charge of the track.
Definition: KFitTrack.cc:181
Belle2::analysis::KFitTrack::getFitError
const CLHEP::HepSymMatrix getFitError(const int flag) const
Get an error matrix of the track.
Definition: KFitTrack.cc:247
Belle2::analysis::KFitTrack::m_Vertex
HepPoint3D m_Vertex
Vertex position associated to the track.
Definition: KFitTrack.h:193
Belle2::analysis::KFitTrack::KFitPXE::m_E
CLHEP::HepSymMatrix m_E
(7x7) error matrix of the track
Definition: KFitTrack.h:50
Belle2::analysis::KFitTrack::setPosition
void setPosition(const HepPoint3D &x, const int flag=KFitConst::kBeforeFit)
Set a position of the track.
Definition: KFitTrack.cc:110
Belle2::analysis::KFitTrack::setVertexError
void setVertexError(const CLHEP::HepSymMatrix &ve)
Set a vertex error matrix associated to the track.
Definition: KFitTrack.cc:149
Belle2::analysis::KFitTrack::setMomentum
void setMomentum(const CLHEP::HepLorentzVector &p, const int flag=KFitConst::kBeforeFit)
Set a Lorentz vector of the track.
Definition: KFitTrack.cc:96
Belle2::analysis::KFitTrack::m_PXEBefore
struct KFitPXE m_PXEBefore
Lorentz vector, position, and error matrix of the track before the fit.
Definition: KFitTrack.h:182
Belle2::analysis::KFitConst::kAfterFit
static const int kAfterFit
Input parameter to specify after-fit when setting/getting a track attribute.
Definition: KFitConst.h:45
Belle2::analysis::KFitTrack::setCharge
void setCharge(const double q)
Set a charge of the track.
Definition: KFitTrack.cc:135
Belle2::analysis::KFitTrack::getMomPos
const CLHEP::HepMatrix getMomPos(const int flag) const
Get a combination of Lorentz vector and position of the track.
Definition: KFitTrack.cc:273
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::analysis::KFitTrack::KFitPXE::m_P
CLHEP::HepLorentzVector m_P
Lorentz vector of the track.
Definition: KFitTrack.h:46
Belle2::analysis::KFitTrack::m_Charge
double m_Charge
Charge of the track.
Definition: KFitTrack.h:188
Belle2::analysis::KFitTrack::KFitTrack
KFitTrack(void)
Construct an object with no argument.
Definition: KFitTrack.cc:22
Belle2::analysis::KFitTrack::getMass
double getMass(void) const
Get a mass of the track.
Definition: KFitTrack.cc:188
Belle2::analysis::KFitTrack
KFitTrack is a container of the track information (Lorentz vector, position, and error matrix),...
Definition: KFitTrack.h:39
Belle2::analysis::KFitTrack::KFitPXE
KFitPXE is a container of the track information (Lorentz vector, position, and error matrix).
Definition: KFitTrack.h:44
Belle2::analysis::KFitTrack::operator=
KFitTrack & operator=(const KFitTrack &)
Operator: assignment operator.
Definition: KFitTrack.cc:80
Belle2::analysis::KFitTrack::m_Mass
double m_Mass
Mass of the track.
Definition: KFitTrack.h:190
Belle2::analysis::KFitTrack::checkMatrixDimension
void checkMatrixDimension(const CLHEP::HepSymMatrix &m, const int dim) const
Check if the matrix size is intended one.
Definition: KFitTrack.h:174
Belle2::analysis::KFitTrack::getMomentum
const CLHEP::HepLorentzVector getMomentum(const int flag=KFitConst::kAfterFit) const
Get a Lorentz vector of the track.
Definition: KFitTrack.cc:157
Belle2::analysis::KFitTrack::setError
void setError(const CLHEP::HepSymMatrix &e, const int flag=KFitConst::kBeforeFit)
Set an error matrix of the track.
Definition: KFitTrack.cc:122
Belle2::analysis::KFitTrack::KFitPXE::m_X
HepPoint3D m_X
Position of the track.
Definition: KFitTrack.h:48
Belle2::analysis::KFitTrack::setVertex
void setVertex(const HepPoint3D &v)
Set a vertex position associated to the track.
Definition: KFitTrack.cc:142
Belle2::analysis::KFitTrack::checkFlag
void checkFlag(const int flag) const
Check if the flag is one of KFitConst::kBeforeFit or KFitConst::kAfterFit.
Definition: KFitTrack.h:165
Belle2::analysis::KFitTrack::m_PXEAfter
struct KFitPXE m_PXEAfter
Lorentz vector, position, and error matrix of the track after the fit.
Definition: KFitTrack.h:185
HepGeom::Point3D< double >
Belle2::analysis::KFitTrack::getVertexError
const CLHEP::HepSymMatrix getVertexError(void) const
Get a vertex error matrix associated to the track.
Definition: KFitTrack.cc:202
Belle2::analysis::KFitTrack::~KFitTrack
~KFitTrack(void)
Destruct the object.
Belle2::analysis::KFitTrack::getVertex
const HepPoint3D getVertex(void) const
Get a vertex position associated to the track.
Definition: KFitTrack.cc:195