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 
25  public:
26 
28 
30  int hubaddress, int portaddress, int rocid,
31  int fednumber, int fedchannel, int fedrocnumber);
32 
33 
34  unsigned int fecnumber() const { return fecnumber_; }
35  unsigned int mfec() const { return mfec_; }
36  unsigned int mfecchannel() const { return mfecchannel_; }
37  unsigned int hubaddress() const { return hubaddress_; }
38  unsigned int portaddress() const { return portaddress_; }
39  unsigned int rocid() const { return rocid_; }
40  unsigned int fednumber() const { return fednumber_; }
41  unsigned int fedchannel() const { return fedchannel_; }
42  unsigned int fedrocnumber() const { return fedrocnumber_; }
43 
44 
45  friend std::ostream& pos::operator<<(std::ostream& s, const PixelHdwAddress& pixelroc);
46 
47 
48  const PixelHdwAddress& operator=(const PixelHdwAddress& aROC);
49 
50  bool operator()(const PixelHdwAddress& roc1, const PixelHdwAddress& roc2) const;
51 
52  // Checks for equality of all parts except the ROC numbers and portaddress.
53  const bool operator|=(const PixelHdwAddress& aHdwAddress) const{
54  return ( fecnumber_ == aHdwAddress.fecnumber_ &&
55  mfec_ == aHdwAddress.mfec_ &&
56  mfecchannel_ == aHdwAddress.mfecchannel_ &&
57  hubaddress_ == aHdwAddress.hubaddress_ &&
58  fednumber_ == aHdwAddress.fednumber_ &&
59  fedchannel_ == aHdwAddress.fedchannel_ );
60  }
61 
62  const bool operator<(const PixelHdwAddress& aHdwAddress) const{
63  if (fednumber_ < aHdwAddress.fednumber_ ) return true;
64  if (fednumber_ > aHdwAddress.fednumber_ ) return false;
65  if (fedchannel_ < aHdwAddress.fedchannel_ ) return true;
66  if (fedchannel_ > aHdwAddress.fedchannel_ ) 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 
75 
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  };
88 
89 }
90 #endif
unsigned int mfec() const
unsigned int hubaddress_
unsigned int portaddress() const
unsigned int fedrocnumber() const
unsigned int fednumber() const
bool operator()(const PixelHdwAddress &roc1, const PixelHdwAddress &roc2) const
unsigned int rocid() const
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
unsigned int fednumber_
const bool operator<(const PixelHdwAddress &aHdwAddress) const
unsigned int mfecchannel() const
const PixelHdwAddress & operator=(const PixelHdwAddress &aROC)
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel() const
unsigned int hubaddress() const
void setAddress(std::string what, int value)
Store mfec, mfecchannel etc.
Definition: value.py:1
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int fecnumber() const
void compare(std::string what, bool &changed, unsigned int newValue, unsigned int &oldValue)
const bool operator|=(const PixelHdwAddress &aHdwAddress) const
unsigned int fedrocnumber_