CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

pos::PixelHdwAddress Class Reference

Store mfec, mfecchannel etc. More...

#include <interface/PixelHdwAddress.h>

List of all members.

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 (int fecnumber, int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int fednumber, int fedchannel, int fedrocnumber)
 PixelHdwAddress ()
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.

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.

                                                  :
    fecnumber_(fecnumber),
    mfec_(mfec),
    mfecchannel_(mfecchannel),
    portaddress_(portaddress),
    hubaddress_(hubaddress),
    rocid_(rocid),
    fednumber_(fednumber),
    fedchannel_(fedchannel),
    fedrocnumber_(fedrocnumber)
{
    //std::cout << "Created PixelHdwAddress:"<<std::endl;
    //std::cout << *this << std::endl;
}

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_, rocid_, and AlCaHLTBitMon_QueryRunRegistry::string.

{
    std::string mthn = "[PixelHdwAddress::compare()]\t\t\t    " ;
    changed  = false ;
    oldValue = 0 ;
    
    if(         what == "fecnumber"   )
    {
      if( fecnumber_ != newValue)       {changed = true; oldValue = fecnumber_;    return ;}
    } else if(  what == "mfec"        ) { 
      if( mfec_          != newValue)   {changed = true; oldValue = mfec_;         return ;}
    } else if(  what == "mfecchannel" ) {
      if( mfecchannel_   != newValue)   {changed = true; oldValue = mfecchannel_;  return ;}
    } else if(  what == "portaddress" ) {
      if( portaddress_   != newValue)   {changed = true; oldValue = portaddress_;  return ;}
    } else if(  what == "hubaddress"  ) {
      if( hubaddress_    != newValue)   {changed = true; oldValue = hubaddress_;   return ;}
    } else if(  what == "rocid"       ) {
      if( rocid_         != newValue)   {changed = true; oldValue = rocid_;        return ;}
    } else if(  what == "fednumber"   ) {
      if( fednumber_     != newValue)   {changed = true; oldValue = fednumber_;    return ;}
    } else if(  what == "fedchannel"  ) {
      if( fedchannel_    != newValue)   {changed = true; oldValue = fedchannel_;   return ;}
    } else if(  what == "fedrocnumber") {
      if( fedrocnumber_  != newValue)   {changed = true; oldValue = fedrocnumber_; return ;}
    } else {
      std::cout << __LINE__ << "]\t" << mthn << "Could not compare value for " << what 
                << " (invalid keyword)" << std::endl ;
      assert(0) ;
    }
}
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_.

{ return 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_.

                                                                                              {

  if (roc1.fednumber_  < roc2.fednumber_ ) return true;
  if (roc1.fednumber_  > roc2.fednumber_ ) return false;
  if (roc1.fedchannel_ < roc2.fedchannel_) return true;
  if (roc1.fedchannel_ > roc2.fedchannel_) return false;

  return (roc1.fedrocnumber_<roc2.fedrocnumber_);

}
const bool pos::PixelHdwAddress::operator< ( const PixelHdwAddress aHdwAddress) const [inline]

Definition at line 62 of file PixelHdwAddress.h.

References fedchannel_, fednumber_, and fedrocnumber_.

                                                                  {
      if (fednumber_ < aHdwAddress.fednumber_ ) return true;
      if (fednumber_ > aHdwAddress.fednumber_ ) return false;
      if (fedchannel_ < aHdwAddress.fedchannel_ ) return true;
      if (fedchannel_ > aHdwAddress.fedchannel_ ) return false;
      return (fedrocnumber_ < aHdwAddress.fedrocnumber_ );
    }
const PixelHdwAddress & PixelHdwAddress::operator= ( const PixelHdwAddress aROC)
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_.

                                                                   {
      return ( fecnumber_    == aHdwAddress.fecnumber_ &&
               mfec_         == aHdwAddress.mfec_ &&
               mfecchannel_  == aHdwAddress.mfecchannel_ &&
               hubaddress_   == aHdwAddress.hubaddress_ &&
               fednumber_    == aHdwAddress.fednumber_ &&
               fedchannel_   == aHdwAddress.fedchannel_ );
    }
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.

{
    std::string mthn = "[PixelHdwAddress::setAddress()]\t\t\t    " ;
    if(        what == "fecnumber"   )
    {
      fecnumber_    =  value;
    } else if( what == "mfec"        ) { 
      mfec_         =  value ;
    } else if( what == "mfecchannel" ) {
      mfecchannel_  =  value ;
    } else if( what == "portaddress" ) {
      portaddress_  =  value ;
    } else if( what == "hubaddress"  ) {
      hubaddress_   =  value ;
    } else if( what == "rocid"       ) {
      rocid_        =  value ;
    } else if( what == "fednumber"   ) {
      fednumber_    =  value ;
    } else if( what == "fedchannel"  ) {
      fedchannel_   =  value ;
    } else if( what == "fedrocnumber") {
      fedrocnumber_ =  value ;
    } else {
      std::cout << __LINE__ << "]\t" << mthn << "Could not set a value for " << what 
                << " (invalid keyword)" << std::endl ;
      assert(0) ;
    }
}

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().