File indexing completed on 2026-04-01 07:46:20
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Vertexing/Vertex.hpp"
0012 #include "ActsExamples/EventData/ProtoVertex.hpp"
0013 #include "ActsExamples/EventData/Track.hpp"
0014 #include "ActsExamples/EventData/Vertex.hpp"
0015
0016 #include <algorithm>
0017 #include <vector>
0018
0019 namespace ActsExamples {
0020
0021
0022
0023
0024
0025 inline std::vector<Acts::InputTrack> makeInputTracks(
0026 const TrackParametersContainer& trackParameters) {
0027 std::vector<Acts::InputTrack> inputTracks;
0028 inputTracks.reserve(trackParameters.size());
0029
0030 for (const auto& trackParam : trackParameters) {
0031 inputTracks.emplace_back(&trackParam);
0032 }
0033 return inputTracks;
0034 }
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 inline ProtoVertexContainer makeProtoVertices(
0046 const std::vector<Acts::InputTrack>& inputTracks,
0047 const VertexContainer& vertices) {
0048 ProtoVertexContainer protoVertices;
0049 protoVertices.reserve(vertices.size());
0050
0051 for (const auto& vertex : vertices) {
0052 ProtoVertex protoVertex;
0053 protoVertex.reserve(vertex.tracks().size());
0054
0055 for (const auto& track : vertex.tracks()) {
0056 auto it = std::ranges::find(inputTracks, track.originalParams);
0057 if (it != inputTracks.end()) {
0058 protoVertex.push_back(std::distance(inputTracks.begin(), it));
0059 } else {
0060 protoVertex.push_back(-1);
0061 }
0062 }
0063 protoVertices.push_back(std::move(protoVertex));
0064 }
0065
0066 return protoVertices;
0067 }
0068
0069 }