4 #include <xercesc/dom/DOMNode.hpp>
5 #include <xercesc/dom/DOM.hpp>
6 #include <xercesc/parsers/XercesDOMParser.hpp>
9 #include <xercesc/util/XMLString.hpp>
10 #include <xercesc/sax/SAXException.hpp>
11 #include <xercesc/framework/LocalFileFormatTarget.hpp>
18 using namespace XERCES_CPP_NAMESPACE;
27 XercesDOMParser*
parser =
new XercesDOMParser;
28 parser->setValidationScheme(XercesDOMParser::Val_Never);
29 parser->setDoNamespaces(
false);
30 parser->setDoSchema(
false);
32 parser->parse(filename.c_str());
34 DOMDocument* xmlDoc = parser->getDocument();
36 std::cout <<
"EcalPulseShapesXMLTranslator::Error parsing document" << std::endl;
40 DOMElement* elementRoot = xmlDoc->getDocumentElement();
103 record[detid].pdfval[
s] = samples[
s];
105 cellnode = cellnode->getNextSibling();
107 while (cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
108 cellnode = cellnode->getNextSibling();
114 std::cout <<
" nb of channels found in xml file " << chan << std::endl;
123 std::fstream fs(filename.c_str(),
ios::out);
132 unique_ptr<DOMImplementation> impl(DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
134 DOMLSSerializer* writer = impl->createLSSerializer();
135 if (writer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
136 writer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
138 DOMDocumentType* doctype = impl->createDocumentType(
cms::xerces::uStr(
"XML").ptr(),
nullptr,
nullptr);
141 DOMElement* root = doc->getDocumentElement();
149 if (record.
find(rawid) == record.
end())
151 if (!record[rawid].pdfval[5])
154 DOMElement* cellnode =
writeCell(root, rawid);
178 if (record.
find(rawid) == record.
end())
180 if (!record[rawid].pdfval[5])
183 DOMElement* cellnode =
writeCell(root, rawid);
const std::string sample9_tag("sample_9")
const std::string sample10_tag("sample_10")
const std::string sample0_tag("sample_0")
const std::string PulseShapes_tag("EcalPulseShapes")
const std::string sample2_tag("sample_2")
tuple chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
const Items & barrelItems() const
static const int TEMPLATESAMPLES
const std::string sample11_tag("sample_11")
const std::string sample5_tag("sample_5")
static EEDetId unhashIndex(int hi)
const std::string sample7_tag("sample_7")
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)
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
const std::string sample3_tag("sample_3")
static const int MIN_HASH
const std::string Cell_tag("cell")
const std::string sample8_tag("sample_8")
const std::string sample1_tag("sample_1")
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
ZStr< XMLCh > uStr(char const *str)
static int readXML(const std::string &filename, EcalCondHeader &header, EcalPulseShapes &record)
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
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
static std::string dumpXML(const EcalCondHeader &header, const EcalPulseShapes &record)
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalPulseShapes &record)
const_iterator find(uint32_t rawId) const
const_iterator end() const
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
const std::string sample6_tag("sample_6")
const Items & endcapItems() const
const std::string sample4_tag("sample_4")
const DetId readCellId(xercesc::DOMElement *node)
Assuming.
tuple dump
OutputFilePath = cms.string('/tmp/zhokin/'), OutputFileExt = cms.string(''),.