CMS 3D CMS Logo

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

#include <HcalDQMDbInterface.h>

Inheritance diagram for HcalDQMDbInterface:
HcalHLXMaskDbInterface HcalHotCellDbInterface

Public Member Functions

XERCES_CPP_NAMESPACE::DOMElement * createChannel (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, HcalDetId id)
 
XERCES_CPP_NAMESPACE::DOMDocument * createDocument ()
 
XERCES_CPP_NAMESPACE::DOMElement * createElement (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
 
XERCES_CPP_NAMESPACE::DOMElement * createElement (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name, const char *value)
 
XERCES_CPP_NAMESPACE::DOMElement * createFooter (XERCES_CPP_NAMESPACE::DOMDocument *doc, unsigned long long fIovBegin, unsigned long long fIovEnd, const char *fTagName, const char *fDetectorName, const char *fComment)
 
XERCES_CPP_NAMESPACE::DOMElement * createIOV (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, unsigned long long fIovBegin, unsigned long long fIovEnd)
 
XERCES_CPP_NAMESPACE::DOMElement * createTag (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *fTagName, const char *fDetectorName, const char *fComment)
 
 HcalDQMDbInterface ()
 
const char * itoa (int i)
 
XERCES_CPP_NAMESPACE::DOMElement * makeMapDataset (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *fIov)
 
XERCES_CPP_NAMESPACE::DOMElement * makeMapIOV (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *fTag)
 
XERCES_CPP_NAMESPACE::DOMElement * makeMapTag (XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *fMap)
 
void writeDocument (XERCES_CPP_NAMESPACE::DOMDocument *doc, const char *xmlFile)
 

Detailed Description

Definition at line 28 of file HcalDQMDbInterface.h.

Constructor & Destructor Documentation

HcalDQMDbInterface::HcalDQMDbInterface ( )
inline

Definition at line 31 of file HcalDQMDbInterface.h.

31 {};

Member Function Documentation

DOMElement * HcalDQMDbInterface::createChannel ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  parent,
HcalDetId  id 
)

Definition at line 119 of file HcalDQMDbInterface.cc.

References createElement(), HLT_25ns14e33_v1_cff::depth, HcalText2DetIdConverter::getFlavor(), itoa(), and ecaldqm::zside().

Referenced by HcalHotCellDbInterface::createDataset().

119  {
120  HcalText2DetIdConverter converter(id);
121  DOMElement* chanElem = createElement(doc,parent,"CHANNEL");
122  createElement(doc,chanElem,"EXTENSION_TABLE_NAME","HCAL_CHANNELS");
123  createElement(doc,chanElem,"ETA",itoa(id.ietaAbs()));
124  createElement(doc,chanElem,"PHI",itoa(id.iphi()));
125  createElement(doc,chanElem,"DEPTH",itoa(id.depth()));
126  createElement(doc,chanElem,"Z",itoa(id.zside()));
127  createElement(doc,chanElem,"DETECTOR_NAME",converter.getFlavor().c_str());
128  createElement(doc,chanElem,"HCAL_CHANNEL_ID",itoa(id.rawId()));
129  return chanElem;
130 }
list parent
Definition: dbtoconf.py:74
int zside(DetId const &)
XERCES_CPP_NAMESPACE::DOMElement * createElement(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
const char * itoa(int i)
DOMDocument * HcalDQMDbInterface::createDocument ( )

Definition at line 25 of file HcalDQMDbInterface.cc.

References XML.

25  {
26  DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XML("Core"));
27  return impl->createDocument(0,XML("ROOT"),0);
28 }
#define XML(str)
XERCES_CPP_NAMESPACE::DOMElement* HcalDQMDbInterface::createElement ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  parent,
const char *  name 
)
XERCES_CPP_NAMESPACE::DOMElement* HcalDQMDbInterface::createElement ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  parent,
const char *  name,
const char *  value 
)
DOMElement * HcalDQMDbInterface::createFooter ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
unsigned long long  fIovBegin,
unsigned long long  fIovEnd,
const char *  fTagName,
const char *  fDetectorName,
const char *  fComment 
)

Definition at line 43 of file HcalDQMDbInterface.cc.

References createElement(), createIOV(), createTag(), dataset::dataset, makeMapDataset(), makeMapIOV(), makeMapTag(), and XERCES_CPP_NAMESPACE_USE::transcode().

45  {
46 
47  DOMElement* parent = doc->getDocumentElement();
48  DOMElement* elems = createElement(doc,parent,"ELEMENTS");
49  DOMElement* dataset = createElement(doc, elems, "DATA_SET");
50  dataset->setAttribute(transcode("id"), transcode("-1"));
51  createIOV(doc,elems,fIovBegin,fIovEnd);
52  createTag(doc,elems,fTagName,fDetectorName,fComment);
53 
54  DOMElement* maps = createElement(doc,parent, "MAPS");
55  DOMElement* mapTag = makeMapTag(doc,maps);
56  DOMElement* mapIov = makeMapIOV(doc,mapTag);
57  makeMapDataset(doc,mapIov);
58 
59  return elems;
60 }
XERCES_CPP_NAMESPACE::DOMElement * createIOV(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, unsigned long long fIovBegin, unsigned long long fIovEnd)
list parent
Definition: dbtoconf.py:74
XERCES_CPP_NAMESPACE::DOMElement * makeMapDataset(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *fIov)
XERCES_CPP_NAMESPACE::DOMElement * createElement(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
XERCES_CPP_NAMESPACE::DOMElement * createTag(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *fTagName, const char *fDetectorName, const char *fComment)
XMLCh * transcode(const T &fInput)
XERCES_CPP_NAMESPACE::DOMElement * makeMapIOV(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *fTag)
tuple dataset
Definition: dataset.py:859
XERCES_CPP_NAMESPACE::DOMElement * makeMapTag(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *fMap)
DOMElement * HcalDQMDbInterface::createIOV ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  parent,
unsigned long long  fIovBegin,
unsigned long long  fIovEnd 
)

