11 using namespace XERCES_CPP_NAMESPACE;
18 std::fstream fs(filename.c_str(),
ios::out);
28 DOMImplementation* impl =
29 DOMImplementationRegistry::getDOMImplementation(
fromNative(
"LS").c_str());
31 DOMWriter* writer =
static_cast<DOMImplementationLS*
>(impl)->createDOMWriter( );
32 writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
34 DOMDocumentType* doctype = impl->createDocumentType(
fromNative(
"XML").c_str(), 0, 0 );
39 doc->setEncoding(
fromNative(
"UTF-8").c_str() );
40 doc->setStandalone(
true);
43 DOMElement*
root = doc->getDocumentElement();
49 fout.open(
"Linearization.txt");
57 DOMElement* cellnode=
writeCell(root,rawid);
59 float m12=(
record)[rawid].mult_x12;
60 float s12=(
record)[rawid].shift_x12;
61 float m6 =(
record)[rawid].mult_x6;
62 float s6 =(
record)[rawid].shift_x6;
63 float m1 =(
record)[rawid].mult_x1;
64 float s1 =(
record)[rawid].shift_x1;
72 fout << rawid <<
" " << m12 <<
" " << m6 <<
" " << m1 <<
" " << s12 <<
" " << s6 <<
" " << s1 <<
"\n";
82 DOMElement* cellnode=
writeCell(root,rawid);
84 float m12=(
record)[rawid].mult_x12;
85 float s12=(
record)[rawid].shift_x12;
86 float m6 =(
record)[rawid].mult_x6;
87 float s6 =(
record)[rawid].shift_x6;
88 float m1 =(
record)[rawid].mult_x1;
89 float s1 =(
record)[rawid].shift_x1;
97 fout << rawid <<
" " << m12 <<
" " << m6 <<
" " << m1 <<
" " << s12 <<
" " << s6 <<
" " << s1 <<
"\n";
const std::string Linearization_m1_tag("mult1")
static std::string dumpXML(const EcalCondHeader &header, const EcalTPGLinearizationConst &record)
const std::string Linearization_s12_tag("shift12")
static EEDetId unhashIndex(int hi)
const std::string Linearization_m12_tag("mult12")
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static bool validHashIndex(int i)
const std::string Linearization_m6_tag("mult6")
const std::string Linearization_s6_tag("shift6")
static const int MIN_HASH
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
const std::string Linearization_s1_tag("shift1")
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalTPGLinearizationConst &record)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
XercesString fromNative(const char *str)
const std::string Linearization_tag("EcalTPGLinearizationConts")
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
std::string toNative(const XMLCh *str)
string root
initialization