CMS 3D CMS Logo

RPCLBLink.h
Go to the documentation of this file.
1 #ifndef CondFormats_RPCObjects_RPCLBLink_h
2 #define CondFormats_RPCObjects_RPCLBLink_h
3 
4 #include <cstdint>
5 #include <string>
6 #include <iosfwd>
7 #include <climits>
8 
10 
12 class RPCLBLink
13 {
14 public:
15  static int const wildcard_ = INT_MIN;
16 
19  static int const min_region_ = 0;
20  static int const max_region_ = 1;
21  static int const min_yoke_ = -5;
22  static int const max_yoke_ = 5;
23  static int const min_sector_ = 1;
24  static int const max_sector_ = 12;
25  static int const min_side_ = 0;
26  static int const max_side_ = 2;
27  static int const min_wheelordisk_ = 0;
28  static int const max_wheelordisk_ = 4;
29  static int const min_fibre_ = 0;
30  static int const max_fibre_ = 7;
31  static int const min_radial_ = 0;
32  static int const max_radial_ = 1;
33  static int const min_linkboard_ = 0;
34  static int const max_linkboard_ = 2;
35  static int const min_connector_ = 0;
36  static int const max_connector_ = 5;
39 protected:
42  static int const pos_region_ = 24;
43  static std::uint32_t const mask_region_ = 0x03000000;
44  static int const pos_yoke_ = 20;
45  static std::uint32_t const mask_yoke_ = 0x00f00000;
46  static int const pos_sector_ = 16;
47  static std::uint32_t const mask_sector_ = 0x000f0000;
48  static int const pos_side_ = 14;
49  static std::uint32_t const mask_side_ = 0x0000c000;
50  static int const pos_wheelordisk_ = 11;
51  static std::uint32_t const mask_wheelordisk_ = 0x00003800;
52  static int const pos_fibre_ = 7;
53  static std::uint32_t const mask_fibre_ = 0x00000780;
54  static int const pos_radial_ = 5;
55  static std::uint32_t const mask_radial_ = 0x00000060;
56  static int const pos_linkboard_ = 3;
57  static std::uint32_t const mask_linkboard_ = 0x00000018;
58  static int const pos_connector_ = 0;
59  static std::uint32_t const mask_connector_ = 0x00000007;
62 public:
63  RPCLBLink();
64  RPCLBLink(std::uint32_t const & id);
65  RPCLBLink(int region
66  , int yoke
67  , int sector = wildcard_
68  , int side = wildcard_
69  , int wheelordisk = wildcard_
70  , int fibre = wildcard_
71  , int radial = wildcard_
72  , int linkboard = wildcard_
73  , int connector = wildcard_);
74 
75  std::uint32_t getId() const;
76  operator std::uint32_t() const;
77  std::uint32_t getMask() const;
78 
79  bool matches(RPCLBLink const & rhs) const;
80 
81  void setId(std::uint32_t const & id);
82  void reset();
83 
86  int getRegion() const;
87  int getYoke() const;
88  int getSector() const;
89  int getSide() const;
90  int getWheelOrDisk() const;
91  int getFibre() const;
92  int getRadial() const;
93  int getLinkBoard() const;
94  int getConnector() const;
101  RPCLBLink & setRegion(int region = wildcard_);
102  RPCLBLink & setYoke(int yoke = wildcard_);
103  RPCLBLink & setSector(int sector = wildcard_);
104  RPCLBLink & setSide(int side = wildcard_);
105  RPCLBLink & setWheelOrDisk(int wheelordisk = wildcard_);
106  RPCLBLink & setFibre(int fibre = wildcard_);
107  RPCLBLink & setRadial(int radial = wildcard_);
108  RPCLBLink & setLinkBoard(int linkboard = wildcard_);
109  RPCLBLink & setConnector(int connector = wildcard_);
112  std::string getName() const;
113 
114  bool operator<(RPCLBLink const & rhs) const;
115  bool operator==(RPCLBLink const & rhs) const;
116  bool operator!=(RPCLBLink const & rhs) const;
117  bool operator<(std::uint32_t const & rhs) const;
118  bool operator==(std::uint32_t const & rhs) const;
119  bool operator!=(std::uint32_t const & rhs) const;
120 
121  RPCLBLink & operator++();
122  RPCLBLink operator++(int);
123  RPCLBLink & operator--();
124  RPCLBLink operator--(int);
125 
126 protected:
127  int bf_get(int const min, std::uint32_t const mask, int const pos) const;
128  RPCLBLink & bf_set(int const min, int const max, std::uint32_t const mask, int const pos, int const value);
129  std::ostream & bf_stream(std::ostream & ostream, int const min, std::uint32_t const mask, int const pos) const;
130 
131 protected:
132  std::uint32_t id_;
133 
135 };
136 
137 std::ostream & operator<<(std::ostream & ostream, RPCLBLink const & link);
138 
139 #include "CondFormats/RPCObjects/interface/RPCLBLink.icc"
140 
141 #endif // CondFormats_RPCObjects_RPCLBLink_h
Definition: value.py:1
T min(T a, T b)
Definition: MathUtil.h:58
#define COND_SERIALIZABLE
Definition: Serializable.h:38