CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
SiStripConfigParser Class Reference

#include <SiStripConfigParser.h>

Inheritance diagram for SiStripConfigParser:
DQMParserBase

Public Member Functions

bool getFrequencyForSummary (int &u_freq)
 
bool getMENamesForSummary (std::map< std::string, std::string > &me_names)
 
 SiStripConfigParser ()
 
 ~SiStripConfigParser ()
 
- Public Member Functions inherited from DQMParserBase
int countNodes (std::string tagName)
 Returns the number of nodes with given name. More...
 
xercesc::DOMDocument * doc ()
 DOM Document. More...
 
 DQMParserBase ()
 Creator. More...
 
void getDocument (std::string configFile, bool UseDB=false)
 Methor that parses the xml file configFile. More...
 
void getNewDocument (std::string configFile, bool UseDB=false)
 Parses a new Document. More...
 
virtual ~DQMParserBase ()
 Destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from DQMParserBase
xercesc::XercesDOMParser * parser
 

Detailed Description

Definition at line 20 of file SiStripConfigParser.h.

Constructor & Destructor Documentation

SiStripConfigParser::SiStripConfigParser ( )

Definition at line 9 of file SiStripConfigParser.cc.

9  : DQMParserBase() {
10  edm::LogInfo("SiStripConfigParser") <<
11  " Creating SiStripConfigParser " << "\n" ;
12 }
DQMParserBase()
Creator.
SiStripConfigParser::~SiStripConfigParser ( )

Definition at line 16 of file SiStripConfigParser.cc.

16  {
17  edm::LogInfo("SiStripConfigParser") <<
18  " Deleting SiStripConfigParser " << "\n" ;
19 }

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

58  {
59  if (!doc()) {
60  std::cout << " SiStripConfigParser::Configuration File is not set!!! " << std::endl;
61  return false;
62  }
63 
64  unsigned int summaryNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->getLength();
65  if (summaryNodes != 1 ) return false;
67  xercesc::DOMNode* summaryNode = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->item(0);
68  //Get Node name
69  if (! summaryNode) return false;
70  xercesc::DOMElement* summaryElement = static_cast<xercesc::DOMElement *>(summaryNode);
71  if (! summaryElement) return false;
72 
73  u_freq = atoi(qtxml::_toString(summaryElement->getAttribute(qtxml::_toDOMS("update_frequency"))).c_str());
74  return true;
75 }
std::string _toString(const XMLCh *toTranscode)
XMLCh * _toDOMS(std::string temp)
tuple cout
Definition: gather_cfg.py:121
xercesc::DOMDocument * doc()
DOM Document.
Definition: DQMParserBase.h:47
bool SiStripConfigParser::getMENamesForSummary ( std::map< std::string, std::string > &  me_names)

Get Node

Definition at line 23 of file SiStripConfigParser.cc.

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

Referenced by SiStripSummaryCreator::readConfiguration().

23  {
24  if (!doc()) {
25  std::cout << " SiStripConfigParser::Configuration File is not set!!! " << std::endl;
26  return false;
27  }
28 
29  me_names.clear();
30  unsigned int summaryNodes = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->getLength();
31  if (summaryNodes == 0) return false;
33  xercesc::DOMNode* summaryNode = doc()->getElementsByTagName(qtxml::_toDOMS("SummaryPlot"))->item(0);
34  //Get Summary ME name and type
35  if (! summaryNode) return false;
36  xercesc::DOMElement* summaryElement = static_cast<xercesc::DOMElement *>(summaryNode);
37  if (! summaryElement) return false;
38 
39 
40  xercesc::DOMNodeList * meList
41  = summaryElement->getElementsByTagName(qtxml::_toDOMS("MonElement"));
42  for (unsigned int k = 0; k < meList->getLength(); k++) {
43  xercesc::DOMNode* meNode = meList->item(k);
44  if (!meNode) return false;
45  xercesc::DOMElement* meElement = static_cast<xercesc::DOMElement *>(meNode);
46  if (!meElement) return false;
47  std::string me_name = qtxml::_toString(meElement->getAttribute (qtxml::_toDOMS ("name")));
48  std::string me_type = qtxml::_toString(meElement->getAttribute (qtxml::_toDOMS ("type")));
49  me_names.insert(std::pair<std::string,std::string>(me_name,me_type));
50  }
51  if (me_names.size() == 0) return false;
52  else return true;
53 
54 }
std::string _toString(const XMLCh *toTranscode)
int k[5][pyjets_maxn]
XMLCh * _toDOMS(std::string temp)
tuple cout
Definition: gather_cfg.py:121
xercesc::DOMDocument * doc()
DOM Document.
Definition: DQMParserBase.h:47