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  const PixelHdwAddress& operator=(const PixelHdwAddress& aROC);
50 
51  bool operator()(const PixelHdwAddress& roc1, const PixelHdwAddress& roc2) const;
52 
53  // Checks for equality of all parts except the ROC numbers and portaddress.
54  const bool operator|=(const PixelHdwAddress& aHdwAddress) const {
55  return (fecnumber_ == aHdwAddress.fecnumber_ && mfec_ == aHdwAddress.mfec_ &&
56  mfecchannel_ == aHdwAddress.mfecchannel_ && hubaddress_ == aHdwAddress.hubaddress_ &&
57  fednumber_ == aHdwAddress.fednumber_ && fedchannel_ == aHdwAddress.fedchannel_);
58  }
59 
60  const bool operator<(const PixelHdwAddress& aHdwAddress) const {
61  if (fednumber_ < aHdwAddress.fednumber_)
62  return true;
63  if (fednumber_ > aHdwAddress.fednumber_)
64  return false;
65  if (fedchannel_ < aHdwAddress.fedchannel_)
66  return true;
67  if (fedchannel_ > aHdwAddress.fedchannel_)
68  return false;
69  return (fedrocnumber_ < aHdwAddress.fedrocnumber_);
70  }
71 
72  void setAddress(std::string what, int value); // Added by Dario
73  void compare(std::string what, bool& changed, unsigned int newValue, unsigned int& oldValue); // Added by Dario
74 
75  private:
76  unsigned int fecnumber_;
77  unsigned int mfec_;
78  unsigned int mfecchannel_;
79  unsigned int portaddress_;
80  unsigned int hubaddress_;
81  unsigned int rocid_;
82  unsigned int fednumber_;
83  unsigned int fedchannel_;
84  unsigned int fedrocnumber_;
85  };
86 
87 } // namespace pos
88 #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
const PixelHdwAddress & operator=(const PixelHdwAddress &aROC)
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