CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- 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 18 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") <<
14  " Creating SiPixelLayoutParser " << "\n" ;
15  cout << " Creating SiPixelLayoutParser " << endl;
16 }
DQMParserBase()
Creator.
tuple cout
Definition: gather_cfg.py:121
SiPixelLayoutParser::~SiPixelLayoutParser ( )

Definition at line 20 of file SiPixelLayoutParser.cc.

20  {
21  edm::LogInfo("SiPixelActionExecutor") <<
22  " Deleting SiPixelLayoutParser " << "\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(), gen::k, and prof2calltree::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
36  = doc()->getElementsByTagName(qtxml::_toDOMS("layout"));
37 
38  unsigned int nlayout = layoutList->getLength();
39  if (nlayout == 0) return false;
40 
41  for (unsigned int k = 0; k < layoutList->getLength(); k++) {
42  DOMNode* layoutNode
43  = layoutList->item(k);
44  if (!layoutNode) return false;
45 
46  DOMElement* layoutElement = static_cast<DOMElement *>(layoutNode);
47  if (!layoutElement) return false;
48  string layoutName = qtxml::_toString(layoutElement->getAttribute (qtxml::_toDOMS ("name")));
49 
50  DOMNodeList * meList
51  = 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) return false;
56  DOMElement* meElement = static_cast<DOMElement *>(meNode);
57  if (!meElement) return false;
58  string meName = qtxml::_toString(meElement->getAttribute (qtxml::_toDOMS ("name")));
59  me_names.push_back(meName);
60  }
61  if (me_names.size() > 0) layouts[layoutName] = me_names;
62  }
63  if ( layouts.size() > 0) return true;
64  else return false;
65 }
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:45