Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Detectors/Base/include/DetectorsBase/MatLayerCyl.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class MatLayerCyl : public o2::gpu::FlatObject
GPUd() int getZBinID(float z) const
{
int idz = int((z - getZMin()) * getDZInv()); // cannot be negative since before isZOutside is applied
return idz < getNZBins() ? idz : getNZBins() - 1;
return idz < getNZBins() ? (idz > 0 ? idz : 0) : getNZBins() - 1;
}

// lower boundary of Z slice
Expand Down
2 changes: 1 addition & 1 deletion Detectors/Base/include/DetectorsBase/Ray.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Ray

GPUd() float getPhi(float t) const
{
float p = o2::gpu::CAMath::ATan2(mP[1] + t * mD[1], mP[0] + t * mD[0]);
float p = o2::math_utils::fastATan2(mP[1] + t * mD[1], mP[0] + t * mD[0]); // instead of float p = o2::gpu::CAMath::ATan2(mP[1] + t * mD[1], mP[0] + t * mD[0]);
o2::math_utils::bringTo02Pi(p);
return p;
}
Expand Down
6 changes: 6 additions & 0 deletions Detectors/Base/src/MatLayerCylSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ GPUd() MatBudget MatLayerCylSet::getMatBudget(float x0, float y0, float z0, floa
if (tEndPhi == Ray::InvalidT) {
break; // ray parallel to radial line, abandon check for phi bin change
}
const auto tMarginPhi = 1.e-6f + 1.e-5f * (cross1 - cross2);
// if (!(tEndPhi >= cross2 - tMarginPhi) | !(tEndPhi <= cross1 + tMarginPhi)) { // use non-short-circuit | to reject eventual NANs
if (tEndPhi < cross2 - tMarginPhi || tEndPhi > cross1 + tMarginPhi) {
tEndPhi = cross2;
checkMorePhi = false;
}
}
auto zID = lr.getZBinID(ray.getZ(tStartPhi));
auto zIDLast = lr.getZBinID(ray.getZ(tEndPhi));
Expand Down