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 int deltaROF,
135 const float bz,
136 const float maxChi2ClusterAttachment,
137 const float cellDeltaTanLambdaSigma,
138 const float nSigmaCut,
139 const int nBlocks,
140 const int nThreads);
141
142void computeCellsHandler(const Cluster** sortedClusters,
143 const Cluster** unsortedClusters,
144 const TrackingFrameInfo** tfInfo,
146 int** trackletsLUT,
147 const int nTracklets,
148 const int layer,
150 int** cellsLUTsDeviceArray,
151 int* cellsLUTsHost,
152 const int deltaROF,
153 const float bz,
154 const float maxChi2ClusterAttachment,
155 const float cellDeltaTanLambdaSigma,
156 const float nSigmaCut,
157 const int nBlocks,
158 const int nThreads);
159
160unsigned int countCellNeighboursHandler(CellSeed** cellsLayersDevice,
161 int* neighboursLUTs,
162 int** cellsLUTs,
163 gpuPair<int, int>* cellNeighbours,
164 int* neighboursIndexTable,
165 const Tracklet** tracklets,
166 const int deltaROF,
167 const float maxChi2ClusterAttachment,
168 const float bz,
169 const int layerIndex,
170 const unsigned int nCells,
171 const unsigned int nCellsNext,
172 const int maxCellNeighbours,
173 const int nBlocks,
174 const int nThreads);
175
176void computeCellNeighboursHandler(CellSeed** cellsLayersDevice,
177 int* neighboursLUTs,
178 int** cellsLUTs,
179 gpuPair<int, int>* cellNeighbours,
180 int* neighboursIndexTable,
181 const Tracklet** tracklets,
182 const int deltaROF,
183 const float maxChi2ClusterAttachment,
184 const float bz,
185 const int layerIndex,
186 const unsigned int nCells,
187 const unsigned int nCellsNext,
188 const int maxCellNeighbours,
189 const int nBlocks,
190 const int nThreads);
191
193 int*,
194 unsigned int,
195 o2::its::ExternalAllocator* = nullptr);
196
197template <int nLayers = 7>
198void processNeighboursHandler(const int startLayer,
199 const int startLevel,
200 CellSeed** allCellSeeds,
201 CellSeed* currentCellSeeds,
202 std::array<int, nLayers - 2>& nCells,
203 const unsigned char** usedClusters,
204 std::array<int*, nLayers - 2>& neighbours,
205 gsl::span<int*> neighboursDeviceLUTs,
206 const TrackingFrameInfo** foundTrackingFrameInfo,
207 bounded_vector<CellSeed>& seedsHost,
209 const float bz,
210 const float MaxChi2ClusterAttachment,
211 const float maxChi2NDF,
212 const o2::base::Propagator* propagator,
213 const o2::base::PropagatorF::MatCorrType matCorrType,
214 const int nBlocks,
215 const int nThreads);
216
217void trackSeedHandler(CellSeed* trackSeeds,
218 const TrackingFrameInfo** foundTrackingFrameInfo,
219 o2::its::TrackITSExt* tracks,
220 std::vector<float>& minPtsHost,
221 const unsigned int nSeeds,
222 const float Bz,
223 const int startLevel,
224 float maxChi2ClusterAttachment,
225 float maxChi2NDF,
226 const o2::base::Propagator* propagator,
227 const o2::base::PropagatorF::MatCorrType matCorrType,
228 const int nBlocks,
229 const int nThreads);
230} // namespace o2::its
231#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 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 int deltaROF, const float bz, const float maxChi2ClusterAttachment, const float cellDeltaTanLambdaSigma, const float nSigmaCut, const int nBlocks, const int nThreads)
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 computeCellNeighboursHandler(CellSeed **cellsLayersDevice, int *neighboursLUTs, int **cellsLUTs, gpuPair< int, int > *cellNeighbours, int *neighboursIndexTable, const Tracklet **tracklets, const int deltaROF, 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 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 int deltaROF, const float bz, const float maxChi2ClusterAttachment, const float cellDeltaTanLambdaSigma, const float nSigmaCut, const int nBlocks, const int nThreads)
unsigned int countCellNeighboursHandler(CellSeed **cellsLayersDevice, int *neighboursLUTs, int **cellsLUTs, gpuPair< int, int > *cellNeighbours, int *neighboursIndexTable, const Tracklet **tracklets, const int deltaROF, 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)
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