CMS 3D CMS Logo

List of all members | Public Member Functions
SiPixelLayoutParser Class Reference

#include <SiPixelLayoutParser.h>

Inheritance diagram for SiPixelLayoutParser:
DQMParserBase

Public Member Functions

bool getAllLayouts (std::map< std::string, std::vector< std::string >> &me_names)
 
 SiPixelLayoutParser ()
 
 ~SiPixelLayoutParser () 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 SiPixelLayoutParser.h.

Constructor & Destructor Documentation

SiPixelLayoutParser::SiPixelLayoutParser ( )

Definition at line 12 of file SiPixelLayoutParser.cc.

References gather_cfg::cout.

12  : DQMParserBase() {
13  edm::LogInfo("SiPixelLayoutParser") << " Creating SiPixelLayoutParser "
14  << "\n";
15  cout << " Creating SiPixelLayoutParser " << endl;
16 }
DQMParserBase()
Creator.
SiPixelLayoutParser::~SiPixelLayoutParser ( )
override

Definition at line 20 of file SiPixelLayoutParser.cc.

20  {
21  edm::LogInfo("SiPixelActionExecutor") << " Deleting SiPixelLayoutParser "
22  << "\n";
23 }

Member Function Documentation

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

Definition at line 27 of file SiPixelLayoutParser.cc.

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

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