CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondCore/RPCPlugins/plugins/RPCObPVSSmapPyWrapper.cc

Go to the documentation of this file.
00001 #include "CondFormats/RPCObjects/interface/RPCObPVSSmap.h"
00002 #include "CondCore/Utilities/interface/PayLoadInspector.h"
00003 #include "CondCore/Utilities/interface/InspectorPythonWrapper.h"
00004 
00005 #include <string>
00006 #include <fstream>
00007 #include <sstream>
00008 #include <iostream>
00009 
00010 namespace cond {
00011 
00012   template<>
00013   class ValueExtractor<RPCObPVSSmap>: public  BaseValueExtractor<RPCObPVSSmap> {
00014   public:
00015 
00016     typedef RPCObPVSSmap Class;
00017     typedef ExtractWhat<Class> What;
00018     static What what() { return What();}
00019 
00020     ValueExtractor(){}
00021     ValueExtractor(What const & what)
00022     {
00023       // here one can make stuff really complicated...
00024     }
00025     void compute(Class const & it){
00026     }
00027   private:
00028 
00029   };
00030   
00031   template<>
00032   std::string PayLoadInspector<RPCObPVSSmap>::summary() const {
00033     std::stringstream ss;
00034 
00035     std::vector<RPCObPVSSmap::Item> const & vdetid = object().ObIDMap_rpc;
00036 
00037 
00038     for(unsigned int i = 0; i < vdetid.size(); ++i ){
00039       ss <<vdetid[i].dpid <<" "<<vdetid[i].region<<" "<<vdetid[i].ring<<" "<<vdetid[i].sector<<" "<<vdetid[i].station<<" "<<vdetid[i].layer<<" "<<vdetid[i].subsector<<" "<<vdetid[i].suptype<<" ";
00040     }
00041 
00042     return ss.str();
00043   }
00044 
00045 
00046   template<>
00047   std::string PayLoadInspector<RPCObPVSSmap>::plot(std::string const & filename,
00048                                                    std::string const &,
00049                                                    std::vector<int> const&,
00050                                                    std::vector<float> const& ) const {
00051     std::string fname = filename + ".png";
00052     std::ofstream f(fname.c_str());
00053     return fname;
00054   }
00055 
00056 
00057 }
00058 
00059 
00060 PYTHON_WRAPPER(RPCObPVSSmap,RPCObPVSSmap);
00061