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> 25 std::cout <<
" DCSTowerStatus should not be filled out from an xml file ..." << std::endl;
28 XercesDOMParser*
parser =
new XercesDOMParser;
29 parser->setValidationScheme(XercesDOMParser::Val_Never);
30 parser->setDoNamespaces(
false);
31 parser->setDoSchema(
false);
35 DOMDocument* xmlDoc =
parser->getDocument();
37 std::cout <<
"EcalDCSTowerStatusXMLTranslator::Error parsing document" << std::endl;
41 DOMElement* elementRoot = xmlDoc->getDocumentElement();
57 cellnode = cellnode->getNextSibling();
59 while (cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
60 cellnode = cellnode->getNextSibling();
83 unique_ptr<DOMImplementation>
impl(DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
85 DOMLSSerializer*
writer =
impl->createLSSerializer();
86 if (
writer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
87 writer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
89 DOMDocumentType* doctype =
impl->createDocumentType(
cms::xerces::uStr(
"XML").ptr(),
nullptr,
nullptr);
91 DOMElement*
root =
doc->getDocumentElement();
94 std::cout <<
" barrel size " <<
record.barrelItems().size() << std::endl;
95 if (
record.barrelItems().empty())
106 std::cout <<
" endcap size " <<
record.endcapItems().size() << std::endl;
107 if (
record.endcapItems().empty())
130 std::ofstream
fout(
fn.c_str());
132 std::cout <<
" barrel size " <<
record.barrelItems().size() << std::endl;
133 if (
record.barrelItems().empty())
154 std::cout <<
" endcap size " <<
record.endcapItems().size() << std::endl;
155 if (
record.endcapItems().empty())
157 int valEE[2][20][20];
158 for (
int k = 0;
k < 2;
k++)
159 for (
int ix = 0; ix < 20; ix++)
160 for (
int iy = 0; iy < 20; iy++)
161 valEE[
k][ix][iy] = -1;
165 int ix = rawid.
ix() - 1;
166 int iy = 20 - rawid.
iy();
167 int side = rawid.
zside();
171 if (ix < 0 || ix > 19)
172 std::cout <<
" Pb in ix " << ix << std::endl;
173 if (iy < 0 || iy > 19)
174 std::cout <<
" Pb in iy " << iy << std::endl;
175 valEE[iz][ix][iy] =
record[rawid].getStatusCode();
178 for (
int k = 0;
k < 2;
k++) {
182 fout <<
" Side : " << iz << std::endl;
184 for (
int ix = 0; ix < 20; ix++) {
185 if (valEE[
k][ix][
line] < 0)
188 fout << setw(2) << valEE[
k][ix][
line] <<
" ";
static int readXML(const std::string &filename, EcalCondHeader &header, EcalDCSTowerStatus &record)
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
const std::string DCSTowerStatus_tag("EcalDCSTowerStatus")
int ieta() const
get the tower ieta
static void plot(std::string, const EcalDCSTowerStatus &record)
static EcalScDetId unhashIndex(int hi)
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
std::string toString(XMLCh const *toTranscode)
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
const std::string Cell_tag("cell")
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
ZStr< XMLCh > uStr(char const *str)
const std::string DCSStatusCode_tag("DCSStatusCode")
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 int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalDCSTowerStatus &record)
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
static bool validHashIndex(int hi)
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
static std::string dumpXML(const EcalCondHeader &header, const EcalDCSTowerStatus &record)
int iphi() const
get the tower iphi
const DetId readCellId(xercesc::DOMElement *node)
Assuming.