10 using namespace xercesc;
20 XMLCh* buff = XMLString::transcode(temp.c_str());
35 catch (
const XMLException&
e) {
36 std::cout <<
"Xerces-c error in initialization \n"
37 <<
"Exception message is: \n"
53 bool well_formed_string;
55 if(!well_formed_string)
std::cout <<
"MiscalibReaderFromXML::getIntAttribute PROBLEMS ...!!!" << std::endl;
71 bool well_formed_string;
73 if(!well_formed_string)
std::cout <<
"MiscalibReaderFromXML::getFloatAttribute PROBLEMS ...!!!" << std::endl;
82 XercesDOMParser*
parser =
new XercesDOMParser;
83 parser->setValidationScheme(XercesDOMParser::Val_Auto);
84 parser->setDoNamespaces(
false);
85 parser->parse(configFile.c_str());
86 DOMDocument*
doc = parser->getDocument();
89 unsigned int linkTagsNum = doc->getElementsByTagName(
_toDOMS(
"Cell"))->getLength();
93 if(linkTagsNum==0)
std::cout <<
"Number of Cells in file is 0 - probably bad file format"<<std::endl;
96 for (
unsigned int i=0;
i<linkTagsNum;
i++){
99 DOMNode* linkNode = doc->getElementsByTagName(
_toDOMS(
"Cell"))->item(
i);
102 std::cout<<
"Node LINK does not exist, i="<<
i<<std::endl;
105 DOMElement* linkElement =
static_cast<DOMElement *
>(linkNode);
107 std::cout<<
"Element LINK does not exist, i="<<
i<<std::endl;
112 DOMNamedNodeMap *
attributes = linkNode->getAttributes();
static double getFloatAttribute(XERCES_CPP_NAMESPACE::DOMNamedNodeMap *attributes, std::string attr_name, bool &well_formed_string)
static int getIntAttribute(XERCES_CPP_NAMESPACE::DOMNamedNodeMap *attributes, std::string attr_name, bool &well_formed_string)
std::string _toString(const XMLCh *toTranscode)
CaloMiscalibMap & caloMap_
bool parseXMLMiscalibFile(std::string configFile)
MiscalibReaderFromXML(CaloMiscalibMap &)
virtual void addCell(const DetId &cell, float scaling_factor)=0
static int s_numberOfInstances
double getScalingFactor(XERCES_CPP_NAMESPACE::DOMNamedNodeMap *attribute)
double getFloatAttribute(XERCES_CPP_NAMESPACE::DOMNamedNodeMap *attribute, const std::string &attribute_name)
std::vector< std::vector< double > > tmp
XMLCh * _toDOMS(std::string temp)
virtual DetId parseCellEntry(XERCES_CPP_NAMESPACE::DOMNamedNodeMap *attribute)=0
int getIntAttribute(XERCES_CPP_NAMESPACE::DOMNamedNodeMap *attribute, const std::string &attribute_name)