Belle II Software development
MassVertexFitKFit.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 <analysis/VertexFitting/KFit/KFitConst.h>
13#include <analysis/VertexFitting/KFit/KFitError.h>
14#include <analysis/VertexFitting/KFit/KFitBase.h>
15
16#include <Math/Vector3D.h>
17
18#ifndef ENABLE_BACKWARDS_COMPATIBILITY
19typedef HepGeom::Point3D<double> HepPoint3D;
20#endif
21
22
23namespace Belle2 {
28
29 namespace analysis {
30
34 class MassVertexFitKFit : public KFitBase {
35 public:
39 ~MassVertexFitKFit(void) override;
40
41 public:
46 enum KFitError::ECode setInitialVertex(const HepPoint3D& v);
51 enum KFitError::ECode setInitialVertex(const ROOT::Math::XYZVector& v);
56 enum KFitError::ECode setInvariantMass(const double m);
61 enum KFitError::ECode fixMass(void);
66 enum KFitError::ECode unfixMass(void);
67 enum KFitError::ECode setCorrelation(const CLHEP::HepMatrix& m) override;
68 enum KFitError::ECode setZeroCorrelation(void) override;
69
70
75 const HepPoint3D getVertex(const int flag = KFitConst::kAfterFit) const;
79 const CLHEP::HepSymMatrix getVertexError(void) const;
83 double getInvariantMass(void) const;
84 double getCHIsq(void) const override;
89 const CLHEP::HepMatrix getTrackVertexError(const int id) const;
90 double getTrackCHIsq(const int id) const override;
91 const CLHEP::HepMatrix getCorrelation(const int id1, const int id2,
92 const int flag = KFitConst::kAfterFit) const override;
93
94
95 public:
99 enum KFitError::ECode doFit(void);
100
106
107 private:
108 enum KFitError::ECode prepareInputMatrix(void) override;
109 enum KFitError::ECode prepareInputSubMatrix(void) override;
110 enum KFitError::ECode prepareCorrelation(void) override;
111 enum KFitError::ECode prepareOutputMatrix(void) override;
112 enum KFitError::ECode makeCoreMatrix(void) override;
113 enum KFitError::ECode calculateNDF(void) override;
114
115
116 private:
118 HepPoint3D m_BeforeVertex;
119
121 HepPoint3D m_AfterVertex;
123 CLHEP::HepSymMatrix m_AfterVertexError;
125 std::vector<CLHEP::HepMatrix> m_AfterTrackVertexError;
126
130 std::vector<int> m_IsFixMass;
131 };
132
133 } // namespace analysis
134
136} // namespace Belle2
Class to store reconstructed particles.
Definition Particle.h:76
KFitBase(void)
Construct an object with no argument.
Definition KFitBase.cc:20
ECode
ECode is a error code enumerate.
Definition KFitError.h:33
enum KFitError::ECode setZeroCorrelation(void) override
Indicate no correlation between tracks.
enum KFitError::ECode prepareInputMatrix(void) override
Build grand matrices for minimum search from input-track properties.
enum KFitError::ECode calculateNDF(void) override
Calculate an NDF of the fit.
enum KFitError::ECode setInitialVertex(const HepPoint3D &v)
Set an initial vertex point for the mass-vertex constraint fit.
double getCHIsq(void) const override
Get a chi-square of the fit.
~MassVertexFitKFit(void) override
Destruct the object.
std::vector< int > m_IsFixMass
Array of flags whether the track property is fixed at the mass.
enum KFitError::ECode updateMother(Particle *mother)
Update mother particle.
const CLHEP::HepSymMatrix getVertexError(void) const
Get a fitted vertex error matrix.
enum KFitError::ECode unfixMass(void)
Tell the object to unfix the last added track property at the invariant mass.
enum KFitError::ECode prepareInputSubMatrix(void) override
Build sub-matrices for minimum search from input-track properties.
enum KFitError::ECode doFit(void)
Perform a mass-vertex-constraint fit.
enum KFitError::ECode setInvariantMass(const double m)
Set an invariant mass for the mass-vertex constraint fit.
enum KFitError::ECode makeCoreMatrix(void) override
Build matrices using the kinematical constraint.
enum KFitError::ECode prepareCorrelation(void) override
Build a grand correlation matrix from input-track properties.
MassVertexFitKFit(void)
Construct an object with no argument.
HepPoint3D m_AfterVertex
Vertex position after the fit.
enum KFitError::ECode setCorrelation(const CLHEP::HepMatrix &m) override
Set a correlation matrix.
std::vector< CLHEP::HepMatrix > m_AfterTrackVertexError
array of vertex error matrices after the fit.
const CLHEP::HepMatrix getCorrelation(const int id1, const int id2, const int flag=KFitConst::kAfterFit) const override
Get a correlation matrix between two tracks.
double getTrackCHIsq(const int id) const override
Get a chi-square of the track.
const HepPoint3D getVertex(const int flag=KFitConst::kAfterFit) const
Get a vertex position.
CLHEP::HepSymMatrix m_AfterVertexError
Vertex error matrix after the fit.
enum KFitError::ECode prepareOutputMatrix(void) override
Build an output error matrix.
const CLHEP::HepMatrix getTrackVertexError(const int id) const
Get a vertex error matrix of the track.
HepPoint3D m_BeforeVertex
Vertex position before the fit.
enum KFitError::ECode fixMass(void)
Tell the object to fix the last added track property at the invariant mass.
double getInvariantMass(void) const
Get an invariant mass.
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:35