File indexing completed on 2024-04-06 12:20:54
0001 #ifndef L1TMuonEndCap_PhiMemoryImage_h
0002 #define L1TMuonEndCap_PhiMemoryImage_h
0003
0004 #include <cstdint>
0005 #include <iosfwd>
0006
0007
0008
0009 class PhiMemoryImage {
0010 public:
0011 typedef uint64_t value_type;
0012
0013 PhiMemoryImage();
0014 ~PhiMemoryImage();
0015
0016
0017 PhiMemoryImage(const PhiMemoryImage& other);
0018 PhiMemoryImage(PhiMemoryImage&& other) noexcept;
0019 PhiMemoryImage& operator=(PhiMemoryImage other);
0020
0021 void swap(PhiMemoryImage& other);
0022
0023 void reset();
0024
0025 void set_bit(unsigned int layer, unsigned int bit);
0026
0027 void clear_bit(unsigned int layer, unsigned int bit);
0028
0029 bool test_bit(unsigned int layer, unsigned int bit) const;
0030
0031 void set_word(unsigned int layer, unsigned int unit, value_type value);
0032
0033 value_type get_word(unsigned int layer, unsigned int unit) const;
0034
0035 void set_straightness(int s) { _straightness = s; }
0036
0037 int get_straightness() const { return _straightness; }
0038
0039
0040 void rotl(unsigned int n);
0041
0042
0043 void rotr(unsigned int n);
0044
0045
0046
0047
0048
0049
0050 unsigned int op_and(const PhiMemoryImage& other) const;
0051
0052 void print(std::ostream& out) const;
0053
0054 private:
0055 void check_input(unsigned int layer, unsigned int bit) const;
0056
0057
0058
0059 static const unsigned int _layers = 4;
0060
0061
0062
0063 static const unsigned int _units = 3;
0064
0065
0066 value_type _buffer[_layers][_units];
0067
0068 int _straightness;
0069 };
0070
0071
0072
0073 std::ostream& operator<<(std::ostream& o, const PhiMemoryImage& p);
0074
0075 #endif