30 mTimeFrameGPU->initialise(iteration, this->mTrkParams[iteration], NLayers);
32 mTimeFrameGPU->loadVertices(iteration);
34 mTimeFrameGPU->loadROFOverlapTable(iteration);
35 mTimeFrameGPU->loadROFVertexLookupTable(iteration);
38 mTimeFrameGPU->loadIndexTableUtils(iteration);
39 mTimeFrameGPU->loadROFCutMask(iteration);
41 mTimeFrameGPU->createUsedClustersDeviceArray(iteration);
42 mTimeFrameGPU->createClustersDeviceArray(iteration);
43 mTimeFrameGPU->createUnsortedClustersDeviceArray(iteration);
44 mTimeFrameGPU->createClustersIndexTablesArray(iteration);
45 mTimeFrameGPU->createTrackingFrameInfoDeviceArray(iteration);
46 mTimeFrameGPU->createROFrameClustersDeviceArray(iteration);
48 mTimeFrameGPU->createTrackletsLUTDeviceArray(iteration);
49 mTimeFrameGPU->createTrackletsBuffersArray(iteration);
50 mTimeFrameGPU->createCellsBuffersArray(iteration);
51 mTimeFrameGPU->createCellsLUTDeviceArray(iteration);
53 mTimeFrameGPU->pushMemoryStack(iteration);
67 for (
int iLayer{NLayers}; iLayer-- > NLayers - 2;) {
68 mTimeFrameGPU->createUsedClustersDevice(iteration, iLayer);
69 mTimeFrameGPU->loadClustersDevice(iteration, iLayer);
70 mTimeFrameGPU->loadClustersIndexTables(iteration, iLayer);
71 mTimeFrameGPU->loadROFrameClustersDevice(iteration, iLayer);
72 mTimeFrameGPU->recordEvent(iLayer);
75 for (
int iLayer{this->mTrkParams[iteration].TrackletsPerRoad()}; iLayer--;) {
77 mTimeFrameGPU->createUsedClustersDevice(iteration, iLayer - 1);
78 mTimeFrameGPU->loadClustersDevice(iteration, iLayer - 1);
79 mTimeFrameGPU->loadClustersIndexTables(iteration, iLayer - 1);
80 mTimeFrameGPU->loadROFrameClustersDevice(iteration, iLayer - 1);
81 mTimeFrameGPU->recordEvent(iLayer - 1);
83 mTimeFrameGPU->createTrackletsLUTDevice(iteration, iLayer);
84 mTimeFrameGPU->waitEvent(iLayer, iLayer + 1);
85 countTrackletsInROFsHandler<NLayers>(mTimeFrameGPU->getDeviceIndexTableUtils(),
86 mTimeFrameGPU->getDeviceROFMaskTableView(),
88 mTimeFrameGPU->getDeviceROFOverlapTableView(),
89 mTimeFrameGPU->getDeviceROFVertexLookupTableView(),
91 mTimeFrameGPU->getDeviceVertices(),
92 mTimeFrameGPU->getDeviceROFramesPV(),
93 mTimeFrameGPU->getDeviceArrayClusters(),
94 mTimeFrameGPU->getClusterSizes(),
95 mTimeFrameGPU->getDeviceROFrameClusters(),
96 (
const uint8_t**)mTimeFrameGPU->getDeviceArrayUsedClusters(),
97 mTimeFrameGPU->getDeviceArrayClustersIndexTables(),
98 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
99 mTimeFrameGPU->getDeviceTrackletsLUTs(),
101 this->mTrkParams[iteration].NSigmaCut,
102 mTimeFrameGPU->getPhiCuts(),
103 this->mTrkParams[iteration].PVres,
104 mTimeFrameGPU->getMinRs(),
105 mTimeFrameGPU->getMaxRs(),
106 mTimeFrameGPU->getPositionResolutions(),
107 this->mTrkParams[iteration].LayerRadii,
108 mTimeFrameGPU->getMSangles(),
109 mTimeFrameGPU->getFrameworkAllocator(),
110 mTimeFrameGPU->getStreams());
111 mTimeFrameGPU->createTrackletsBuffers(iLayer);
112 if (mTimeFrameGPU->getNTracklets()[iLayer] == 0) {
115 computeTrackletsInROFsHandler<NLayers>(mTimeFrameGPU->getDeviceIndexTableUtils(),
116 mTimeFrameGPU->getDeviceROFMaskTableView(),
118 mTimeFrameGPU->getDeviceROFOverlapTableView(),
119 mTimeFrameGPU->getDeviceROFVertexLookupTableView(),
121 mTimeFrameGPU->getDeviceVertices(),
122 mTimeFrameGPU->getDeviceROFramesPV(),
123 mTimeFrameGPU->getDeviceArrayClusters(),
124 mTimeFrameGPU->getClusterSizes(),
125 mTimeFrameGPU->getDeviceROFrameClusters(),
126 (
const uint8_t**)mTimeFrameGPU->getDeviceArrayUsedClusters(),
127 mTimeFrameGPU->getDeviceArrayClustersIndexTables(),
128 mTimeFrameGPU->getDeviceArrayTracklets(),
129 mTimeFrameGPU->getDeviceTracklets(),
130 mTimeFrameGPU->getNTracklets(),
131 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
132 mTimeFrameGPU->getDeviceTrackletsLUTs(),
134 this->mTrkParams[iteration].NSigmaCut,
135 mTimeFrameGPU->getPhiCuts(),
136 this->mTrkParams[iteration].PVres,
137 mTimeFrameGPU->getMinRs(),
138 mTimeFrameGPU->getMaxRs(),
139 mTimeFrameGPU->getPositionResolutions(),
140 this->mTrkParams[iteration].LayerRadii,
141 mTimeFrameGPU->getMSangles(),
142 mTimeFrameGPU->getFrameworkAllocator(),
143 mTimeFrameGPU->getStreams());
151 for (
int iLayer{NLayers}; iLayer-- > NLayers - 3;) {
152 mTimeFrameGPU->loadUnsortedClustersDevice(iteration, iLayer);
153 mTimeFrameGPU->loadTrackingFrameInfoDevice(iteration, iLayer);
154 mTimeFrameGPU->recordEvent(iLayer);
157 for (
int iLayer{this->mTrkParams[iteration].CellsPerRoad()}; iLayer--;) {
159 mTimeFrameGPU->loadUnsortedClustersDevice(iteration, iLayer - 1);
160 mTimeFrameGPU->loadTrackingFrameInfoDevice(iteration, iLayer - 1);
161 mTimeFrameGPU->recordEvent(iLayer - 1);
165 const int currentLayerTrackletsNum{
static_cast<int>(mTimeFrameGPU->getNTracklets()[iLayer])};
166 if (!currentLayerTrackletsNum || !mTimeFrameGPU->getNTracklets()[iLayer + 1]) {
167 mTimeFrameGPU->getNCells()[iLayer] = 0;
171 mTimeFrameGPU->createCellsLUTDevice(iLayer);
172 mTimeFrameGPU->waitEvent(iLayer, iLayer + 1);
173 mTimeFrameGPU->waitEvent(iLayer, iLayer + 2);
174 countCellsHandler<NLayers>(mTimeFrameGPU->getDeviceArrayClusters(),
175 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
176 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
177 mTimeFrameGPU->getDeviceArrayTracklets(),
178 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
179 currentLayerTrackletsNum,
182 mTimeFrameGPU->getDeviceArrayCellsLUT(),
183 mTimeFrameGPU->getDeviceCellLUTs()[iLayer],
185 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
186 this->mTrkParams[iteration].CellDeltaTanLambdaSigma,
187 this->mTrkParams[iteration].NSigmaCut,
188 this->mTrkParams[iteration].LayerxX0,
189 mTimeFrameGPU->getFrameworkAllocator(),
190 mTimeFrameGPU->getStreams());
191 mTimeFrameGPU->createCellsBuffers(iLayer);
192 if (mTimeFrameGPU->getNCells()[iLayer] == 0) {
195 computeCellsHandler<NLayers>(mTimeFrameGPU->getDeviceArrayClusters(),
196 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
197 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
198 mTimeFrameGPU->getDeviceArrayTracklets(),
199 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
200 currentLayerTrackletsNum,
202 mTimeFrameGPU->getDeviceCells()[iLayer],
203 mTimeFrameGPU->getDeviceArrayCellsLUT(),
204 mTimeFrameGPU->getDeviceCellLUTs()[iLayer],
206 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
207 this->mTrkParams[iteration].CellDeltaTanLambdaSigma,
208 this->mTrkParams[iteration].NSigmaCut,
209 this->mTrkParams[iteration].LayerxX0,
210 mTimeFrameGPU->getStreams());
217 for (
int iLayer{0}; iLayer < this->mTrkParams[iteration].NeighboursPerRoad(); ++iLayer) {
218 const int currentLayerCellsNum{
static_cast<int>(mTimeFrameGPU->getNCells()[iLayer])};
219 const int nextLayerCellsNum{
static_cast<int>(mTimeFrameGPU->getNCells()[iLayer + 1])};
220 if (!nextLayerCellsNum || !currentLayerCellsNum) {
221 mTimeFrameGPU->getNNeighbours()[iLayer] = 0;
224 mTimeFrameGPU->createNeighboursIndexTablesDevice(iLayer);
225 mTimeFrameGPU->createNeighboursLUTDevice(iLayer, nextLayerCellsNum);
226 countCellNeighboursHandler<NLayers>(mTimeFrameGPU->getDeviceArrayCells(),
227 mTimeFrameGPU->getDeviceNeighboursLUT(iLayer),
228 mTimeFrameGPU->getDeviceArrayCellsLUT(),
229 mTimeFrameGPU->getDeviceNeighbourPairs(iLayer),
230 mTimeFrameGPU->getDeviceNeighboursIndexTables(iLayer),
231 (
const Tracklet**)mTimeFrameGPU->getDeviceArrayTracklets(),
232 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
235 currentLayerCellsNum,
238 mTimeFrameGPU->getFrameworkAllocator(),
239 mTimeFrameGPU->getStream(iLayer));
240 mTimeFrameGPU->createNeighboursDevice(iLayer);
241 if (mTimeFrameGPU->getNNeighbours()[iLayer] == 0) {
244 computeCellNeighboursHandler<NLayers>(mTimeFrameGPU->getDeviceArrayCells(),
245 mTimeFrameGPU->getDeviceNeighboursLUT(iLayer),
246 mTimeFrameGPU->getDeviceArrayCellsLUT(),
247 mTimeFrameGPU->getDeviceNeighbourPairs(iLayer),
248 mTimeFrameGPU->getDeviceNeighboursIndexTables(iLayer),
249 (
const Tracklet**)mTimeFrameGPU->getDeviceArrayTracklets(),
250 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
253 currentLayerCellsNum,
256 mTimeFrameGPU->getStream(iLayer));
258 mTimeFrameGPU->getDeviceNeighbours(iLayer),
259 mTimeFrameGPU->getArrayNNeighbours()[iLayer],
260 mTimeFrameGPU->getStream(iLayer),
261 mTimeFrameGPU->getFrameworkAllocator());
263 mTimeFrameGPU->syncStreams(
false);
271 firstClusters.resize(this->mTrkParams[iteration].NLayers);
272 sharedFirstClusters.resize(this->mTrkParams[iteration].NLayers);
273 for (
int startLevel{this->mTrkParams[iteration].CellsPerRoad()}; startLevel >= this->mTrkParams[iteration].CellMinimumLevel(); --startLevel) {
274 const int minimumLayer{startLevel - 1};
276 for (
int startLayer{this->mTrkParams[iteration].CellsPerRoad() - 1}; startLayer >= minimumLayer; --startLayer) {
277 if ((this->mTrkParams[iteration].StartLayerMask & (1 << (startLayer + 2))) == 0) {
280 processNeighboursHandler<NLayers>(startLayer,
282 mTimeFrameGPU->getDeviceArrayCells(),
283 mTimeFrameGPU->getDeviceCells()[startLayer],
284 mTimeFrameGPU->getArrayNCells(),
285 (
const uint8_t**)mTimeFrameGPU->getDeviceArrayUsedClusters(),
286 mTimeFrameGPU->getDeviceNeighboursAll(),
287 mTimeFrameGPU->getDeviceNeighboursLUTs(),
288 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
291 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
292 this->mTrkParams[iteration].MaxChi2NDF,
293 this->mTrkParams[iteration].LayerxX0,
294 mTimeFrameGPU->getDevicePropagator(),
295 this->mTrkParams[iteration].CorrType,
296 mTimeFrameGPU->getFrameworkAllocator());
299 if (trackSeeds.empty()) {
300 LOGP(
debug,
"No track seeds found, skipping track finding");
303 mTimeFrameGPU->loadTrackSeedsDevice(trackSeeds);
308 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
309 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
310 mTimeFrameGPU->getDeviceTrackSeedsLUT(),
311 this->mTrkParams[iteration].LayerRadii,
312 this->mTrkParams[iteration].MinPt,
313 this->mTrkParams[iteration].LayerxX0,
317 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
318 this->mTrkParams[iteration].MaxChi2NDF,
319 this->mTrkParams[iteration].ReseedIfShorter,
320 this->mTrkParams[iteration].RepeatRefitOut,
321 this->mTrkParams[iteration].ShiftRefToCluster,
322 mTimeFrameGPU->getDevicePropagator(),
323 this->mTrkParams[iteration].CorrType,
324 mTimeFrameGPU->getFrameworkAllocator());
325 mTimeFrameGPU->createTrackITSExtDevice(trackSeeds.size());
327 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
328 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
329 mTimeFrameGPU->getDeviceTrackITSExt(),
330 mTimeFrameGPU->getDeviceTrackSeedsLUT(),
331 this->mTrkParams[iteration].LayerRadii,
332 this->mTrkParams[iteration].MinPt,
333 this->mTrkParams[iteration].LayerxX0,
335 mTimeFrameGPU->getNTrackSeeds(),
338 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
339 this->mTrkParams[iteration].MaxChi2NDF,
340 this->mTrkParams[iteration].ReseedIfShorter,
341 this->mTrkParams[iteration].RepeatRefitOut,
342 this->mTrkParams[iteration].ShiftRefToCluster,
343 mTimeFrameGPU->getDevicePropagator(),
344 this->mTrkParams[iteration].CorrType,
345 mTimeFrameGPU->getFrameworkAllocator());
346 mTimeFrameGPU->downloadTrackITSExtDevice();
348 auto& tracks = mTimeFrameGPU->getTrackITSExt();
349 this->acceptTracks(iteration, tracks, firstClusters, sharedFirstClusters);
350 mTimeFrameGPU->loadUsedClustersDevice();
352 this->markTracks(iteration, sharedFirstClusters);
354 mTimeFrameGPU->popMemoryStack(iteration);
void countTrackSeedHandler(TrackSeed< NLayers > *trackSeeds, const TrackingFrameInfo **foundTrackingFrameInfo, const Cluster **unsortedClusters, int *seedLUT, const std::vector< float > &layerRadiiHost, const std::vector< float > &minPtsHost, const std::vector< float > &layerxX0Host, const unsigned int nSeeds, const float Bz, const int startLevel, const float maxChi2ClusterAttachment, const float maxChi2NDF, const int reseedIfShorter, const bool repeatRefitOut, const bool shiftRefToCluster, const o2::base::Propagator *propagator, const o2::base::PropagatorF::MatCorrType matCorrType, o2::its::ExternalAllocator *alloc)
void computeTrackSeedHandler(TrackSeed< NLayers > *trackSeeds, const TrackingFrameInfo **foundTrackingFrameInfo, const Cluster **unsortedClusters, o2::its::TrackITSExt *tracks, const int *seedLUT, const std::vector< float > &layerRadiiHost, const std::vector< float > &minPtsHost, const std::vector< float > &layerxX0Host, const unsigned int nSeeds, const unsigned int nTracks, const float Bz, const int startLevel, const float maxChi2ClusterAttachment, const float maxChi2NDF, const int reseedIfShorter, const bool repeatRefitOut, const bool shiftRefToCluster, const o2::base::Propagator *propagator, const o2::base::PropagatorF::MatCorrType matCorrType, o2::its::ExternalAllocator *alloc)