/**
   Translates a EcalFloatCondObjectContainer record to XML
   and vice versa   

   \author Stefano ARGIRO
   \version $Id: EcalFloatCondObjectContainerXMLTranslator.h,v 1.3 2009/07/09 22:56:14 argiro Exp $
   \date 20 Jun 2008
*/

#ifndef __EcalFloatCondObjectContainterXMLTranslator_h_
#define __EcalFloatCondObjectContainterXMLTranslator_h_

#include "CondTools/Ecal/interface/EcalCondHeader.h"
#include "CondFormats/EcalObjects/interface/EcalCondObjectContainer.h"
#include <string>
#include <vector>

class EcalFloatCondObjectContainerXMLTranslator {
public:
  static int readXML(const std::string& filename, EcalCondHeader& header, EcalFloatCondObjectContainer& record);

  static std::vector<float> barrelfromXML(const std::string& filename);

  static std::vector<float> endcapfromXML(const std::string& filename);

  static int writeXML(const std::string& filename,
                      const EcalCondHeader& header,
                      const EcalFloatCondObjectContainer& record);

  // dump the two flat arrays (hashed-indexed as in EBDetId, EEDetId) to XML
  static std::string dumpXML(const EcalCondHeader& header, const std::vector<float>& eb, const std::vector<float>& ee);

private:
  // dump the CMSSW object container to XML
  static std::string dumpXML(const EcalCondHeader& header, const EcalFloatCondObjectContainer& record);
};

#endif  // __EcalFloatCondObjectContainerXMLTranslator_h_
