Skip to content

Commit 1dd5823

Browse files
committed
Adjust handling of saturated qTot
1 parent 72b16ac commit 1dd5823

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

DataFormats/Detectors/TPC/include/DataFormatsTPC/ClusterNative.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ struct ClusterNative {
9090
GPUd() uint16_t getQtot() const
9191
{
9292
if (isSaturated()) [[unlikely]] {
93-
return maxRegularQtot;
93+
auto sQtot = getSaturatedQtot();
94+
return sQtot < USHRT_MAX ? sQtot : USHRT_MAX;
9495
}
9596
return qTot;
9697
}
@@ -158,10 +159,10 @@ struct ClusterNative {
158159

159160
GPUd() void setSaturatedQtot(uint32_t qtot)
160161
{
161-
if (qtot > maxSaturatedQtot) {
162-
qtot = maxSaturatedQtot;
162+
this->qTot = USHRT_MAX;
163+
if (qtot < maxSaturatedQtot) {
164+
this->qTot = ((qtot + scaleSaturatedQtot / 2) / scaleSaturatedQtot) + maxRegularQtot;
163165
}
164-
this->qTot = ((qtot + scaleSaturatedQtot / 2) / scaleSaturatedQtot) + maxRegularQtot;
165166
}
166167

167168
GPUd() uint32_t getSaturatedQtot() const

0 commit comments

Comments
 (0)