#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include "CalibFormats/HcalObjects/interface/HcalText2DetIdConverter.h"
#include "CondFormats/HcalObjects/interface/AllObjects.h"
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOMElement.hpp>
#include <xercesc/dom/DOMText.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationRegistry.hpp>
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMWriter.hpp>
#include "CondTools/Hcal/interface/StreamOutFormatTarget.h"
#include "CondTools/Hcal/interface/HcalDbXml.h"
Go to the source code of this file.
Classes | |
class | XMLDocument |
Functions | |
template<class T1 , class T2 > | |
bool | dumpObject_ (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const T1 *fObject1, const T2 *fObject2=0) |
bool dumpObject_ | ( | std::ostream & | fOutput, |
unsigned | fRun, | ||
unsigned long | fGMTIOVBegin, | ||
unsigned long | fGMTIOVEnd, | ||
const std::string & | fTag, | ||
const T1 * | fObject1, | ||
const T2 * | fObject2 = 0 |
||
) |
Definition at line 307 of file HcalDbXml.cc.
References XMLDocument::addData(), gather_cfg::cout, runTheMatrix::data, BeamSplash_cfg::dataset, asciidump::doc, asciidump::elements, XMLDocument::makeChId(), XMLDocument::makeData(), XMLDocument::makeDataset(), XMLDocument::makeElement(), XMLDocument::makeElementDataset(), XMLDocument::makeElementIOV(), XMLDocument::makeElementTag(), XMLDocument::makeHeader(), XMLDocument::makeMapDataset(), XMLDocument::makeMapIOV(), XMLDocument::makeMaps(), XMLDocument::makeMapTag(), dbtoconf::root, XMLDocument::root(), XMLDocument::streamOut(), and BeamSplash_cfg::version.
Referenced by HcalDbXml::dumpObject().
{ if (!fObject1) return false; const std::string KIND = kind (*fObject1); XMLDocument doc; DOMElement* root = doc.root (); doc.makeHeader (root, KIND, fRun); DOMElement* elements = doc.makeElement (root); doc.makeElementIOV (elements, fGMTIOVBegin, fGMTIOVEnd); doc.makeElementTag (elements, fTag, "HCAL"); DOMElement* iovmap = doc.makeMapIOV (doc.makeMapTag (doc.makeMaps (root))); std::vector<DetId> detids = fObject1->getAllChannels (); for (unsigned iCh = 0; iCh < detids.size(); iCh++) { DetId id = detids [iCh]; ostringstream version; version << fTag << '_' << fGMTIOVBegin; // CONVENTION: version == tag + iov for initial setting DOMElement* dataset = doc.makeDataset (root, version.str()); doc.makeChId (dataset, id); DOMElement* data = doc.makeData (dataset); doc.addData (data, *(fObject1->getValues (id))); try { if (fObject2) doc.addData (data, *(fObject2->getValues (id))); } catch (...) { std::cout << "dumpObject_-> ERROR: width is not available for cell # " << id.rawId() << std::endl; } doc.makeElementDataset (elements, iCh, id, version.str(), KIND, fRun); doc.makeMapDataset (iovmap, iCh); } doc.streamOut (fOutput); return true; }