CMS 3D CMS Logo

Public Member Functions

SiStripConfigParser Class Reference

#include <SiStripConfigParser.h>

Inheritance diagram for SiStripConfigParser:
DQMParserBase

List of all members.

Public Member Functions

bool getFrequencyForSummary (int &u_freq)
bool getMENamesForSummary (std::map< std::string, std::string > &me_names)
 SiStripConfigParser ()
 ~SiStripConfigParser ()

Detailed Description

* Class that handles the SiStrip Quality Tests

Date:
2009/02/25 17:02:37
Revision:
1.5
Author:
Suchandra Dutta

Definition at line 20 of file SiStripConfigParser.h.


Constructor & Destructor Documentation

SiStripConfigParser::SiStripConfigParser ( )

Definition at line 9 of file SiStripConfigParser.cc.

                                         : DQMParserBase() {
  edm::LogInfo("SiStripConfigParser") << 
    " Creating SiStripConfigParser " << "\n" ;
}
SiStripConfigParser::~SiStripConfigParser ( )

Definition at line 16 of file SiStripConfigParser.cc.

                                          {
  edm::LogInfo("SiStripConfigParser") << 
    " Deleting SiStripConfigParser " << "\n" ;
}

Member Function Documentation

bool SiStripConfigParser::getFrequencyForSummary ( int &  u_freq)

Get Node

Definition at line 58 of file SiStripConfigParser.cc.

References qtxml::_toDOMS(), qtxml::_toString(), gather_cfg::cout, and DQMParserBase::doc().

Referenced by SiStripSummaryCreator::readConfiguration().

                                                            {
  if (!doc()) {
    std::cout << " SiStripConfigParser::Configuration File is not set!!! " << std::endl;
    return false;
  }

  unsigned int summaryNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->getLength();
  if (summaryNodes != 1 ) return false;
  xercesc::DOMNode* summaryNode = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->item(0);
 //Get Node name
  if (! summaryNode) return false;
  xercesc::DOMElement* summaryElement = static_cast<xercesc::DOMElement *>(summaryNode);          
  if (! summaryElement) return false;            
                
  u_freq = atoi(qtxml::_toString(summaryElement->getAttribute(qtxml::_toDOMS("update_frequency"))).c_str());
  return true;
}
bool SiStripConfigParser::getMENamesForSummary ( std::map< std::string, std::string > &  me_names)

Get Node

Definition at line 23 of file SiStripConfigParser.cc.

References qtxml::_toDOMS(), _toString(), gather_cfg::cout, DQMParserBase::doc(), and gen::k.

Referenced by SiStripSummaryCreator::readConfiguration().

                                                                                     {
  if (!doc()) {
    std::cout << " SiStripConfigParser::Configuration File is not set!!! " << std::endl;
    return false;
  }

  me_names.clear();
  unsigned int summaryNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->getLength();
  if (summaryNodes == 0) return false;
  xercesc::DOMNode* summaryNode = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->item(0);
 //Get Summary ME name and type
  if (! summaryNode) return false;
  xercesc::DOMElement* summaryElement = static_cast<xercesc::DOMElement *>(summaryNode);          
  if (! summaryElement) return false;            
                

  xercesc::DOMNodeList * meList 
                  = summaryElement->getElementsByTagName(qtxml::_toDOMS("MonElement"));
  for (unsigned int k = 0; k < meList->getLength(); k++) {
    xercesc::DOMNode* meNode = meList->item(k);
    if (!meNode) return false;
    xercesc::DOMElement* meElement = static_cast<xercesc::DOMElement *>(meNode);          
    if (!meElement) return false;
    std::string me_name = qtxml::_toString(meElement->getAttribute (qtxml::_toDOMS ("name"))); 
    std::string me_type = qtxml::_toString(meElement->getAttribute (qtxml::_toDOMS ("type"))); 
    me_names.insert(std::pair<std::string,std::string>(me_name,me_type));    
  }
  if (me_names.size() == 0) return false;
  else return true;
  
}