CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions
ESGainXMLTranslator Class Reference

#include <ESGainXMLTranslator.h>

Static Public Member Functions

static std::string dumpXML (const EcalCondHeader &header, const ESGain &record)
 
static int writeXML (const std::string &filename, const EcalCondHeader &header, const ESGain &record)
 

Detailed Description

Definition at line 23 of file ESGainXMLTranslator.h.

Member Function Documentation

std::string ESGainXMLTranslator::dumpXML ( const EcalCondHeader header,
const ESGain record 
)
static

Definition at line 30 of file ESGainXMLTranslator.cc.

References xuti::ADCToGeVConstant_tag(), asciidump::doc, hcal_timing_source_file_cfg::dump, xuti::ESGain_tag(), xuti::fromNative(), ESGain::getESGain(), dbtoconf::root, AlCaHLTBitMon_QueryRunRegistry::string, xuti::toNative(), xuti::writeHeader(), xuti::WriteNodeWithValue(), and cms::concurrency::xercesInitialize().

Referenced by cond::PayLoadInspector< DataT >::dump().

31  {
32 
34 
35  DOMImplementation* impl =
36  DOMImplementationRegistry::getDOMImplementation(fromNative("LS").c_str());
37 
38  DOMWriter* writer =static_cast<DOMImplementationLS*>(impl)->createDOMWriter( );
39  writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
40 
41  DOMDocumentType* doctype = impl->createDocumentType(fromNative("XML").c_str(), 0, 0 );
42  DOMDocument * doc =
43  impl->createDocument( 0, fromNative(ADCToGeVConstant_tag).c_str(), doctype );
44 
45 
46  doc->setEncoding(fromNative("UTF-8").c_str() );
47  doc->setStandalone(true);
48  doc->setVersion(fromNative("1.0").c_str() );
49 
50  DOMElement* root = doc->getDocumentElement();
51 
52  xuti::writeHeader(root,header);
53 
55 
56  std::string dump= toNative(writer->writeToString(*root));
57  doc->release();
58 
59  // cms::concurrency::xercesTerminate();
60 
61  return dump;
62 }
void xercesInitialize()
Definition: Xerces.cc:17
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
const std::string ESGain_tag("ESGain")
const std::string ADCToGeVConstant_tag("EcalADCToGeVConstant")
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
tuple doc
Definition: asciidump.py:381
float getESGain() const
Definition: ESGain.h:11
XercesString fromNative(const char *str)
Definition: XercesString.h:31
std::string toNative(const XMLCh *str)
Definition: XercesString.h:42
string root
initialization
Definition: dbtoconf.py:70
int ESGainXMLTranslator::writeXML ( const std::string &  filename,
const EcalCondHeader header,
const ESGain record 
)
static

Definition at line 21 of file ESGainXMLTranslator.cc.

References EcalCondTools::dumpXML(), and dbtoconf::out.

23  {
24  std::fstream fs(filename.c_str(),ios::out);
25  fs<< dumpXML(header,record);
26  return 0;
27 
28 }
static std::string dumpXML(const EcalCondHeader &header, const ESGain &record)
tuple out
Definition: dbtoconf.py:99
tuple filename
Definition: lut2db_cfg.py:20