FairShip
Loading...
Searching...
No Matches
RecoVertex.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#ifndef SHIPDATA_RECOVERTEX_H_
6#define SHIPDATA_RECOVERTEX_H_
7
8#include <array>
9#include <vector>
10
11#include "Rtypes.h"
12#include "TObject.h"
13#include "TVector3.h"
14
15namespace SHiP {
16
24class RecoVertex : public TObject {
25 public:
26 RecoVertex() = default;
27 RecoVertex(const TVector3& position,
28 const std::array<Double_t, 6>& covariance, Double_t chi2,
29 Double_t nDoF);
30 ~RecoVertex() override = default;
31
37 void AddTrack(Int_t trackId, const TVector3& momentum,
38 const std::array<Double_t, 6>& momentumCovariance);
40 void SetDoca(Double_t doca) { m_doca = doca; }
41
42 Double_t x() const { return m_x; }
43 Double_t y() const { return m_y; }
44 Double_t z() const { return m_z; }
45 Double_t err_x() const { return m_err_x; }
46 Double_t err_y() const { return m_err_y; }
47 Double_t err_z() const { return m_err_z; }
48 Double_t chi2() const { return m_chi2; }
49 Double_t nDoF() const { return m_nDoF; }
51 Double_t doca() const { return m_doca; }
52 const std::vector<Double_t>& GetCovarianceElements() const {
53 return m_cov_elements;
54 }
55
56 const std::vector<Int_t>& trackIds() const { return m_trackIds; }
57 const std::vector<Double_t>& trackPx() const { return m_trackPx; }
58 const std::vector<Double_t>& trackPy() const { return m_trackPy; }
59 const std::vector<Double_t>& trackPz() const { return m_trackPz; }
61 std::array<Double_t, 6> GetTrackMomentumCovariance(size_t i) const;
62
63 private:
64 Double_t m_x{0.};
65 Double_t m_y{0.};
66 Double_t m_z{0.};
67 Double_t m_err_x{0.};
68 Double_t m_err_y{0.};
69 Double_t m_err_z{0.};
70 Double_t m_chi2{0.};
71 Double_t m_nDoF{0.};
72 Double_t m_doca{-1.};
73 std::vector<Double_t> m_cov_elements;
74 std::vector<Int_t> m_trackIds;
75 std::vector<Double_t> m_trackPx;
76 std::vector<Double_t> m_trackPy;
77 std::vector<Double_t> m_trackPz;
79 std::vector<Double_t> m_trackCovP;
80
82};
83
84} // namespace SHiP
85
86#endif // SHIPDATA_RECOVERTEX_H_
void AddTrack(Int_t trackId, const TVector3 &momentum, const std::array< Double_t, 6 > &momentumCovariance)
Double_t chi2() const
Definition RecoVertex.h:48
Double_t m_err_z
Definition RecoVertex.h:69
std::vector< Double_t > m_trackCovP
Momentum covariances of all tracks, 6 elements per track.
Definition RecoVertex.h:79
~RecoVertex() override=default
Double_t err_y() const
Definition RecoVertex.h:46
Double_t nDoF() const
Definition RecoVertex.h:49
Double_t m_nDoF
Definition RecoVertex.h:71
Double_t doca() const
Distance of closest approach in cm for two-track vertices, else -1.
Definition RecoVertex.h:51
std::array< Double_t, 6 > GetTrackMomentumCovariance(size_t i) const
Momentum covariance of track i, as 6 upper-triangle elements.
Double_t m_err_x
Definition RecoVertex.h:67
const std::vector< Double_t > & trackPz() const
Definition RecoVertex.h:59
RecoVertex()=default
Double_t y() const
Definition RecoVertex.h:43
Double_t err_z() const
Definition RecoVertex.h:47
std::vector< Double_t > m_trackPx
Definition RecoVertex.h:75
std::vector< Double_t > m_trackPz
Definition RecoVertex.h:77
const std::vector< Double_t > & trackPy() const
Definition RecoVertex.h:58
std::vector< Int_t > m_trackIds
Definition RecoVertex.h:74
ClassDefOverride(RecoVertex, 1)
Double_t z() const
Definition RecoVertex.h:44
Double_t m_chi2
Definition RecoVertex.h:70
Double_t x() const
Definition RecoVertex.h:42
std::vector< Double_t > m_cov_elements
Definition RecoVertex.h:73
const std::vector< Int_t > & trackIds() const
Definition RecoVertex.h:56
Double_t m_doca
Definition RecoVertex.h:72
Double_t m_err_y
Definition RecoVertex.h:68
void SetDoca(Double_t doca)
Distance of closest approach of the two tracks, before the vertex fit.
Definition RecoVertex.h:40
std::vector< Double_t > m_trackPy
Definition RecoVertex.h:76
Double_t err_x() const
Definition RecoVertex.h:45
const std::vector< Double_t > & GetCovarianceElements() const
Definition RecoVertex.h:52
const std::vector< Double_t > & trackPx() const
Definition RecoVertex.h:57