Skip to content

Commit 66df649

Browse files
bazinskisawenzel
authored andcommitted
TRD add less than operator to Tracklet64 to permit std::merge usage
1 parent 3486413 commit 66df649

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

DataFormats/Detectors/TRD/src/Tracklet64.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ std::ostream& operator<<(std::ostream& stream, const Tracklet64& trg)
4040
trg.printStream(stream);
4141
return stream;
4242
}
43+
44+
bool operator<(const Tracklet64& lhs, const Tracklet64& rhs)
45+
{
46+
return (lhs.getDetector() < rhs.getDetector()) ||
47+
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() < rhs.getROB()) ||
48+
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() == rhs.getROB() && lhs.getMCM() < rhs.getMCM()) ||
49+
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() == rhs.getROB() && lhs.getMCM() == rhs.getMCM() && lhs.getPadRow() < rhs.getPadRow()) ||
50+
(lhs.getDetector() == rhs.getDetector() && lhs.getROB() == rhs.getROB() && lhs.getMCM() == rhs.getMCM() && lhs.getPadRow() == rhs.getPadRow() && lhs.getPadCol() < rhs.getPadCol());
51+
}
52+
4353
#endif // GPUCA_GPUCODE_DEVICE
4454

4555
} // namespace trd

0 commit comments

Comments
 (0)