Project
Loading...
Searching...
No Matches
TrackingKernels.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.
12
13#ifndef ITSTRACKINGGPU_TRACKINGKERNELS_H_
14#define ITSTRACKINGGPU_TRACKINGKERNELS_H_
15
17#include "GPUCommonDef.h"
18
19namespace o2::its
20{
21class CellSeed;
22class ExternalAllocator;
23namespace gpu
24{
25
26#ifdef GPUCA_GPUCODE // GPUg() global kernels must only when compiled by GPU compiler
27
28GPUdi() int4 getEmptyBinsRect() { return int4{0, 0, 0, 0}; }
29
30GPUd() bool fitTrack(TrackITSExt& track,
31 int start,
32 int end,
33 int step,
34 float chi2clcut,
35 float chi2ndfcut,
36 float maxQoverPt,
37 int nCl,
38 float Bz,
39 TrackingFrameInfo** tfInfos,
40 const o2::base::Propagator* prop,
41 o2::base::PropagatorF::MatCorrType matCorrType = o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrNONE);
42
43template <int nLayers = 7>
44GPUg() void fitTrackSeedsKernel(
45 CellSeed* trackSeeds,
46 const TrackingFrameInfo** foundTrackingFrameInfo,
47 o2::its::TrackITSExt* tracks,
48 const float* minPts,
49 const unsigned int nSeeds,
50 const float Bz,
51 const int startLevel,
52 float maxChi2ClusterAttachment,
53 float maxChi2NDF,
54 const o2::base::Propagator* propagator,
55 const o2::base::PropagatorF::MatCorrType matCorrType = o2::base::PropagatorF::MatCorrType::USEMatCorrLUT);
56#endif
57} // namespace gpu
58
59template <int nLayers = 7>
61 const uint8_t* multMask,
62 const int startROF,
63 const int endROF,
64 const int maxROF,
65 const int deltaROF,
66 const int vertexId,
67 const Vertex* vertices,
68 const int* rofPV,
69 const int nVertices,
70 const Cluster** clusters,
71 std::vector<unsigned int> nClusters,
72 const int** ROFClusters,
73 const unsigned char** usedClusters,
74 const int** clustersIndexTables,
75 int** trackletsLUTs,
76 gsl::span<int*> trackletsLUTsHost,
77 const int iteration,
78 const float NSigmaCut,
79 bounded_vector<float>& phiCuts,
80 const float resolutionPV,
81 std::array<float, nLayers>& minR,
82 std::array<float, nLayers>& maxR,
83 bounded_vector<float>& resolutions,
84 std::vector<float>& radii,
85 bounded_vector<float>& mulScatAng,
86 const int nBlocks,
87 const int nThreads,
88 gpu::Streams& streams);
89
90template <int nLayers = 7>
92 const uint8_t* multMask,
93 const int startROF,
94 const int endROF,
95 const int maxROF,
96 const int deltaROF,
97 const int vertexId,
98 const Vertex* vertices,
99 const int* rofPV,
100 const int nVertices,
101 const Cluster** clusters,
102 std::vector<unsigned int> nClusters,
103 const int** ROFClusters,
104 const unsigned char** usedClusters,
105 const int** clustersIndexTables,
107 gsl::span<Tracklet*> spanTracklets,
108 gsl::span<int> nTracklets,
109 int** trackletsLUTs,
110 gsl::span<int*> trackletsLUTsHost,
111 const int iteration,
112 const float NSigmaCut,
113 bounded_vector<float>& phiCuts,
114 const float resolutionPV,
115 std::array<float, nLayers>& minR,
116 std::array<float, nLayers>& maxR,
117 bounded_vector<float>& resolutions,
118 std::vector<float>& radii,
119 bounded_vector<float>& mulScatAng,
120 const int nBlocks,
121 const int nThreads,
122 gpu::Streams& streams);
123
124void countCellsHandler(const Cluster** sortedClusters,
125 const Cluster** unsortedClusters,
126 const TrackingFrameInfo** tfInfo,
128 int** trackletsLUT,
129 const int nTracklets,
130 const int layer,
132 int** cellsLUTsDeviceArray,
133 int* cellsLUTsHost,
134 const float bz,
135 const float maxChi2ClusterAttachment,
136 const float cellDeltaTanLambdaSigma,
137 const float nSigmaCut,
138 const int nBlocks,
139 const int nThreads);
140
141void computeCellsHandler(const Cluster** sortedClusters,
142 const Cluster** unsortedClusters,
143 const TrackingFrameInfo** tfInfo,
145 int** trackletsLUT,
146 const int nTracklets,
147 const int layer,
149 int** cellsLUTsDeviceArray,
150 int* cellsLUTsHost,
151 const float bz,
152 const float maxChi2ClusterAttachment,
153 const float cellDeltaTanLambdaSigma,
154 const float nSigmaCut,
155 const int nBlocks,
156 const int nThreads);
157
158unsigned int countCellNeighboursHandler(CellSeed** cellsLayersDevice,
159 int* neighboursLUTs,
160 int** cellsLUTs,
161 gpuPair<int, int>* cellNeighbours,
162 int* neighboursIndexTable,
163 const float maxChi2ClusterAttachment,
164 const float bz,
165 const int layerIndex,
166 const unsigned int nCells,
167 const unsigned int nCellsNext,
168 const int maxCellNeighbours,
169 const int nBlocks,
170 const int nThreads);
171
172void computeCellNeighboursHandler(CellSeed** cellsLayersDevice,
173 int* neighboursLUTs,
174 int** cellsLUTs,
175 gpuPair<int, int>* cellNeighbours,
176 int* neighboursIndexTable,
177 const float maxChi2ClusterAttachment,
178 const float bz,
179 const int layerIndex,
180 const unsigned int nCells,
181 const unsigned int nCellsNext,
182 const int maxCellNeighbours,
183 const int nBlocks,
184 const int nThreads);
185
187 int*,
188 unsigned int,
189 o2::its::ExternalAllocator* = nullptr);
190
191template <int nLayers = 7>
192void processNeighboursHandler(const int startLayer,
193 const int startLevel,
194 CellSeed** allCellSeeds,
195 CellSeed* currentCellSeeds,
196 std::array<int, nLayers - 2>& nCells,
197 const unsigned char** usedClusters,
198 std::array<int*, nLayers - 2>& neighbours,
199 gsl::span<int*> neighboursDeviceLUTs,
200 const TrackingFrameInfo** foundTrackingFrameInfo,
201 bounded_vector<CellSeed>& seedsHost,
203 const float bz,
204 const float MaxChi2ClusterAttachment,
205 const float maxChi2NDF,
206 const o2::base::Propagator* propagator,
207 const o2::base::PropagatorF::MatCorrType matCorrType,
208 const int nBlocks,
209 const int nThreads);
210
211void trackSeedHandler(CellSeed* trackSeeds,
212 const TrackingFrameInfo** foundTrackingFrameInfo,
213 o2::its::TrackITSExt* tracks,
214 std::vector<float>& minPtsHost,
215 const unsigned int nSeeds,
216 const float Bz,
217 const int startLevel,
218 float maxChi2ClusterAttachment,
219 float maxChi2NDF,
220 const o2::base::Propagator* propagator,
221 const o2::base::PropagatorF::MatCorrType matCorrType,
222 const int nBlocks,
223 const int nThreads);
224} // namespace o2::its
225#endif // ITSTRACKINGGPU_TRACKINGKERNELS_H_
#define GPUg()
#define GPUdi()
#define GPUd()
int nClusters
GLuint GLuint end
Definition glcorearb.h:469
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLuint start
Definition glcorearb.h:469
int filterCellNeighboursHandler(gpuPair< int, int > *, int *, unsigned int, o2::its::ExternalAllocator *=nullptr)
std::pmr::vector< T > bounded_vector
void computeTrackletsInROFsHandler(const IndexTableUtils *utils, const uint8_t *multMask, const int startROF, const int endROF, const int maxROF, const int deltaROF, const int vertexId, const Vertex *vertices, const int *rofPV, const int nVertices, const Cluster **clusters, std::vector< unsigned int > nClusters, const int **ROFClusters, const unsigned char **usedClusters, const int **clustersIndexTables, Tracklet **tracklets, gsl::span< Tracklet * > spanTracklets, gsl::span< int > nTracklets, int **trackletsLUTs, gsl::span< int * > trackletsLUTsHost, const int iteration, const float NSigmaCut, bounded_vector< float > &phiCuts, const float resolutionPV, std::array< float, nLayers > &minR, std::array< float, nLayers > &maxR, bounded_vector< float > &resolutions, std::vector< float > &radii, bounded_vector< float > &mulScatAng, const int nBlocks, const int nThreads, gpu::Streams &streams)
void computeCellsHandler(const Cluster **sortedClusters, const Cluster **unsortedClusters, const TrackingFrameInfo **tfInfo, Tracklet **tracklets, int **trackletsLUT, const int nTracklets, const int layer, CellSeed *cells, int **cellsLUTsDeviceArray, int *cellsLUTsHost, const float bz, const float maxChi2ClusterAttachment, const float cellDeltaTanLambdaSigma, const float nSigmaCut, const int nBlocks, const int nThreads)
void computeCellNeighboursHandler(CellSeed **cellsLayersDevice, int *neighboursLUTs, int **cellsLUTs, gpuPair< int, int > *cellNeighbours, int *neighboursIndexTable, const float maxChi2ClusterAttachment, const float bz, const int layerIndex, const unsigned int nCells, const unsigned int nCellsNext, const int maxCellNeighbours, const int nBlocks, const int nThreads)
unsigned int countCellNeighboursHandler(CellSeed **cellsLayersDevice, int *neighboursLUTs, int **cellsLUTs, gpuPair< int, int > *cellNeighbours, int *neighboursIndexTable, const float maxChi2ClusterAttachment, const float bz, const int layerIndex, const unsigned int nCells, const unsigned int nCellsNext, const int maxCellNeighbours, const int nBlocks, const int nThreads)
void trackSeedHandler(CellSeed *trackSeeds, const TrackingFrameInfo **foundTrackingFrameInfo, o2::its::TrackITSExt *tracks, std::vector< float > &minPtsHost, const unsigned int nSeeds, const float Bz, const int startLevel, float maxChi2ClusterAttachment, float maxChi2NDF, const o2::base::Propagator *propagator, const o2::base::PropagatorF::MatCorrType matCorrType, const int nBlocks, const int nThreads)
void processNeighboursHandler(const int startLayer, const int startLevel, CellSeed **allCellSeeds, CellSeed *currentCellSeeds, std::array< int, nLayers - 2 > &nCells, const unsigned char **usedClusters, std::array< int *, nLayers - 2 > &neighbours, gsl::span< int * > neighboursDeviceLUTs, const TrackingFrameInfo **foundTrackingFrameInfo, bounded_vector< CellSeed > &seedsHost, o2::its::ExternalAllocator *, const float bz, const float MaxChi2ClusterAttachment, const float maxChi2NDF, const o2::base::Propagator *propagator, const o2::base::PropagatorF::MatCorrType matCorrType, const int nBlocks, const int nThreads)
void countTrackletsInROFsHandler(const IndexTableUtils *utils, const uint8_t *multMask, const int startROF, const int endROF, const int maxROF, const int deltaROF, const int vertexId, const Vertex *vertices, const int *rofPV, const int nVertices, const Cluster **clusters, std::vector< unsigned int > nClusters, const int **ROFClusters, const unsigned char **usedClusters, const int **clustersIndexTables, int **trackletsLUTs, gsl::span< int * > trackletsLUTsHost, const int iteration, const float NSigmaCut, bounded_vector< float > &phiCuts, const float resolutionPV, std::array< float, nLayers > &minR, std::array< float, nLayers > &maxR, bounded_vector< float > &resolutions, std::vector< float > &radii, bounded_vector< float > &mulScatAng, const int nBlocks, const int nThreads, gpu::Streams &streams)
void countCellsHandler(const Cluster **sortedClusters, const Cluster **unsortedClusters, const TrackingFrameInfo **tfInfo, Tracklet **tracklets, int **trackletsLUT, const int nTracklets, const int layer, CellSeed *cells, int **cellsLUTsDeviceArray, int *cellsLUTsHost, const float bz, const float maxChi2ClusterAttachment, const float cellDeltaTanLambdaSigma, const float nSigmaCut, const int nBlocks, const int nThreads)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Common utility functions.
std::vector< Cluster > clusters
std::vector< Cell > cells
std::vector< Tracklet64 > tracklets