File indexing completed on 2025-01-18 09:11:33
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Vertexing/KalmanVertexUpdater.hpp"
0010
0011 #include "Acts/Vertexing/Vertex.hpp"
0012
0013 #include <stdexcept>
0014
0015 namespace Acts::KalmanVertexUpdater {
0016
0017 namespace detail {
0018 template <unsigned int nDimVertex>
0019 void updateVertexWithTrackImpl(Vertex& vtx, TrackAtVertex& trk, int sign);
0020
0021 template <unsigned int nDimVertex>
0022 void updateTrackWithVertexImpl(TrackAtVertex& track, const Vertex& vtx);
0023 }
0024
0025
0026
0027
0028
0029 void updateVertexWithTrack(Vertex& vtx, TrackAtVertex& trk,
0030 unsigned int nDimVertex) {
0031 if (nDimVertex == 3) {
0032 detail::updateVertexWithTrackImpl<3>(vtx, trk, 1);
0033 } else if (nDimVertex == 4) {
0034 detail::updateVertexWithTrackImpl<4>(vtx, trk, 1);
0035 } else {
0036 throw std::invalid_argument(
0037 "The vertex dimension must either be 3 (when fitting the spatial "
0038 "coordinates) or 4 (when fitting the spatial coordinates + time).");
0039 }
0040 }
0041
0042 void updateTrackWithVertex(TrackAtVertex& track, const Vertex& vtx,
0043 unsigned int nDimVertex) {
0044 if (nDimVertex == 3) {
0045 detail::updateTrackWithVertexImpl<3>(track, vtx);
0046 } else if (nDimVertex == 4) {
0047 detail::updateTrackWithVertexImpl<4>(track, vtx);
0048 } else {
0049 throw std::invalid_argument(
0050 "The vertex dimension must either be 3 (when fitting the spatial "
0051 "coordinates) or 4 (when fitting the spatial coordinates + time).");
0052 }
0053 }
0054
0055 }