Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Core/include/Acts/EventData/DynamicColumnInfo.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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/Utilities/HashedString.hpp"
0012 
0013 #include <concepts>
0014 #include <ranges>
0015 #include <string_view>
0016 #include <typeindex>
0017 
0018 namespace Acts {
0019 
0020 /// Description of one dynamic track or track-state column.
0021 struct DynamicColumnInfo {
0022   HashedString key;       ///< Key used for component access.
0023   std::string_view name;  ///< Original name, borrowed from the backend.
0024   std::type_index type;   ///< C++ value type stored in the column.
0025 };
0026 
0027 namespace detail {
0028 template <typename R>
0029 concept DynamicColumnInfoRange =
0030     std::ranges::input_range<R> &&
0031     std::same_as<std::ranges::range_value_t<R>, DynamicColumnInfo>;
0032 
0033 inline auto dynamicColumnView(const auto& columns) {
0034   return columns | std::views::transform([](const auto& entry) {
0035            const auto& [key, column] = entry;
0036            return DynamicColumnInfo{key, column->name(), column->type()};
0037          });
0038 }
0039 }  // namespace detail
0040 }  // namespace Acts