Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:00

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2019 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 http://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   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   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   ActsScalar time() const;
0054 
0055   /// @return Returns 4-position
0056   const Vector4& fullPosition() const;
0057   Vector4& fullPosition();
0058 
0059   /// @return Returns 4D position of the vertex seed
0060   const Vector4& fullSeedPosition() const;
0061   Vector4& fullSeedPosition();
0062 
0063   /// @return Returns position covariance
0064   SquareMatrix3 covariance() const;
0065 
0066   /// @return Returns 4x4 covariance
0067   const SquareMatrix4& fullCovariance() const;
0068   SquareMatrix4& fullCovariance();
0069 
0070   /// @return Returns vector of tracks associated with the vertex
0071   const std::vector<TrackAtVertex>& tracks() const;
0072 
0073   /// @return Returns pair of (chi2, numberDoF)
0074   std::pair<double, double> fitQuality() const;
0075 
0076   /// @brief Set position and time
0077   ///
0078   /// @param position Vertex position
0079   /// @param time The time
0080   void setPosition(const Vector3& position, ActsScalar time = 0);
0081 
0082   /// @brief Set position and time
0083   ///
0084   /// @param fullPosition Vertex position and time
0085   void setFullPosition(const Vector4& fullPosition);
0086 
0087   /// @brief Sets time
0088   ///
0089   /// @param time The time
0090   void setTime(ActsScalar time);
0091 
0092   /// @brief Sets 3x3 covariance
0093   ///
0094   /// @param covariance Position covariance matrix
0095   void setCovariance(const SquareMatrix3& covariance);
0096 
0097   /// @brief Sets 4x4 covariance
0098   ///
0099   /// @param covariance The 4x4 covariance matrix
0100   void setFullCovariance(const SquareMatrix4& covariance);
0101 
0102   /// @param tracks Vector of tracks at vertex
0103   void setTracksAtVertex(std::vector<TrackAtVertex> tracks);
0104 
0105   /// @param chiSquared Chi2 of fit
0106   /// @param numberDoF Number of degrees of freedom
0107   void setFitQuality(double chiSquared, double numberDoF);
0108 
0109   /// @param fitQuality pair of (chi2, numberDoF)
0110   void setFitQuality(std::pair<double, double> fitQuality);
0111 
0112  private:
0113   Vector4 m_position = Vector4::Zero();
0114   Vector4 m_seedPosition = Vector4::Zero();
0115   SquareMatrix4 m_covariance = SquareMatrix4::Zero();
0116   std::vector<TrackAtVertex> m_tracksAtVertex;
0117   double m_chiSquared = 0.;  // chi2 of the fit
0118   double m_numberDoF = 0.;   // number of degrees of freedom
0119 };
0120 
0121 }  // namespace Acts