29 XMLPlatformUtils::Initialize();
31 XercesDOMParser*
parser =
new XercesDOMParser;
32 parser->setValidationScheme( XercesDOMParser::Val_Never );
33 parser->setDoNamespaces(
false );
34 parser->setDoSchema(
false );
38 DOMDocument* xmlDoc = parser->getDocument();
40 std::cout <<
"EcalWeightSetXMLTranslator::Error parsing document" << std::endl;
44 DOMElement* elementRoot = xmlDoc->getDocumentElement();
56 DOMElement* rowelement;
61 rowelement =
dynamic_cast< xercesc::DOMElement*
>(rownode);
65 std::stringstream rowid_ss(rowid_s);
71 std::stringstream weightrow_s(weightrow);
74 while(weightrow_s >> weight)
82 rownode = rownode->getNextSibling();
84 while (rownode && rownode->getNodeType( ) != DOMNode::ELEMENT_NODE)
85 rownode = rownode->getNextSibling();
95 rowelement =
dynamic_cast< xercesc::DOMElement*
>(rownode);
99 std::stringstream rowid_ss(rowid_s);
105 std::stringstream weightrow_s(weightrow);
108 while(weightrow_s >> weight)
116 rownode = rownode->getNextSibling();
118 while (rownode && rownode->getNodeType( ) != DOMNode::ELEMENT_NODE)
119 rownode = rownode->getNextSibling();
130 rowelement =
dynamic_cast< xercesc::DOMElement*
>(rownode);
133 std::stringstream rowid_ss(rowid_s);
139 std::stringstream weightrow_s(weightrow);
142 while(weightrow_s >> weight)
150 rownode = rownode->getNextSibling();
152 while (rownode && rownode->getNodeType( ) != DOMNode::ELEMENT_NODE)
153 rownode = rownode->getNextSibling();
165 rowelement =
dynamic_cast< xercesc::DOMElement*
>(rownode);
168 std::stringstream rowid_ss(rowid_s);
174 std::stringstream weightrow_s(weightrow);
177 while(weightrow_s >> weight)
185 rownode = rownode->getNextSibling();
187 while (rownode && rownode->getNodeType( ) != DOMNode::ELEMENT_NODE)
188 rownode = rownode->getNextSibling();
194 XMLPlatformUtils::Terminate();
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
const std::string id_tag("id")
const std::string row_tag("row")
const std::string wgtChi2AfterSwitch_tag("Chi2WeightAfterSwitch")
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
EcalChi2WeightMatrix & getChi2WeightsAfterGainSwitch()
const std::string wgtBeforeSwitch_tag("WeightBeforeSwitch")
EcalWeightMatrix & getWeightsAfterGainSwitch()
EcalWeightMatrix & getWeightsBeforeGainSwitch()
const std::string wgtChi2BeforeSwitch_tag("Chi2WeightBeforeSwitch")
xercesc::DOMNode * getChildNode(xercesc::DOMNode *node, const std::string &nodename)
get the child of
const std::string wgtAfterSwitch_tag("WeightAfterSwitch")
XercesString fromNative(const char *str)
std::string toNative(const XMLCh *str)