Skip to content

Commit c0fc35c

Browse files
committed
GPU TPC dEdx: fixing bug in padPos calculation
1 parent 87e0db4 commit c0fc35c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GPU/GPUTracking/dEdx/GPUdEdx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ GPUdnii() void GPUdEdx::fillCluster(float qtot, float qmax, int32_t padRow, uint
118118
const float tanTheta = CAMath::Sqrt(tgl2 * sec2);
119119

120120
// getting the topology correction
121-
const uint32_t padPos = CAMath::Max<uint32_t>(GPUTPCGeometry::NPads(padRow) - 1, CAMath::Float2UIntRn(pad)); // position of the pad is shifted half a pad ( pad=3 -> centre position of third pad)
121+
const uint32_t padPos = CAMath::Min<uint32_t>(GPUTPCGeometry::NPads(padRow) - 1, CAMath::Float2UIntRn(pad)); // position of the pad is shifted half a pad ( pad=3 -> centre position of third pad)
122122
const float absRelPad = CAMath::Abs(pad - padPos);
123123
const int32_t region = geo.GetRegion(padRow);
124124
z = CAMath::Abs(z);

0 commit comments

Comments
 (0)