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 <stdint.h>
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 ::uint32_t const mask_region_ = 0x03000000;
44  static int const pos_yoke_ = 20;
45  static ::uint32_t const mask_yoke_ = 0x00f00000;
46  static int const pos_sector_ = 16;
47  static ::uint32_t const mask_sector_ = 0x000f0000;
48  static int const pos_side_ = 14;
49  static ::uint32_t const mask_side_ = 0x0000c000;
50  static int const pos_wheelordisk_ = 11;
51  static ::uint32_t const mask_wheelordisk_ = 0x00003800;
52  static int const pos_fibre_ = 7;
53  static ::uint32_t const mask_fibre_ = 0x00000780;
54  static int const pos_radial_ = 5;
55  static ::uint32_t const mask_radial_ = 0x00000060;
56  static int const pos_linkboard_ = 3;
57  static ::uint32_t const mask_linkboard_ = 0x00000018;
58  static int const pos_connector_ = 0;
59  static ::uint32_t const mask_connector_ = 0x00000007;
62 public:
63  RPCLBLink();
64  RPCLBLink(::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  ::uint32_t getId() const;
76  operator ::uint32_t() const;
77  ::uint32_t getMask() const;
78 
79  bool matches(RPCLBLink const & _rhs) const;
80 
81  void setId(::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<(::uint32_t const & _rhs) const;
118  bool operator==(::uint32_t const & _rhs) const;
119  bool operator!=(::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, ::uint32_t const _mask, int const _pos) const;
128  RPCLBLink & bf_set(int const _min, int const _max, ::uint32_t const _mask, int const _pos, int const _value);
129  std::ostream & bf_stream(std::ostream & _ostream, int const _min, ::uint32_t const _mask, int const _pos) const;
130 
131 protected:
132  ::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
#define COND_SERIALIZABLE
Definition: Serializable.h:38