Skip to content

Commit

Permalink
Handle pixel modules with all invalid pixels
Browse files Browse the repository at this point in the history
Handle the case where all pixels in a module are invalid or duplicate.
  • Loading branch information
fwyzard committed Aug 8, 2022
1 parent 2522012 commit 7ca6d96
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions RecoLocalTracker/SiPixelClusterizer/plugins/gpuClusterChargeCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@ namespace gpuClustering {
auto endModule = moduleStart[0];
for (auto module = firstModule; module < endModule; module += gridDim.x) {
auto firstPixel = moduleStart[1 + module];
while (id[firstPixel] == invalidModuleId)
++firstPixel; // could be duplicates!
auto thisModuleId = id[firstPixel];
while (thisModuleId == invalidModuleId and firstPixel < numElements) {
// skip invalid or duplicate pixels
++firstPixel;
thisModuleId = id[firstPixel];
}
if (firstPixel >= numElements) {
// reached the end of the input while skipping the invalid pixels, nothing left to do
break;
}
if (thisModuleId != moduleId[module]) {
// reached the end of the module while skipping the invalid pixels, skip this module
continue;
}
assert(thisModuleId < nMaxModules);
assert(thisModuleId == moduleId[module]);

auto nclus = nClustersInModule[thisModuleId];
if (nclus == 0)
Expand Down

0 comments on commit 7ca6d96

Please sign in to comment.