CbmRoot
Loading...
Searching...
No Matches
CbmDcaVertexFinder.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dario Ramirez [committer] */
4
5#ifndef CBMDCAVERTEXFINDER_H
6#define CBMDCAVERTEXFINDER_H
7
8#include "TH2.h"
9#include "TMatrixFSym.h"
10#include "TVector3.h"
11
12#include <optional>
13class CbmVertex;
14class CbmGlobalTrack;
15
23 public:
24 struct Qa {
25 std::shared_ptr<TH2> pca_y_vs_x;
26 std::shared_ptr<TH2> pca_x_vs_z;
27 std::shared_ptr<TH2> pca_y_vs_z;
28 };
29
31 struct PCA {
32 TVector3 point;
33 double d_trk;
34 };
35
37
39 CbmDcaVertexFinder(double max_dca);
40
42 CbmDcaVertexFinder(const std::vector<CbmGlobalTrack*> tracks);
43
45 CbmDcaVertexFinder(const std::vector<CbmGlobalTrack*> tracks, const double max_dca);
46
48 void SetTracks(const std::vector<CbmGlobalTrack*> tracks);
49
51
56 std::optional<CbmDcaVertexFinder::PCA> FindPca(CbmGlobalTrack* trk_i, CbmGlobalTrack* trk_j);
57
62 std::optional<CbmVertex> FindVertex();
63
64 void EnableQa(Qa qa) { fQA = std::make_optional<Qa>(qa); }
65
66 private:
67 const double fMaxDca;
68 std::vector<CbmGlobalTrack*> fInputTracks;
69 double fNbPairs;
70 std::optional<Qa> fQA;
71
72 TMatrixFSym fCovMatrix;
73};
74
75#endif
TClonesArray * tracks
void SetTracks(const std::vector< CbmGlobalTrack * > tracks)
Set input track.
std::vector< CbmGlobalTrack * > fInputTracks
~CbmDcaVertexFinder()=default
std::optional< CbmVertex > FindVertex()
Run algorithm to find vertex.
std::optional< CbmDcaVertexFinder::PCA > FindPca(CbmGlobalTrack *trk_i, CbmGlobalTrack *trk_j)
Calculate the Point of Closest Approach of two straight tracks if tracks are parallel it return a nul...
std::optional< Qa > fQA
std::shared_ptr< TH2 > pca_x_vs_z
std::shared_ptr< TH2 > pca_y_vs_z
std::shared_ptr< TH2 > pca_y_vs_x