Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:51

0001 /**
0002    Translates a EcalTBWeights record to XML
0003    and vice versa   
0004 
0005    \author Stefano ARGIRO
0006    \version $Id: EcalTBWeightsXMLTranslator.h,v 1.1 2008/11/14 15:46:05 argiro Exp $
0007    \date 21 Aug 2008
0008 */
0009 
0010 #ifndef _EcalTBWeightsXMLTranslator_h_
0011 #define _EcalTBWeightsXMLTranslator_h_
0012 
0013 #include "CondFormats/EcalObjects/interface/EcalTBWeights.h"
0014 #include "CondFormats/EcalObjects/interface/EcalWeightSet.h"
0015 #include "CondTools/Ecal/interface/EcalCondHeader.h"
0016 #include <xercesc/dom/DOMNode.hpp>
0017 #include <string>
0018 
0019 class EcalTBWeightsXMLTranslator {
0020 public:
0021   static int readXML(const std::string& filename, EcalCondHeader& header, EcalTBWeights& record);
0022 
0023   static int writeXML(const std::string& filename, const EcalCondHeader& header, const EcalTBWeights& record);
0024 
0025 private:
0026   static std::string dumpXML(const EcalCondHeader& header, const EcalTBWeights& record);
0027 
0028   static void readWeightSet(xercesc::DOMNode* parentNode, EcalWeightSet& ws);
0029   static void writeWeightSet(xercesc::DOMNode* parentNode, const EcalWeightSet& ws);
0030   static void writeWeightMatrix(xercesc::DOMNode* node, const EcalWeightSet::EcalWeightMatrix& matrix);
0031 
0032   static void writeChi2WeightMatrix(xercesc::DOMNode* node, const EcalWeightSet::EcalChi2WeightMatrix& matrix);
0033 };
0034 
0035 #endif