25 mTimeFrameGPU->initialise(this->mTrkParams[iteration], NLayers, iteration);
29 mTimeFrameGPU->loadVertices();
31 mTimeFrameGPU->loadROFOverlapTable();
32 mTimeFrameGPU->loadROFVertexLookupTable();
33 mTimeFrameGPU->loadTrackingTopologies();
36 mTimeFrameGPU->loadIndexTableUtils();
38 mTimeFrameGPU->createUsedClustersDeviceArray();
39 mTimeFrameGPU->createClustersDeviceArray();
40 mTimeFrameGPU->createUnsortedClustersDeviceArray();
41 mTimeFrameGPU->createClustersIndexTablesArray();
42 mTimeFrameGPU->createTrackingFrameInfoDeviceArray();
43 mTimeFrameGPU->createROFrameClustersDeviceArray();
45 mTimeFrameGPU->createTrackletsLUTDeviceArray();
46 mTimeFrameGPU->createTrackletsBuffersArray();
47 mTimeFrameGPU->createCellsBuffersArray();
48 mTimeFrameGPU->createCellsLUTDeviceArray();
51 mTimeFrameGPU->loadROFCutMask(iteration);
54 mTimeFrameGPU->pushMemoryStack(iteration);
67 const auto topology = mTimeFrameGPU->getDeviceTrackingTopologyView();
69 for (
int iLayer{0}; iLayer < this->mTrkParams[iteration].NLayers; ++iLayer) {
71 mTimeFrameGPU->createUsedClustersDevice(iLayer);
72 mTimeFrameGPU->loadClustersDevice(iLayer);
73 mTimeFrameGPU->loadClustersIndexTables(iLayer);
74 mTimeFrameGPU->loadROFrameClustersDevice(iLayer);
76 mTimeFrameGPU->recordEvent(iLayer);
79 for (
int transitionId{0}; transitionId < hostTopology.nTransitions; ++transitionId) {
80 const auto transition = hostTopology.getTransition(transitionId);
81 mTimeFrameGPU->createTrackletsLUTDevice(this->mTrkParams[iteration].PassFlags[
IterationStep::FirstPass], transitionId);
82 mTimeFrameGPU->waitEvent(transitionId, transition.fromLayer);
83 mTimeFrameGPU->waitEvent(transitionId, transition.toLayer);
84 countTrackletsInROFsHandler<NLayers>(mTimeFrameGPU->getDeviceIndexTableUtils(),
85 mTimeFrameGPU->getDeviceROFMaskTableView(),
89 mTimeFrameGPU->getDeviceROFOverlapTableView(),
90 mTimeFrameGPU->getDeviceROFVertexLookupTableView(),
92 mTimeFrameGPU->getDeviceVertices(),
93 mTimeFrameGPU->getDeviceROFramesPV(),
94 mTimeFrameGPU->getDeviceArrayClusters(),
95 mTimeFrameGPU->getClusterSizes(),
96 mTimeFrameGPU->getDeviceROFrameClusters(),
97 (
const uint8_t**)mTimeFrameGPU->getDeviceArrayUsedClusters(),
98 mTimeFrameGPU->getDeviceArrayClustersIndexTables(),
99 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
100 mTimeFrameGPU->getDeviceTrackletsLUTs(),
102 this->mTrkParams[iteration].NSigmaCut,
104 mTimeFrameGPU->getTransitionPhiCuts(),
105 this->mTrkParams[iteration].PVres,
106 mTimeFrameGPU->getMinRs(),
107 mTimeFrameGPU->getMaxRs(),
108 mTimeFrameGPU->getPositionResolutions(),
109 this->mTrkParams[iteration].LayerRadii,
110 mTimeFrameGPU->getTransitionMSAngles(),
111 mTimeFrameGPU->getFrameworkAllocator(),
112 mTimeFrameGPU->getStreams());
113 mTimeFrameGPU->createTrackletsBuffers(transitionId);
114 if (mTimeFrameGPU->getNTracklets()[transitionId] == 0) {
115 mTimeFrameGPU->recordEvent(transitionId);
118 computeTrackletsInROFsHandler<NLayers>(mTimeFrameGPU->getDeviceIndexTableUtils(),
119 mTimeFrameGPU->getDeviceROFMaskTableView(),
121 transition.fromLayer,
123 mTimeFrameGPU->getDeviceROFOverlapTableView(),
124 mTimeFrameGPU->getDeviceROFVertexLookupTableView(),
126 mTimeFrameGPU->getDeviceVertices(),
127 mTimeFrameGPU->getDeviceROFramesPV(),
128 mTimeFrameGPU->getDeviceArrayClusters(),
129 mTimeFrameGPU->getClusterSizes(),
130 mTimeFrameGPU->getDeviceROFrameClusters(),
131 (
const uint8_t**)mTimeFrameGPU->getDeviceArrayUsedClusters(),
132 mTimeFrameGPU->getDeviceArrayClustersIndexTables(),
133 mTimeFrameGPU->getDeviceArrayTracklets(),
134 mTimeFrameGPU->getDeviceTracklets(),
135 mTimeFrameGPU->getNTracklets(),
136 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
137 mTimeFrameGPU->getDeviceTrackletsLUTs(),
139 this->mTrkParams[iteration].NSigmaCut,
141 mTimeFrameGPU->getTransitionPhiCuts(),
142 this->mTrkParams[iteration].PVres,
143 mTimeFrameGPU->getMinRs(),
144 mTimeFrameGPU->getMaxRs(),
145 mTimeFrameGPU->getPositionResolutions(),
146 this->mTrkParams[iteration].LayerRadii,
147 mTimeFrameGPU->getTransitionMSAngles(),
148 mTimeFrameGPU->getFrameworkAllocator(),
149 mTimeFrameGPU->getStreams());
150 mTimeFrameGPU->recordEvent(transitionId);
157 const auto topology = mTimeFrameGPU->getDeviceTrackingTopologyView();
158 const auto hostTopology = mTimeFrameGPU->getTrackingTopologyView();
159 for (
int iLayer{0}; iLayer < this->mTrkParams[iteration].NLayers; ++iLayer) {
161 mTimeFrameGPU->loadUnsortedClustersDevice(iLayer);
162 mTimeFrameGPU->loadTrackingFrameInfoDevice(iLayer);
164 mTimeFrameGPU->recordEvent(iLayer);
167 for (
int cellTopologyId{hostTopology.nCells}; cellTopologyId--;) {
168 const auto cellTopology = hostTopology.getCell(cellTopologyId);
169 const auto first = hostTopology.getTransition(cellTopology.firstTransition);
170 const auto second = hostTopology.getTransition(cellTopology.secondTransition);
171 const int currentLayerTrackletsNum{
static_cast<int>(mTimeFrameGPU->getNTracklets()[cellTopology.firstTransition])};
172 if (!currentLayerTrackletsNum || !mTimeFrameGPU->getNTracklets()[cellTopology.secondTransition]) {
173 mTimeFrameGPU->getNCells()[cellTopologyId] = 0;
177 mTimeFrameGPU->createCellsLUTDevice(cellTopologyId);
178 mTimeFrameGPU->waitEvent(cellTopologyId, cellTopology.firstTransition);
179 mTimeFrameGPU->waitEvent(cellTopologyId, cellTopology.secondTransition);
180 mTimeFrameGPU->waitEvent(cellTopologyId,
first.fromLayer);
181 mTimeFrameGPU->waitEvent(cellTopologyId,
first.toLayer);
182 mTimeFrameGPU->waitEvent(cellTopologyId, second.toLayer);
183 countCellsHandler<NLayers>(mTimeFrameGPU->getDeviceArrayClusters(),
184 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
185 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
186 mTimeFrameGPU->getDeviceArrayTracklets(),
187 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
188 currentLayerTrackletsNum,
192 mTimeFrameGPU->getDeviceArrayCellsLUT(),
193 mTimeFrameGPU->getDeviceCellLUTs()[cellTopologyId],
195 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
196 this->mTrkParams[iteration].CellDeltaTanLambdaSigma,
197 this->mTrkParams[iteration].NSigmaCut,
198 this->mTrkParams[iteration].LayerxX0,
199 mTimeFrameGPU->getFrameworkAllocator(),
200 mTimeFrameGPU->getStreams());
201 mTimeFrameGPU->createCellsBuffers(cellTopologyId);
202 if (mTimeFrameGPU->getNCells()[cellTopologyId] == 0) {
203 mTimeFrameGPU->recordEvent(cellTopologyId);
206 computeCellsHandler<NLayers>(mTimeFrameGPU->getDeviceArrayClusters(),
207 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
208 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
209 mTimeFrameGPU->getDeviceArrayTracklets(),
210 mTimeFrameGPU->getDeviceArrayTrackletsLUT(),
211 currentLayerTrackletsNum,
214 mTimeFrameGPU->getDeviceCells()[cellTopologyId],
215 mTimeFrameGPU->getDeviceArrayCellsLUT(),
216 mTimeFrameGPU->getDeviceCellLUTs()[cellTopologyId],
218 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
219 this->mTrkParams[iteration].CellDeltaTanLambdaSigma,
220 this->mTrkParams[iteration].NSigmaCut,
221 this->mTrkParams[iteration].LayerxX0,
222 mTimeFrameGPU->getStreams());
223 mTimeFrameGPU->recordEvent(cellTopologyId);
225 mTimeFrameGPU->syncStreams(
false);
231 const auto hostTopology = mTimeFrameGPU->getTrackingTopologyView();
232 for (
int outerLayer{0}; outerLayer < NLayers; ++outerLayer) {
233 for (
int targetCellTopologyId{0}; targetCellTopologyId < hostTopology.nCells; ++targetCellTopologyId) {
234 const auto targetCellTopology = hostTopology.getCell(targetCellTopologyId);
235 if (targetCellTopology.hitLayerMask.last() != outerLayer) {
238 const int targetCellsNum{
static_cast<int>(mTimeFrameGPU->getNCells()[targetCellTopologyId])};
239 if (!targetCellsNum) {
240 mTimeFrameGPU->getNNeighbours()[targetCellTopologyId] = 0;
241 mTimeFrameGPU->recordEvent(targetCellTopologyId);
244 mTimeFrameGPU->createNeighboursIndexTablesDevice(targetCellTopologyId);
245 mTimeFrameGPU->createNeighboursLUTDevice(targetCellTopologyId, targetCellsNum);
247 for (
int sourceCellTopologyId{0}; sourceCellTopologyId < hostTopology.nCells; ++sourceCellTopologyId) {
248 const auto sourceCellTopology = hostTopology.getCell(sourceCellTopologyId);
249 const int sourceCellsNum{
static_cast<int>(mTimeFrameGPU->getNCells()[sourceCellTopologyId])};
250 if (!sourceCellsNum || sourceCellTopology.secondTransition != targetCellTopology.firstTransition) {
253 mTimeFrameGPU->waitEvent(targetCellTopologyId, sourceCellTopologyId);
254 countCellNeighboursHandler<NLayers>(mTimeFrameGPU->getDeviceArrayCells(),
255 mTimeFrameGPU->getDeviceNeighboursIndexTables(targetCellTopologyId),
256 mTimeFrameGPU->getDeviceArrayCellsLUT(),
257 sourceCellTopologyId,
258 targetCellTopologyId,
259 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
262 mTimeFrameGPU->getStream(targetCellTopologyId));
266 mTimeFrameGPU->getDeviceNeighboursLUT(targetCellTopologyId),
268 mTimeFrameGPU->getFrameworkAllocator(),
269 mTimeFrameGPU->getStream(targetCellTopologyId));
271 mTimeFrameGPU->createNeighboursDevice(targetCellTopologyId);
272 if (mTimeFrameGPU->getNNeighbours()[targetCellTopologyId] == 0) {
273 mTimeFrameGPU->recordEvent(targetCellTopologyId);
277 for (
int sourceCellTopologyId{0}; sourceCellTopologyId < hostTopology.nCells; ++sourceCellTopologyId) {
278 const auto sourceCellTopology = hostTopology.getCell(sourceCellTopologyId);
279 const int sourceCellsNum{
static_cast<int>(mTimeFrameGPU->getNCells()[sourceCellTopologyId])};
280 if (!sourceCellsNum || sourceCellTopology.secondTransition != targetCellTopology.firstTransition) {
283 computeCellNeighboursHandler<NLayers>(mTimeFrameGPU->getDeviceArrayCells(),
284 mTimeFrameGPU->getDeviceNeighboursIndexTables(targetCellTopologyId),
285 mTimeFrameGPU->getDeviceArrayCellsLUT(),
286 mTimeFrameGPU->getDeviceNeighbours(targetCellTopologyId),
287 sourceCellTopologyId,
288 targetCellTopologyId,
289 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
292 mTimeFrameGPU->getStream(targetCellTopologyId));
294 mTimeFrameGPU->recordEvent(targetCellTopologyId);
297 mTimeFrameGPU->syncStreams(
false);
305 firstClusters.resize(this->mTrkParams[iteration].NLayers);
306 sharedFirstClusters.resize(this->mTrkParams[iteration].NLayers);
307 const auto hostTopology = mTimeFrameGPU->getTrackingTopologyView();
308 for (
int startLevel{this->mTrkParams[iteration].CellsPerRoad()}; startLevel >= this->mTrkParams[iteration].CellMinimumLevel(); --startLevel) {
310 for (
int startCellTopologyId{0}; startCellTopologyId < hostTopology.nCells; ++startCellTopologyId) {
311 const int startLayer = hostTopology.getCell(startCellTopologyId).hitLayerMask.last();
312 if ((this->mTrkParams[iteration].StartLayerMask & (1 << startLayer)) == 0 ||
313 mTimeFrameGPU->getNCells()[startCellTopologyId] == 0) {
316 processNeighboursHandler<NLayers>(startLevel,
318 mTimeFrameGPU->getDeviceArrayCells(),
319 mTimeFrameGPU->getDeviceCells()[startCellTopologyId],
322 mTimeFrameGPU->getArrayNCells().data(),
323 (
const uint8_t**)mTimeFrameGPU->getDeviceArrayUsedClusters(),
324 mTimeFrameGPU->getDeviceArrayNeighbours(),
325 mTimeFrameGPU->getDeviceArrayNeighboursCellLUT(),
326 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
329 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
330 this->mTrkParams[iteration].MaxChi2NDF,
331 this->mTrkParams[iteration].MaxHoles,
332 this->mTrkParams[iteration].MinTrackLength,
333 this->mTrkParams[iteration].HoleLayerMask,
334 this->mTrkParams[iteration].LayerxX0,
335 mTimeFrameGPU->getDevicePropagator(),
336 this->mTrkParams[iteration].CorrType,
337 mTimeFrameGPU->getFrameworkAllocator());
340 if (trackSeeds.empty()) {
341 LOGP(
debug,
"No track seeds found, skipping track finding");
344 mTimeFrameGPU->loadTrackSeedsDevice(trackSeeds);
349 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
350 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
351 mTimeFrameGPU->getDeviceTrackSeedsLUT(),
352 this->mTrkParams[iteration].LayerRadii,
353 this->mTrkParams[iteration].MinPt,
354 this->mTrkParams[iteration].LayerxX0,
358 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
359 this->mTrkParams[iteration].MaxChi2NDF,
360 this->mTrkParams[iteration].ReseedIfShorter,
361 this->mTrkParams[iteration].RepeatRefitOut,
362 this->mTrkParams[iteration].ShiftRefToCluster,
363 mTimeFrameGPU->getDevicePropagator(),
364 this->mTrkParams[iteration].CorrType,
365 mTimeFrameGPU->getFrameworkAllocator());
366 mTimeFrameGPU->createTrackITSExtDevice(trackSeeds.size());
368 mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
369 mTimeFrameGPU->getDeviceArrayUnsortedClusters(),
370 mTimeFrameGPU->getDeviceTrackITSExt(),
371 mTimeFrameGPU->getDeviceTrackSeedsLUT(),
372 this->mTrkParams[iteration].LayerRadii,
373 this->mTrkParams[iteration].MinPt,
374 this->mTrkParams[iteration].LayerxX0,
376 mTimeFrameGPU->getNTrackSeeds(),
379 this->mTrkParams[iteration].MaxChi2ClusterAttachment,
380 this->mTrkParams[iteration].MaxChi2NDF,
381 this->mTrkParams[iteration].ReseedIfShorter,
382 this->mTrkParams[iteration].RepeatRefitOut,
383 this->mTrkParams[iteration].ShiftRefToCluster,
384 mTimeFrameGPU->getDevicePropagator(),
385 this->mTrkParams[iteration].CorrType,
386 mTimeFrameGPU->getFrameworkAllocator());
387 mTimeFrameGPU->downloadTrackITSExtDevice();
389 auto& tracks = mTimeFrameGPU->getTrackITSExt();
390 this->acceptTracks(iteration, tracks, firstClusters, sharedFirstClusters);
391 mTimeFrameGPU->loadUsedClustersDevice();
393 this->markTracks(iteration, sharedFirstClusters);
395 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)