CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
12 class RPCDCCLink {
13 public:
14  static int const wildcard_ = INT_MIN;
15 
18  static int const min_fed_ = 0;
19  static int const max_fed_ = 65534;
20  static int const min_dccinput_ = 0;
21  static int const max_dccinput_ = 36;
22  static int const min_tbinput_ = 0;
23  static int const max_tbinput_ = 18;
26 protected:
29  static int const pos_fed_ = 16;
30  static std::uint32_t const mask_fed_ = 0xffff0000;
31  static int const pos_dccinput_ = 8;
32  static std::uint32_t const mask_dccinput_ = 0x0000ff00;
33  static int const pos_tbinput_ = 0;
34  static std::uint32_t const mask_tbinput_ = 0x000000ff;
37 public:
38  RPCDCCLink();
39  RPCDCCLink(std::uint32_t const& id);
40  RPCDCCLink(int fed, int dccinput, int tbinput = wildcard_);
41 
42  std::uint32_t getId() const;
43  operator std::uint32_t() const;
44  std::uint32_t getMask() const;
45 
46  bool matches(RPCDCCLink const& rhs) const;
47 
48  void setId(std::uint32_t const& id);
49  void reset();
50 
53  int getFED() const;
54  int getDCCInput() const;
55  int getTBInput() const;
62  RPCDCCLink& setFED(int fed = wildcard_);
63  RPCDCCLink& setDCCInput(int dccinput = wildcard_);
64  RPCDCCLink& setTBInput(int tbinput = wildcard_);
67  std::string getName() const;
68 
69  bool operator<(RPCDCCLink const& rhs) const;
70  bool operator==(RPCDCCLink const& rhs) const;
71  bool operator!=(RPCDCCLink const& rhs) const;
72  bool operator<(std::uint32_t const& rhs) const;
73  bool operator==(std::uint32_t const& rhs) const;
74  bool operator!=(std::uint32_t const& rhs) const;
75 
80 
81 protected:
82  int bf_get(int const min, std::uint32_t const mask, int const pos) const;
83  RPCDCCLink& bf_set(int const min, int const max, std::uint32_t const mask, int const pos, int const value);
84  std::ostream& bf_stream(std::ostream& ostream, int const min, std::uint32_t const mask, int const pos) const;
85 
86 protected:
87  std::uint32_t id_;
88 
90 };
91 
92 std::ostream& operator<<(std::ostream& ostream, RPCDCCLink const& link);
93 
94 #include "CondFormats/RPCObjects/interface/RPCDCCLink.icc"
95 
96 #endif // CondFormats_RPCObjects_RPCDCCLink_h
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
T min(T a, T b)
Definition: MathUtil.h:58
#define COND_SERIALIZABLE
Definition: Serializable.h:39