#include <EcalClusterEnergyCorrectionXMLTranslator.h>
Static Public Member Functions | |
static std::string | dumpXML (const EcalCondHeader &header, const EcalFunParams &record) |
static int | readXML (const std::string &filename, EcalCondHeader &header, EcalFunParams &record) |
static int | writeXML (const std::string &filename, const EcalCondHeader &header, const EcalFunParams &record) |
Translates a EcalClusterEnergyCorrection record to XML and vice versa
Definition at line 21 of file EcalClusterEnergyCorrectionXMLTranslator.h.
std::string EcalClusterEnergyCorrectionXMLTranslator::dumpXML | ( | const EcalCondHeader & | header, |
const EcalFunParams & | record | ||
) | [static] |
Definition at line 56 of file EcalClusterEnergyCorrectionXMLTranslator.cc.
References asciidump::doc, hcal_timing_source_file_cfg::dump, xuti::fromNative(), EcalFunParams::params(), dbtoconf::root, xuti::toNative(), xuti::Value_tag(), xuti::writeHeader(), and xuti::WriteNodeWithValue().
{ XMLPlatformUtils::Initialize(); DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(fromNative("LS").c_str()); DOMWriter* writer = static_cast<DOMImplementationLS*>(impl)->createDOMWriter( ); writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true); DOMDocumentType* doctype = impl->createDocumentType( fromNative("XML").c_str(), 0, 0 ); const std::string EcalClusterEnergyCorrection_tag("EcalClusterEnergyCorrection"); DOMDocument * doc = impl->createDocument( 0, fromNative(EcalClusterEnergyCorrection_tag).c_str(), doctype ); doc->setEncoding(fromNative("UTF-8").c_str() ); doc->setStandalone(true); doc->setVersion(fromNative("1.0").c_str() ); DOMElement* root = doc->getDocumentElement(); xuti::writeHeader(root, header); const std::string ECEC_tag("ClusterEnergy"); for ( EcalFunctionParameters::const_iterator it = record.params().begin(); it != record.params().end(); ++it ) { DOMElement* ECEC = root->getOwnerDocument()->createElement( fromNative(ECEC_tag).c_str()); root->appendChild(ECEC); WriteNodeWithValue(ECEC,Value_tag,*it); } std::string dump= toNative(writer->writeToString(*root)); doc->release(); return dump; }
static int EcalClusterEnergyCorrectionXMLTranslator::readXML | ( | const std::string & | filename, |
EcalCondHeader & | header, | ||
EcalFunParams & | record | ||
) | [static] |
int EcalClusterEnergyCorrectionXMLTranslator::writeXML | ( | const std::string & | filename, |
const EcalCondHeader & | header, | ||
const EcalFunParams & | record | ||
) | [static] |
Definition at line 99 of file EcalClusterEnergyCorrectionXMLTranslator.cc.
References EcalCondTools::dumpXML(), and dbtoconf::out.