Skip to content

Commit

Permalink
Merge pull request #42428 from silviodonato/sortOnlyGoodQualityPixelT…
Browse files Browse the repository at this point in the history
…racks

sort by pt only good-quality tracks
  • Loading branch information
cmsbuild authored Aug 2, 2023
2 parents 7359381 + a7c4a22 commit a41eee2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ void PixelTrackProducerFromSoAT<TrackerTraits>::produce(edm::StreamID streamID,
//sort index by pt
std::vector<int32_t> sortIdxs(nTracks);
std::iota(sortIdxs.begin(), sortIdxs.end(), 0);
//sort good-quality tracks by pt, keep bad-quality tracks in the bottom
std::sort(sortIdxs.begin(), sortIdxs.end(), [&](int32_t const i1, int32_t const i2) {
return tsoa.view()[i1].pt() > tsoa.view()[i2].pt();
if (quality[i1] >= minQuality_ && quality[i2] >= minQuality_)
return tsoa.view()[i1].pt() > tsoa.view()[i2].pt();
else
return quality[i1] > quality[i2];
});

//store the index of the SoA: indToEdm[index_SoAtrack] -> index_edmTrack (if it exists)
Expand Down

0 comments on commit a41eee2

Please sign in to comment.