Skip to content

Commit 1807af3

Browse files
committed
ITS: fix ROFLookpTables warning
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 3ca055f commit 1807af3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Detectors/ITSMFT/ITS/tracking/include/ITStracking/ROFLookupTables.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ struct LayerTiming {
7777
GPUhi() BCType getROF(BCType bc) const noexcept
7878
{
7979
BCType rof = (bc - mROFDelay - mROFBias) / mROFLength;
80-
return rof >= 0 ? rof : 0;
80+
const BCType offset = mROFDelay + mROFBias;
81+
if (bc <= offset) {
82+
return 0;
83+
}
84+
return (bc - offset) / mROFLength;
8185
}
8286

8387
#ifndef GPUCA_GPUCODE
@@ -102,7 +106,7 @@ class LayerTimingBase
102106

103107
public:
104108
using T = LayerTiming::BCType;
105-
GPUh() LayerTimingBase() = default;
109+
LayerTimingBase() = default;
106110

107111
GPUh() void defineLayer(int32_t layer, T nROFsTF, T rofLength, T rofDelay, T rofBias, T rofTE)
108112
{
@@ -295,7 +299,7 @@ class ROFOverlapTable : public LayerTimingBase<NLayers>
295299
using TableIndex = dataformats::RangeReference<T, T>;
296300

297301
using View = ROFOverlapTableView<NLayers, TableEntry, TableIndex>;
298-
GPUh() ROFOverlapTable() = default;
302+
ROFOverlapTable() = default;
299303

300304
GPUh() void init()
301305
{
@@ -516,7 +520,7 @@ class ROFVertexLookupTable : public LayerTimingBase<NLayers>
516520

517521
using View = ROFVertexLookupTableView<NLayers, TableEntry, TableIndex>;
518522

519-
GPUh() ROFVertexLookupTable() = default;
523+
ROFVertexLookupTable() = default;
520524

521525
GPUh() size_t getFlatTableSize() const noexcept { return mFlatTable.size(); }
522526
static GPUh() constexpr size_t getIndicesSize() { return NLayers; }

0 commit comments

Comments
 (0)