CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
pos::PixelHdwAddress Class Reference

Store mfec, mfecchannel etc. More...

#include "interface/PixelHdwAddress.h"

Public Member Functions

void compare (std::string what, bool &changed, unsigned int newValue, unsigned int &oldValue)
 
unsigned int fecnumber () const
 
unsigned int fedchannel () const
 
unsigned int fednumber () const
 
unsigned int fedrocnumber () const
 
unsigned int hubaddress () const
 
unsigned int mfec () const
 
unsigned int mfecchannel () const
 
bool operator() (const PixelHdwAddress &roc1, const PixelHdwAddress &roc2) const
 
const bool operator< (const PixelHdwAddress &aHdwAddress) const
 
const bool operator|= (const PixelHdwAddress &aHdwAddress) const
 
 PixelHdwAddress ()
 
 PixelHdwAddress (int fecnumber, int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int fednumber, int fedchannel, int fedrocnumber)
 
unsigned int portaddress () const
 
unsigned int rocid () const
 
void setAddress (std::string what, int value)
 

Private Attributes

unsigned int fecnumber_
 
unsigned int fedchannel_
 
unsigned int fednumber_
 
unsigned int fedrocnumber_
 
unsigned int hubaddress_
 
unsigned int mfec_
 
unsigned int mfecchannel_
 
unsigned int portaddress_
 
unsigned int rocid_
 

Friends

std::ostream & pos::operator<< (std::ostream &s, const PixelHdwAddress &pixelroc)
 

Detailed Description

Store mfec, mfecchannel etc.

A longer explanation will be placed here later

Definition at line 23 of file PixelHdwAddress.h.

Constructor & Destructor Documentation

◆ PixelHdwAddress() [1/2]

PixelHdwAddress::PixelHdwAddress ( )

Definition at line 16 of file PixelHdwAddress.cc.

17  : mfec_(0),
18  mfecchannel_(0),
19  portaddress_(0),
20  hubaddress_(0),
21  rocid_(0),
22  fednumber_(0),
23  fedchannel_(0),
24  fedrocnumber_(0) {}
unsigned int hubaddress_
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel_
unsigned int fedrocnumber_

◆ PixelHdwAddress() [2/2]

PixelHdwAddress::PixelHdwAddress ( int  fecnumber,
int  mfec,
int  mfecchannel,
int  hubaddress,
int  portaddress,
int  rocid,
int  fednumber,
int  fedchannel,
int  fedrocnumber 
)

Definition at line 27 of file PixelHdwAddress.cc.

37  mfec_(mfec),
41  rocid_(rocid),
45  //std::cout << "Created PixelHdwAddress:"<<std::endl;
46  //std::cout << *this << std::endl;
47 }
unsigned int hubaddress_
unsigned int mfec() const
unsigned int fedchannel() const
unsigned int fednumber_
unsigned int portaddress() const
unsigned int mfecchannel_
unsigned int fedrocnumber() const
unsigned int portaddress_
unsigned int mfecchannel() const
unsigned int rocid() const
unsigned int fecnumber() const
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int hubaddress() const
unsigned int fedrocnumber_
unsigned int fednumber() const

Member Function Documentation

◆ compare()

void PixelHdwAddress::compare ( std::string  what,
bool &  changed,
unsigned int  newValue,
unsigned int &  oldValue 
)

Definition at line 94 of file PixelHdwAddress.cc.

References cms::cuda::assert(), gather_cfg::cout, fecnumber_, fedchannel_, fednumber_, fedrocnumber_, hubaddress_, mfec_, mfecchannel_, portaddress_, rocid_, and AlCaHLTBitMon_QueryRunRegistry::string.

