CMS 3D CMS Logo

Public Member Functions | Private Types

L1MuGMTLUT::PortDecoder Class Reference

#include <L1MuGMTLUT.h>

List of all members.

Public Member Functions

 PortDecoder (const std::vector< port > &pt)
 PortDecoder (const std::string &input)
std::string str ()

Private Types

typedef std::vector< portbase

Detailed Description

Definition at line 165 of file L1MuGMTLUT.h.


Member Typedef Documentation

typedef std::vector<port> L1MuGMTLUT::PortDecoder::base [private]

Definition at line 166 of file L1MuGMTLUT.h.


Constructor & Destructor Documentation

L1MuGMTLUT::PortDecoder::PortDecoder ( const std::vector< port > &  pt) [inline]

Definition at line 168 of file L1MuGMTLUT.h.

: base(pt) {};
L1MuGMTLUT::PortDecoder::PortDecoder ( const std::string &  input) [inline]

Definition at line 170 of file L1MuGMTLUT.h.

References i.

                                         {
        // decode std::string of style "phi(2) eta(4)"
        L1MuGMTLUTHelpers::Tokenizer tok(" ", input);
        for (unsigned int i=0;i<tok.size(); i++) {
          size_type obrace=tok[i].find("("), cbrace=tok[i].find(")");
          if (obrace != std::string::npos && cbrace != std::string::npos) 
            push_back( port ( tok[i].substr(0,obrace), (unsigned) atoi (tok[i].substr(obrace+1,cbrace-obrace-1).c_str() ) ) );
          else 
            edm::LogWarning("LUTMismatch") << "L1MuGMTLUT::PortDecoder: error decoding port " << tok[i]; 
        }
      };

Member Function Documentation

std::string L1MuGMTLUT::PortDecoder::str ( ) [inline]

Definition at line 181 of file L1MuGMTLUT.h.

References i, edm::second(), findQualityFiles::size, and cond::rpcobtemp::temp.

Referenced by L1MuGMTLUT::Save().

                      {
        std::string temp;
        for  (unsigned int i=0; i<size();i++) {
          // ostd::stringstream os; os << (*this)[i].second << ends;
          //      temp += (*this)[i].first + "(" + std::string( os.str() ) + ")";
          
          char buf[100]; sprintf(buf,"(%d)",(*this)[i].second);
          temp += (*this)[i].first + std::string(buf);

          if (i!=size()-1) temp += " ";
        }
        return temp;
      };