Project
Loading...
Searching...
No Matches
TrackITSInternal.h
Go to the documentation of this file.
1// Copyright 2019-2026 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 TRACKINGITSU_INCLUDE_TRACKITSINTERNAL_H_
13#define TRACKINGITSU_INCLUDE_TRACKITSINTERNAL_H_
14
15#include <array>
16
17#include "GPUCommonDef.h"
22
23namespace o2::its
24{
25
26template <int NLayers>
28 GPUhdi() TrackITSInternal() { resetClusters(); }
29
30 GPUhdi() void resetClusters()
31 {
32 for (int iLayer{0}; iLayer < NLayers; ++iLayer) {
34 }
35 nClusters = 0;
36 }
37
38 GPUhdi() int getClusterIndex(int layer) const { return clusters[layer]; }
39
40 GPUhdi() void setClusterIndex(int layer, int cluster)
41 {
43 ++nClusters;
45 --nClusters;
46 }
48 }
49
50 GPUhdi() int getNClusters() const { return nClusters; }
51 GPUhdi() int getNumberOfClusters() const { return nClusters; }
52 GPUhdi() float getChi2() const { return chi2; }
54 GPUdi() float getPt() const { return paramIn.getPt(); }
55
56 GPUhdi() uint32_t getPattern() const
57 {
58 uint32_t pattern{0};
59 for (int iLayer{0}; iLayer < NLayers; ++iLayer) {
60 if (clusters[iLayer] != constants::UnusedIndex) {
61 pattern |= (0x1u << iLayer);
62 }
63 }
64 return pattern;
65 }
66
67 GPUhdi() int getFirstClusterLayer() const
68 {
69 for (int iLayer{0}; iLayer < NLayers; ++iLayer) {
70 if (clusters[iLayer] != constants::UnusedIndex) {
71 return iLayer;
72 }
73 }
75 }
76
77 GPUhdi() int getLastClusterLayer() const
78 {
79 for (int iLayer{NLayers - 1}; iLayer >= 0; --iLayer) {
80 if (clusters[iLayer] != constants::UnusedIndex) {
81 return iLayer;
82 }
83 }
85 }
86
89 std::array<int, NLayers> clusters{};
91 float chi2{0.f};
92 int nClusters{0};
93};
94
95template <int NLayers>
96GPUhdi() TrackITSExt makeTrackITSExt(const TrackITSInternal<NLayers>& track)
97{
98 TrackITSExt out;
99 out.getParamIn() = track.paramIn;
100 out.getParamOut() = track.paramOut;
101 out.setChi2(track.chi2);
102 out.getTimeStamp() = track.time.makeSymmetrical();
103 for (int iLayer{0}; iLayer < NLayers; ++iLayer) {
104 if (track.clusters[iLayer] != constants::UnusedIndex) {
105 out.setExternalClusterIndex(iLayer, track.clusters[iLayer], true);
106 }
107 }
108 return out;
109}
110
111} // namespace o2::its
112
113#endif /* TRACKINGITSU_INCLUDE_TRACKITSINTERNAL_H_ */
Base track model for the Barrel, params only, w/o covariance.
Definition of the ITS track.
GLsizei const GLfloat * value
Definition glcorearb.h:819
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
constexpr int UnusedIndex
Definition Constants.h:32
track setChi2(hypo.chi2)
GPUhdi() int IndexTableUtils< nLayers >
const bool const int TrackITSInternal< NLayers > & track
TrackParCovF TrackParCov
Definition Track.h:33
GPUhdi() int getFirstClusterLayer() const
GPUhdi() TrackITSInternal()
GPUdi() float getPt() const
GPUhdi() int getLastClusterLayer() const
std::array< int, NLayers > clusters
GPUhdi() uint32_t getPattern() const
GPUhdi() void setChi2(float value)
GPUhdi() int getClusterIndex(int layer) const
GPUhdi() float getChi2() const
GPUhdi() void resetClusters()
o2::track::TrackParCov paramOut
GPUhdi() int getNClusters() const
GPUhdi() int getNumberOfClusters() const
o2::track::TrackParCov paramIn
std::array< uint16_t, 5 > pattern