Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for repeat detIDs when converting clusters from SoA #47076

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <memory>
#include <unordered_set>

#include "DataFormats/Common/interface/DetSetVector.h"
#include "DataFormats/DetId/interface/DetId.h"
Expand Down Expand Up @@ -159,6 +160,7 @@ void SiPixelDigisClustersFromSoAAlpaka<TrackerTraits>::produce(edm::StreamID,
#ifdef GPU_DEBUG
std::cout << "Dumping all digis. nDigis = " << nDigis << std::endl;
#endif
std::unordered_set<uint32_t> processedDetIds;
for (uint32_t i = 0; i < nDigis; i++) {
// check for uninitialized digis
if (digisView[i].rawIdArr() == 0)
Expand All @@ -183,12 +185,17 @@ void SiPixelDigisClustersFromSoAAlpaka<TrackerTraits>::produce(edm::StreamID,
#ifdef EDM_ML_DEBUG
assert(digisView[i].rawIdArr() > 109999);
#endif
// Check if detId has already been processed
if (processedDetIds.find(detId) != processedDetIds.end()) {
continue; // Skip processing this detId if it has already been handled
}
if (detId != digisView[i].rawIdArr()) {
#ifdef GPU_DEBUG
std::cout << ">> Closed module --" << detId << "; nclus = " << nclus << std::endl;
#endif
// new module
fillClusters(detId);
processedDetIds.insert(detId);
#ifdef EDM_ML_DEBUG
assert(nclus == -1);
#endif
Expand Down Expand Up @@ -223,8 +230,8 @@ void SiPixelDigisClustersFromSoAAlpaka<TrackerTraits>::produce(edm::StreamID,
aclusters[digisView[i].clus()].add(pix, digisView[i].adc());
}

// fill final clusters
if (detId > 0)
// fill final clusters (if not already filled for that ID)
if (detId > 0 && processedDetIds.find(detId) == processedDetIds.end())
fillClusters(detId);

#ifdef EDM_ML_DEBUG
Expand Down