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, char *name)
 
DOMElement * createElement (DOMDocument *doc, DOMElement *parent, char *name, char *value)
 
DOMElement * createElement (DOMDocument *doc, DOMElement *parent, 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 123 of file HcalDQMDbInterface.cc.

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

Referenced by HcalHotCellDbInterface::createDataset().

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

Definition at line 29 of file HcalDQMDbInterface.cc.

References XML.

29  {
30  DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XML("Core"));
31  return impl->createDocument(0,XML("ROOT"),0);
32 }
#define XML(str)
DOMElement * HcalDQMDbInterface::createElement ( DOMDocument *  doc,
DOMElement *  parent,
char *  name 
)
DOMElement * HcalDQMDbInterface::createElement ( DOMDocument *  doc,
DOMElement *  parent,
char *  name,
char *  value 
)

Definition at line 17 of file HcalDQMDbInterface.cc.

References createElement(), 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)
tuple doc
Definition: asciidump.py:381
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, char *name)
DOMElement * HcalDQMDbInterface::createElement ( DOMDocument *  doc,
DOMElement *  parent,
char *  name,
const char *  value 
)

Definition at line 23 of file HcalDQMDbInterface.cc.

References createElement(), and XML.

23  {
24  DOMElement* elem = createElement(doc,parent,name);
25  elem->appendChild(doc->createTextNode(XML(value)));
26  return elem;
27 }
list parent
Definition: dbtoconf.py:74
#define XML(str)
tuple doc
Definition: asciidump.py:381
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, char *name)
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 47 of file HcalDQMDbInterface.cc.

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

49  {
50 
51  DOMElement* parent = doc->getDocumentElement();
52  DOMElement* elems = createElement(doc,parent,(char*)"ELEMENTS");
53  DOMElement* dataset = createElement(doc, elems, (char*)"DATA_SET");
54  dataset->setAttribute(transcode("id"), transcode("-1"));
55  createIOV(doc,elems,fIovBegin,fIovEnd);
56  createTag(doc,elems,fTagName,fDetectorName,fComment);
57 
58  DOMElement* maps = createElement(doc,parent,(char*)"MAPS");
59  DOMElement* mapTag = makeMapTag(doc,maps);
60  DOMElement* mapIov = makeMapIOV(doc,mapTag);
61  makeMapDataset(doc,mapIov);
62 
63  return elems;
64 }
list parent
Definition: dbtoconf.py:74
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)
DOMElement * makeMapTag(DOMDocument *doc, DOMElement *fMap)
DOMElement * makeMapDataset(DOMDocument *doc, DOMElement *fIov)
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, char *name)
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 84 of file HcalDQMDbInterface.cc.

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

Referenced by createFooter().

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

Definition at line 96 of file HcalDQMDbInterface.cc.

References createElement(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by createFooter().

97  {
98  DOMElement* tag = createElement(doc,parent,(char*)"TAG");
99  tag->setAttribute(transcode("id"), transcode ("TAG_ID"));
100  tag->setAttribute(transcode("mode"), transcode ("auto"));
101 
102  createElement(doc,tag,(char*)"TAG_NAME", fTagName);
103  createElement(doc,tag,(char*)"DETECTOR_NAME", fDetectorName);
104  createElement(doc,tag,(char*)"COMMENT_DESCRIPTION", fComment);
105 
106  return tag;
107 }
list parent
Definition: dbtoconf.py:74
tuple doc
Definition: asciidump.py:381
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, char *name)
const char* HcalDQMDbInterface::itoa ( int  i)
inline

Definition at line 52 of file HcalDQMDbInterface.h.

References cond::rpcobtemp::temp.

Referenced by createChannel(), HcalHotCellDbInterface::createData(), HcalHLXMaskDbInterface::createDataset(), HcalHotCellDbInterface::createHeader(), and createIOV().

52  {
53  char temp[256];
54  sprintf(temp,"%d",i);
55  std::string outVal(temp);
56  return outVal.c_str();
57  }
int i
Definition: DBlmapReader.cc:9
DOMElement * HcalDQMDbInterface::makeMapDataset ( DOMDocument *  doc,
DOMElement *  fIov 
)

Definition at line 78 of file HcalDQMDbInterface.cc.

References createElement().

Referenced by createFooter().

78  {
79  DOMElement* element = createElement(doc,fIov, (char*)"DATA_SET");
80  element->setAttribute(transcode("idref"), transcode("-1"));
81  return element;
82 }
tuple doc
Definition: asciidump.py:381
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, char *name)
DOMElement * HcalDQMDbInterface::makeMapIOV ( DOMDocument *  doc,
DOMElement *  fTag 
)

Definition at line 72 of file HcalDQMDbInterface.cc.

References createElement(), and o2o::iov.

Referenced by createFooter().

72  {
73  DOMElement* iov = createElement(doc,fTag, (char*)"IOV");
74  iov->setAttribute(transcode("idref"), transcode("IOV_ID"));
75  return iov;
76 }
tuple iov
Definition: o2o.py:307
tuple doc
Definition: asciidump.py:381
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, char *name)
DOMElement * HcalDQMDbInterface::makeMapTag ( DOMDocument *  doc,
DOMElement *  fMap 
)

Definition at line 66 of file HcalDQMDbInterface.cc.

References createElement(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by createFooter().

66  {
67  DOMElement* tag = createElement(doc, fMap, (char*)"TAG");
68  tag->setAttribute(transcode("idref"), transcode("TAG_ID"));
69  return tag;
70 }
tuple doc
Definition: asciidump.py:381
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, char *name)
void HcalDQMDbInterface::writeDocument ( DOMDocument *  doc,
const char *  xmlFile 
)

Definition at line 34 of file HcalDQMDbInterface.cc.

References XML.

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