|
|
Go to the documentation of this file.
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);
196 DOMDocument* xmlDoc =
parser->getDocument();
199 std::cout <<
"Error parsing document" << std::endl;
203 DOMElement* elementRoot = xmlDoc->getDocumentElement();
xercesc::DOMNode * getChildNode(xercesc::DOMNode *node, const std::string &nodename)
get the child of
const std::string Header_versiontag("version")
int ieta() const
get the crystal ieta
int iphi() const
get the tower iphi
const std::string iySC_tag("iySC")
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
void GetNodeStringData(xercesc::DOMNode *node, std::string &value)
get the node data as string. Needs to be used to avoid splitting
const std::string iPhi_tag("iPhi")
const std::string Header_tag("EcalCondHeader")
std::string toString(XMLCh const *toTranscode)
const std::string Header_sincetag("since")
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
const std::string zside_tag("zside")
const std::string Header_datasourcetag("datasource")
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
const std::string iEta_tag("iEta")
const std::string ixSC_tag("ixSC")
const std::string ix_tag("ix")
ZStr< XMLCh > uStr(char const *str)
int ieta() const
get the tower ieta
const std::string Header_methodtag("method")
const std::string Header_tagtag("tag")
constexpr uint32_t rawId() const
get the raw id
int iphi() const
get the crystal iphi
const DetId readCellId(xercesc::DOMElement *node)
Assuming.
const std::string iy_tag("iy")
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
const std::string Cell_tag("cell")
const std::string Header_datetag("date")
void GetNodeData(xercesc::DOMNode *node, T &value)
get the node data