Skip to content

Commit

Permalink
Sort by pT only good-quality tracks
Browse files Browse the repository at this point in the history
Port from CUDA to Alpaka the changes in cms-sw#42428 by Silvio Donato.
  • Loading branch information
fwyzard committed Mar 17, 2024
1 parent 7cbd587 commit 7268687
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,12 @@ void PixelTrackProducerFromSoAAlpaka<TrackerTraits>::produce(edm::StreamID strea
//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 at 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 7268687

Please sign in to comment.