File indexing completed on 2025-01-18 09:11:43
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/Trajectories.hpp"
0015 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0016 #include "ActsExamples/Framework/DataHandle.hpp"
0017
0018 #include <algorithm>
0019 #include <memory>
0020 #include <vector>
0021
0022 namespace ActsExamples {
0023
0024
0025
0026
0027
0028 inline std::vector<Acts::InputTrack> makeInputTracks(
0029 const TrackParametersContainer& trackParameters) {
0030 std::vector<Acts::InputTrack> inputTracks;
0031 inputTracks.reserve(trackParameters.size());
0032
0033 for (const auto& trackParam : trackParameters) {
0034 inputTracks.emplace_back(&trackParam);
0035 }
0036 return inputTracks;
0037 }
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 inline ProtoVertexContainer makeProtoVertices(
0049 const std::vector<Acts::InputTrack>& inputTracks,
0050 const std::vector<Acts::Vertex>& vertices) {
0051 ProtoVertexContainer protoVertices;
0052 protoVertices.reserve(vertices.size());
0053
0054 for (const auto& vertex : vertices) {
0055 ProtoVertex protoVertex;
0056 protoVertex.reserve(vertex.tracks().size());
0057
0058 for (const auto& track : vertex.tracks()) {
0059 auto it = std::ranges::find(inputTracks, track.originalParams);
0060 if (it != inputTracks.end()) {
0061 protoVertex.push_back(std::distance(inputTracks.begin(), it));
0062 } else {
0063 protoVertex.push_back(-1);
0064 }
0065 }
0066 protoVertices.push_back(std::move(protoVertex));
0067 }
0068
0069 return protoVertices;
0070 }
0071
0072 }