94  {
95  std::string mthn = "[PixelHdwAddress::compare()]\t\t\t ";
96  changed = false;
97  oldValue = 0;
98 
99  if (what == "fecnumber") {
100  if (fecnumber_ != newValue) {
101  changed = true;
102  oldValue = fecnumber_;
103  return;
104  }
105  } else if (what == "mfec") {
106  if (mfec_ != newValue) {
107  changed = true;
108  oldValue = mfec_;
109  return;
110  }
111  } else if (what == "mfecchannel") {
112  if (mfecchannel_ != newValue) {
113  changed = true;
114  oldValue = mfecchannel_;
115  return;
116  }
117  } else if (what == "portaddress") {
118  if (portaddress_ != newValue) {
119  changed = true;
120  oldValue = portaddress_;
121  return;
122  }
123  } else if (what == "hubaddress") {
124  if (hubaddress_ != newValue) {
125  changed = true;
126  oldValue = hubaddress_;
127  return;
128  }
129  } else if (what == "rocid") {
130  if (rocid_ != newValue) {
131  changed = true;
132  oldValue = rocid_;
133  return;
134  }
135  } else if (what == "fednumber") {
136  if (fednumber_ != newValue) {
137  changed = true;
138  oldValue = fednumber_;
139  return;
140  }
141  } else if (what == "fedchannel") {
142  if (fedchannel_ != newValue) {
143  changed = true;
144  oldValue = fedchannel_;
145  return;
146  }
147  } else if (what == "fedrocnumber") {
148  if (fedrocnumber_ != newValue) {
149  changed = true;
150  oldValue = fedrocnumber_;
151  return;
152  }
153  } else {
154  std::cout << __LINE__ << "]\t" << mthn << "Could not compare value for " << what << " (invalid keyword)"
155  << std::endl;
156  assert(0);
157  }
158 }
unsigned int hubaddress_
assert(be >=bs)
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int fedrocnumber_

◆ fecnumber()

unsigned int pos::PixelHdwAddress::fecnumber ( ) const
inline

◆ fedchannel()

unsigned int pos::PixelHdwAddress::fedchannel ( ) const
inline

◆ fednumber()

unsigned int pos::PixelHdwAddress::fednumber ( ) const
inline

◆ fedrocnumber()

unsigned int pos::PixelHdwAddress::fedrocnumber ( ) const
inline

Definition at line 45 of file PixelHdwAddress.h.

References fedrocnumber_.

45 { return fedrocnumber_; }
unsigned int fedrocnumber_

◆ hubaddress()

unsigned int pos::PixelHdwAddress::hubaddress ( ) const
inline

◆ mfec()

unsigned int pos::PixelHdwAddress::mfec ( ) const
inline

◆ mfecchannel()

unsigned int pos::PixelHdwAddress::mfecchannel ( ) const
inline

◆ operator()()

bool PixelHdwAddress::operator() ( const PixelHdwAddress roc1,
const PixelHdwAddress roc2 
) const

Definition at line 161 of file PixelHdwAddress.cc.

References fedchannel_, fednumber_, and fedrocnumber_.

161  {
162  if (roc1.fednumber_ < roc2.fednumber_)
163  return true;
164  if (roc1.fednumber_ > roc2.fednumber_)
165  return false;
166  if (roc1.fedchannel_ < roc2.fedchannel_)
167  return true;
168  if (roc1.fedchannel_ > roc2.fedchannel_)
169  return false;
170 
171  return (roc1.fedrocnumber_ < roc2.fedrocnumber_);
172 }
unsigned int fednumber_
unsigned int fedchannel_
unsigned int fedrocnumber_

◆ operator<()

const bool pos::PixelHdwAddress::operator< ( const PixelHdwAddress aHdwAddress) const
inline

Definition at line 58 of file PixelHdwAddress.h.

References fedchannel_, fednumber_, and fedrocnumber_.

58  {
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  }
unsigned int fednumber_
unsigned int fedchannel_
unsigned int fedrocnumber_

◆ operator|=()

const bool pos::PixelHdwAddress::operator|= ( const PixelHdwAddress aHdwAddress) const
inline

Definition at line 52 of file PixelHdwAddress.h.