Definition at line 80 of file HcalDQMDbInterface.cc.

References createElement(), o2o::iov, itoa(), and XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by createFooter().

81  {
82  DOMElement* iov = createElement(doc,parent,"IOV");
83  iov->setAttribute(transcode("id"), transcode("IOV_ID"));
84 
85  createElement(doc,iov,"INTERVAL_OF_VALIDITY_BEGIN", itoa(fIovBegin));
86  if(fIovEnd) {
87  createElement(doc,iov,"INTERVAL_OF_VALIDITY_END", itoa(fIovEnd));
88  }
89  return iov;
90 }
list parent
Definition: dbtoconf.py:74
XERCES_CPP_NAMESPACE::DOMElement * createElement(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
tuple iov
Definition: o2o.py:307
XMLCh * transcode(const T &fInput)
const char * itoa(int i)
DOMElement * HcalDQMDbInterface::createTag ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  parent,
const char *  fTagName,
const char *  fDetectorName,
const char *  fComment 
)

Definition at line 92 of file HcalDQMDbInterface.cc.

References createElement(), GlobalPosition_Frontier_DevDB_cff::tag, and XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by createFooter().

93  {
94  DOMElement* tag = createElement(doc,parent,"TAG");
95  tag->setAttribute(transcode("id"), transcode ("TAG_ID"));
96  tag->setAttribute(transcode("mode"), transcode ("auto"));
97 
98  createElement(doc,tag,"TAG_NAME", fTagName);
99  createElement(doc,tag,"DETECTOR_NAME", fDetectorName);
100  createElement(doc,tag,"COMMENT_DESCRIPTION", fComment);
101 
102  return tag;
103 }
list parent
Definition: dbtoconf.py:74
XERCES_CPP_NAMESPACE::DOMElement * createElement(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
XMLCh * transcode(const T &fInput)
const char* HcalDQMDbInterface::itoa ( int  i)
inline
DOMElement * HcalDQMDbInterface::makeMapDataset ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  fIov 
)

Definition at line 74 of file HcalDQMDbInterface.cc.

References createElement(), and XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by createFooter().

74  {
75  DOMElement* element = createElement(doc,fIov, "DATA_SET");
76  element->setAttribute(transcode("idref"), transcode("-1"));
77  return element;
78 }
XERCES_CPP_NAMESPACE::DOMElement * createElement(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
XMLCh * transcode(const T &fInput)
DOMElement * HcalDQMDbInterface::makeMapIOV ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  fTag 
)

Definition at line 68 of file HcalDQMDbInterface.cc.

References createElement(), o2o::iov, and XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by createFooter().

68  {
69  DOMElement* iov = createElement(doc,fTag, "IOV");
70  iov->setAttribute(transcode("idref"), transcode("IOV_ID"));
71  return iov;
72 }
XERCES_CPP_NAMESPACE::DOMElement * createElement(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
tuple iov
Definition: o2o.py:307
XMLCh * transcode(const T &fInput)
DOMElement * HcalDQMDbInterface::makeMapTag ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
XERCES_CPP_NAMESPACE::DOMElement *  fMap 
)

Definition at line 62 of file HcalDQMDbInterface.cc.

References createElement(), GlobalPosition_Frontier_DevDB_cff::tag, and XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by createFooter().

62  {
63  DOMElement* tag = createElement(doc, fMap, "TAG");
64  tag->setAttribute(transcode("idref"), transcode("TAG_ID"));
65  return tag;
66 }
XERCES_CPP_NAMESPACE::DOMElement * createElement(XERCES_CPP_NAMESPACE::DOMDocument *doc, XERCES_CPP_NAMESPACE::DOMElement *parent, const char *name)
XMLCh * transcode(const T &fInput)
void HcalDQMDbInterface::writeDocument ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
const char *  xmlFile 
)

Definition at line 30 of file HcalDQMDbInterface.cc.

References XML.

30  {
31  DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XML("Core"));
32  DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
33  if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true))
34  theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
35  if (theSerializer->canSetFeature(XMLUni::fgDOMWRTBOM, true))
36  theSerializer->setFeature(XMLUni::fgDOMWRTBOM, true);
37  XMLFormatTarget *myFormTarget = new LocalFileFormatTarget(xmlFile);
38  theSerializer->writeNode(myFormTarget, *doc);
39  delete theSerializer;
40  delete myFormTarget;
41 }
#define XML(str)
bool xmlFile(const std::string fParam)