Project
Loading...
Searching...
No Matches
IdTypes.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_ITSMFT_TRACKING_IDTYPES_H_
13#define ALICEO2_ITSMFT_TRACKING_IDTYPES_H_
14
15#include <cstdint>
16#include <limits>
17#include <type_traits>
18
19#include "GPUCommonDef.h"
20
22{
23
24// The coordinate convention of a surface and every state defined on it.
25enum class SurfaceKind : uint8_t {
28 Disk
29};
30
31namespace detail
32{
33template <typename Tag, typename ValueType>
35{
36 public:
37 static constexpr ValueType InvalidValue = std::numeric_limits<ValueType>::max();
38
39 GPUhdDefault() constexpr Identifier() noexcept = default;
40 GPUhdDefault() explicit constexpr Identifier(ValueType value) noexcept : mValue{value} {}
41
42 GPUhdi() constexpr ValueType value() const noexcept { return mValue; }
43 GPUhdi() constexpr bool isValid() const noexcept { return mValue != InvalidValue; }
44 GPUhdi() static constexpr Identifier invalid() noexcept { return Identifier{InvalidValue}; }
45
46 GPUhdi() friend constexpr bool operator==(Identifier lhs, Identifier rhs) noexcept { return lhs.mValue == rhs.mValue; }
47 GPUhdi() friend constexpr bool operator!=(Identifier lhs, Identifier rhs) noexcept { return !(lhs == rhs); }
48 GPUhdi() friend constexpr bool operator<(Identifier lhs, Identifier rhs) noexcept { return lhs.mValue < rhs.mValue; }
49
50 private:
51 ValueType mValue{InvalidValue};
52};
53} // namespace detail
54
55struct LayerIdTag;
56struct EdgeIdTag;
57struct CellPathIdTag;
58struct ClusterSourceIdTag;
59
64
65GPUhdi() constexpr bool isRecognizedSurfaceKind(SurfaceKind kind) noexcept
66{
68}
69
70inline constexpr uint32_t MaxLayoutSurfaces = 32;
71inline constexpr uint32_t MaxLayoutEdges = MaxLayoutSurfaces * (MaxLayoutSurfaces - 1);
72inline constexpr uint32_t MaxLayoutPaths = MaxLayoutSurfaces * (MaxLayoutSurfaces - 1) * (MaxLayoutSurfaces - 1);
73
74} // namespace o2::itsmft::tracking
75
76#endif
GPUhdi() const expr bool isValid() const noexcept
Definition IdTypes.h:43
GPUhdi() const expr ValueType value() const noexcept
Definition IdTypes.h:42
GPUhdi() friend const expr bool operator
static constexpr ValueType InvalidValue
Definition IdTypes.h:37
GPUhdi() static const expr Identifier invalid() noexcept
Definition IdTypes.h:44
GPUhdDefault() const expr Identifier() noexcept=default
GLsizei const GLfloat * value
Definition glcorearb.h:819
constexpr uint32_t MaxLayoutPaths
Definition IdTypes.h:72
constexpr uint32_t MaxLayoutEdges
Definition IdTypes.h:71
uint32_t trackClusterIndicesSize noexcept
GPUhdi() const expr bool isRecognizedSurfaceKind(SurfaceKind kind) noexcept
Definition IdTypes.h:65
constexpr uint32_t MaxLayoutSurfaces
Definition IdTypes.h:70
bool isValid(std::string alias)