Belle II Software development
KFitTrack.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * External Contributor: J. Tanaka *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9
10#pragma once
11
12#include <CLHEP/Matrix/Matrix.h>
13#include <CLHEP/Matrix/SymMatrix.h>
14#include <CLHEP/Vector/LorentzVector.h>
15#include <CLHEP/Geometry/Point3D.h>
16
17#include <framework/logging/Logger.h>
18
19#include <analysis/VertexFitting/KFit/KFitConst.h>
20
21#ifndef ENABLE_BACKWARDS_COMPATIBILITY
23#endif
24
25
26namespace Belle2 {
32 namespace analysis {
33
38 class KFitTrack {
39 public:
43 struct KFitPXE {
45 CLHEP::HepLorentzVector m_P;
49 CLHEP::HepSymMatrix m_E;
50 };
51
53 KFitTrack(void);
55 KFitTrack(const KFitTrack& kp);
64 const CLHEP::HepLorentzVector& p,
65 const HepPoint3D& x,
66 const CLHEP::HepSymMatrix& e,
67 const double q,
68 const int flag = KFitConst::kBeforeFit
69 );
70
73
74
75 public:
78
79
80 public:
85 void setMomentum(const CLHEP::HepLorentzVector& p, const int flag = KFitConst::kBeforeFit);
90 void setPosition(const HepPoint3D& x, const int flag = KFitConst::kBeforeFit);
95 void setError(const CLHEP::HepSymMatrix& e, const int flag = KFitConst::kBeforeFit);
99 void setCharge(const double q);
103 void setVertex(const HepPoint3D& v);
107 void setVertexError(const CLHEP::HepSymMatrix& ve);
108
113 const CLHEP::HepLorentzVector getMomentum(const int flag = KFitConst::kAfterFit) const;
118 const HepPoint3D getPosition(const int flag = KFitConst::kAfterFit) const;
123 const CLHEP::HepSymMatrix getError(const int flag = KFitConst::kAfterFit) const;
126 double getCharge(void) const;
129 double getMass(void) const;
132 const HepPoint3D getVertex(void) const;
135 const CLHEP::HepSymMatrix getVertexError(void) const;
136
142 double getFitParameter(const int which, const int flag) const;
147 const CLHEP::HepMatrix getFitParameter(const int flag) const;
152 const CLHEP::HepSymMatrix getFitError(const int flag) const;
157 const CLHEP::HepMatrix getMomPos(const int flag) const;
158
159
160 private:
164 inline void checkFlag(const int flag) const
165 {
166 if (flag != KFitConst::kBeforeFit && flag != KFitConst::kAfterFit) B2FATAL("checkFlag");
167 }
168
173 inline void checkMatrixDimension(const CLHEP::HepSymMatrix& m, const int dim) const
174 {
175 if (m.num_row() != dim) B2FATAL("checkMatrixDimension");
176 }
177
178
179 private:
182
185
187 double m_Charge;
189 double m_Mass;
190
194 CLHEP::HepSymMatrix m_VertexError;
195 };
196
197 } // namespace analysis
199} // namespace Belle2
KFitTrack is a container of the track information (Lorentz vector, position, and error matrix),...
Definition: KFitTrack.h:38
void checkMatrixDimension(const CLHEP::HepSymMatrix &m, const int dim) const
Check if the matrix size is intended one.
Definition: KFitTrack.h:173
void checkFlag(const int flag) const
Check if the flag is one of KFitConst::kBeforeFit or KFitConst::kAfterFit.
Definition: KFitTrack.h:164
double m_Charge
Charge of the track.
Definition: KFitTrack.h:187
double m_Mass
Mass of the track.
Definition: KFitTrack.h:189
KFitTrack & operator=(const KFitTrack &)
Operator: assignment operator.
Definition: KFitTrack.cc:79
KFitTrack(void)
Construct an object with no argument.
Definition: KFitTrack.cc:21
void setCharge(const double q)
Set a charge of the track.
Definition: KFitTrack.cc:134
~KFitTrack(void)
Destruct the object.
const CLHEP::HepLorentzVector getMomentum(const int flag=KFitConst::kAfterFit) const
Get a Lorentz vector of the track.
Definition: KFitTrack.cc:156
void setPosition(const HepPoint3D &x, const int flag=KFitConst::kBeforeFit)
Set a position of the track.
Definition: KFitTrack.cc:109
const HepPoint3D getVertex(void) const
Get a vertex position associated to the track.
Definition: KFitTrack.cc:194
const CLHEP::HepSymMatrix getVertexError(void) const
Get a vertex error matrix associated to the track.
Definition: KFitTrack.cc:201
HepPoint3D m_Vertex
Vertex position associated to the track.
Definition: KFitTrack.h:192
void setVertexError(const CLHEP::HepSymMatrix &ve)
Set a vertex error matrix associated to the track.
Definition: KFitTrack.cc:148
CLHEP::HepSymMatrix m_VertexError
Vertex error matrix associated to the track.
Definition: KFitTrack.h:194
const CLHEP::HepSymMatrix getError(const int flag=KFitConst::kAfterFit) const
Get an error matrix of the track.
Definition: KFitTrack.cc:172
const CLHEP::HepSymMatrix getFitError(const int flag) const
Get an error matrix of the track.
Definition: KFitTrack.cc:246
void setVertex(const HepPoint3D &v)
Set a vertex position associated to the track.
Definition: KFitTrack.cc:141
KFitTrack(const KFitTrack &kp)
Construct the object as a copy constructor.
double getCharge(void) const
Get a charge of the track.
Definition: KFitTrack.cc:180
void setMomentum(const CLHEP::HepLorentzVector &p, const int flag=KFitConst::kBeforeFit)
Set a Lorentz vector of the track.
Definition: KFitTrack.cc:95
struct KFitPXE m_PXEBefore
Lorentz vector, position, and error matrix of the track before the fit.
Definition: KFitTrack.h:181
double getFitParameter(const int which, const int flag) const
Get a parameter of the track.
Definition: KFitTrack.cc:208
void setError(const CLHEP::HepSymMatrix &e, const int flag=KFitConst::kBeforeFit)
Set an error matrix of the track.
Definition: KFitTrack.cc:121
const HepPoint3D getPosition(const int flag=KFitConst::kAfterFit) const
Get a position of the track.
Definition: KFitTrack.cc:164
const CLHEP::HepMatrix getMomPos(const int flag) const
Get a combination of Lorentz vector and position of the track.
Definition: KFitTrack.cc:272
struct KFitPXE m_PXEAfter
Lorentz vector, position, and error matrix of the track after the fit.
Definition: KFitTrack.h:184
double getMass(void) const
Get a mass of the track.
Definition: KFitTrack.cc:187
Abstract base class for different kinds of events.
static const int kAfterFit
Input parameter to specify after-fit when setting/getting a track attribute.
Definition: KFitConst.h:37
static const int kBeforeFit
Input parameter to specify before-fit when setting/getting a track attribute.
Definition: KFitConst.h:35
KFitPXE is a container of the track information (Lorentz vector, position, and error matrix).
Definition: KFitTrack.h:43
HepPoint3D m_X
Position of the track.
Definition: KFitTrack.h:47
CLHEP::HepSymMatrix m_E
(7x7) error matrix of the track
Definition: KFitTrack.h:49
CLHEP::HepLorentzVector m_P
Lorentz vector of the track.
Definition: KFitTrack.h:45