Project
Loading...
Searching...
No Matches
GenericTrack.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_GENERICTRACK_H_
13#define ALICEO2_ITSMFT_TRACKING_GENERICTRACK_H_
14
15#include <cstddef>
16#include <cstdint>
17#include <limits>
18#include <type_traits>
19
20#include "GPUCommonDef.h"
21#ifndef GPUCA_GPUCODE
23#endif
28
30{
31
32// Stable TimeFrame identity. clusterId is the pre-sort position in the
33// per-surface measurement arrays; publication adapters translate it to any
34// external index space.
37 uint16_t reserved{0};
38 uint32_t clusterId{std::numeric_limits<uint32_t>::max()};
39
40 GPUhdi() bool isValid() const noexcept { return layer.isValid() && clusterId != std::numeric_limits<uint32_t>::max(); }
41};
42
43// Frame-owned result; [firstClusterRef, clusterRefEnd) is inner-to-outer and
44// valid only with the same normalized event.
54
55#ifndef GPUCA_GPUCODE
56
57// Successful refit result; typed output remains adapter-owned.
61
62 int getNumberOfClusters() const noexcept { return seed.getActiveLayerCount(); }
63 int getClusterIndex(int position) const noexcept { return seed.getCluster(position); }
64 int getFirstClusterLayer() const noexcept { return seed.getHitLayerMask().first(); }
65};
66
67#endif
68
69// The caller supplies the current frame-owned reference-array size; do not
70// infer validity from the track itself.
71GPUhdi() constexpr bool isValidTrackRange(const GenericTrack& track, uint32_t trackClusterIndicesSize) noexcept
72{
73 return track.firstClusterRef <= track.clusterRefEnd && track.clusterRefEnd <= trackClusterIndicesSize;
74}
75
76GPUhdi() constexpr uint32_t trackClusterRefCount(const GenericTrack& track) noexcept
77{
78 return track.clusterRefEnd - track.firstClusterRef;
79}
80
81} // namespace o2::itsmft::tracking
82
83#endif /* ALICEO2_ITSMFT_TRACKING_GENERICTRACK_H_ */
GPU-portable whole-track seed for common CA tracking.
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
uint32_t trackClusterIndicesSize noexcept
GPUhdi() const expr bool isRecognizedSurfaceKind(SurfaceKind kind) noexcept
Definition IdTypes.h:65
bool isValid(std::string alias)
GPUhdi() bool isValid() const noexcept
int getClusterIndex(int position) const noexcept
int getFirstClusterLayer() const noexcept