CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/CondCore/RunInfoPlugins/plugins/L1TriggerScalerPyWrapper.cc

Go to the documentation of this file.
00001 
00002 #include "CondFormats/RunInfo/interface/L1TriggerScaler.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<L1TriggerScaler>: public  BaseValueExtractor<L1TriggerScaler> {
00014   public:
00015 
00016     typedef L1TriggerScaler 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<L1TriggerScaler>::dump() const {
00035     std::stringstream ss;
00036     return ss.str();
00037     
00038   }
00039   
00040   template<>
00041   std::string PayLoadInspector<L1TriggerScaler>::summary() const {
00042     std::stringstream ss;
00043     ss << object().m_run.size() <<", ";
00044     if (!object().m_run.empty()) {
00045       ss << object().m_run.front().m_rn;
00046       ss << ", ";
00047       ss << object().m_run.front().m_lumisegment;
00048       ss << ", " << object().m_run.front().m_date;
00049  ss << ", " << object().m_run.front().m_date;
00050 
00051       for(size_t i=0; i<object().m_run.front().m_GTAlgoCounts.size(); i++ ){ 
00052       ss << "m_GTAlgoCounts["<<i<<"] = "<< object().m_run.front().m_GTAlgoCounts[i]<<std::endl;  
00053     }
00054       for(size_t i=0; i<object().m_run.front().m_GTAlgoRates.size(); i++ ){ 
00055       ss << "m_GTAlgoRates["<<i<<"] = "<< object().m_run.front().m_GTAlgoRates[i]<<std::endl;  
00056     }
00057     for(size_t i=0; i<object().m_run.front().m_GTAlgoPrescaling.size(); i++ ){ 
00058       ss << "m_GTAlgoPrescaling["<<i<<"] = "<< object().m_run.front().m_GTAlgoPrescaling[i]<<std::endl;  
00059     } 
00060     for(size_t i=0; i<object().m_run.front().m_GTTechCounts.size(); i++ ){ 
00061       ss << " m_GTTechCounts["<<i<<"] = "<< object().m_run.front().m_GTTechCounts[i]<<std::endl;  
00062     } 
00063     for(size_t i=0; i<object().m_run.front().m_GTTechRates.size(); i++ ){ 
00064       ss << " m_GTTechRates["<<i<<"] = "<< object().m_run.front().m_GTTechRates[i]<<std::endl;  
00065     } 
00066     for(size_t i=0; i<object().m_run.front().m_GTTechPrescaling.size(); i++ ){ 
00067       ss << " m_GTTechPrescaling["<<i<<"] = "<< object().m_run.front().m_GTTechPrescaling[i]<<std::endl;  
00068     } 
00069     for(size_t i=0; i<object().m_run.front().m_GTPartition0TriggerCounts.size(); i++ ){ 
00070       ss << " m_GTPartition0TriggerCounts["<<i<<"] = "<< object().m_run.front().m_GTPartition0TriggerCounts[i]<<std::endl;  
00071     } 
00072     for(size_t i=0; i<object().m_run.front().m_GTPartition0TriggerRates.size(); i++ ){ 
00073       ss << " m_GTPartition0TriggerRates["<<i<<"] = "<< object().m_run.front().m_GTPartition0TriggerRates[i]<<std::endl;  
00074     } 
00075     for(size_t i=0; i<object().m_run.front().m_GTPartition0DeadTime.size(); i++ ){ 
00076       ss << " m_GTPartition0DeadTime["<<i<<"] = "<< object().m_run.front().m_GTPartition0DeadTime[i]<<std::endl;  
00077     }
00078     for(size_t i=0; i<object().m_run.front().m_GTPartition0DeadTimeRatio.size(); i++ ){ 
00079       ss << " m_GTPartition0DeadTimeRatio["<<i<<"] = "<< object().m_run.front().m_GTPartition0DeadTimeRatio[i]<<std::endl;  
00080     } 
00081   
00082  
00083       ss << "; ";
00084       ss << object().m_run.back().m_rn;
00085       ss << ", ";
00086       ss << object().m_run.back().m_lumisegment;
00087       ss << ", " << object().m_run.back().m_date;
00088 
00089      for(size_t i=0; i<object().m_run.back().m_GTAlgoCounts.size(); i++ ){ 
00090       ss << "m_GTAlgoCounts["<<i<<"] = "<< object().m_run.back().m_GTAlgoCounts[i]<<std::endl;  
00091     }
00092       for(size_t i=0; i<object().m_run.back().m_GTAlgoRates.size(); i++ ){ 
00093       ss << "m_GTAlgoRates["<<i<<"] = "<< object().m_run.back().m_GTAlgoRates[i]<<std::endl;  
00094     }
00095     for(size_t i=0; i<object().m_run.back().m_GTAlgoPrescaling.size(); i++ ){ 
00096       ss << "m_GTAlgoPrescaling["<<i<<"] = "<< object().m_run.back().m_GTAlgoPrescaling[i]<<std::endl;  
00097     } 
00098     for(size_t i=0; i<object().m_run.back().m_GTTechCounts.size(); i++ ){ 
00099       ss << " m_GTTechCounts["<<i<<"] = "<< object().m_run.back().m_GTTechCounts[i]<<std::endl;  
00100     } 
00101     for(size_t i=0; i<object().m_run.back().m_GTTechRates.size(); i++ ){ 
00102       ss << " m_GTTechRates["<<i<<"] = "<< object().m_run.back().m_GTTechRates[i]<<std::endl;  
00103     } 
00104     for(size_t i=0; i<object().m_run.back().m_GTTechPrescaling.size(); i++ ){ 
00105       ss << " m_GTTechPrescaling["<<i<<"] = "<< object().m_run.back().m_GTTechPrescaling[i]<<std::endl;  
00106     } 
00107     for(size_t i=0; i<object().m_run.back().m_GTPartition0TriggerCounts.size(); i++ ){ 
00108       ss << " m_GTPartition0TriggerCounts["<<i<<"] = "<< object().m_run.back().m_GTPartition0TriggerCounts[i]<<std::endl;  
00109     } 
00110     for(size_t i=0; i<object().m_run.back().m_GTPartition0TriggerRates.size(); i++ ){ 
00111       ss << " m_GTPartition0TriggerRates["<<i<<"] = "<< object().m_run.back().m_GTPartition0TriggerRates[i]<<std::endl;  
00112     } 
00113     for(size_t i=0; i<object().m_run.back().m_GTPartition0DeadTime.size(); i++ ){ 
00114       ss << " m_GTPartition0DeadTime["<<i<<"] = "<< object().m_run.back().m_GTPartition0DeadTime[i]<<std::endl;  
00115     }
00116     for(size_t i=0; i<object().m_run.back().m_GTPartition0DeadTimeRatio.size(); i++ ){ 
00117       ss << " m_GTPartition0DeadTimeRatio["<<i<<"] = "<< object().m_run.back().m_GTPartition0DeadTimeRatio[i]<<std::endl;  
00118     } 
00119     }
00120     return ss.str();
00121   }
00122   
00123 
00124   template<>
00125   std::string PayLoadInspector<L1TriggerScaler>::plot(std::string const & filename,
00126                                                    std::string const &, 
00127                                                    std::vector<int> const&, 
00128                                                    std::vector<float> const& ) const {
00129     std::string fname = filename + ".png";
00130     std::ofstream f(fname.c_str());
00131     return fname;
00132   }
00133 
00134 
00135 }
00136 
00137 PYTHON_WRAPPER(L1TriggerScaler,L1TriggerScaler);