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
16#include <array>
17#include <gsl/gsl>
18
28
29namespace o2::its
30{
33
34class CellSeed;
35struct CellNeighbour;
36template <int>
37class TrackSeed;
38class TrackingFrameInfo;
39class Tracklet;
40template <int>
41class IndexTableUtils;
42class Cluster;
43class TrackITSExt;
44class ExternalAllocator;
45
46template <int NLayers>
49 const typename ROFMaskTable<NLayers>::View& rofMask,
50 const int linkId,
51 const int fromLayer,
52 const int toLayer,
53 const typename ROFOverlapTable<NLayers>::View& rofOverlaps,
54 const typename ROFVertexLookupTable<NLayers>::View& vertexLUT,
55 const int vertexId,
56 const Vertex* vertices,
57 const bool useDiamond,
58 const Cluster** clusters,
59 const std::vector<unsigned int>& nClusters,
60 const int** ROFClusters,
61 const unsigned char** usedClusters,
62 const int** clustersIndexTables,
64 gsl::span<Tracklet*> spanTracklets,
65 gsl::span<int> nTracklets,
66 const int capacity,
67 gsl::span<int*> trackletsLUTsHost,
68 const bool selectUPCVertices,
69 const float NSigmaCut,
70 const typename TrackingTopology<NLayers>::View topology,
71 bounded_vector<float>& linkPhiCuts,
72 const float resolutionPV,
73 const float* minRs,
74 const float* maxRs,
75 bounded_vector<float>& resolutions,
76 std::vector<float>& radii,
77 bounded_vector<float>& linkMSAngles,
79 gpu::Streams& streams);
80
81 static int computeCellsHandler(const Cluster** sortedClusters,
82 const Cluster** unsortedClusters,
83 const TrackingFrameInfo** tfInfo,
85 int** trackletsLUT,
86 const int nTracklets,
87 const int cellTopologyId,
88 const typename TrackingTopology<NLayers>::View topology,
90 const int capacity,
91 int* cellsLUTsHost,
92 const float bz,
93 const float maxChi2ClusterAttachment,
94 const float cellDeltaTanLambdaSigma,
95 const float cellDeltaPhiCut,
96 const float nSigmaCut,
97 const float* layerxX0,
98 CapacityEstimator& estimator,
99 const int iteration,
100 const bool orderCandidates,
102 gpu::Streams& streams);
103
104 static void computeCellNeighboursHandler(CellSeed** cellsLayersDevice,
105 int** cellsLUTs,
106 CellNeighbour* cellNeighbours,
107 int* outputCounter,
108 const int capacity,
109 const int sourceCellTopologyId,
110 const int targetCellTopologyId,
111 const float maxChi2ClusterAttachment,
112 const float bz,
113 const unsigned int nCells,
116
117 static void processNeighboursHandler(const int startLevel,
118 const int startCellTopologyId,
119 CellSeed** allCellSeeds,
120 CellSeed* currentCellSeeds,
121 const int* currentCellTopologyIds,
122 const int* currentCellIds,
123 const int* nCells,
124 const unsigned char** usedClusters,
125 CellNeighbour** neighbours,
126 int** neighboursDeviceLUTs,
127 const TrackingFrameInfo** foundTrackingFrameInfo,
128 TrackSeed<NLayers>* seedsDevice,
129 const int seedsCapacity,
130 int& seedsCursor,
131 CapacityEstimator& estimator,
132 const int iteration,
133 const float bz,
134 const float MaxChi2ClusterAttachment,
135 const float maxChi2NDF,
136 const int maxHoles,
137 const int minSeedingClusters,
138 const LayerMask holeLayerMask,
139 const LayerMask nonSeedingLayerMask,
140 const float* layerxX0,
141 const o2::base::Propagator* propagator,
142 const o2::base::PropagatorF::MatCorrType matCorrType,
144
146 const TrackingFrameInfo** foundTrackingFrameInfo,
147 const Cluster** unsortedClusters,
149 const typename ROFMaskTable<NLayers>::View& rofMask,
150 const typename ROFOverlapTable<NLayers>::View& rofOverlaps,
151 const Cluster** clusters,
152 const unsigned char** usedClusters,
153 const int** clustersIndexTables,
154 const int** ROFClusters,
156 int* trackIndices,
157 int* trackSeedIndices,
158 int* outputCounter,
159 const int trackCapacity,
162 const float* layerRadii,
163 const float* minPts,
164 const float* layerxX0,
165 const unsigned int nSeeds,
166 const float Bz,
167 const float maxChi2ClusterAttachment,
168 const float maxChi2NDF,
169 const int reseedIfShorter,
170 const bool repeatRefitOut,
171 const bool shiftRefToCluster,
172 const int nLayers,
173 const int phiBins,
174 const int maxHypotheses,
175 const bool extendTop,
176 const bool extendBot,
177 const float nSigmaCutPhi,
178 const float nSigmaCutZ,
179 const o2::base::Propagator* propagator,
180 const o2::base::PropagatorF::MatCorrType matCorrType,
182
183 static void sortClustersHandler(const Cluster* unsorted,
184 Cluster* sorted,
185 const int* clusterOffsets,
186 int* indexTable,
188 const typename ROFMaskTable<NLayers>::View& rofMask,
189 float beamX, float beamY,
190 int zBins, int phiBins, int nRofs, int nClustersLayer, int iLayer,
191 float* minRadiusLayer, float* maxRadiusLayer,
192 int* keys,
193 int* perm,
196
197 static void registerClusterOwnershipHandler(const CellSeed* cellsLayersDevice,
198 const int nCells,
199 unsigned long long** clusterOwnersDeviceArray,
201
202 static void linearizeCellsToLinesHandler(const int nCells,
203 const CellSeed* cells,
204 const unsigned long long* const* clusterOwners,
205 const int* rofFramesClustersL1,
206 const int nRofsL1,
207 const int ownedClustersCut,
208 o2::its::Line* lines,
209 int* lineRof,
210 int* lineClusters,
211 int* lineSlots,
212 const float beamX,
213 const float beamY,
214 const float bz,
215 const float curvatureScale,
216 const float maxZ,
217 const float minPt,
218 float* linesZs,
219 o2::its::TimeEstBC* lineTimes,
220 float* lineChi2,
221 float* linePt,
224
225 static void sortLinesHandler(const int nLines,
226 const int nRofs,
227 const gpu::LineProjSoA soa,
228 const gpu::LineProjSoA sortedSoa,
229 const int* lineRof,
230 int* rofOffsets,
233
234 static void scanDensityHandler(const int nLines,
235 const gpu::LineProjSoA sortedSoa,
236 const int* rofOffsets,
237 int* density,
238 gpu::LineWindow* win,
239 const float zWindow,
241
242 static void findPeaksHandler(const int nLines,
243 const int nRofs,
244 const gpu::LineProjSoA sortedSoa,
245 const int* rofOffsets,
246 const int* density,
247 const gpu::LineWindow* win,
248 uint8_t* isPeak,
249 const int* densityFine,
250 const gpu::LineWindow* winFine,
251 const int fineMinDensity,
252 uint8_t* isPeakFine,
253 int* peakScan,
254 int* peakLineIdx,
255 int* peakOffsets,
258
259 static void fitPeaksHandler(const int* nPeaksDevice,
260 const int* peakLineIdx,
261 const gpu::LineWindow* win,
262 const gpu::LineProjSoA sortedSoa,
263 const o2::its::Line* lines,
264 const float* lineChi2,
265 const float* linePt,
266 const float goodLineChi2Cut,
267 const float goodLinePtCut,
268 const float pairCut2,
269 const float nSigmaCut,
270 const int minContributors,
271 const float beamX,
272 const float beamY,
273 const uint8_t* isPeakFine,
274 const float fineMaxDrift,
275 gpu::VertexCand* cands,
277
278 static void dedupVertexCandidatesHandler(const int* nPeaksDevice,
279 const int* peakLineIdx,
280 const int* peakOffsets,
281 const gpu::LineProjSoA sortedSoa,
282 const float duplicateZCut,
283 const float duplicateZScale,
284 gpu::VertexCand* cands,
286};
287
289
291 int* neighboursLUT,
292 const int nTargetCells,
293 const int capacity,
296
297} // namespace o2::its
298#endif // ITSTRACKINGGPU_TRACKINGKERNELS_H_
Cross-timeframe output-size prediction.
std::vector< std::string > keys
std::vector< o2::its::TrackITS > tracks
small types shared by the host and device seeding vertexers, describing lines projected onto the beam...
int nClusters
HMPID cluster implementation.
Definition Cluster.h:27
CellSeed: connections of three clusters.
Definition Cell.h:81
GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat maxZ
Definition glcorearb.h:2910
GLuint GLuint stream
Definition glcorearb.h:1806
const float beamX
const bool const int nLayers
void resetOutputCounterHandler(int *outputCounter, gpu::Stream &stream)
TrackExtensionHypothesis< NLayers > int const int maxHypotheses
const bool const bool extendBot
const bool extendTop
const float const float const float const float curvatureScale
const float const float beamY
const track::TrackFitContext< NLayers > const TrackFollowContext< NLayers > const bool TrackExtensionHypothesis< NLayers > * activeHypotheses
const float const float const float bz
int finalizeCellNeighboursHandler(CellNeighbour *cellNeighbours, int *neighboursLUT, const int nTargetCells, const int capacity, o2::its::ExternalAllocator *alloc, gpu::Stream &stream)
const track::TrackFitContext< NLayers > const TrackFollowContext< NLayers > const bool TrackExtensionHypothesis< NLayers > TrackExtensionHypothesis< NLayers > * nextHypotheses
std::pmr::vector< T > bounded_vector
Common utility functions.
static void sortClustersHandler(const Cluster *unsorted, Cluster *sorted, const int *clusterOffsets, int *indexTable, const IndexTableUtils< NLayers > *utils, const typename ROFMaskTable< NLayers >::View &rofMask, float beamX, float beamY, int zBins, int phiBins, int nRofs, int nClustersLayer, int iLayer, float *minRadiusLayer, float *maxRadiusLayer, int *keys, int *perm, o2::its::ExternalAllocator *alloc, gpu::Stream &stream)
static void fitPeaksHandler(const int *nPeaksDevice, const int *peakLineIdx, const gpu::LineWindow *win, const gpu::LineProjSoA sortedSoa, const o2::its::Line *lines, const float *lineChi2, const float *linePt, const float goodLineChi2Cut, const float goodLinePtCut, const float pairCut2, const float nSigmaCut, const int minContributors, const float beamX, const float beamY, const uint8_t *isPeakFine, const float fineMaxDrift, gpu::VertexCand *cands, gpu::Stream &stream)
static void computeCellNeighboursHandler(CellSeed **cellsLayersDevice, int **cellsLUTs, CellNeighbour *cellNeighbours, int *outputCounter, const int capacity, const int sourceCellTopologyId, const int targetCellTopologyId, const float maxChi2ClusterAttachment, const float bz, const unsigned int nCells, o2::its::ExternalAllocator *alloc, gpu::Stream &stream)
static void dedupVertexCandidatesHandler(const int *nPeaksDevice, const int *peakLineIdx, const int *peakOffsets, const gpu::LineProjSoA sortedSoa, const float duplicateZCut, const float duplicateZScale, gpu::VertexCand *cands, gpu::Stream &stream)
static void scanDensityHandler(const int nLines, const gpu::LineProjSoA sortedSoa, const int *rofOffsets, int *density, gpu::LineWindow *win, const float zWindow, gpu::Stream &stream)
static void processNeighboursHandler(const int startLevel, const int startCellTopologyId, CellSeed **allCellSeeds, CellSeed *currentCellSeeds, const int *currentCellTopologyIds, const int *currentCellIds, const int *nCells, const unsigned char **usedClusters, CellNeighbour **neighbours, int **neighboursDeviceLUTs, const TrackingFrameInfo **foundTrackingFrameInfo, TrackSeed< NLayers > *seedsDevice, const int seedsCapacity, int &seedsCursor, CapacityEstimator &estimator, const int iteration, const float bz, const float MaxChi2ClusterAttachment, const float maxChi2NDF, const int maxHoles, const int minSeedingClusters, const LayerMask holeLayerMask, const LayerMask nonSeedingLayerMask, const float *layerxX0, const o2::base::Propagator *propagator, const o2::base::PropagatorF::MatCorrType matCorrType, o2::its::ExternalAllocator *alloc)
static int computeTrackSeedHandler(TrackSeed< NLayers > *trackSeeds, const TrackingFrameInfo **foundTrackingFrameInfo, const Cluster **unsortedClusters, const IndexTableUtils< NLayers > *utils, const typename ROFMaskTable< NLayers >::View &rofMask, const typename ROFOverlapTable< NLayers >::View &rofOverlaps, const Cluster **clusters, const unsigned char **usedClusters, const int **clustersIndexTables, const int **ROFClusters, o2::its::TrackITSExt *tracks, int *trackIndices, int *trackSeedIndices, int *outputCounter, const int trackCapacity, TrackExtensionHypothesis< NLayers > *activeHypotheses, TrackExtensionHypothesis< NLayers > *nextHypotheses, const float *layerRadii, const float *minPts, const float *layerxX0, const unsigned int nSeeds, const float Bz, const float maxChi2ClusterAttachment, const float maxChi2NDF, const int reseedIfShorter, const bool repeatRefitOut, const bool shiftRefToCluster, const int nLayers, const int phiBins, const int maxHypotheses, const bool extendTop, const bool extendBot, const float nSigmaCutPhi, const float nSigmaCutZ, const o2::base::Propagator *propagator, const o2::base::PropagatorF::MatCorrType matCorrType, o2::its::ExternalAllocator *alloc)
static void registerClusterOwnershipHandler(const CellSeed *cellsLayersDevice, const int nCells, unsigned long long **clusterOwnersDeviceArray, gpu::Stream &stream)
static void linearizeCellsToLinesHandler(const int nCells, const CellSeed *cells, const unsigned long long *const *clusterOwners, const int *rofFramesClustersL1, const int nRofsL1, const int ownedClustersCut, o2::its::Line *lines, int *lineRof, int *lineClusters, int *lineSlots, const float beamX, const float beamY, const float bz, const float curvatureScale, const float maxZ, const float minPt, float *linesZs, o2::its::TimeEstBC *lineTimes, float *lineChi2, float *linePt, o2::its::ExternalAllocator *alloc, gpu::Stream &stream)
static void findPeaksHandler(const int nLines, const int nRofs, const gpu::LineProjSoA sortedSoa, const int *rofOffsets, const int *density, const gpu::LineWindow *win, uint8_t *isPeak, const int *densityFine, const gpu::LineWindow *winFine, const int fineMinDensity, uint8_t *isPeakFine, int *peakScan, int *peakLineIdx, int *peakOffsets, o2::its::ExternalAllocator *alloc, gpu::Stream &stream)
static int computeCellsHandler(const Cluster **sortedClusters, const Cluster **unsortedClusters, const TrackingFrameInfo **tfInfo, Tracklet **tracklets, int **trackletsLUT, const int nTracklets, const int cellTopologyId, const typename TrackingTopology< NLayers >::View topology, CellSeed *cells, const int capacity, int *cellsLUTsHost, const float bz, const float maxChi2ClusterAttachment, const float cellDeltaTanLambdaSigma, const float cellDeltaPhiCut, const float nSigmaCut, const float *layerxX0, CapacityEstimator &estimator, const int iteration, const bool orderCandidates, o2::its::ExternalAllocator *alloc, gpu::Streams &streams)
static int computeTrackletsInROFsHandler(const IndexTableUtils< NLayers > *utils, const typename ROFMaskTable< NLayers >::View &rofMask, const int linkId, const int fromLayer, const int toLayer, const typename ROFOverlapTable< NLayers >::View &rofOverlaps, const typename ROFVertexLookupTable< NLayers >::View &vertexLUT, const int vertexId, const Vertex *vertices, const bool useDiamond, const Cluster **clusters, const 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, const int capacity, gsl::span< int * > trackletsLUTsHost, const bool selectUPCVertices, const float NSigmaCut, const typename TrackingTopology< NLayers >::View topology, bounded_vector< float > &linkPhiCuts, const float resolutionPV, const float *minRs, const float *maxRs, bounded_vector< float > &resolutions, std::vector< float > &radii, bounded_vector< float > &linkMSAngles, o2::its::ExternalAllocator *alloc, gpu::Streams &streams)
static void sortLinesHandler(const int nLines, const int nRofs, const gpu::LineProjSoA soa, const gpu::LineProjSoA sortedSoa, const int *lineRof, int *rofOffsets, o2::its::ExternalAllocator *alloc, gpu::Stream &stream)
std::vector< Cluster > clusters
std::vector< Cell > cells
std::vector< Tracklet64 > tracklets