30 XMLPlatformUtils::Initialize();
32 DOMImplementation* impl =
33 DOMImplementationRegistry::getDOMImplementation(
fromNative(
"LS").c_str());
35 DOMWriter* writer =
static_cast<DOMImplementationLS*
>(impl)->createDOMWriter( );
36 writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
38 DOMDocumentType* doctype = impl->createDocumentType(
fromNative(
"XML").c_str(), 0, 0 );
43 doc->setEncoding(
fromNative(
"UTF-8").c_str() );
44 doc->setStandalone(
true);
47 DOMElement*
root = doc->getDocumentElement();
51 for ( vector<AlignTransform>::const_iterator it = record.
m_align.begin();
52 it != record.
m_align.end(); it++ ) {
53 int Id = (*it).rawId();
54 int sub = (Id>>24)&0xF;
61 int side = (Id>>16)&1;
70 if(SM < 10) subdet <<
"0" << SM;
78 int side = (Id>>14)&1;
86 if(x == 20) subdet <<
"F";
87 else if(x == 70) subdet <<
"N";
88 else cout <<
" strange value for x " << x << endl;
95 int plane = (Id>>18)&1;
96 int side = (Id>>19)&1;
97 if(side == 0) subdet <<
"-";
99 if(plane) subdet <<
"F";
101 if(x/30) subdet <<
"F";
104 else cout <<
" problem sub = " << sub << endl;
105 cout << (*it).rawId()
106 <<
" " << (*it).rotation().getPhi()
107 <<
" " << (*it).rotation().getTheta()
108 <<
" " << (*it).rotation().getPsi()
109 <<
" " << (*it).translation().x()
110 <<
" " << (*it).translation().y()
111 <<
" " << (*it).translation().z()
113 uint32_t rawid = (*it).rawId();
114 DOMElement* cellnode =
116 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
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
const std::string z_tag("z")
const std::string Psi_tag("Psi")
XercesString fromNative(const char *str)
const std::string Theta_tag("Theta")
std::string toNative(const XMLCh *str)
const std::string AlignmentConstant_tag("EcalAlignmentConstant")
string root
initialization