Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vertex.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Vertex.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
13 
14 namespace Acts {
15 
22 template <typename input_track_t>
23 class Vertex {
24  public:
26  Vertex() = default;
27 
31  Vertex(const Vector3& position);
32 
36  Vertex(const Vector4& position);
37 
43  Vertex(const Vector3& position, const SquareMatrix3& covariance,
44  const std::vector<TrackAtVertex<input_track_t>>& tracks);
45 
51  Vertex(const Vector4& position, const SquareMatrix4& covariance,
52  const std::vector<TrackAtVertex<input_track_t>>& tracks);
53 
55  Vector3 position() const;
56 
58  ActsScalar time() const;
59 
61  const Vector4& fullPosition() const;
62 
64  SquareMatrix3 covariance() const;
65 
67  const SquareMatrix4& fullCovariance() const;
68 
70  const std::vector<TrackAtVertex<input_track_t>>& tracks() const;
71 
73  std::pair<double, double> fitQuality() const;
74 
79  void setPosition(const Vector3& position, ActsScalar time = 0);
80 
84  void setFullPosition(const Vector4& fullPosition);
85 
89  void setTime(ActsScalar time);
90 
94  void setCovariance(const SquareMatrix3& covariance);
95 
99  void setFullCovariance(const SquareMatrix4& covariance);
100 
102  void setTracksAtVertex(
103  const std::vector<TrackAtVertex<input_track_t>>& tracks);
104 
107  void setFitQuality(double chiSquared, double numberDoF);
108 
110  void setFitQuality(std::pair<double, double> fitQuality);
111 
112  private:
113  Vector4 m_position = Vector4::Zero();
114  SquareMatrix4 m_covariance = SquareMatrix4::Zero();
115  std::vector<TrackAtVertex<input_track_t>> m_tracksAtVertex;
116  double m_chiSquared = 0.; // chi2 of the fit
117  double m_numberDoF = 0.; // number of degrees of freedom
118 };
119 
120 } // namespace Acts
121 
122 #include "Vertex.ipp"