CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TriggerScalerPyWrapper.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<L1TriggerScaler>: public BaseValueExtractor<L1TriggerScaler> {
14  public:
15 
18  static What what() { return What();}
19 
22  {
23  // here one can make stuff really complicated...
24  }
25  void compute(Class const & it){
26  }
27  private:
28 
29  };
30 
31 
32  template<>
35  std::stringstream ss;
36  return ss.str();
37 
38  }
39 
40  template<>
42  std::stringstream ss;
43  ss << object().m_run.size() <<", ";
44  if (!object().m_run.empty()) {
45  ss << object().m_run.front().m_rn;
46  ss << ", ";
47  ss << object().m_run.front().m_lumisegment;
48  ss << ", " << object().m_run.front().m_date;
49  ss << ", " << object().m_run.front().m_date;
50 
51  for(size_t i=0; i<object().m_run.front().m_GTAlgoCounts.size(); i++ ){
52  ss << "m_GTAlgoCounts["<<i<<"] = "<< object().m_run.front().m_GTAlgoCounts[i]<<std::endl;
53  }
54  for(size_t i=0; i<object().m_run.front().m_GTAlgoRates.size(); i++ ){
55  ss << "m_GTAlgoRates["<<i<<"] = "<< object().m_run.front().m_GTAlgoRates[i]<<std::endl;
56  }
57  for(size_t i=0; i<object().m_run.front().m_GTAlgoPrescaling.size(); i++ ){
58  ss << "m_GTAlgoPrescaling["<<i<<"] = "<< object().m_run.front().m_GTAlgoPrescaling[i]<<std::endl;
59  }
60  for(size_t i=0; i<object().m_run.front().m_GTTechCounts.size(); i++ ){
61  ss << " m_GTTechCounts["<<i<<"] = "<< object().m_run.front().m_GTTechCounts[i]<<std::endl;
62  }
63  for(size_t i=0; i<object().m_run.front().m_GTTechRates.size(); i++ ){
64  ss << " m_GTTechRates["<<i<<"] = "<< object().m_run.front().m_GTTechRates[i]<<std::endl;
65  }
66  for(size_t i=0; i<object().m_run.front().m_GTTechPrescaling.size(); i++ ){
67  ss << " m_GTTechPrescaling["<<i<<"] = "<< object().m_run.front().m_GTTechPrescaling[i]<<std::endl;
68  }
69  for(size_t i=0; i<object().m_run.front().m_GTPartition0TriggerCounts.size(); i++ ){
70  ss << " m_GTPartition0TriggerCounts["<<i<<"] = "<< object().m_run.front().m_GTPartition0TriggerCounts[i]<<std::endl;
71  }
72  for(size_t i=0; i<object().m_run.front().m_GTPartition0TriggerRates.size(); i++ ){
73  ss << " m_GTPartition0TriggerRates["<<i<<"] = "<< object().m_run.front().m_GTPartition0TriggerRates[i]<<std::endl;
74  }
75  for(size_t i=0; i<object().m_run.front().m_GTPartition0DeadTime.size(); i++ ){
76  ss << " m_GTPartition0DeadTime["<<i<<"] = "<< object().m_run.front().m_GTPartition0DeadTime[i]<<std::endl;
77  }
78  for(size_t i=0; i<object().m_run.front().m_GTPartition0DeadTimeRatio.size(); i++ ){
79  ss << " m_GTPartition0DeadTimeRatio["<<i<<"] = "<< object().m_run.front().m_GTPartition0DeadTimeRatio[i]<<std::endl;
80  }
81 
82 
83  ss << "; ";
84  ss << object().m_run.back().m_rn;
85  ss << ", ";
86  ss << object().m_run.back().m_lumisegment;
87  ss << ", " << object().m_run.back().m_date;
88 
89  for(size_t i=0; i<object().m_run.back().m_GTAlgoCounts.size(); i++ ){
90  ss << "m_GTAlgoCounts["<<i<<"] = "<< object().m_run.back().m_GTAlgoCounts[i]<<std::endl;
91  }
92  for(size_t i=0; i<object().m_run.back().m_GTAlgoRates.size(); i++ ){
93  ss << "m_GTAlgoRates["<<i<<"] = "<< object().m_run.back().m_GTAlgoRates[i]<<std::endl;
94  }
95  for(size_t i=0; i<object().m_run.back().m_GTAlgoPrescaling.size(); i++ ){
96  ss << "m_GTAlgoPrescaling["<<i<<"] = "<< object().m_run.back().m_GTAlgoPrescaling[i]<<std::endl;
97  }
98  for(size_t i=0; i<object().m_run.back().m_GTTechCounts.size(); i++ ){
99  ss << " m_GTTechCounts["<<i<<"] = "<< object().m_run.back().m_GTTechCounts[i]<<std::endl;
100  }
101  for(size_t i=0; i<object().m_run.back().m_GTTechRates.size(); i++ ){
102  ss << " m_GTTechRates["<<i<<"] = "<< object().m_run.back().m_GTTechRates[i]<<std::endl;
103  }
104  for(size_t i=0; i<object().m_run.back().m_GTTechPrescaling.size(); i++ ){
105  ss << " m_GTTechPrescaling["<<i<<"] = "<< object().m_run.back().m_GTTechPrescaling[i]<<std::endl;
106  }
107  for(size_t i=0; i<object().m_run.back().m_GTPartition0TriggerCounts.size(); i++ ){
108  ss << " m_GTPartition0TriggerCounts["<<i<<"] = "<< object().m_run.back().m_GTPartition0TriggerCounts[i]<<std::endl;
109  }
110  for(size_t i=0; i<object().m_run.back().m_GTPartition0TriggerRates.size(); i++ ){
111  ss << " m_GTPartition0TriggerRates["<<i<<"] = "<< object().m_run.back().m_GTPartition0TriggerRates[i]<<std::endl;
112  }
113  for(size_t i=0; i<object().m_run.back().m_GTPartition0DeadTime.size(); i++ ){
114  ss << " m_GTPartition0DeadTime["<<i<<"] = "<< object().m_run.back().m_GTPartition0DeadTime[i]<<std::endl;
115  }
116  for(size_t i=0; i<object().m_run.back().m_GTPartition0DeadTimeRatio.size(); i++ ){
117  ss << " m_GTPartition0DeadTimeRatio["<<i<<"] = "<< object().m_run.back().m_GTPartition0DeadTimeRatio[i]<<std::endl;
118  }
119  }
120  return ss.str();
121  }
122 
123 
124  template<>
126  std::string const &,
127  std::vector<int> const&,
128  std::vector<float> const& ) const {
129  std::string fname = filename + ".png";
130  std::ofstream f(fname.c_str());
131  return fname;
132  }
133 
134 
135 }
136 
int i
Definition: DBlmapReader.cc:9
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]
list object
Definition: dbtoconf.py:77
string fname
main script
tuple filename
Definition: lut2db_cfg.py:20
std::string dump() const