Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-21 08:02:27

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Vertexing/TrackAtVertex.hpp"
0013 
0014 namespace Acts {
0015 
0016 /// @class Vertex
0017 /// @brief Class for storing vertex objects
0018 class Vertex {
0019  public:
0020   /// @brief Default constructor
0021   Vertex() = default;
0022 
0023   /// @brief Construct for vertex at given 3d-position, sets covariance to zero
0024   ///
0025   /// @param position Vertex position
0026   explicit Vertex(const Vector3& position);
0027 
0028   /// @brief Construct for vertex at given 4d-position, sets covariance to zero
0029   ///
0030   /// @param position Vertex position
0031   explicit Vertex(const Vector4& position);
0032 
0033   /// @brief Vertex constructor
0034   ///
0035   /// @param position Vertex position
0036   /// @param covariance Position covariance matrix
0037   /// @param tracks Vector of tracks associated with the vertex
0038   Vertex(const Vector3& position, const SquareMatrix3& covariance,
0039          std::vector<TrackAtVertex> tracks);
0040 
0041   /// @brief Vertex constructor
0042   ///
0043   /// @param position Full vertex position
0044   /// @param covariance 4x4 covariance matrix
0045   /// @param tracks Vector of tracks associated with the vertex
0046   Vertex(const Vector4& position, const SquareMatrix4& covariance,
0047          std::vector<TrackAtVertex> tracks);
0048 
0049   /// @return Returns 3-position
0050   Vector3 position() const;
0051 
0052   /// @return Returns time
0053   double time() const;
0054 
0055   /// @return Returns 4-position
0056   const Vector4& fullPosition() const;
0057   /// @return Returns mutable reference to 4-position
0058   Vector4& fullPosition();
0059 
0060   /// @return Returns 4D position of the vertex seed
0061   const Vector4& fullSeedPosition() const;
0062   /// @return Returns mutable reference to 4D position of the vertex seed
0063   Vector4& fullSeedPosition();
0064 
0065   /// @return Returns position covariance
0066   SquareMatrix3 covariance() const;
0067 
0068   /// @return Returns 4x4 covariance
0069   const SquareMatrix4& fullCovariance() const;
0070   /// @return Returns mutable reference to 4x4 covariance
0071   SquareMatrix4& fullCovariance();
0072 
0073   /// @return Returns vector of tracks associated with the vertex
0074   const std::vector<TrackAtVertex>& tracks() const;
0075 
0076   /// @return Returns pair of (chi2, numberDoF)
0077   std::pair<double, double> fitQuality() const;
0078 
0079   /// @brief Set position
0080   ///
0081   /// @param position Vertex position
0082   void setPosition(const Vector3& position);
0083 
0084   /// @brief Set position and time
0085   ///
0086   /// @param fullPosition Vertex position and time
0087   void setFullPosition(const Vector4& fullPosition);
0088 
0089   /// @brief Sets time
0090   ///
0091   /// @param time The time
0092   void setTime(double time);
0093 
0094   /// @brief Sets 3x3 covariance
0095   ///
0096   /// @param covariance Position covariance matrix
0097   void setCovariance(const SquareMatrix3& covariance);
0098 
0099   /// @brief Sets 4x4 covariance
0100   ///
0101   /// @param covariance The 4x4 covariance matrix
0102   void setFullCovariance(const SquareMatrix4& covariance);
0103 
0104   /// @param tracks Vector of tracks at vertex
0105   void setTracksAtVertex(std::vector<TrackAtVertex> tracks);
0106 
0107   /// @param chiSquared Chi2 of fit
0108   /// @param numberDoF Number of degrees of freedom
0109   void setFitQuality(double chiSquared, double numberDoF);
0110 
0111   /// @param fitQuality pair of (chi2, numberDoF)
0112   void setFitQuality(std::pair<double, double> fitQuality);
0113 
0114  private:
0115   Vector4 m_position = Vector4::Zero();
0116   Vector4 m_seedPosition = Vector4::Zero();
0117   SquareMatrix4 m_covariance = SquareMatrix4::Zero();
0118   std::vector<TrackAtVertex> m_tracksAtVertex;
0119   double m_chiSquared = 0.;  // chi2 of the fit
0120   double m_numberDoF = 0.;   // number of degrees of freedom
0121 };
0122 
0123 }  // namespace Acts