CMS 3D CMS Logo

Public Member Functions | Public Attributes | Friends

cscdqm::Address Struct Reference

Structure to store detector addresses of any granularity: from whole detector to the single HV element. More...

#include <CSCDQM_Detector.h>

List of all members.

Public Member Functions

const std::string name () const
 Get the full name of the address prefixed with CSC_. It is being used by summaryReportContent variables.
const Addressoperator= (const Address &a)
const bool operator== (const Address &a) const

Public Attributes

unsigned int cfeb
unsigned int chamber
unsigned int hv
unsigned int layer
AddressMask mask
unsigned int ring
unsigned int side
unsigned int station

Friends

std::ostream & operator<< (std::ostream &out, const Address &adr)

Detailed Description

Structure to store detector addresses of any granularity: from whole detector to the single HV element.

Definition at line 82 of file CSCDQM_Detector.h.


Member Function Documentation

const std::string cscdqm::Address::name ( void  ) const [inline]

Get the full name of the address prefixed with CSC_. It is being used by summaryReportContent variables.

Returns:
Address name as string

Definition at line 132 of file CSCDQM_Detector.h.

References cfeb, cscdqm::AddressMask::cfeb, chamber, cscdqm::AddressMask::chamber, cscdqm::AddressMask::hv, hv, cscdqm::AddressMask::layer, layer, mask, cscdqm::AddressMask::ring, ring, side, cscdqm::AddressMask::side, station, and cscdqm::AddressMask::station.

                               {
    std::ostringstream oss;
    oss << "CSC";
    if (mask.side) {
      oss << "_Side" << (side == 1 ? "Plus" : "Minus");
      if (mask.station) {
        oss << "_Station" << std::setfill('0') << std::setw(2) << station;
        if (mask.ring) {
          oss << "_Ring" << std::setfill('0') << std::setw(2) << ring;
          if (mask.chamber) {
            oss << "_Chamber" << std::setfill('0') << std::setw(2) << chamber;
            if (mask.layer) {
              oss << "_Layer" << std::setfill('0') << std::setw(2) << layer;
              if (mask.cfeb) {
                oss << "_CFEB" << std::setfill('0') << std::setw(2) << cfeb;
                if (mask.hv) {
                  oss << "_HV" << std::setfill('0') << std::setw(2) << hv;
                }
              }
            }
          }
        }
      }
    }
    return oss.str();
  }
const Address* cscdqm::Address::operator= ( const Address a) [inline]

Definition at line 105 of file CSCDQM_Detector.h.

References cfeb, cscdqm::AddressMask::cfeb, chamber, cscdqm::AddressMask::chamber, cscdqm::AddressMask::hv, hv, cscdqm::AddressMask::layer, layer, mask, cscdqm::AddressMask::ring, ring, side, cscdqm::AddressMask::side, station, and cscdqm::AddressMask::station.

                                              {
    mask.side    = a.mask.side;
    side         = a.side;
    mask.station = a.mask.station;
    station      = a.station;
    mask.ring    = a.mask.ring;
    ring         = a.ring;
    mask.chamber = a.mask.chamber;
    chamber      = a.chamber;
    mask.layer   = a.mask.layer;
    layer        = a.layer;
    mask.cfeb    = a.mask.cfeb;
    cfeb         = a.cfeb;
    mask.hv      = a.mask.hv;
    hv           = a.hv;
    return this;
  };
const bool cscdqm::Address::operator== ( const Address a) const [inline]

Definition at line 94 of file CSCDQM_Detector.h.

References cfeb, cscdqm::AddressMask::cfeb, chamber, cscdqm::AddressMask::chamber, cscdqm::AddressMask::hv, hv, cscdqm::AddressMask::layer, layer, mask, cscdqm::AddressMask::ring, ring, side, cscdqm::AddressMask::side, station, and cscdqm::AddressMask::station.

                                                 {
    if (mask.side    == a.mask.side    && mask.side    == true && side    != a.side)    return false;
    if (mask.station == a.mask.station && mask.station == true && station != a.station) return false;
    if (mask.ring    == a.mask.ring    && mask.ring    == true && ring    != a.ring)    return false;
    if (mask.chamber == a.mask.chamber && mask.chamber == true && chamber != a.chamber) return false;
    if (mask.layer   == a.mask.layer   && mask.layer   == true && layer   != a.layer)   return false;
    if (mask.cfeb    == a.mask.cfeb    && mask.cfeb    == true && cfeb    != a.cfeb)    return false;
    if (mask.hv      == a.mask.hv      && mask.hv      == true && hv      != a.hv)      return false;
    return true;
  };

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const Address adr 
) [friend]

Definition at line 123 of file CSCDQM_Detector.h.

                                                                     {
    out << adr.name();
    return out;
  }

Member Data Documentation

unsigned int cscdqm::Address::cfeb
unsigned int cscdqm::Address::hv
unsigned int cscdqm::Address::layer
unsigned int cscdqm::Address::ring
unsigned int cscdqm::Address::side