CMS 3D CMS Logo

RPCDCCLink.h
Go to the documentation of this file.
1 #ifndef CondFormats_RPCObjects_RPCDCCLink_h
2 #define CondFormats_RPCObjects_RPCDCCLink_h
3 
4 #include <cstdint>
5 #include <string>
6 #include <iosfwd>
7 #include <climits>
8 
10 
13 {
14 public:
15  static int const wildcard_ = INT_MIN;
16 
19  static int const min_fed_ = 0;
20  static int const max_fed_ = 65534;
21  static int const min_dccinput_ = 0;
22  static int const max_dccinput_ = 36;
23  static int const min_tbinput_ = 0;
24  static int const max_tbinput_ = 18;
27 protected:
30  static int const pos_fed_ = 16;
31  static std::uint32_t const mask_fed_ = 0xffff0000;
32  static int const pos_dccinput_ = 8;
33  static std::uint32_t const mask_dccinput_ = 0x0000ff00;
34  static int const pos_tbinput_ = 0;
35  static std::uint32_t const mask_tbinput_ = 0x000000ff;
38 public:
39  RPCDCCLink();
40  RPCDCCLink(std::uint32_t const & id);
41  RPCDCCLink(int fed
42  , int dccinput
43  , int tbinput = wildcard_);
44 
45  std::uint32_t getId() const;
46  operator std::uint32_t() const;
47  std::uint32_t getMask() const;
48 
49  bool matches(RPCDCCLink const & rhs) const;
50 
51  void setId(std::uint32_t const & id);
52  void reset();
53 
56  int getFED() const;
57  int getDCCInput() const;
58  int getTBInput() const;
65  RPCDCCLink & setFED(int fed = wildcard_);
66  RPCDCCLink & setDCCInput(int dccinput = wildcard_);
67  RPCDCCLink & setTBInput(int tbinput = wildcard_);
70  std::string getName() const;
71 
72  bool operator<(RPCDCCLink const & rhs) const;
73  bool operator==(RPCDCCLink const & rhs) const;
74  bool operator!=(RPCDCCLink const & rhs) const;
75  bool operator<(std::uint32_t const & rhs) const;
76  bool operator==(std::uint32_t const & rhs) const;
77  bool operator!=(std::uint32_t const & rhs) const;
78 
83 
84 protected:
85  int bf_get(int const min, std::uint32_t const mask, int const pos) const;
86  RPCDCCLink & bf_set(int const min, int const max, std::uint32_t const mask, int const pos, int const value);
87  std::ostream & bf_stream(std::ostream & ostream, int const min, std::uint32_t const mask, int const pos) const;
88 
89 protected:
90  std::uint32_t id_;
91 
93 };
94 
95 std::ostream & operator<<(std::ostream & ostream, RPCDCCLink const & link);
96 
97 #include "CondFormats/RPCObjects/interface/RPCDCCLink.icc"
98 
99 #endif // CondFormats_RPCObjects_RPCDCCLink_h
Definition: value.py:1
T min(T a, T b)
Definition: MathUtil.h:58
#define COND_SERIALIZABLE
Definition: Serializable.h:38