CbmRoot
Loading...
Searching...
No Matches
KfVertexFitter.h
Go to the documentation of this file.
1/* Copyright (C) 2007-2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov [committer] */
4
5
10
11#pragma once
12
13#include "KfDefs.h"
14#include "KfSetup.h"
15#include "KfTrackParam.h"
16#include "KfVertex.h"
17
18#include <tuple>
19#include <vector>
20
21namespace cbm::algo::kf
22{
26 template<DoFitTime FlagFitTime = DoFitTime::Y>
28 public:
30 VertexFitter() = default;
31
33 VertexFitter(std::shared_ptr<const Setup<double>> kfSetup) : fKfSetup(kfSetup) {}
34
36 ~VertexFitter() = default;
37
39 void SetKfSetup(std::shared_ptr<const Setup<double>> kfSetup) { fKfSetup = kfSetup; }
40
43
46
48 void SetConstrainToBeamXY(double x, double y, double sigmaX, double sigmaY)
49 {
50 fConstrainToBeamXY = true;
51 fBeamX = x;
52 fBeamY = y;
53 fBeamSigmaX = sigmaX;
54 fBeamSigmaY = sigmaY;
55 }
56
59
61 void SetRmsCut(double c) { fRmsCut = c; }
62
64 void SetNoRmsCut() { fRmsCut = -1.; }
65
67 void SetNofIterations(int n) { fNofIterations = n; }
68
70
72 bool IsConstrainToBeamXY() const { return fConstrainToBeamXY; }
73 double GetRmsCut() const { return fRmsCut; }
74 int GetNofIterations() const { return fNofIterations; }
75 std::shared_ptr<const Setup<double>> GetKfSetup() const { return fKfSetup; }
76
78 template<typename T>
79 std::tuple<VertexD, std::vector<char>> FitVertex(const std::vector<const TrackParam<T>*>& tracks,
80 const std::vector<const TrackParam<T>*>& linearizations,
81 const VertexD& vtxGuess) const;
83
84 private:
85 void dummy();
86
87 private:
88 std::shared_ptr<const Setup<double>> fKfSetup{};
89
90 bool fConstrainToTargetZ{false};
91 bool fConstrainToBeamXY{false};
92
93 double fBeamX{0.};
94 double fBeamY{0.};
95 double fBeamSigmaX{0.1};
96 double fBeamSigmaY{0.1};
97 double fRmsCut{5.};
99 };
100
101} // namespace cbm::algo::kf
TClonesArray * tracks
Common constant definitions for the Kalman Filter library.
Setup representation for the Kalman-filter framework (header)
header file for the kf::Vertex class
KF-framework representation of the detector setup.
Definition KfSetup.h:37
TrackParam classes of different types.
double fBeamX
Width of beamline constraint in X [cm].
double fBeamSigmaY
Sigma of beamline constraint in Y [cm].
void SetNofIterations(int n)
Set N of iterations for vertex fitting.
VertexFitter(std::shared_ptr< const Setup< double > > kfSetup)
VertexD GetGuessFromTheTarget() const
void SetNoConstrainToTargetZ()
Unset flag to constrain vertex to target.
bool IsConstrainToTargetZ() const
Getters.
~VertexFitter()=default
Destructor.
bool fConstrainToTargetZ
Flag to constrain vertex to target.
void SetNoRmsCut()
Unset cut in standard deviation for track inclusion.
double fBeamY
Width of beamline constraint in Y [cm].
void SetConstrainToTargetZ()
Set flag to constrain vertex to target.
std::shared_ptr< const Setup< double > > GetKfSetup() const
std::tuple< VertexD, std::vector< char > > FitVertex(const std::vector< const TrackParam< T > * > &tracks, const std::vector< const TrackParam< T > * > &linearizations, const VertexD &vtxGuess) const
Fit vertex from the given tracks.
void SetNoConstrainToBeamXY()
Unset flag to constrain vertex to beamline.
std::shared_ptr< const Setup< double > > fKfSetup
Kalman Filter setup.
void SetConstrainToBeamXY(double x, double y, double sigmaX, double sigmaY)
Set flag and values to constrain vertex to beamline.
VertexFitter()=default
Default constructor.
void dummy()
template instantiation dummy function
double fBeamSigmaX
Sigma of beamline constraint in X [cm].
double fRmsCut
Cut in standard deviation for track to be included in vertex fit.
void SetRmsCut(double c)
Set cut in standard deviation for track inclusion.
void SetKfSetup(std::shared_ptr< const Setup< double > > kfSetup)
Set Kalman Filter setup.
int fNofIterations
N of iterations for vertex fitting.
bool fConstrainToBeamXY
Flag to constrain vertex to beamline.
Vertex< double > VertexD
Definition KfVertex.h:166