4 template <
class T> XMLCh* transcode (
const T& fInput) {
5 std::ostringstream ost;
7 return XMLString::transcode(ost.str().c_str());
12 DOMElement*
elem = doc->createElement(
XML(name));
13 parent->appendChild(elem);
19 elem->appendChild(doc->createTextNode(
XML(value)));
24 DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(
XML(
"Core"));
25 return impl->createDocument(0,
XML(
"ROOT"),0);
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);
42 unsigned long long fIovBegin,
unsigned long long fIovEnd,
43 const char* fTagName,
const char* fDetectorName,
const char* fComment){
45 DOMElement*
parent = doc->getDocumentElement();
48 dataset->setAttribute(transcode(
"id"), transcode(
"-1"));
50 createTag(doc,elems,fTagName,fDetectorName,fComment);
62 tag->setAttribute(transcode(
"idref"), transcode(
"TAG_ID"));
68 iov->setAttribute(transcode(
"idref"), transcode(
"IOV_ID"));
74 element->setAttribute(transcode(
"idref"), transcode(
"-1"));
79 unsigned long long fIovBegin,
unsigned long long fIovEnd) {
81 iov->setAttribute(transcode(
"id"), transcode(
"IOV_ID"));
91 const char* fTagName,
const char* fDetectorName,
const char* fComment) {
93 tag->setAttribute(transcode(
"id"), transcode (
"TAG_ID"));
94 tag->setAttribute(transcode(
"mode"), transcode (
"auto"));
105 DOMElement*
parent = doc->getDocumentElement();
108 createElement(doc,typeElem,
"EXTENSION_TABLE_NAME",
"HCAL_CHANNEL_ON_OFF_STATES");
109 createElement(doc,typeElem,
"NAME",
"HCAL channel on off states");
120 createElement(doc,chanElem,
"EXTENSION_TABLE_NAME",
"HCAL_CHANNELS");
144 DOMElement*
parent = doc->getDocumentElement();
145 DOMElement* dataSetElem =
createElement(doc,parent,
"DATA_SET");
156 DOMElement*
parent = doc->getDocumentElement();
159 createElement(doc,typeElem,
"EXTENSION_TABLE_NAME",
"HCAL_HLX_MASKS_TYPE01");
160 createElement(doc,typeElem,
"NAME",
"HCAL HLX masks [type 1]");
162 element->setAttribute(transcode(
"mode"), transcode(
"no-run"));
168 char tmp[5] =
"fooo";
169 sprintf(tmp,
"%i",masks.
occMask);
171 sprintf(tmp,
"%i",masks.
lhcMask);
180 const char*
version,
const char* subversion){
182 DOMElement*
parent = doc->getDocumentElement();
183 DOMElement* dataSetElem =
createElement(doc,parent,
"DATA_SET");
189 DOMElement* partAssElem =
createElement(doc,dataSetElem,
"PART_ASSEMBLY");
190 DOMElement* parentPartAssElem =
createElement(doc,partAssElem,
"PARENT_PART");
191 createElement(doc, parentPartAssElem,
"KIND_OF_PART",
"HCAL HTR Crate");
194 else{ sprintf(tmp,
"CRATE%i",masks.
crateId);}
197 DOMElement* childUniqueIdByElem =
createElement(doc,partAssElem,
"CHILD_UNIQUELY_IDENTIFIED_BY");
198 createElement(doc, childUniqueIdByElem,
"KIND_OF_PART",
"HCAL HTR Crate Slot");
199 DOMElement* attributeElem =
createElement(doc,childUniqueIdByElem,
"ATTRIBUTE");
200 createElement(doc, attributeElem,
"NAME",
"HCAL HTR Slot Number");
DOMElement * createData(DOMDocument *doc, DOMElement *parent, const HcalDQMChannelQuality::Item &item)
void createHeader(DOMDocument *doc, unsigned int runno, const char *startTime)
DOMElement * createFooter(DOMDocument *doc, unsigned long long fIovBegin, unsigned long long fIovEnd, const char *fTagName, const char *fDetectorName, const char *fComment)
DOMDocument * createDocument()
DOMElement * createElement(DOMDocument *doc, DOMElement *parent, const char *name)
DOMElement * createChannel(DOMDocument *doc, DOMElement *parent, HcalDetId id)
void createDataset(DOMDocument *doc, const HcalDQMChannelQuality::Item &item, const char *gmtime, const char *version)
DOMElement * createTag(DOMDocument *doc, DOMElement *parent, const char *fTagName, const char *fDetectorName, const char *fComment)
DOMElement * makeMapIOV(DOMDocument *doc, DOMElement *fTag)
void writeDocument(DOMDocument *doc, const char *xmlFile)
bool xmlFile(const std::string fParam)
std::vector< std::vector< double > > tmp
void createHeader(DOMDocument *doc)
DOMElement * makeMapTag(DOMDocument *doc, DOMElement *fMap)
DOMElement * createDataset(DOMDocument *doc, const HcalHLXMask &mask, const char *gmtime, const char *version, const char *subversion)
void createData(DOMDocument *doc, DOMElement *parent, const HcalHLXMask &mask)
const std::string & getFlavor() const
DOMElement * makeMapDataset(DOMDocument *doc, DOMElement *fIov)
DOMElement * createIOV(DOMDocument *doc, DOMElement *parent, unsigned long long fIovBegin, unsigned long long fIovEnd)
static const uint32_t masks[]