Skip to content

Commit

Permalink
ugly patch to avoid issue with writing the same detid twice
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Apr 11, 2021
1 parent d30a4d4 commit 3ba2e1c
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -123,6 +123,10 @@ void NearbyPixelClusterProducer::produce(edm::Event& iEvent, const edm::EventSet
if (!trajTrackCollectionHandle.isValid())
return;

//std::cout << (*trajTrackCollectionHandle).size() << std::endl;

std::vector<uint32_t> treatedIDs;

for (const auto& pair : *trajTrackCollectionHandle) {
const edm::Ref<std::vector<Trajectory>> traj = pair.key;
const reco::TrackRef track = pair.val;
Expand All @@ -140,6 +144,12 @@ void NearbyPixelClusterProducer::produce(edm::Event& iEvent, const edm::EventSet
if (!this->detidIsOnPixel(r_rawId))
continue;

if (std::find(treatedIDs.begin(), treatedIDs.end(), r_rawId.rawId()) != treatedIDs.end()) {
continue;
} else {
treatedIDs.push_back(r_rawId.rawId());
}

// Skipping hits with undeterminable positions
TrajectoryStateOnSurface trajStateOnSurface = this->getTrajectoryStateOnSurface(measurement);

Expand Down

0 comments on commit 3ba2e1c

Please sign in to comment.