References fecnumber_, fedchannel_, fednumber_, hubaddress_, mfec_, and mfecchannel_.

52  {
53  return (fecnumber_ == aHdwAddress.fecnumber_ && mfec_ == aHdwAddress.mfec_ &&
54  mfecchannel_ == aHdwAddress.mfecchannel_ && hubaddress_ == aHdwAddress.hubaddress_ &&
55  fednumber_ == aHdwAddress.fednumber_ && fedchannel_ == aHdwAddress.fedchannel_);
56  }
unsigned int hubaddress_
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int fedchannel_
unsigned int fecnumber_

◆ portaddress()

unsigned int pos::PixelHdwAddress::portaddress ( ) const
inline

◆ rocid()

unsigned int pos::PixelHdwAddress::rocid ( ) const
inline

◆ setAddress()

void PixelHdwAddress::setAddress ( std::string  what,
int  value 
)

Definition at line 67 of file PixelHdwAddress.cc.

References cms::cuda::assert(), gather_cfg::cout, fecnumber_, fedchannel_, fednumber_, fedrocnumber_, hubaddress_, mfec_, mfecchannel_, portaddress_, rocid_, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

67  {
68  std::string mthn = "[PixelHdwAddress::setAddress()]\t\t\t ";
69  if (what == "fecnumber") {
70  fecnumber_ = value;
71  } else if (what == "mfec") {
72  mfec_ = value;
73  } else if (what == "mfecchannel") {
75  } else if (what == "portaddress") {
77  } else if (what == "hubaddress") {
79  } else if (what == "rocid") {
80  rocid_ = value;
81  } else if (what == "fednumber") {
82  fednumber_ = value;
83  } else if (what == "fedchannel") {
85  } else if (what == "fedrocnumber") {
87  } else {
88  std::cout << __LINE__ << "]\t" << mthn << "Could not set a value for " << what << " (invalid keyword)" << std::endl;
89  assert(0);
90  }
91 }
unsigned int hubaddress_
assert(be >=bs)
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int fedrocnumber_

Friends And Related Function Documentation

◆ pos::operator<<

std::ostream& pos::operator<< ( std::ostream &  s,
const PixelHdwAddress pixelroc 
)
friend

Member Data Documentation

◆ fecnumber_

unsigned int pos::PixelHdwAddress::fecnumber_
private

Definition at line 74 of file PixelHdwAddress.h.

Referenced by compare(), fecnumber(), pos::operator<<(), operator|=(), and setAddress().

◆ fedchannel_

unsigned int pos::PixelHdwAddress::fedchannel_
private

◆ fednumber_

unsigned int pos::PixelHdwAddress::fednumber_
private

◆ fedrocnumber_

unsigned int pos::PixelHdwAddress::fedrocnumber_
private

◆ hubaddress_

unsigned int pos::PixelHdwAddress::hubaddress_
private

Definition at line 78 of file PixelHdwAddress.h.

Referenced by compare(), hubaddress(), pos::operator<<(), operator|=(), and setAddress().

◆ mfec_

unsigned int pos::PixelHdwAddress::mfec_
private

Definition at line 75 of file PixelHdwAddress.h.

Referenced by compare(), mfec(), pos::operator<<(), operator|=(), and setAddress().

◆ mfecchannel_

unsigned int pos::PixelHdwAddress::mfecchannel_
private

Definition at line 76 of file PixelHdwAddress.h.

Referenced by compare(), mfecchannel(), pos::operator<<(), operator|=(), and setAddress().

◆ portaddress_

unsigned int pos::PixelHdwAddress::portaddress_
private

Definition at line 77 of file PixelHdwAddress.h.

Referenced by compare(), pos::operator<<(), portaddress(), and setAddress().

◆ rocid_

unsigned int pos::PixelHdwAddress::rocid_
private

Definition at line 79 of file PixelHdwAddress.h.

Referenced by compare(), pos::operator<<(), rocid(), and setAddress().