6 #include <xercesc/dom/DOMNode.hpp>
7 #include <xercesc/dom/DOM.hpp>
8 #include <xercesc/parsers/XercesDOMParser.hpp>
9 #include <xercesc/util/XMLString.hpp>
10 #include <xercesc/sax/SAXException.hpp>
11 #include <xercesc/framework/LocalFileFormatTarget.hpp>
16 using namespace XERCES_CPP_NAMESPACE;
25 fstream fs(filename.c_str(),
ios::out);
34 unique_ptr<DOMImplementation> impl(DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
36 DOMLSSerializer* writer = impl->createLSSerializer();
37 if (writer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
38 writer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
40 DOMDocumentType* doctype = impl->createDocumentType(
cms::xerces::uStr(
"XML").ptr(),
nullptr,
nullptr);
42 DOMElement* root = doc->getDocumentElement();
46 for (vector<AlignTransform>::const_iterator it = record.
m_align.begin(); it != record.
m_align.end(); it++) {
47 int Id = (*it).rawId();
48 int sub = (Id >> 24) & 0xF;
55 int side = (Id >> 16) & 1;
67 }
else if (sub == 4) {
70 int x = (Id >> 7) & 0x7F;
72 int side = (Id >> 14) & 1;
84 cout <<
" strange value for x " << x << endl;
85 }
else if (sub == 6) {
88 int x = (Id >> 6) & 0x3F;
90 int plane = (Id >> 18) & 1;
91 int side = (Id >> 19) & 1;
105 cout <<
" problem sub = " << sub << endl;
106 cout << (*it).rawId() <<
" " << (*it).rotation().getPhi() <<
" " << (*it).rotation().getTheta() <<
" "
107 << (*it).rotation().getPsi() <<
" " << (*it).translation().x() <<
" " << (*it).translation().y() <<
" "
108 << (*it).translation().z() << endl;
109 uint32_t rawid = (*it).rawId();
111 root->appendChild(cellnode);
const std::string Phi_tag("Phi")
const std::string x_tag("x")
const std::string id_tag("id")
std::vector< AlignTransform > m_align
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static std::string dumpXML(const EcalCondHeader &header, const Alignments &record)
std::string toString(XMLCh const *toTranscode)
static int writeXML(const std::string &filename, const EcalCondHeader &header, const Alignments &record)
const std::string y_tag("y")
const std::string Cell_tag("cell")
const std::string subdet_tag("SubDet")
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
ZStr< XMLCh > uStr(char const *str)
const std::string z_tag("z")
const std::string Psi_tag("Psi")
const std::string Theta_tag("Theta")
const std::string AlignmentConstant_tag("EcalAlignmentConstant")
tuple dump
OutputFilePath = cms.string('/tmp/zhokin/'), OutputFileExt = cms.string(''),.