ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
indexing.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/core/detail/indexing.hpp"
13#include "detray/utils/invalid_values.hpp"
14
15namespace detray {
16
18using dindex = unsigned int;
19
21inline constexpr dindex dindex_invalid = detail::invalid_value<dindex>();
22
24using dindex_range = detail::index_range<dindex>;
27 detail::index_range<dindex, detail::sized_index_range>;
30
32template <typename index_t = dindex, std::size_t DIM = 3u>
33using dmulti_index = detail::multi_index<index_t, DIM>;
34
36template <typename id_t = dindex, typename index_t = dindex,
37 typename value_t = std::uint_least32_t, value_t id_mask = 0xf0000000,
38 value_t index_mask = ~id_mask>
40 detail::typed_index<id_t, index_t, value_t, id_mask, index_mask>;
41
42namespace detail {
43
45template <std::size_t ID>
46dindex get(dindex idx) noexcept {
47 return idx;
48}
49
50} // namespace detail
51
52} // namespace detray
Detray include(s).
Definition array_operators.hpp:18
detail::index_range< dindex > dindex_range
Index ranges and sequences.
Definition indexing.hpp:24
vecmem::vector< value_t > dvector
Vector container backed by vecmem.
Definition containers.hpp:34
detail::typed_index< id_t, index_t, value_t, id_mask, index_mask > dtyped_index
Link consisting of a type ID and an index.
Definition indexing.hpp:39
unsigned int dindex
Default index type.
Definition indexing.hpp:18
constexpr dindex dindex_invalid
Global invalid index definition.
Definition indexing.hpp:21
detail::index_range< dindex, detail::sized_index_range > dsized_index_range
Index range whose size is known at compile time.
Definition indexing.hpp:26
const auto & get(const detray::tuple< Ts... > &t) noexcept
Get a tuple element by index from a const tuple.
Definition tuple.hpp:152
dvector< dindex > dindex_sequence
Compile-time sequence of detector indices.
Definition indexing.hpp:29
detail::multi_index< index_t, DIM > dmulti_index
Index that consists of multiple subindices.
Definition indexing.hpp:33