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 PixelHdwAddressoperator= (const PixelHdwAddress &aROC)
 
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) {}

◆ 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 }

Member Function Documentation

◆ compare()

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

Definition at line 109 of file PixelHdwAddress.cc.

109  {
110  std::string mthn = "[PixelHdwAddress::compare()]\t\t\t ";
111  changed = false;
112  oldValue = 0;
113 
114  if (what == "fecnumber") {
115  if (fecnumber_ != newValue) {
116  changed = true;
117  oldValue = fecnumber_;
118  return;
119  }
120  } else if (what == "mfec") {
121  if (mfec_ != newValue) {
122  changed = true;
123  oldValue = mfec_;
124  return;
125  }
126  } else if (what == "mfecchannel") {
127  if (mfecchannel_ != newValue) {
128  changed = true;
129  oldValue = mfecchannel_;
130  return;
131  }
132  } else if (what == "portaddress") {
133  if (portaddress_ != newValue) {
134  changed = true;
135  oldValue = portaddress_;
136  return;
137  }
138  } else if (what == "hubaddress") {
139  if (hubaddress_ != newValue) {
140  changed = true;
141  oldValue = hubaddress_;
142  return;
143  }
144  } else if (what == "rocid") {
145  if (rocid_ != newValue) {
146  changed = true;
147  oldValue = rocid_;
148  return;
149  }
150  } else if (what == "fednumber") {
151  if (fednumber_ != newValue) {
152  changed = true;
153  oldValue = fednumber_;
154  return;
155  }
156  } else if (what == "fedchannel") {
157  if (fedchannel_ != newValue) {
158  changed = true;
159  oldValue = fedchannel_;
160  return;
161  }
162  } else if (what == "fedrocnumber") {
163  if (fedrocnumber_ != newValue) {
164  changed = true;
165  oldValue = fedrocnumber_;
166  return;
167  }
168  } else {
169  std::cout << __LINE__ << "]\t" << mthn << "Could not compare value for " << what << " (invalid keyword)"
170  << std::endl;
171  assert(0);
172  }
173 }

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

◆ 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.

45 { return fedrocnumber_; }

References 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 176 of file PixelHdwAddress.cc.

176  {
177  if (roc1.fednumber_ < roc2.fednumber_)
178  return true;
179  if (roc1.fednumber_ > roc2.fednumber_)
180  return false;
181  if (roc1.fedchannel_ < roc2.fedchannel_)
182  return true;
183  if (roc1.fedchannel_ > roc2.fedchannel_)
184  return false;
185 
186  return (roc1.fedrocnumber_ < roc2.fedrocnumber_);
187 }

References fedchannel_, fednumber_, and fedrocnumber_.

◆ operator<()

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

Definition at line 60 of file PixelHdwAddress.h.

60  {
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  }

References fedchannel_, fednumber_, and fedrocnumber_.

◆ operator=()

const PixelHdwAddress & PixelHdwAddress::operator= ( const PixelHdwAddress aROC)

Definition at line 66 of file PixelHdwAddress.cc.

66  {
67  fecnumber_ = aROC.fecnumber_;
68  mfec_ = aROC.mfec_;
71  hubaddress_ = aROC.hubaddress_;
72  rocid_ = aROC.rocid_;
73  fednumber_ = aROC.fednumber_;
74  fedchannel_ = aROC.fedchannel_;
76 
77  return *this;
78 }

References fecnumber_, fedchannel_, fednumber_, fedrocnumber_, hubaddress_, mfec_, mfecchannel_, portaddress_, and rocid_.

◆ operator|=()

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

Definition at line 54 of file PixelHdwAddress.h.

54  {
55  return (fecnumber_ == aHdwAddress.fecnumber_ && mfec_ == aHdwAddress.mfec_ &&
56  mfecchannel_ == aHdwAddress.mfecchannel_ && hubaddress_ == aHdwAddress.hubaddress_ &&
57  fednumber_ == aHdwAddress.fednumber_ && fedchannel_ == aHdwAddress.fedchannel_);
58  }

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

◆ 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 82 of file PixelHdwAddress.cc.

82  {
83  std::string mthn = "[PixelHdwAddress::setAddress()]\t\t\t ";
84  if (what == "fecnumber") {
85  fecnumber_ = value;
86  } else if (what == "mfec") {
87  mfec_ = value;
88  } else if (what == "mfecchannel") {
90  } else if (what == "portaddress") {
92  } else if (what == "hubaddress") {
94  } else if (what == "rocid") {
95  rocid_ = value;
96  } else if (what == "fednumber") {
97  fednumber_ = value;
98  } else if (what == "fedchannel") {
100  } else if (what == "fedrocnumber") {
102  } else {
103  std::cout << __LINE__ << "]\t" << mthn << "Could not set a value for " << what << " (invalid keyword)" << std::endl;
104  assert(0);
105  }
106 }

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

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 76 of file PixelHdwAddress.h.

Referenced by compare(), fecnumber(), pos::operator<<(), 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

◆ mfec_

unsigned int pos::PixelHdwAddress::mfec_
private

Definition at line 77 of file PixelHdwAddress.h.

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

◆ mfecchannel_

unsigned int pos::PixelHdwAddress::mfecchannel_
private

◆ portaddress_

unsigned int pos::PixelHdwAddress::portaddress_
private

Definition at line 79 of file PixelHdwAddress.h.

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

◆ rocid_

unsigned int pos::PixelHdwAddress::rocid_
private

Definition at line 81 of file PixelHdwAddress.h.

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

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
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::cuda::assert
assert(be >=bs)
pos::PixelHdwAddress::hubaddress
unsigned int hubaddress() const
Definition: PixelHdwAddress.h:40
pos::PixelHdwAddress::mfecchannel
unsigned int mfecchannel() const
Definition: PixelHdwAddress.h:39
pos::PixelHdwAddress::rocid
unsigned int rocid() const
Definition: PixelHdwAddress.h:42
pos::PixelHdwAddress::fecnumber
unsigned int fecnumber() const
Definition: PixelHdwAddress.h:37
pos::PixelHdwAddress::fedrocnumber_
unsigned int fedrocnumber_
Definition: PixelHdwAddress.h:84
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::PixelHdwAddress::fednumber_
unsigned int fednumber_
Definition: PixelHdwAddress.h:82
pos::PixelHdwAddress::fedrocnumber
unsigned int fedrocnumber() const
Definition: PixelHdwAddress.h:45
pos::PixelHdwAddress::portaddress_
unsigned int portaddress_
Definition: PixelHdwAddress.h:79
pos::PixelHdwAddress::hubaddress_
unsigned int hubaddress_
Definition: PixelHdwAddress.h:80
relativeConstraints.value
value
Definition: relativeConstraints.py:53
pos::PixelHdwAddress::mfecchannel_
unsigned int mfecchannel_
Definition: PixelHdwAddress.h:78
pos::PixelHdwAddress::mfec
unsigned int mfec() const
Definition: PixelHdwAddress.h:38