Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-12 07:51:25

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/EventData/SpacePointContainer2.hpp"
0012 
0013 #include "Acts/EventData/SpacePointProxy2.hpp"
0014 
0015 namespace Acts::Experimental {
0016 
0017 inline MutableSpacePointProxy2 SpacePointContainer2::createSpacePoint(
0018     std::span<const SourceLink> sourceLinks, float x, float y,
0019     float z) noexcept {
0020   m_x.push_back(x);
0021   m_y.push_back(y);
0022   m_z.push_back(z);
0023   m_sourceLinkOffsets.push_back(m_sourceLinks.size());
0024   m_sourceLinkCounts.push_back(static_cast<std::uint8_t>(sourceLinks.size()));
0025   m_sourceLinks.insert(m_sourceLinks.end(), sourceLinks.begin(),
0026                        sourceLinks.end());
0027 
0028   for (auto &column : m_extraColumns) {
0029     column->emplace_back();
0030   }
0031 
0032   return MutableProxyType(*this, size() - 1);
0033 }
0034 
0035 inline MutableSpacePointProxy2 SpacePointContainer2::at(IndexType index) {
0036   if (index >= size()) {
0037     throw std::out_of_range("Index out of range in SpacePointContainer2");
0038   }
0039   return MutableProxyType(*this, index);
0040 }
0041 
0042 inline ConstSpacePointProxy2 SpacePointContainer2::at(IndexType index) const {
0043   if (index >= size()) {
0044     throw std::out_of_range("Index out of range in SpacePointContainer2");
0045   }
0046   return ConstProxyType(*this, index);
0047 }
0048 
0049 inline MutableSpacePointProxy2 SpacePointContainer2::operator[](
0050     IndexType index) noexcept {
0051   return MutableProxyType(*this, index);
0052 }
0053 
0054 inline ConstSpacePointProxy2 SpacePointContainer2::operator[](
0055     IndexType index) const noexcept {
0056   return ConstProxyType(*this, index);
0057 }
0058 
0059 }  // namespace Acts::Experimental