File indexing completed on 2025-08-06 08:17:18
0001
0002
0003
0004
0005 #ifndef MVTXDECODER_INTERACTIONRECORD_H
0006 #define MVTXDECODER_INTERACTIONRECORD_H
0007
0008 #include <cstdint>
0009 #include <string>
0010
0011 namespace mvtx
0012 {
0013 namespace lhcConstants
0014 {
0015 constexpr int LHCMaxBunches = 3564;
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 }
0029
0030
0031
0032 struct InteractionRecord
0033 {
0034
0035 static constexpr uint64_t DummyOrbit = 0xffffffffff;
0036 static constexpr uint16_t DummyBC = 0xffff;
0037
0038 uint64_t orbit = DummyOrbit;
0039 uint16_t bc = DummyBC;
0040
0041 InteractionRecord() = default;
0042
0043 InteractionRecord( uint64_t orb, uint16_t b ) : orbit(orb), bc(b){};
0044
0045 InteractionRecord(const InteractionRecord& src) = default;
0046
0047 InteractionRecord& operator=(const InteractionRecord& src) = default;
0048
0049 void clear()
0050 {
0051 orbit = DummyOrbit;
0052 bc = DummyBC;
0053 }
0054
0055 bool isDummy() const
0056 {
0057 return bc > mvtx::lhcConstants::LHCMaxBunches;
0058 }
0059
0060 bool operator==(const InteractionRecord& other) const
0061 {
0062 return (orbit == other.orbit) && (bc == other.bc);
0063 }
0064
0065 bool operator!=(const InteractionRecord& other) const
0066 {
0067 return (orbit != other.orbit) || (bc != other.bc);
0068 }
0069
0070 void print() const;
0071 std::string asString() const;
0072 friend std::ostream& operator<<(std::ostream& stream, InteractionRecord const& ir);
0073
0074 };
0075
0076 }
0077 #endif