CMS 3D CMS Logo

PixelHdwAddress.h
Go to the documentation of this file.
1 #ifndef PixelHdwAddress_h
2 #define PixelHdwAddress_h
3 
10 #include <iosfwd>
11 #include <string>
12 
13 namespace pos {
19  class PixelHdwAddress;
20 
21  std::ostream& operator<<(std::ostream& s, const PixelHdwAddress& pixelroc);
22 
24  public:
26 
28  int mfec,
29  int mfecchannel,
30  int hubaddress,
31  int portaddress,
32  int rocid,
33  int fednumber,
34  int fedchannel,
35  int fedrocnumber);
36 
37  unsigned int fecnumber() const { return fecnumber_; }
38  unsigned int mfec() const { return mfec_; }
39  unsigned int mfecchannel() const { return mfecchannel_; }
40  unsigned int hubaddress() const { return hubaddress_; }
41  unsigned int portaddress() const { return portaddress_; }
42  unsigned int rocid() const { return rocid_; }
43  unsigned int fednumber() const { return fednumber_; }
44  unsigned int fedchannel() const { return fedchannel_; }
45  unsigned int fedrocnumber() const { return fedrocnumber_; }
46 
47  friend std::ostream& pos::operator<<(std::ostream& s, const PixelHdwAddress& pixelroc);
48 
49  bool operator()(const PixelHdwAddress& roc1, const PixelHdwAddress& roc2) const;
50 
51  // Checks for equality of all parts except the ROC numbers and portaddress.
52  const bool operator|=(const PixelHdwAddress& aHdwAddress) const {
53  return (fecnumber_ == aHdwAddress.fecnumber_ && mfec_ == aHdwAddress.mfec_ &&
54  mfecchannel_ == aHdwAddress.mfecchannel_ && hubaddress_ == aHdwAddress.hubaddress_ &&
55  fednumber_ == aHdwAddress.fednumber_ && fedchannel_ == aHdwAddress.fedchannel_);
56  }
57 
58  const bool operator<(const PixelHdwAddress& aHdwAddress) const {
59  if (fednumber_ < aHdwAddress.fednumber_)
60  return true;
61  if (fednumber_ > aHdwAddress.fednumber_)
62  return false;
63  if (fedchannel_ < aHdwAddress.fedchannel_)
64  return true;
65  if (fedchannel_ > aHdwAddress.fedchannel_)
66  return false;
67  return (fedrocnumber_ < aHdwAddress.fedrocnumber_);
68  }
69 
70  void setAddress(std::string what, int value); // Added by Dario
71  void compare(std::string what, bool& changed, unsigned int newValue, unsigned int& oldValue); // Added by Dario
72 
73  private:
74  unsigned int fecnumber_;
75  unsigned int mfec_;
76  unsigned int mfecchannel_;
77  unsigned int portaddress_;
78  unsigned int hubaddress_;
79  unsigned int rocid_;
80  unsigned int fednumber_;
81  unsigned int fedchannel_;
82  unsigned int fedrocnumber_;
83  };
84 
85 } // namespace pos
86 #endif
unsigned int hubaddress_
unsigned int mfec() const
bool operator()(const PixelHdwAddress &roc1, const PixelHdwAddress &roc2) const
unsigned int fedchannel() const
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
unsigned int fednumber_
unsigned int portaddress() const
unsigned int mfecchannel_
unsigned int fedrocnumber() const
unsigned int portaddress_
void setAddress(std::string what, int value)
Store mfec, mfecchannel etc.
unsigned int mfecchannel() const
Definition: value.py:1
unsigned int rocid() const
unsigned int fecnumber() const
const bool operator|=(const PixelHdwAddress &aHdwAddress) const
unsigned int fedchannel_
unsigned int fecnumber_
const bool operator<(const PixelHdwAddress &aHdwAddress) const
void compare(std::string what, bool &changed, unsigned int newValue, unsigned int &oldValue)
unsigned int hubaddress() const
unsigned int fedrocnumber_
unsigned int fednumber() const