diff --git a/RecoHGCal/TICL/plugins/LinkingAlgoByPCAGeometric.cc b/RecoHGCal/TICL/plugins/LinkingAlgoByPCAGeometric.cc index cc8e2697bbb04..3be353d6bea0c 100644 --- a/RecoHGCal/TICL/plugins/LinkingAlgoByPCAGeometric.cc +++ b/RecoHGCal/TICL/plugins/LinkingAlgoByPCAGeometric.cc @@ -144,6 +144,7 @@ void LinkingAlgoByPCAGeometric::linkTracksters(const edm::Handle candidateTrackIds; for (unsigned i = 0; i < tracks.size(); ++i) { const auto tk = tracks[i]; reco::TrackRef trackref = reco::TrackRef(tkH, i); @@ -153,6 +154,9 @@ void LinkingAlgoByPCAGeometric::linkTracksters(const edm::Handle chargedCandidates; std::vector chargedHadronsFromTk; int chargedMask[tracksters.size()] = {0}; - for (unsigned i = 0; i < tracks.size(); ++i) { + for (unsigned i : candidateTrackIds) { if (tracksters_near[i].empty() && tsNearTkAtInt[i].empty()) { // nothing linked to track, make charged hadrons TICLCandidate chargedHad; const auto &tk = tracks[i];