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::PixelHdwAddress ( )

Definition at line 16 of file PixelHdwAddress.cc.

16  :
17  mfec_(0),
18  mfecchannel_(0),
19  portaddress_(0),
20  hubaddress_(0),
21  rocid_(0),
22  fednumber_(0),
23  fedchannel_(0),
24  fedrocnumber_(0)
25 {}
unsigned int hubaddress_
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel_
unsigned int fedrocnumber_
PixelHdwAddress::PixelHdwAddress ( int  fecnumber,
int  mfec,
int  mfecchannel,
int  hubaddress,
int  portaddress,
int  rocid,
int  fednumber,
int  fedchannel,
int  fedrocnumber 
)

Definition at line 29 of file PixelHdwAddress.cc.

32  :
34  mfec_(mfec),
38  rocid_(rocid),
42 {
43  //std::cout << "Created PixelHdwAddress:"<<std::endl;
44  //std::cout << *this << std::endl;
45 }
unsigned int mfec() const
unsigned int hubaddress_
unsigned int portaddress() const
unsigned int fedrocnumber() const
unsigned int fednumber() const
unsigned int rocid() const
unsigned int fednumber_
unsigned int mfecchannel() const
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel() const
unsigned int hubaddress() const
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int fecnumber() const
unsigned int fedrocnumber_

Member Function Documentation

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

Definition at line 113 of file PixelHdwAddress.cc.

References gather_cfg::cout, funct::false, fecnumber_, fedchannel_, fednumber_, fedrocnumber_, hubaddress_, mfec_, mfecchannel_, portaddress_, mathSSE::return(), rocid_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by operator<().

114 {
115  std::string mthn = "[PixelHdwAddress::compare()]\t\t\t " ;
116  changed = false ;
117  oldValue = 0 ;
118 
119  if( what == "fecnumber" )
120  {
121  if( fecnumber_ != newValue) {changed = true; oldValue = fecnumber_; return ;}
122  } else if( what == "mfec" ) {
123  if( mfec_ != newValue) {changed = true; oldValue = mfec_; return ;}
124  } else if( what == "mfecchannel" ) {
125  if( mfecchannel_ != newValue) {changed = true; oldValue = mfecchannel_; return ;}
126  } else if( what == "portaddress" ) {
127  if( portaddress_ != newValue) {changed = true; oldValue = portaddress_; return ;}
128  } else if( what == "hubaddress" ) {
129  if( hubaddress_ != newValue) {changed = true; oldValue = hubaddress_; return ;}
130  } else if( what == "rocid" ) {
131  if( rocid_ != newValue) {changed = true; oldValue = rocid_; return ;}
132  } else if( what == "fednumber" ) {
133  if( fednumber_ != newValue) {changed = true; oldValue = fednumber_; return ;}
134  } else if( what == "fedchannel" ) {
135  if( fedchannel_ != newValue) {changed = true; oldValue = fedchannel_; return ;}
136  } else if( what == "fedrocnumber") {
137  if( fedrocnumber_ != newValue) {changed = true; oldValue = fedrocnumber_; return ;}
138  } else {
139  std::cout << __LINE__ << "]\t" << mthn << "Could not compare value for " << what
140  << " (invalid keyword)" << std::endl ;
141  assert(0) ;
142  }
143 }
unsigned int hubaddress_
unsigned int fednumber_
return((rh^lh)&mask)
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int fedrocnumber_
unsigned int pos::PixelHdwAddress::fecnumber ( ) const
inline
unsigned int pos::PixelHdwAddress::fedchannel ( ) const
inline
unsigned int pos::PixelHdwAddress::fednumber ( ) const
inline
unsigned int pos::PixelHdwAddress::fedrocnumber ( ) const
inline

Definition at line 42 of file PixelHdwAddress.h.

References fedrocnumber_, operator()(), pos::operator<<(), operator=(), and alignCSCRings::s.

42 { return fedrocnumber_; }
unsigned int fedrocnumber_
unsigned int pos::PixelHdwAddress::hubaddress ( ) const
inline
unsigned int pos::PixelHdwAddress::mfec ( ) const
inline
unsigned int pos::PixelHdwAddress::mfecchannel ( ) const
inline
bool PixelHdwAddress::operator() ( const PixelHdwAddress roc1,
const PixelHdwAddress roc2 
) const

Definition at line 146 of file PixelHdwAddress.cc.

References fedchannel_, fednumber_, and fedrocnumber_.

