302 for (
int iLayer{0}; iLayer < NLayers; ++iLayer) {
305 for (
int iLayer{0}; iLayer < trkParam.
NLayers; ++iLayer) {
307 for (
auto& tfInfo : mTrackingFrameInfo[iLayer]) {
309 tfInfo.covarianceTrackingFrame[0] += trkParam.
SystErrorY2[iLayer];
310 tfInfo.covarianceTrackingFrame[2] += trkParam.
SystErrorZ2[iLayer];
315 mMinR.fill(std::numeric_limits<float>::max());
316 mMaxR.fill(std::numeric_limits<float>::min());
329 mNTrackletsPerROF.resize(2);
330 for (
auto&
v : mNTrackletsPerROF) {
331 v = bounded_vector<int>(getNrof(1) + 1, 0, mMemoryPool.get());
334 prepareClusters(trkParam, maxLayers);
336 mTotalTracklets = {0, 0};
337 if (maxLayers < trkParam.
NLayers) {
338 for (
size_t iLayer{0}; iLayer < maxLayers; ++iLayer) {
345 std::array<float, NLayers> msAngles{};
346 for (
unsigned int iLayer{0}; iLayer < NLayers; ++iLayer) {
352 float oneOverR{0.001f * 0.3f * std::abs(mBz) / trkParam.
TrackletMinPt};
353 for (
int linkId{0}; linkId < (
int)mTracklets.size(); ++linkId) {
354 const auto&
link = mTrackingTopologyView.getLink(linkId);
357 ms2 += math_utils::Sq(msAngles[
layer]);
359 mLinkMSAngles[linkId] = o2::gpu::CAMath::Sqrt(ms2);
363 const float res1 = o2::gpu::CAMath::Hypot(trkParam.
PVres, mPositionResolution[
link.fromLayer]);
364 const float res2 = o2::gpu::CAMath::Hypot(trkParam.
PVres, mPositionResolution[
link.toLayer]);
365 const float cosTheta1half = o2::gpu::CAMath::Sqrt(1.f - math_utils::Sq(0.5f * r1 * oneOverR));
366 const float cosTheta2half = o2::gpu::CAMath::Sqrt(1.f - math_utils::Sq(0.5f * r2 * oneOverR));
367 float x = (r2 * cosTheta1half) - (r1 * cosTheta2half);
368 float delta = o2::gpu::CAMath::Sqrt(1.f / (1.f - 0.25f * math_utils::Sq(
x * oneOverR)) * (math_utils::Sq((0.25f * r1 * r2 * math_utils::Sq(oneOverR) / cosTheta2half) + cosTheta1half) * math_utils::Sq(res1) + math_utils::Sq((0.25f * r1 * r2 * math_utils::Sq(oneOverR) / cosTheta1half) + cosTheta2half) * math_utils::Sq(res2)));
370 mLinkPhiCuts[linkId] = o2::gpu::CAMath::Min(o2::gpu::CAMath::ASin(0.5f *
x * oneOverR) + 2.f * mLinkMSAngles[linkId] + delta,
o2::constants::math::PI * 0.5f);
376 mTrackletsLookupTable[linkId].resize(mClusters[
link.fromLayer].size() + 1, 0);
379 for (
int cellId{0}; cellId < (
int)mCells.size(); ++cellId) {
389template <
int NLayers>
392 unsigned long size{0};
393 for (
const auto& trkl : mTracklets) {
396 for (
const auto&
cells : mCells) {
399 for (
const auto& cellsN : mCellsNeighbours) {
400 size +=
sizeof(
int) * cellsN.size();
402 for (
const auto& cellsN : mCellsNeighboursTopology) {
403 size +=
sizeof(
int) * cellsN.size();
408template <
int NLayers>
411 LOGP(info,
"TimeFrame: Artefacts occupy {:.2f} MB", getArtefactsMemory() /
constants::MB);
414template <
int NLayers>
417 for (ushort iLayer = 0; iLayer < 2; ++iLayer) {
418 for (
unsigned int iRof{0}; iRof < getNrof(1); ++iRof) {
419 if (mROFMaskView.isROFEnabled(1, iRof)) {
420 mTotalTracklets[iLayer] += mNTrackletsPerROF[iLayer][iRof];
423 std::exclusive_scan(mNTrackletsPerROF[iLayer].begin(), mNTrackletsPerROF[iLayer].
end(), mNTrackletsPerROF[iLayer].begin(), 0);
424 std::exclusive_scan(mNTrackletsPerCluster[iLayer].begin(), mNTrackletsPerCluster[iLayer].
end(), mNTrackletsPerClusterSum[iLayer].begin(), 0);
428template <
int NLayers>
438 auto initContainers = [&]<
typename Container>(Container& container,
bool useExternal =
false) {
439 for (
auto&
v : container) {
440 initVector(
v, useExternal);
445 initContainers(mClusterExternalIndices);
446 initContainers(mNTrackletsPerCluster);
447 initContainers(mNTrackletsPerClusterSum);
448 initContainers(mNClustersPerROF);
449 initVector(mPrimaryVertices);
450 initVector(mLinkPhiCuts);
451 initVector(mLinkMSAngles);
452 initVector(mPositionResolution);
453 initContainers(mClusterSize);
454 initVector(mPValphaX);
455 initVector(mBogusClusters);
456 initContainers(mTrackletsIndexROF);
458 initContainers(mTracklets);
459 initContainers(mCells);
460 initContainers(mCellsNeighbours);
461 initContainers(mCellsLookupTable);
463 initVector(mPrimaryVerticesLabels);
464 initContainers(mLinesLabels);
465 initContainers(mTrackletLabels);
466 initContainers(mCellLabels);
467 initVector(mTracksLabel);
469 initContainers(mClusters, hasFrameworkAllocator());
470 initContainers(mUsedClusters, hasFrameworkAllocator());
471 initContainers(mUnsortedClusters, hasFrameworkAllocator());
472 initContainers(mIndexTables, hasFrameworkAllocator());
473 initContainers(mTrackingFrameInfo, hasFrameworkAllocator());
474 initContainers(mROFramesClusters, hasFrameworkAllocator());
477template <
int NLayers>
480 mExternalAllocator = ext;
481 mExtMemoryPool = std::make_shared<BoundedMemoryResource>(mExternalAllocator);
484template <
int NLayers>
487 resetTrackExtensionCounters();
511 if (!hasFrameworkAllocator()) {
520 if (hasMCinformation()) {
531#ifdef ENABLE_UPGRADES