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>
23 using namespace XERCES_CPP_NAMESPACE;
32 std::fstream fs(filename.c_str(),
ios::out);
42 unique_ptr<DOMImplementation> impl(DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
44 DOMLSSerializer* writer = impl->createLSSerializer();
45 if (writer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
46 writer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
47 DOMDocumentType* doctype = impl->createDocumentType(
cms::xerces::uStr(
"XML").ptr(),
nullptr,
nullptr);
50 DOMElement* root = doc->getDocumentElement();
60 std::cout <<
"EcalTPGCrystalStatusXMLTranslator::dumpXML" << std::endl;
62 int thesign =
sign == 1 ? 1 : -1;
64 for (
int ieta = 0; ieta <
kBarlRings; ieta++) {
66 EBDetId id((ieta + 1) * thesign, iphi + 1);
67 if (record[
id.rawId()].getStatusCode() > 0) {
68 DOMElement* cellnode =
writeCell(root,
id);
79 if (record[
id.rawId()].getStatusCode() > 0) {
80 DOMElement* cellnode =
writeCell(root,
id);
uint16_t *__restrict__ id
static std::string dumpXML(const EcalCondHeader &header, const EcalTPGCrystalStatus &record)
static const int kBarlRings
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static const int kBarlWedges
std::string toString(XMLCh const *toTranscode)
static const int kEndcWedgesX
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
const std::string TPGCrystalStatus_tag("EcalTPGCrystalStatus")
ZStr< XMLCh > uStr(char const *str)
static const int MAX_IPHI
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int MAX_IETA
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalTPGCrystalStatus &record)
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
tuple dump
OutputFilePath = cms.string('/tmp/zhokin/'), OutputFileExt = cms.string(''),.
static const int kEndcWedgesY