Skip to content

Commit 2b3cdd0

Browse files
committed
ITS: template Traits and TimeFrame
1 parent 453dfbb commit 2b3cdd0

22 files changed

Lines changed: 603 additions & 764 deletions

File tree

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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ namespace its
2222
{
2323

2424
template <int nLayers = 7>
25-
class TrackerTraitsGPU final : public TrackerTraits
25+
class TrackerTraitsGPU final : public TrackerTraits<nLayers>
2626
{
2727
public:
2828
TrackerTraitsGPU() = default;
2929
~TrackerTraitsGPU() override = default;
3030

31-
void adoptTimeFrame(TimeFrame* tf) final;
31+
void adoptTimeFrame(TimeFrame<nLayers>* tf) final;
3232
void initialiseTimeFrame(const int iteration) final;
3333

3434
void computeLayerTracklets(const int iteration, int, int) final;
@@ -55,12 +55,12 @@ class TrackerTraitsGPU final : public TrackerTraits
5555
};
5656

5757
template <int nLayers>
58-
inline void TrackerTraitsGPU<nLayers>::adoptTimeFrame(TimeFrame* tf)
58+
inline void TrackerTraitsGPU<nLayers>::adoptTimeFrame(TimeFrame<nLayers>* tf)
5959
{
6060
mTimeFrameGPU = static_cast<gpu::TimeFrameGPU<nLayers>*>(tf);
61-
mTimeFrame = static_cast<TimeFrame*>(tf);
61+
this->mTimeFrame = static_cast<TimeFrame<nLayers>*>(tf);
6262
}
6363
} // namespace its
6464
} // namespace o2
6565

66-
#endif
66+
#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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ 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;
@@ -57,10 +57,10 @@ class VertexerTraitsGPU final : public VertexerTraits
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)