File indexing completed on 2025-01-18 09:11:43
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "TruthVertexSeeder.hpp"
0010
0011 #include "VertexingHelpers.hpp"
0012
0013 namespace ActsExamples {
0014
0015 TruthVertexSeeder::TruthVertexSeeder(const Config &cfg) : m_cfg(cfg) {}
0016
0017 Acts::Result<std::vector<Acts::Vertex>> TruthVertexSeeder::find(
0018 const std::vector<Acts::InputTrack> & ,
0019 const Acts::VertexingOptions &vertexingOptions,
0020 Acts::IVertexFinder::State &anyState) const {
0021 auto &state = anyState.template as<State>();
0022
0023 if (state.nextVertexIndex >= state.truthVertices.size()) {
0024 return std::vector<Acts::Vertex>();
0025 }
0026
0027 const auto &truthVertex = state.truthVertices[state.nextVertexIndex];
0028 ++state.nextVertexIndex;
0029
0030 Acts::Vertex converted;
0031 converted.fullPosition().z() = truthVertex.position().z();
0032 if (m_cfg.useXY) {
0033 converted.fullPosition().x() = truthVertex.position().x();
0034 converted.fullPosition().y() = truthVertex.position().y();
0035 }
0036 if (m_cfg.useTime) {
0037 converted.setTime(truthVertex.time());
0038 }
0039
0040 Acts::SquareMatrix4 seedCov = vertexingOptions.constraint.fullCovariance();
0041 converted.setFullCovariance(seedCov);
0042
0043 return std::vector<Acts::Vertex>{converted};
0044 }
0045
0046 Acts::IVertexFinder::State TruthVertexSeeder::makeState(
0047 const Acts::MagneticFieldContext & ) const {
0048 return Acts::IVertexFinder::State{State{}};
0049 }
0050
0051 void TruthVertexSeeder::setTracksToRemove(
0052 Acts::IVertexFinder::State & ,
0053 const std::vector<Acts::InputTrack> & ) const {
0054
0055 }
0056
0057 }