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
pos::PixelHdwAddress::compare
void compare(std::string what, bool &changed, unsigned int newValue, unsigned int &oldValue)
Definition: PixelHdwAddress.cc:109
pos::PixelHdwAddress::mfec_
unsigned int mfec_
Definition: PixelHdwAddress.h:77
pos::PixelHdwAddress::fedchannel_
unsigned int fedchannel_
Definition: PixelHdwAddress.h:83
pos::PixelHdwAddress::fednumber
unsigned int fednumber() const
Definition: PixelHdwAddress.h:43
pos
Definition: PixelAliasList.h:18
pos::PixelHdwAddress::hubaddress
unsigned int hubaddress() const
Definition: PixelHdwAddress.h:40
pos::PixelHdwAddress::operator|=
const bool operator|=(const PixelHdwAddress &aHdwAddress) const
Definition: PixelHdwAddress.h:54
pos::PixelHdwAddress::mfecchannel
unsigned int mfecchannel() const
Definition: PixelHdwAddress.h:39
pos::PixelHdwAddress::operator<
const bool operator<(const PixelHdwAddress &aHdwAddress) const
Definition: PixelHdwAddress.h:60
pos::PixelHdwAddress::rocid
unsigned int rocid() const
Definition: PixelHdwAddress.h:42
alignCSCRings.s
s
Definition: alignCSCRings.py:92
pos::PixelHdwAddress::fecnumber
unsigned int fecnumber() const
Definition: PixelHdwAddress.h:37
pos::PixelHdwAddress::fedrocnumber_
unsigned int fedrocnumber_
Definition: PixelHdwAddress.h:84
pos::PixelHdwAddress::PixelHdwAddress
PixelHdwAddress()
Definition: PixelHdwAddress.cc:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pos::PixelHdwAddress::portaddress
unsigned int portaddress() const
Definition: PixelHdwAddress.h:41
pos::PixelHdwAddress::fedchannel
unsigned int fedchannel() const
Definition: PixelHdwAddress.h:44
pos::PixelHdwAddress::fecnumber_
unsigned int fecnumber_
Definition: PixelHdwAddress.h:76
pos::PixelHdwAddress::rocid_
unsigned int rocid_
Definition: PixelHdwAddress.h:81
pos::operator<<
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
Definition: PixelCalibConfiguration.cc:1325
value
Definition: value.py:1
pos::PixelHdwAddress
Store mfec, mfecchannel etc.
Definition: PixelHdwAddress.h:23
pos::PixelHdwAddress::fednumber_
unsigned int fednumber_
Definition: PixelHdwAddress.h:82
pos::PixelHdwAddress::fedrocnumber
unsigned int fedrocnumber() const
Definition: PixelHdwAddress.h:45
pos::PixelHdwAddress::operator=
const PixelHdwAddress & operator=(const PixelHdwAddress &aROC)
Definition: PixelHdwAddress.cc:66
pos::PixelHdwAddress::portaddress_
unsigned int portaddress_
Definition: PixelHdwAddress.h:79
pos::PixelHdwAddress::hubaddress_
unsigned int hubaddress_
Definition: PixelHdwAddress.h:80
pos::PixelHdwAddress::setAddress
void setAddress(std::string what, int value)
Definition: PixelHdwAddress.cc:82
pos::PixelHdwAddress::mfecchannel_
unsigned int mfecchannel_
Definition: PixelHdwAddress.h:78
pos::PixelHdwAddress::operator()
bool operator()(const PixelHdwAddress &roc1, const PixelHdwAddress &roc2) const
Definition: PixelHdwAddress.cc:176
pos::PixelHdwAddress::mfec
unsigned int mfec() const
Definition: PixelHdwAddress.h:38