diff --git a/DataFormats/common/include/CommonDataFormat/InteractionRecord.h b/DataFormats/common/include/CommonDataFormat/InteractionRecord.h index 68797a477c4f9..4067d0f505143 100644 --- a/DataFormats/common/include/CommonDataFormat/InteractionRecord.h +++ b/DataFormats/common/include/CommonDataFormat/InteractionRecord.h @@ -68,7 +68,7 @@ struct InteractionRecord { bool operator==(const InteractionRecord& other) const { - return (orbit == other.orbit) && (bc == other.bc); + return (bc == other.bc) && (orbit == other.orbit); } int differenceInBC(const InteractionRecord& other) const @@ -81,6 +81,22 @@ struct InteractionRecord { return diffBC; } + int64_t toLong() const + { + // return as single long number + return (int64_t(orbit) * o2::constants::lhc::LHCMaxBunches) + bc; + } + + bool operator>(const InteractionRecord& other) const + { + return (orbit == other.orbit) ? (bc > other.bc) : (orbit > other.orbit); + } + + bool operator<(const InteractionRecord& other) const + { + return (orbit == other.orbit) ? (bc < other.bc) : (orbit < other.orbit); + } + void print() const; ClassDefNV(InteractionRecord, 3);