12 #include <xercesc/dom/DOM.hpp>
13 #include <xercesc/dom/DOMNode.hpp>
14 #include <xercesc/parsers/XercesDOMParser.hpp>
17 #include <xercesc/framework/LocalFileFormatTarget.hpp>
22 using namespace xercesc;
33 stringstream ieta_str;
34 stringstream iphi_str;
37 stringstream ixSC_str;
38 stringstream iySC_str;
39 stringstream zside_str;
60 if (ix && iy && zside) {
63 if (ixSC && iySC && zside) {
67 cerr <<
"XMLCell: error reading cell, missing field ?" << std::endl;
74 node->appendChild(cell_node);
88 unsigned int ScIdCheck = detid.
rawId() & 0x00008000;
104 stringstream value_s;
122 stringstream value_s;
139 for (DOMNode* childNode = node->getFirstChild(); childNode; childNode = childNode->getNextSibling()) {
140 if (childNode->getNodeType() == DOMNode::ELEMENT_NODE) {
143 if (foundName == nodename)
153 parentNode->appendChild(headernode);
189 XercesDOMParser*
parser =
new XercesDOMParser;
190 parser->setValidationScheme(XercesDOMParser::Val_Never);
191 parser->setDoNamespaces(
false);
192 parser->setDoSchema(
false);
194 parser->parse(filename.c_str());
196 DOMDocument* xmlDoc = parser->getDocument();
199 std::cout <<
"Error parsing document" << std::endl;
203 DOMElement* elementRoot = xmlDoc->getDocumentElement();
void GetNodeStringData(xercesc::DOMNode *node, std::string &value)
get the node data as string. Needs to be used to avoid splitting
const std::string iySC_tag("iySC")
const std::string Header_sincetag("since")
constexpr uint32_t rawId() const
get the raw id
const std::string iEta_tag("iEta")
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
int ieta() const
get the tower ieta
int iphi() const
get the crystal iphi
std::string toString(XMLCh const *toTranscode)
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
const std::string Header_methodtag("method")
const std::string Cell_tag("cell")
const std::string ix_tag("ix")
const std::string Header_datetag("date")
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
ZStr< XMLCh > uStr(char const *str)
int ieta() const
get the crystal ieta
const std::string iy_tag("iy")
const std::string Header_tagtag("tag")
const std::string Header_versiontag("version")
int iphi() const
get the tower iphi
const std::string Header_tag("EcalCondHeader")
void GetNodeData(xercesc::DOMNode *node, T &value)
get the node data
xercesc::DOMNode * getChildNode(xercesc::DOMNode *node, const std::string &nodename)
get the child of
const std::string zside_tag("zside")
const std::string Header_datasourcetag("datasource")
const std::string ixSC_tag("ixSC")
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
const std::string iPhi_tag("iPhi")
const DetId readCellId(xercesc::DOMElement *node)
Assuming.