|
|
Go to the documentation of this file.
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>
24 std::cout <<
" DAQTowerStatus should not be filled out from an xml file ..." << std::endl;
27 XercesDOMParser*
parser =
new XercesDOMParser;
28 parser->setValidationScheme(XercesDOMParser::Val_Never);
29 parser->setDoNamespaces(
false);
30 parser->setDoSchema(
false);
34 DOMDocument* xmlDoc =
parser->getDocument();
36 std::cout <<
"EcalDAQTowerStatusXMLTranslator::Error parsing document" << std::endl;
40 DOMElement* elementRoot = xmlDoc->getDocumentElement();
56 cellnode = cellnode->getNextSibling();
58 while (cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
59 cellnode = cellnode->getNextSibling();
82 unique_ptr<DOMImplementation>
impl(DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
84 DOMLSSerializer*
writer =
impl->createLSSerializer();
85 if (
writer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
86 writer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
88 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)
xercesc::DOMNode * getChildNode(xercesc::DOMNode *node, const std::string &nodename)
get the child of
int iphi() const
get the tower iphi
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
static void plot(std::string, const EcalDAQTowerStatus &record)
const std::string DAQStatusCode_tag("DAQStatusCode")
static EcalScDetId unhashIndex(int hi)
static int readXML(const std::string &filename, EcalCondHeader &header, EcalDAQTowerStatus &record)
std::string toString(XMLCh const *toTranscode)
static std::string dumpXML(const EcalCondHeader &header, const EcalDAQTowerStatus &record)
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
const std::string DAQTowerStatus_tag("EcalDAQTowerStatus")
static bool validHashIndex(int hi)
ZStr< XMLCh > uStr(char const *str)
int ieta() const
get the tower ieta
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi....
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
const DetId readCellId(xercesc::DOMElement *node)
Assuming.
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalDAQTowerStatus &record)
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
const std::string Cell_tag("cell")
void GetNodeData(xercesc::DOMNode *node, T &value)
get the node data