#include <DQM/HcalMonitorClient/interface/HcalDQMDbInterface.h>
Public Member Functions | |
DOMElement * | createChannel (DOMDocument *doc, DOMElement *parent, HcalDetId id) |
DOMDocument * | createDocument () |
DOMElement * | createElement (DOMDocument *doc, DOMElement *parent, char *name, const char *value) |
DOMElement * | createElement (DOMDocument *doc, DOMElement *parent, char *name, char *value) |
DOMElement * | createElement (DOMDocument *doc, DOMElement *parent, char *name) |
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) |
Definition at line 29 of file HcalDQMDbInterface.h.
HcalDQMDbInterface::HcalDQMDbInterface | ( | ) | [inline] |
DOMElement * HcalDQMDbInterface::createChannel | ( | DOMDocument * | doc, | |
DOMElement * | parent, | |||
HcalDetId | id | |||
) |
Definition at line 125 of file HcalDQMDbInterface.cc.
References createElement(), HcalText2DetIdConverter::getFlavor(), and itoa().
Referenced by HcalHotCellDbInterface::createDataset().
00125 { 00126 HcalText2DetIdConverter converter(id); 00127 DOMElement* chanElem = createElement(doc,parent,"CHANNEL"); 00128 createElement(doc,chanElem,"EXTENSION_TABLE_NAME","HCAL_CHANNELS"); 00129 createElement(doc,chanElem,"ETA",itoa(id.ietaAbs())); 00130 createElement(doc,chanElem,"PHI",itoa(id.iphi())); 00131 createElement(doc,chanElem,"DEPTH",itoa(id.depth())); 00132 createElement(doc,chanElem,"Z",itoa(id.zside())); 00133 createElement(doc,chanElem,"DETECTOR_NAME",converter.getFlavor().c_str()); 00134 createElement(doc,chanElem,"HCAL_CHANNEL_ID",itoa(id.rawId())); 00135 return chanElem; 00136 }
DOMDocument * HcalDQMDbInterface::createDocument | ( | ) |
Definition at line 31 of file HcalDQMDbInterface.cc.
References XML.
00031 { 00032 DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XML("Core")); 00033 return impl->createDocument(0,XML("ROOT"),0); 00034 }
DOMElement * HcalDQMDbInterface::createElement | ( | DOMDocument * | doc, | |
DOMElement * | parent, | |||
char * | name, | |||
const char * | value | |||
) |
Definition at line 25 of file HcalDQMDbInterface.cc.
References createElement(), and XML.
00025 { 00026 DOMElement* elem = createElement(doc,parent,name); 00027 elem->appendChild(doc->createTextNode(XML(value))); 00028 return elem; 00029 }
DOMElement * HcalDQMDbInterface::createElement | ( | DOMDocument * | doc, | |
DOMElement * | parent, | |||
char * | name, | |||
char * | value | |||
) |
Definition at line 19 of file HcalDQMDbInterface.cc.
References createElement(), and XML.
00019 { 00020 DOMElement* elem = createElement(doc,parent,name); 00021 elem->appendChild(doc->createTextNode(XML(value))); 00022 return elem; 00023 }
DOMElement * HcalDQMDbInterface::createElement | ( | DOMDocument * | doc, | |
DOMElement * | parent, | |||
char * | name | |||
) |
Definition at line 13 of file HcalDQMDbInterface.cc.
References XML.
Referenced by createChannel(), HcalHotCellDbInterface::createData(), HcalHLXMaskDbInterface::createData(), HcalHotCellDbInterface::createDataset(), HcalHLXMaskDbInterface::createDataset(), createElement(), createFooter(), HcalHotCellDbInterface::createHeader(), HcalHLXMaskDbInterface::createHeader(), createIOV(), createTag(), makeMapDataset(), makeMapIOV(), and makeMapTag().
00013 { 00014 DOMElement* elem = doc->createElement(XML(name)); 00015 parent->appendChild(elem); 00016 return elem; 00017 }
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 49 of file HcalDQMDbInterface.cc.
References createElement(), createIOV(), createTag(), ttbarGen_cfg::dataset, makeMapDataset(), makeMapIOV(), makeMapTag(), maps, dbtoconf::parent, and transcode().
00051 { 00052 00053 DOMElement* parent = doc->getDocumentElement(); 00054 DOMElement* elems = createElement(doc,parent,"ELEMENTS"); 00055 DOMElement* dataset = createElement(doc, elems, "DATA_SET"); 00056 dataset->setAttribute(transcode("id"), transcode("-1")); 00057 createIOV(doc,elems,fIovBegin,fIovEnd); 00058 createTag(doc,elems,fTagName,fDetectorName,fComment); 00059 00060 DOMElement* maps = createElement(doc,parent,"MAPS"); 00061 DOMElement* mapTag = makeMapTag(doc,maps); 00062 DOMElement* mapIov = makeMapIOV(doc,mapTag); 00063 makeMapDataset(doc,mapIov); 00064 00065 return elems; 00066 }
DOMElement * HcalDQMDbInterface::createIOV | ( | DOMDocument * | doc, | |
DOMElement * | parent, | |||
unsigned long long | fIovBegin, | |||
unsigned long long | fIovEnd | |||
) |
Definition at line 86 of file HcalDQMDbInterface.cc.
References createElement(), itoa(), and transcode().
Referenced by createFooter().
00087 { 00088 DOMElement* iov = createElement(doc,parent,"IOV"); 00089 iov->setAttribute(transcode("id"), transcode("IOV_ID")); 00090 00091 createElement(doc,iov,"INTERVAL_OF_VALIDITY_BEGIN", itoa(fIovBegin)); 00092 if(fIovEnd) { 00093 createElement(doc,iov,"INTERVAL_OF_VALIDITY_END", itoa(fIovEnd)); 00094 } 00095 return iov; 00096 }
DOMElement * HcalDQMDbInterface::createTag | ( | DOMDocument * | doc, | |
DOMElement * | parent, | |||
const char * | fTagName, | |||
const char * | fDetectorName, | |||
const char * | fComment | |||
) |
Definition at line 98 of file HcalDQMDbInterface.cc.
References createElement(), ecalRecalibSequence_cff::tag, and transcode().
Referenced by createFooter().
00099 { 00100 DOMElement* tag = createElement(doc,parent,"TAG"); 00101 tag->setAttribute(transcode("id"), transcode ("TAG_ID")); 00102 tag->setAttribute(transcode("mode"), transcode ("auto")); 00103 00104 createElement(doc,tag,"TAG_NAME", fTagName); 00105 createElement(doc,tag,"DETECTOR_NAME", fDetectorName); 00106 createElement(doc,tag,"COMMENT_DESCRIPTION", fComment); 00107 00108 return tag; 00109 }
const char* HcalDQMDbInterface::itoa | ( | int | i | ) | [inline] |
Definition at line 52 of file HcalDQMDbInterface.h.
References pyDBSRunClass::temp.
Referenced by createChannel(), HcalHotCellDbInterface::createData(), HcalHLXMaskDbInterface::createDataset(), HcalHotCellDbInterface::createHeader(), and createIOV().
00052 { 00053 char temp[256]; 00054 sprintf(temp,"%d",i); 00055 std::string outVal(temp); 00056 return outVal.c_str(); 00057 }
DOMElement * HcalDQMDbInterface::makeMapDataset | ( | DOMDocument * | doc, | |
DOMElement * | fIov | |||
) |
Definition at line 80 of file HcalDQMDbInterface.cc.
References createElement(), element(), and transcode().
Referenced by createFooter().
00080 { 00081 DOMElement* element = createElement(doc,fIov, "DATA_SET"); 00082 element->setAttribute(transcode("idref"), transcode("-1")); 00083 return element; 00084 }
DOMElement * HcalDQMDbInterface::makeMapIOV | ( | DOMDocument * | doc, | |
DOMElement * | fTag | |||
) |
Definition at line 74 of file HcalDQMDbInterface.cc.
References createElement(), and transcode().
Referenced by createFooter().
00074 { 00075 DOMElement* iov = createElement(doc,fTag, "IOV"); 00076 iov->setAttribute(transcode("idref"), transcode("IOV_ID")); 00077 return iov; 00078 }
DOMElement * HcalDQMDbInterface::makeMapTag | ( | DOMDocument * | doc, | |
DOMElement * | fMap | |||
) |
Definition at line 68 of file HcalDQMDbInterface.cc.
References createElement(), ecalRecalibSequence_cff::tag, and transcode().
Referenced by createFooter().
00068 { 00069 DOMElement* tag = createElement(doc, fMap, "TAG"); 00070 tag->setAttribute(transcode("idref"), transcode("TAG_ID")); 00071 return tag; 00072 }
void HcalDQMDbInterface::writeDocument | ( | DOMDocument * | doc, | |
const char * | xmlFile | |||
) |
Definition at line 36 of file HcalDQMDbInterface.cc.
References XML.
00036 { 00037 DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XML("Core")); 00038 DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter(); 00039 if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true)) 00040 theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true); 00041 if (theSerializer->canSetFeature(XMLUni::fgDOMWRTBOM, true)) 00042 theSerializer->setFeature(XMLUni::fgDOMWRTBOM, true); 00043 XMLFormatTarget *myFormTarget = new LocalFileFormatTarget(xmlFile); 00044 theSerializer->writeNode(myFormTarget, *doc); 00045 delete theSerializer; 00046 delete myFormTarget; 00047 }