![]() |
![]() |
00001 #include "CondFormats/ESObjects/interface/ESGain.h" 00002 #include "CondTools/Ecal/interface/ESGainXMLTranslator.h" 00003 #include "CondCore/Utilities/interface/PayLoadInspector.h" 00004 #include "CondCore/Utilities/interface/InspectorPythonWrapper.h" 00005 00006 #include <string> 00007 #include <fstream> 00008 00009 namespace cond { 00010 00011 template<> 00012 class ValueExtractor<ESGain>: public BaseValueExtractor<ESGain> { 00013 public: 00014 00015 typedef ESGain Class; 00016 typedef ExtractWhat<Class> What; 00017 static What what() { return What();} 00018 00019 ValueExtractor(){} 00020 ValueExtractor(What const & what) 00021 { 00022 // here one can make stuff really complicated... 00023 } 00024 void compute(Class const & it){ 00025 } 00026 private: 00027 00028 }; 00029 00030 00031 template<> 00032 std::string 00033 PayLoadInspector<ESGain>::dump() const { 00034 std::stringstream ss; 00035 EcalCondHeader h; 00036 ss<<ESGainXMLTranslator::dumpXML(h,object()); 00037 return ss.str(); 00038 00039 } 00040 00041 template<> 00042 std::string PayLoadInspector<ESGain>::summary() const { 00043 std::stringstream ss; 00044 object().print(ss); 00045 return ss.str(); 00046 } 00047 00048 00049 template<> 00050 std::string PayLoadInspector<ESGain>::plot(std::string const & filename, 00051 std::string const &, 00052 std::vector<int> const&, 00053 std::vector<float> const& ) const { 00054 std::string fname = filename + ".png"; 00055 std::ofstream f(fname.c_str()); 00056 return fname; 00057 } 00058 00059 00060 } 00061 00062 PYTHON_WRAPPER(ESGain,ESGain);