Referenced by fedrocnumber().

146  {
147 
148  if (roc1.fednumber_ < roc2.fednumber_ ) return true;
149  if (roc1.fednumber_ > roc2.fednumber_ ) return false;
150  if (roc1.fedchannel_ < roc2.fedchannel_) return true;
151  if (roc1.fedchannel_ > roc2.fedchannel_) return false;
152 
153  return (roc1.fedrocnumber_<roc2.fedrocnumber_);
154 
155 }
unsigned int fednumber_
unsigned int fedchannel_
unsigned int fedrocnumber_
const bool pos::PixelHdwAddress::operator< ( const PixelHdwAddress aHdwAddress) const
inline

Definition at line 62 of file PixelHdwAddress.h.

References compare(), fedchannel_, fednumber_, fedrocnumber_, setAddress(), and AlCaHLTBitMon_QueryRunRegistry::string.

62  {
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  }
unsigned int fednumber_
unsigned int fedchannel_
unsigned int fedrocnumber_
const PixelHdwAddress & PixelHdwAddress::operator= ( const PixelHdwAddress aROC)

Definition at line 65 of file PixelHdwAddress.cc.

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

Referenced by fedrocnumber().

65  {
66 
67  fecnumber_ = aROC.fecnumber_ ;
68  mfec_ = aROC.mfec_ ;
69  mfecchannel_ = aROC.mfecchannel_ ;
70  portaddress_ = aROC.portaddress_ ;
71  hubaddress_ = aROC.hubaddress_ ;
72  rocid_ = aROC.rocid_ ;
73  fednumber_ = aROC.fednumber_ ;
74  fedchannel_ = aROC.fedchannel_ ;
76 
77  return *this;
78 
79 }
unsigned int hubaddress_
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int fedrocnumber_
const bool pos::PixelHdwAddress::operator|= ( const PixelHdwAddress aHdwAddress) const
inline

Definition at line 53 of file PixelHdwAddress.h.

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

53  {
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  }
unsigned int hubaddress_
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int pos::PixelHdwAddress::portaddress ( ) const
inline
unsigned int pos::PixelHdwAddress::rocid ( ) const
inline
void PixelHdwAddress::setAddress ( std::string  what,
int  value 
)

Definition at line 83 of file PixelHdwAddress.cc.

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

Referenced by operator<().

84 {
85  std::string mthn = "[PixelHdwAddress::setAddress()]\t\t\t " ;
86  if( what == "fecnumber" )
87  {
88  fecnumber_ = value;
89  } else if( what == "mfec" ) {
90  mfec_ = value ;
91  } else if( what == "mfecchannel" ) {
93  } else if( what == "portaddress" ) {
95  } else if( what == "hubaddress" ) {
96  hubaddress_ = value ;
97  } else if( what == "rocid" ) {
98  rocid_ = value ;
99  } else if( what == "fednumber" ) {
100  fednumber_ = value ;
101  } else if( what == "fedchannel" ) {
102  fedchannel_ = value ;
103  } else if( what == "fedrocnumber") {
104  fedrocnumber_ = value ;
105  } else {
106  std::cout << __LINE__ << "]\t" << mthn << "Could not set a value for " << what
107  << " (invalid keyword)" << std::endl ;
108  assert(0) ;
109  }
110 }
unsigned int hubaddress_
unsigned int fednumber_
unsigned int mfecchannel_
unsigned int portaddress_
unsigned int fedchannel_
unsigned int fecnumber_
unsigned int fedrocnumber_

Friends And Related Function Documentation

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

Member Data Documentation

unsigned int pos::PixelHdwAddress::fecnumber_
private

Definition at line 76 of file PixelHdwAddress.h.

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

unsigned int pos::PixelHdwAddress::fedchannel_
private
unsigned int pos::PixelHdwAddress::fednumber_
private
unsigned int pos::PixelHdwAddress::fedrocnumber_
private
unsigned int pos::PixelHdwAddress::hubaddress_
private
unsigned int pos::PixelHdwAddress::mfec_
private

Definition at line 77 of file PixelHdwAddress.h.

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

unsigned int pos::PixelHdwAddress::mfecchannel_
private
unsigned int pos::PixelHdwAddress::portaddress_
private

Definition at line 79 of file PixelHdwAddress.h.

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

unsigned int pos::PixelHdwAddress::rocid_
private

Definition at line 81 of file PixelHdwAddress.h.

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