CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripConfigParser.cc
Go to the documentation of this file.
4 #include <iostream>
5 
6 //
7 // -- Constructor
8 //
10  edm::LogInfo("SiStripConfigParser") <<
11  " Creating SiStripConfigParser " << "\n" ;
12 }
13 //
14 // -- Destructor
15 //
17  edm::LogInfo("SiStripConfigParser") <<
18  " Deleting SiStripConfigParser " << "\n" ;
19 }
20 //
21 // -- Get List of MEs for the summary plot and the
22 //
23 bool SiStripConfigParser::getMENamesForSummary(std::map<std::string, std::string>& me_names) {
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 }
55 //
56 // -- Get List of MEs for the summary plot and the
57 //
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 }
bool getFrequencyForSummary(int &u_freq)
std::string _toString(const XMLCh *toTranscode)
int k[5][pyjets_maxn]
XMLCh * _toDOMS(std::string temp)
bool getMENamesForSummary(std::map< std::string, std::string > &me_names)
tuple cout
Definition: gather_cfg.py:121
xercesc::DOMDocument * doc()
DOM Document.
Definition: DQMParserBase.h:47