Skip to content

Commit

Permalink
TRD add less than operator to Tracklet64 to permit std::merge usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bazinski authored and sawenzel committed Nov 15, 2024
1 parent 3486413 commit 66df649
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DataFormats/Detectors/TRD/src/Tracklet64.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ std::ostream& operator<<(std::ostream& stream, const Tracklet64& trg)
trg.printStream(stream);
return stream;
}

bool operator<(const Tracklet64& lhs, const Tracklet64& rhs)
{
return (lhs.getDetector() < rhs.getDetector()) ||
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() < rhs.getROB()) ||
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() == rhs.getROB() && lhs.getMCM() < rhs.getMCM()) ||
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() == rhs.getROB() && lhs.getMCM() == rhs.getMCM() && lhs.getPadRow() < rhs.getPadRow()) ||
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() == rhs.getROB() && lhs.getMCM() == rhs.getMCM() && lhs.getPadRow() == rhs.getPadRow() && lhs.getPadCol() < rhs.getPadCol());
}

#endif // GPUCA_GPUCODE_DEVICE

} // namespace trd
Expand Down

0 comments on commit 66df649

Please sign in to comment.