00001 00010 #ifndef _EcalTBWeightsXMLTranslator_h_ 00011 #define _EcalTBWeightsXMLTranslator_h_ 00012 00013 #include <xercesc/dom/DOMNode.hpp> 00014 #include "CondFormats/EcalObjects/interface/EcalTBWeights.h" 00015 #include "CondFormats/EcalObjects/interface/EcalWeightSet.h" 00016 #include "CondTools/Ecal/interface/EcalCondHeader.h" 00017 #include "CondTools/Ecal/interface/XercesString.h" 00018 #include <string> 00019 00020 00021 00022 class EcalTBWeightsXMLTranslator { 00023 00024 00025 public: 00026 00027 static int readXML(const std::string& filename, 00028 EcalCondHeader& header, 00029 EcalTBWeights& record); 00030 00031 static int writeXML(const std::string& filename, 00032 const EcalCondHeader& header, 00033 const EcalTBWeights& record); 00034 00035 static std::string dumpXML(const EcalCondHeader& header, 00036 const EcalTBWeights& record); 00037 private: 00038 00039 static void readWeightSet(xercesc::DOMNode* parentNode, 00040 EcalWeightSet& ws); 00041 static void writeWeightSet(xercesc::DOMNode* parentNode, 00042 const EcalWeightSet& ws); 00043 static void writeWeightMatrix(xercesc::DOMNode* node, 00044 const EcalWeightSet::EcalWeightMatrix& matrix); 00045 00046 static void writeChi2WeightMatrix(xercesc::DOMNode* node, 00047 const EcalWeightSet::EcalChi2WeightMatrix& matrix); 00048 00049 00050 00051 }; 00052 00053 00054 00055 00056 #endif