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;
28 XercesDOMParser*
parser =
new XercesDOMParser;
29 parser->setValidationScheme( XercesDOMParser::Val_Never );
30 parser->setDoNamespaces(
false );
31 parser->setDoSchema(
false );
33 parser->parse(filename.c_str());
35 DOMDocument* xmlDoc = parser->getDocument();
37 std::cout <<
"EcalPulseShapesXMLTranslator::Error parsing document" << std::endl;
41 DOMElement* elementRoot = xmlDoc->getDocumentElement();
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;
134 unique_ptr<DOMImplementation> impl( DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
136 DOMLSSerializer* writer = impl->createLSSerializer();
137 if( writer->getDomConfig()->canSetParameter( XMLUni::fgDOMWRTFormatPrettyPrint,
true ))
138 writer->getDomConfig()->setParameter( XMLUni::fgDOMWRTFormatPrettyPrint,
true );
140 DOMDocumentType* doctype = impl->createDocumentType(
cms::xerces::uStr(
"XML").ptr(), 0, 0 );
144 DOMElement*
root = doc->getDocumentElement();
153 if (record.
find(rawid) == record.
end())
continue;
154 if(!record[rawid].pdfval[5])
continue;
156 DOMElement* cellnode=
writeCell(root,rawid);
181 if (record.
find(rawid) == record.
end())
continue;
182 if(!record[rawid].pdfval[5])
continue;
184 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.
edm::Service< TFileService > fs