5 #include <xercesc/dom/DOMNode.hpp> 6 #include <xercesc/dom/DOM.hpp> 7 #include <xercesc/parsers/XercesDOMParser.hpp> 10 #include <xercesc/util/XMLString.hpp> 11 #include <xercesc/sax/SAXException.hpp> 12 #include <xercesc/framework/LocalFileFormatTarget.hpp> 29 XercesDOMParser*
parser =
new XercesDOMParser;
30 parser->setValidationScheme(XercesDOMParser::Val_Never);
31 parser->setDoNamespaces(
false);
32 parser->setDoSchema(
false);
36 DOMDocument* xmlDoc =
parser->getDocument();
38 std::cout <<
"EcalPulseSymmCovariancesXMLTranslator::Error parsing document" << std::endl;
42 DOMElement* elementRoot = xmlDoc->getDocumentElement();
56 std::vector<std::string> pulsecov_tag(
65 pulsecov_tag[
k] = Form(
"samplecov_%d_%d",
i,
j);
79 cellnode = cellnode->getNextSibling();
81 while (cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
82 cellnode = cellnode->getNextSibling();
88 std::cout <<
" nb of channels found in xml file " <<
chan << std::endl;
107 unique_ptr<DOMImplementation>
impl(DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
109 DOMLSSerializer*
writer =
impl->createLSSerializer();
110 if (
writer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
111 writer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
113 DOMDocumentType* doctype =
impl->createDocumentType(
cms::xerces::uStr(
"XML").ptr(),
nullptr,
nullptr);
116 DOMElement*
root =
doc->getDocumentElement();
127 pulsecov_tag[linK] = Form(
"samplecov_%d_%d",
i,
j);
131 if (
record.barrelItems().empty())
145 if (
record.endcapItems().empty())
static constexpr int kSizeForDenseIndexing
static const int TEMPLATESAMPLES
static EEDetId unhashIndex(int hi)
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static bool validHashIndex(int i)
std::string toString(XMLCh const *toTranscode)
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalPulseSymmCovariances &record)
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
static constexpr int kSizeForDenseIndexing
static const int MIN_HASH
const std::string Cell_tag("cell")
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
ZStr< XMLCh > uStr(char const *str)
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 PulseSymmCovariances_tag("EcalPulseSymmCovariances")
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
static int readXML(const std::string &filename, EcalCondHeader &header, EcalPulseSymmCovariances &record)
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
const DetId readCellId(xercesc::DOMElement *node)
Assuming.
Power< A, B >::type pow(const A &a, const B &b)
static std::string dumpXML(const EcalCondHeader &header, const EcalPulseSymmCovariances &record)