CMS 3D CMS Logo

List of all members | Public Member Functions
SiStripLayoutParser Class Reference

#include <SiStripLayoutParser.h>

Inheritance diagram for SiStripLayoutParser:
DQMParserBase

Public Member Functions

bool getAllLayouts (std::map< std::string, std::vector< std::string > > &me_names)
 
 SiStripLayoutParser ()
 
 ~SiStripLayoutParser () override
 
- 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 17 of file SiStripLayoutParser.h.

Constructor & Destructor Documentation

SiStripLayoutParser::SiStripLayoutParser ( )

Definition at line 9 of file SiStripLayoutParser.cc.

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

Definition at line 16 of file SiStripLayoutParser.cc.

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

Member Function Documentation

bool SiStripLayoutParser::getAllLayouts ( std::map< std::string, std::vector< std::string > > &  me_names)

Definition at line 23 of file SiStripLayoutParser.cc.

References qtxml::_toDOMS(), qtxml::_toString(), gather_cfg::cout, DQMParserBase::doc(), dqmdumpme::k, cmsLHEtoEOSManager::l, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by TrackingActionExecutor::createShiftReport(), and SiStripActionExecutor::createShiftReport().

23  {
24  if (!doc()) {
25  std::cout << " SiStripLayoutParser::Configuration File is not set!!! " << std::endl;
26  return false;
27  }
28 
29  layouts.clear();
30 
31  xercesc::DOMNodeList* layoutList = doc()->getElementsByTagName(qtxml::_toDOMS("layout"));
32 
33  unsigned int nlayout = layoutList->getLength();
34  if (nlayout == 0)
35  return false;
36 
37  for (unsigned int k = 0; k < layoutList->getLength(); k++) {
38  xercesc::DOMNode* layoutNode = layoutList->item(k);
39  if (!layoutNode)
40  return false;
41 
42  xercesc::DOMElement* layoutElement = static_cast<xercesc::DOMElement*>(layoutNode);
43  if (!layoutElement)
44  return false;
45  std::string layoutName = qtxml::_toString(layoutElement->getAttribute(qtxml::_toDOMS("name")));
46 
47  xercesc::DOMNodeList* meList = layoutElement->getElementsByTagName(qtxml::_toDOMS("monitorable"));
48  std::vector<std::string> me_names;
49  for (unsigned int l = 0; l < meList->getLength(); l++) {
50  xercesc::DOMNode* meNode = meList->item(l);
51  if (!meNode)
52  return false;
53  xercesc::DOMElement* meElement = static_cast<xercesc::DOMElement*>(meNode);
54  if (!meElement)
55  return false;
56  std::string meName = qtxml::_toString(meElement->getAttribute(qtxml::_toDOMS("name")));
57  me_names.push_back(meName);
58  }
59  if (!me_names.empty())
60  layouts[layoutName] = me_names;
61  }
62  if (!layouts.empty())
63  return true;
64  else
65  return false;
66 }
std::string _toString(const XMLCh *toTranscode)
XMLCh * _toDOMS(std::string temp)
xercesc::DOMDocument * doc()
DOM Document.
Definition: DQMParserBase.h:39