File indexing completed on 2025-08-05 08:20:06
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
0033
0034
0035 struct InteractionRecord
0036 {
0037
0038 static constexpr uint64_t DummyOrbit = 0xffffffffff;
0039 static constexpr uint16_t DummyBC = 0xffff;
0040
0041 uint64_t orbit = DummyOrbit;
0042 uint16_t bc = DummyBC;
0043
0044 InteractionRecord() = default;
0045
0046 InteractionRecord(uint64_t orb, uint16_t b)
0047 : orbit(orb)
0048 , bc(b) {};
0049
0050 InteractionRecord(const InteractionRecord &src) = default;
0051
0052 InteractionRecord &operator=(const InteractionRecord &src) = default;
0053
0054 void clear()
0055 {
0056 orbit = DummyOrbit;
0057 bc = DummyBC;
0058 }
0059
0060 bool isDummy() const { return bc > mvtx::lhcConstants::LHCMaxBunches; }
0061
0062 bool operator==(const InteractionRecord &other) const
0063 {
0064 return (orbit == other.orbit) && (bc == other.bc);
0065 }
0066
0067 bool operator!=(const InteractionRecord &other) const
0068 {
0069 return (orbit != other.orbit) || (bc != other.bc);
0070 }
0071
0072 void print() const;
0073 std::string asString() const;
0074 friend std::ostream &operator<<(std::ostream &stream,
0075 InteractionRecord const &ir);
0076
0077 };
0078
0079 }
0080 #endif