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

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

Detailed Description

Definition at line 29 of file HcalDQMDbInterface.h.

Constructor & Destructor Documentation

HcalDQMDbInterface::HcalDQMDbInterface ( )
inline

Definition at line 32 of file HcalDQMDbInterface.h.

32 {};

Member Function Documentation

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

Definition at line 117 of file HcalDQMDbInterface.cc.

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

Referenced by HcalHotCellDbInterface::createDataset().

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

Definition at line 23 of file HcalDQMDbInterface.cc.

References XML.

23  {
24  DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XML("Core"));
25  return impl->createDocument(0,XML("ROOT"),0);
26 }
#define XML(str)
DOMElement * HcalDQMDbInterface::createElement ( DOMDocument *  doc,
DOMElement *  parent,
const char *  name 
)
DOMElement * HcalDQMDbInterface::createElement ( DOMDocument *  doc,
DOMElement *  parent,
const char *  name,
const char *  value 
)

Definition at line 17 of file HcalDQMDbInterface.cc.

References createElement(), HTMLExport::elem(), and XML.

17  {
18  DOMElement* elem = createElement(doc,parent,name);
19  elem->appendChild(doc->createTextNode(XML(value)));
20  return elem;
21 }
list parent
Definition: dbtoconf.py:74
#define XML(str)
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, const char *name)
tuple doc
Definition: asciidump.py:381
DOMElement * HcalDQMDbInterface::createFooter ( DOMDocument *  doc,
unsigned long long  fIovBegin,
unsigned long long  fIovEnd,
const char *  fTagName,
const char *  fDetectorName,
const char *  fComment 
)

Definition at line 41 of file HcalDQMDbInterface.cc.

References createElement(), createIOV(), createTag(), dataset::dataset, makeMapDataset(), makeMapIOV(), makeMapTag(), and dbtoconf::parent.

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

Definition at line 78 of file HcalDQMDbInterface.cc.

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

Referenced by createFooter().

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

Definition at line 90 of file HcalDQMDbInterface.cc.

References createElement(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by createFooter().

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

Definition at line 72 of file HcalDQMDbInterface.cc.

References createElement().

Referenced by createFooter().

72  {
73  DOMElement* element = createElement(doc,fIov, "DATA_SET");
74  element->setAttribute(transcode("idref"), transcode("-1"));
75  return element;
76 }
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, const char *name)
tuple doc
Definition: asciidump.py:381
DOMElement * HcalDQMDbInterface::makeMapIOV ( DOMDocument *  doc,
DOMElement *  fTag 
)

Definition at line 66 of file HcalDQMDbInterface.cc.

References createElement(), and o2o::iov.

Referenced by createFooter().

66  {
67  DOMElement* iov = createElement(doc,fTag, "IOV");
68  iov->setAttribute(transcode("idref"), transcode("IOV_ID"));
69  return iov;
70 }
tuple iov
Definition: o2o.py:307
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, const char *name)
tuple doc
Definition: asciidump.py:381
DOMElement * HcalDQMDbInterface::makeMapTag ( DOMDocument *  doc,
DOMElement *  fMap 
)

Definition at line 60 of file HcalDQMDbInterface.cc.

References createElement(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by createFooter().

60  {
61  DOMElement* tag = createElement(doc, fMap, "TAG");
62  tag->setAttribute(transcode("idref"), transcode("TAG_ID"));
63  return tag;
64 }
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, const char *name)
tuple doc
Definition: asciidump.py:381
void HcalDQMDbInterface::writeDocument ( DOMDocument *  doc,
const char *  xmlFile 
)

Definition at line 28 of file HcalDQMDbInterface.cc.

References XML.

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