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