CMS 3D CMS Logo

PhiMemoryImage.h
Go to the documentation of this file.
1 #ifndef L1TMuonEndCap_PhiMemoryImage_h
2 #define L1TMuonEndCap_PhiMemoryImage_h
3 
4 #include <cstdint>
5 #include <iosfwd>
6 
7 // Originally written by Ivan Furic and Matt Carver (Univ of Florida)
8 
10 public:
12 
15 
16  // Copy constructor, move constructor and copy assignment
20 
21  void swap(PhiMemoryImage& other);
22 
23  void reset();
24 
25  void set_bit(unsigned int layer, unsigned int bit);
26 
27  void clear_bit(unsigned int layer, unsigned int bit);
28 
29  bool test_bit(unsigned int layer, unsigned int bit) const;
30 
31  void set_word(unsigned int layer, unsigned int unit, value_type value);
32 
33  value_type get_word(unsigned int layer, unsigned int unit) const;
34 
35  void set_straightness(int s) { _straightness = s; }
36 
37  int get_straightness() const { return _straightness; }
38 
39  // Left rotation by n bits
40  void rotl(unsigned int n);
41 
42  // Right rotation by n bits
43  void rotr(unsigned int n);
44 
45  // Kind of like AND operator
46  // It returns a layer code which encodes
47  // bit 0: st3 or st4 hit
48  // bit 1: st2 hit
49  // bit 2: st1 hit
50  unsigned int op_and(const PhiMemoryImage& other) const;
51 
52  void print(std::ostream& out) const;
53 
54 private:
55  void check_input(unsigned int layer, unsigned int bit) const;
56 
57  // Num of layers
58  // [0,1,2,3] --> [st1,st2,st3,st4]
59  static const unsigned int _layers = 4;
60 
61  // Num of value_type allocated per layer
62  // 3 * 64 bits = 192 bits
63  static const unsigned int _units = 3;
64 
65  // Hits in non-key stations
67 
69 };
70 
71 // _____________________________________________________________________________
72 // Output streams
73 std::ostream& operator<<(std::ostream& o, const PhiMemoryImage& p);
74 
75 #endif
PhiMemoryImage::set_bit
void set_bit(unsigned int layer, unsigned int bit)
Definition: PhiMemoryImage.cc:40
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
PhiMemoryImage::set_word
void set_word(unsigned int layer, unsigned int unit, value_type value)
Definition: PhiMemoryImage.cc:61
operator<<
std::ostream & operator<<(std::ostream &o, const PhiMemoryImage &p)
Definition: PhiMemoryImage.cc:177
PhiMemoryImage::_buffer
value_type _buffer[_layers][_units]
Definition: PhiMemoryImage.h:66
PhiMemoryImage::_units
static const unsigned int _units
Definition: PhiMemoryImage.h:63
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PhiMemoryImage::swap
void swap(PhiMemoryImage &other)
Definition: PhiMemoryImage.cc:28
PhiMemoryImage::print
void print(std::ostream &out) const
Definition: PhiMemoryImage.cc:164
PhiMemoryImage::value_type
uint64_t value_type
Definition: PhiMemoryImage.h:11
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
PhiMemoryImage::_straightness
int _straightness
Definition: PhiMemoryImage.h:68
PhiMemoryImage::set_straightness
void set_straightness(int s)
Definition: PhiMemoryImage.h:35
alignCSCRings.s
s
Definition: alignCSCRings.py:92
PhiMemoryImage::check_input
void check_input(unsigned int layer, unsigned int bit) const
Definition: PhiMemoryImage.cc:71
PhiMemoryImage::test_bit
bool test_bit(unsigned int layer, unsigned int bit) const
Definition: PhiMemoryImage.cc:54
PhiMemoryImage::reset
void reset()
Definition: PhiMemoryImage.cc:34
trackingPlots.other
other
Definition: trackingPlots.py:1467
PhiMemoryImage::~PhiMemoryImage
~PhiMemoryImage()
Definition: PhiMemoryImage.cc:12
PhiMemoryImage::clear_bit
void clear_bit(unsigned int layer, unsigned int bit)
Definition: PhiMemoryImage.cc:47
PhiMemoryImage::get_word
value_type get_word(unsigned int layer, unsigned int unit) const
Definition: PhiMemoryImage.cc:66
value
Definition: value.py:1
PhiMemoryImage::operator=
PhiMemoryImage & operator=(PhiMemoryImage other)
Definition: PhiMemoryImage.cc:23
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
PhiMemoryImage
Definition: PhiMemoryImage.h:9
PhiMemoryImage::PhiMemoryImage
PhiMemoryImage()
Definition: PhiMemoryImage.cc:10
PhiMemoryImage::get_straightness
int get_straightness() const
Definition: PhiMemoryImage.h:37
PhiMemoryImage::rotl
void rotl(unsigned int n)
Definition: PhiMemoryImage.cc:88
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
PhiMemoryImage::op_and
unsigned int op_and(const PhiMemoryImage &other) const
Definition: PhiMemoryImage.cc:144
PhiMemoryImage::rotr
void rotr(unsigned int n)
Definition: PhiMemoryImage.cc:116
PhiMemoryImage::_layers
static const unsigned int _layers
Definition: PhiMemoryImage.h:59