CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CondCore/SiStripPlugins/plugins/AlCaRecoTriggerBitsPyWrapper.cc

Go to the documentation of this file.
00001 
00002 #include "CondFormats/HLTObjects/interface/AlCaRecoTriggerBits.h"
00003 #include <boost/algorithm/string.hpp>
00004 #include "CondCore/Utilities/interface/PayLoadInspector.h"
00005 #include "CondCore/Utilities/interface/InspectorPythonWrapper.h"
00006 
00007 #include <string>
00008 #include <fstream>
00009 
00010 namespace cond {
00011 
00012   template<>
00013   class ValueExtractor<AlCaRecoTriggerBits>: public  BaseValueExtractor<AlCaRecoTriggerBits> {
00014   public:
00015 
00016     typedef AlCaRecoTriggerBits 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 
00032   template<>
00033   std::string
00034   PayLoadInspector<AlCaRecoTriggerBits>::dump() const {
00035     std::stringstream ss;
00036     return ss.str();
00037     
00038   }
00039   
00040   template<>
00041   std::string PayLoadInspector<AlCaRecoTriggerBits>::summary() const {
00042     // std::stringstream ss;
00043         std::string result = "empty map";
00044         if( object().m_alcarecoToTrig.size() > 0 ) {
00045                 //      ss << "trigger bit : value \n";
00046                 //      std::map<std::string, std::string>::const_iterator it = object().m_alcarecoToTrig.begin();
00047 
00048                 //std::vector<std::string> strs;
00049                 //boost::split(strs, object().m_alcarecoToTrig.begin()->second, boost::is_any_of(";"));
00050                 result = object().m_alcarecoToTrig.begin()->first +" :\n"+ object().m_alcarecoToTrig.begin()->second;
00051                 boost::replace_all(result, ";", ";\n");
00052                 //ss << it->first << " : " << it->second << "\n";
00053         }
00054         return result;
00055   }
00056   
00057 
00058   template<>
00059   std::string PayLoadInspector<AlCaRecoTriggerBits>::plot(std::string const & filename,
00060                                                    std::string const &, 
00061                                                    std::vector<int> const&, 
00062                                                    std::vector<float> const& ) const {
00063     std::string fname = filename + ".png";
00064     std::ofstream f(fname.c_str());
00065     return fname;
00066   }
00067 
00068 
00069 }
00070 
00071 PYTHON_WRAPPER(AlCaRecoTriggerBits,AlCaRecoTriggerBits);