CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/CondCore/RunInfoPlugins/plugins/FillInfoPyWrapper.cc

Go to the documentation of this file.
00001 
00002 #include "CondFormats/RunInfo/interface/FillInfo.h"
00003 
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<FillInfo>: public  BaseValueExtractor<FillInfo> {
00014   public:
00015 
00016     typedef FillInfo 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       this->add( it.fillNumber() );
00027       this->add( it.bunchesInBeam1() );
00028       this->add( it.bunchesInBeam2() );
00029       this->add( it.collidingBunches() );
00030       this->add( it.targetBunches() );
00031       this->add( it.crossingAngle() );
00032       this->add( it.betaStar() );
00033       this->add( it.intensityForBeam1() );
00034       this->add( it.intensityForBeam2() );
00035       this->add( it.energy() );
00036       this->add( it.createTime() );
00037       this->add( it.beginTime() );
00038       this->add( it.endTime() );
00039     }
00040   private:
00041   
00042   };
00043   
00044   template<>
00045   std::string PayLoadInspector<FillInfo>::summary() const {
00046     std::stringstream ss;
00047     ss << this->object();
00048     return ss.str();
00049   }
00050   
00051   template<>
00052   std::string PayLoadInspector<FillInfo>::plot(std::string const & filename,
00053                                                std::string const &, 
00054                                                std::vector<int> const&, 
00055                                                std::vector<float> const& ) const {
00056     std::string fname = filename + ".png";
00057     std::ofstream f(fname.c_str());
00058     return fname;
00059   }
00060   
00061 }
00062 
00063 PYTHON_WRAPPER(FillInfo,FillInfo);