Skip to content

Commit

Permalink
add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Aug 21, 2024
1 parent a3245df commit 64471b8
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions Examples/Framework/src/EventData/Measurement.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

// This file is part of the Acts project.
//
// Copyright (C) 2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include "ActsExamples/EventData/Measurement.hpp"

namespace ActsExamples {

MeasurementContainer::MeasurementContainer() = default;

std::size_t MeasurementContainer::size() const {
return m_entries.size();
}

void MeasurementContainer::reserve(std::size_t size) {
m_sourceLinks.reserve(size);
m_parameters.reserve(size * 2);
m_covariances.reserve(size * 2 * 2);
m_subspaceIndices.reserve(size * 2);
}

std::size_t MeasurementContainer::addMeasurement(std::uint8_t size) {
m_subspaceIndices.resize(m_subspaceIndices.size() + size);
m_entries.push_back({m_parameters.size(), m_covariances.size(),
m_subspaceIndices.size(), size});
m_parameters.resize(m_parameters.size() + size);
m_covariances.resize(m_covariances.size() + size * size);
return m_entries.size() - 1;
}

MeasurementContainer::VariableProxy MeasurementContainer::getMeasurement(
std::size_t index) {
return VariableProxy{*this, index};
}

MeasurementContainer::ConstVariableProxy MeasurementContainer::getMeasurement(
std::size_t index) const {
return ConstVariableProxy{*this, index};
}

MeasurementContainer::VariableProxy MeasurementContainer::makeMeasurement(
std::uint8_t size) {
return getMeasurement(addMeasurement(size));
}

MeasurementContainer::Iterator MeasurementContainer::begin() {
return Iterator{*this, 0};
}

MeasurementContainer::Iterator MeasurementContainer::end() {
return Iterator{*this, m_entries.size()};
}

MeasurementContainer::ConstIterator MeasurementContainer::begin() const {
return ConstIterator{*this, 0};
}

MeasurementContainer::ConstIterator MeasurementContainer::end() const {
return ConstIterator{*this, m_entries.size()};
}

} // namespace ActsExamples

0 comments on commit 64471b8

Please sign in to comment.