Skip to content

Commit 9736cfe

Browse files
committed
ITS: template Traits and TimeFrame
1 parent fdb198d commit 9736cfe

File tree

22 files changed

+601
-819
lines changed

22 files changed

+601
-819
lines changed

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class DefaultGPUAllocator : public ExternalAllocator
3030
};
3131

3232
template <int nLayers = 7>
33-
class TimeFrameGPU : public TimeFrame
33+
class TimeFrameGPU : public TimeFrame<nLayers>
3434
{
3535
public:
3636
TimeFrameGPU();
@@ -205,14 +205,14 @@ class TimeFrameGPU : public TimeFrame
205205
template <int nLayers>
206206
inline int TimeFrameGPU<nLayers>::getNClustersInRofSpan(const int rofIdstart, const int rofSpanSize, const int layerId) const
207207
{
208-
return static_cast<int>(mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < mROFramesClusters.size() ? rofIdstart + rofSpanSize : mROFramesClusters.size() - 1] - mROFramesClusters[layerId][rofIdstart]);
208+
return static_cast<int>(this->mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < this->mROFramesClusters.size() ? rofIdstart + rofSpanSize : this->mROFramesClusters.size() - 1] - this->mROFramesClusters[layerId][rofIdstart]);
209209
}
210210

211211
template <int nLayers>
212212
inline std::vector<unsigned int> TimeFrameGPU<nLayers>::getClusterSizes()
213213
{
214-
std::vector<unsigned int> sizes(mUnsortedClusters.size());
215-
std::transform(mUnsortedClusters.begin(), mUnsortedClusters.end(), sizes.begin(),
214+
std::vector<unsigned int> sizes(this->mUnsortedClusters.size());
215+
std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(), sizes.begin(),
216216
[](const auto& v) { return static_cast<unsigned int>(v.size()); });
217217
return sizes;
218218
}

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackerTraitsGPU.h

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@
1616
#include "ITStracking/TrackerTraits.h"
1717
#include "ITStrackingGPU/TimeFrameGPU.h"
1818

19-
namespace o2
20-
{
21-
namespace its
19+
namespace o2::its
2220
{
2321

2422
template <int nLayers = 7>
25-
class TrackerTraitsGPU final : public TrackerTraits
23+
class TrackerTraitsGPU final : public TrackerTraits<nLayers>
2624
{
2725
public:
2826
TrackerTraitsGPU() = default;
2927
~TrackerTraitsGPU() override = default;
3028

31-
void adoptTimeFrame(TimeFrame* tf) final;
29+
void adoptTimeFrame(TimeFrame<nLayers>* tf) final;
3230
void initialiseTimeFrame(const int iteration) final;
3331

3432
void computeLayerTracklets(const int iteration, int, int) final;
@@ -54,13 +52,6 @@ class TrackerTraitsGPU final : public TrackerTraits
5452
gpu::TimeFrameGPU<7>* mTimeFrameGPU;
5553
};
5654

57-
template <int nLayers>
58-
inline void TrackerTraitsGPU<nLayers>::adoptTimeFrame(TimeFrame* tf)
59-
{
60-
mTimeFrameGPU = static_cast<gpu::TimeFrameGPU<nLayers>*>(tf);
61-
mTimeFrame = static_cast<TimeFrame*>(tf);
62-
}
63-
} // namespace its
64-
} // namespace o2
55+
} // namespace o2::its
6556

66-
#endif
57+
#endif

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackingKernels.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ void countTrackletsInROFsHandler(const IndexTableUtils* utils,
7373
const float NSigmaCut,
7474
std::vector<float>& phiCuts,
7575
const float resolutionPV,
76-
std::vector<float>& minR,
77-
std::vector<float>& maxR,
76+
std::array<float, nLayers>& minR,
77+
std::array<float, nLayers>& maxR,
7878
std::vector<float>& resolutions,
7979
std::vector<float>& radii,
8080
std::vector<float>& mulScatAng,
@@ -106,8 +106,8 @@ void computeTrackletsInROFsHandler(const IndexTableUtils* utils,
106106
const float NSigmaCut,
107107
std::vector<float>& phiCuts,
108108
const float resolutionPV,
109-
std::vector<float>& minR,
110-
std::vector<float>& maxR,
109+
std::array<float, nLayers>& minR,
110+
std::array<float, nLayers>& maxR,
111111
std::vector<float>& resolutions,
112112
std::vector<float>& radii,
113113
std::vector<float>& mulScatAng,

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/VertexerTraitsGPU.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ class VertexerTraitsGPU final : public VertexerTraits
4141
{
4242
public:
4343
void initialise(const TrackingParameters&, const int iteration = 0) final;
44-
void adoptTimeFrame(TimeFrame*) final;
44+
void adoptTimeFrame(TimeFrame<7>*) final;
4545
void computeTracklets(const int iteration = 0) final;
4646
void computeTrackletMatching(const int iteration = 0) final;
4747
void computeVertices(const int iteration = 0) final;
4848
void updateVertexingParameters(const std::vector<VertexingParameters>&, const TimeFrameGPUParameters&) final;
4949
void computeVerticesHist();
5050

51-
virtual bool isGPU() final { return true; }
52-
virtual const char* getName() final { return "GPU"; }
51+
bool isGPU() const noexcept final { return true; }
52+
const char* getName() const noexcept final { return "GPU"; }
5353

5454
protected:
5555
IndexTableUtils* mDeviceIndexTableUtils;
5656
gpu::TimeFrameGPU<7>* mTimeFrameGPU;
5757
TimeFrameGPUParameters mTfGPUParams;
5858
};
5959

60-
inline void VertexerTraitsGPU::adoptTimeFrame(TimeFrame* tf)
60+
inline void VertexerTraitsGPU::adoptTimeFrame(TimeFrame<7>* tf)
6161
{
6262
mTimeFrameGPU = static_cast<gpu::TimeFrameGPU<7>*>(tf);
63-
mTimeFrame = static_cast<TimeFrame*>(tf);
63+
mTimeFrame = static_cast<TimeFrame<7>*>(tf);
6464
}
6565

6666
} // namespace its

0 commit comments

Comments
 (0)