Belle II Software development
MassFourCFitKFit.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <analysis/VertexFitting/KFit/KFitConst.h>
12#include <analysis/VertexFitting/KFit/KFitError.h>
13#include <analysis/VertexFitting/KFit/KFitBase.h>
14
15#include <Math/Vector4D.h>
16
17#ifndef ENABLE_BACKWARDS_COMPATIBILITY
18typedef HepGeom::Point3D<double> HepPoint3D;
19#endif
20
21namespace Belle2 {
26
27 namespace analysis {
28
32 class MassFourCFitKFit : public KFitBase {
33 public:
38
39
40 public:
41
42
48 enum KFitError::ECode addMassConstraint(const double m, std::vector<unsigned>& childTrackId);
49
54 enum KFitError::ECode setVertex(const HepPoint3D& v);
59 enum KFitError::ECode setVertexError(const CLHEP::HepSymMatrix& e);
64 enum KFitError::ECode setInvariantMass(const double m);
69 enum KFitError::ECode setFourMomentum(const ROOT::Math::PxPyPzEVector& m);
74 enum KFitError::ECode setFlagAtDecayPoint(const bool flag);
79 enum KFitError::ECode fixMass(void);
84 enum KFitError::ECode unfixMass(void);
89 enum KFitError::ECode setTrackVertexError(const CLHEP::HepMatrix& e);
94 enum KFitError::ECode setCorrelation(const CLHEP::HepMatrix& m) override;
95 enum KFitError::ECode setZeroCorrelation(void) override;
96
97
102 const HepPoint3D getVertex(const int flag = KFitConst::kAfterFit) const;
107 const CLHEP::HepSymMatrix getVertexError(const int flag = KFitConst::kAfterFit) const;
111 double getInvariantMass(void) const;
115 bool getFlagAtDecayPoint(void) const;
119 bool getFlagFitWithVertex(void) const;
120 double getCHIsq(void) const override;
126 const CLHEP::HepMatrix getTrackVertexError(const int id, const int flag = KFitConst::kAfterFit) const;
127 double getTrackCHIsq(const int id) const override;
128 const CLHEP::HepMatrix getCorrelation(const int id1, const int id2,
129 const int flag = KFitConst::kAfterFit) const override;
130
131
132 public:
136 enum KFitError::ECode doFit(void);
137
143
144 private:
145 enum KFitError::ECode prepareInputMatrix(void) override;
146 enum KFitError::ECode prepareInputSubMatrix(void) override;
147 enum KFitError::ECode prepareCorrelation(void) override;
148 enum KFitError::ECode prepareOutputMatrix(void) override;
149 enum KFitError::ECode makeCoreMatrix(void) override;
150 enum KFitError::ECode calculateNDF(void) override;
151
152
153 private:
155 HepPoint3D m_BeforeVertex;
157 CLHEP::HepSymMatrix m_BeforeVertexError;
159 std::vector<CLHEP::HepMatrix> m_BeforeTrackVertexError;
160
162 HepPoint3D m_AfterVertex;
164 CLHEP::HepSymMatrix m_AfterVertexError;
166 std::vector<CLHEP::HepMatrix> m_AfterTrackVertexError;
167
174
177
179 ROOT::Math::PxPyPzEVector m_FourMomentum;
180
182 std::vector<int> m_IsFixMass;
183
186
188 std::vector<double> m_ConstraintMassList;
189
191 std::vector<std::pair<int, int>> m_ConstraintMassChildLists;
192 };
193
194 } // namespace analysis
195
197} // 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 setVertex(const HepPoint3D &v)
Set an initial vertex position for the mass-four-momentum-constraint fit.
bool m_FlagTrackVertexError
Flag to indicate if the vertex error matrix of the child particle is preset.
enum KFitError::ECode setFourMomentum(const ROOT::Math::PxPyPzEVector &m)
Set an 4 Momentum for the mass-four-constraint fit.
bool m_FlagAtDecayPoint
Flag controlled by setFlagAtDecayPoint().
bool getFlagAtDecayPoint(void) const
Get a flag if to constraint at the decay point in the mass-four-momentum-constraint fit.
enum KFitError::ECode addMassConstraint(const double m, std::vector< unsigned > &childTrackId)
Set an invariant mass of daughter particle for the mass-four-momentum-constraint fit.
enum KFitError::ECode prepareInputMatrix(void) override
Build grand matrices for minimum search from input-track properties.
bool getFlagFitWithVertex(void) const
Get a flag if the fit is allowed with moving the vertex position.
enum KFitError::ECode calculateNDF(void) override
Calculate an NDF of the fit.
double getCHIsq(void) const override
Get a chi-square of the fit.
enum KFitError::ECode setFlagAtDecayPoint(const bool flag)
Set a flag if to constraint at the decay point in the mass-four-momentum-constraint fit.
enum KFitError::ECode setTrackZeroVertexError(void)
Indicate no vertex uncertainty in the child particle in the addTrack'ed order.
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.
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.
bool m_FlagFitIncludingVertex
Flag to indicate if the fit is allowed with moving the vertex position.
~MassFourCFitKFit(void)
Destruct the object.
enum KFitError::ECode doFit(void)
Perform a mass-four-momentum-constraint fit.
enum KFitError::ECode setInvariantMass(const double m)
Set an invariant mass for the mass-four-momentum-constraint fit.
std::vector< CLHEP::HepMatrix > m_BeforeTrackVertexError
array of vertex error matrices before the fit.
enum KFitError::ECode makeCoreMatrix(void) override
Build matrices using the kinematical constraint.
enum KFitError::ECode setVertexError(const CLHEP::HepSymMatrix &e)
Set an initial vertex error matrix for the mass-four-momentum-constraint fit.
enum KFitError::ECode setTrackVertexError(const CLHEP::HepMatrix &e)
Set a vertex error matrix of the child particle in the addTrack'ed order.
enum KFitError::ECode prepareCorrelation(void) override
Build a grand correlation matrix from input-track properties.
HepPoint3D m_AfterVertex
Vertex position after the fit.
enum KFitError::ECode setCorrelation(const CLHEP::HepMatrix &m) override
Set a correlation matrix.
std::vector< std::pair< int, int > > m_ConstraintMassChildLists
Daughter track id of constrained particle.
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 CLHEP::HepSymMatrix getVertexError(const int flag=KFitConst::kAfterFit) const
Get a vertex error matrix.
MassFourCFitKFit()
Construct an object with no argument.
const HepPoint3D getVertex(const int flag=KFitConst::kAfterFit) const
Get a vertex position.
std::vector< double > m_ConstraintMassList
constrained mass
const CLHEP::HepMatrix getTrackVertexError(const int id, const int flag=KFitConst::kAfterFit) const
Get a vertex error matrix of the track.
CLHEP::HepSymMatrix m_AfterVertexError
Vertex error matrix after the fit.
enum KFitError::ECode prepareOutputMatrix(void) override
Build an output error matrix.
CLHEP::HepSymMatrix m_BeforeVertexError
Vertex error matrix before the fit.
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.
ROOT::Math::PxPyPzEVector m_FourMomentum
Four Momentum.
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