CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunInfoPyWrapper.cc
Go to the documentation of this file.
1 
3 
6 
7 #include <string>
8 #include <fstream>
9 
10 namespace cond {
11 
12  template<>
13  class ValueExtractor<RunInfo>: public BaseValueExtractor<RunInfo> {
14  public:
15 
16  typedef RunInfo Class;
18  static What what() { return What();}
19 
22  {
23  // here one can make stuff really complicated...
24  }
25  void compute(Class const & it) override{
26  this->add(it.m_start_current);
27  this->add(it.m_stop_current);
28  this->add(it.m_avg_current);
29  this->add(it.m_max_current);
30  this->add(it.m_min_current);
31  this->add(it.m_run_intervall_micros);
32  this->add(it.m_start_time_ll);
33  this->add(it.m_stop_time_ll);
34  }
35  private:
36 
37  };
38 
39 
40  template<>
43  std::stringstream ss;
44  return ss.str();
45 
46  }
47 
48  template<>
50  std::stringstream ss;
51  ss << "RUN: "<<object().m_run;
52  ss << ", START TIME: " << object().m_start_time_str;
53  ss << ", STOP TIME:" << object().m_stop_time_str;
54  ss << ", START CURRENT: " << object().m_start_current;
55  ss << ", STOP CURRENT: " << object().m_stop_current;
56  ss << ", AVG CURRENT: " << object().m_avg_current;
57  ss << ", MIN CURRENT: " << object().m_min_current;
58  ss << ", MAX CURRENT: " << object().m_max_current;
59  ss << ", RUN INTERVALL IN MICROSECONDS: "<< object().m_run_intervall_micros; /*
60  ss << ", ALL CURRENT VALUE FROM STOP TO START (BACKWARD) :" ;
61  for (size_t i=0; i< object().m_current.size() ; i++){
62  ss<< object().m_current[i] << ", ";
63  }
64  */
65  ss << ", FED IN :" ;
66  for (size_t i=0; i<object().m_fed_in.size(); i++){
67  ss<< object().m_fed_in[i] << ", ";
68  }
69 
70  return ss.str();
71 }
72 
73 
74  template<>
76  std::string const &,
77  std::vector<int> const&,
78  std::vector<float> const& ) const {
79  std::string fname = filename + ".png";
80  std::ofstream f(fname.c_str());
81  return fname;
82  }
83 
84 
85 }
86 
int i
Definition: DBlmapReader.cc:9
void compute(Class const &it) override
std::string plot(std::string const &, std::string const &, std::vector< int > const &, std::vector< float > const &) const
ExtractWhat< Class > What
#define PYTHON_WRAPPER(_class, _name)
std::string summary() const
double f[11][100]
float m_stop_current
Definition: RunInfo.h:28
long long m_stop_time_ll
Definition: RunInfo.h:24
float m_min_current
Definition: RunInfo.h:31
list object
Definition: dbtoconf.py:77
string fname
main script
float m_avg_current
Definition: RunInfo.h:29
float m_run_intervall_micros
Definition: RunInfo.h:32
float m_max_current
Definition: RunInfo.h:30
float m_start_current
Definition: RunInfo.h:27
tuple filename
Definition: lut2db_cfg.py:20
std::string dump() const
long long m_start_time_ll
Definition: RunInfo.h:22