CMS 3D CMS Logo

PayloadInspector.h
Go to the documentation of this file.
1 #ifndef CondCore_Utilities_PayloadInspector_h
2 #define CondCore_Utilities_PayloadInspector_h
3 
6 #include <iostream>
7 
8 #include <string>
9 #include <tuple>
10 #include <vector>
11 #include <boost/uuid/uuid.hpp>
12 #include <boost/uuid/uuid_generators.hpp>
13 #include <boost/uuid/uuid_io.hpp>
14 
15 namespace cond {
16 
17  namespace payloadInspector {
18 
19  // Metadata dictionary
20  struct PlotAnnotations {
21  static constexpr const char* const PLOT_TYPE_K = "type";
22  static constexpr const char* const TITLE_K = "title";
23  static constexpr const char* const PAYLOAD_TYPE_K = "payload_type";
24  static constexpr const char* const INFO_K = "info";
25  static constexpr const char* const XAXIS_K = "x_label";
26  static constexpr const char* const YAXIS_K = "y_label";
27  static constexpr const char* const ZAXIS_K = "z_label";
29  std::string get(const std::string& key) const;
30  std::map<std::string, std::string> m;
31  bool singleIov = false;
32  bool twoTags = false;
33  };
34 
35  static const char* const JSON_FORMAT_VERSION = "1.0";
36 
37  // Serialize functions
38  template <typename V>
39  std::string serializeValue(const std::string& entryLabel, const V& value) {
40  std::stringstream ss;
41  ss << "\"" << entryLabel << "\":" << value;
42  return ss.str();
43  }
44 
45  template <>
47  std::stringstream ss;
48  ss << "\"" << entryLabel << "\":\"" << value << "\"";
49  return ss.str();
50  }
51 
52  // Specialization for the multi-values coordinates ( to support the combined time+runlumi abscissa )
53  template <typename V>
54  std::string serializeValue(const std::string& entryLabel, const std::tuple<V, std::string>& value) {
55  std::stringstream ss;
56  ss << serializeValue(entryLabel, std::get<0>(value));
57  ss << ", ";
58  ss << serializeValue(entryLabel + "_label", std::get<1>(value));
59  return ss.str();
60  }
61 
62  // Specialization for the error bars
63  template <typename V>
64  std::string serializeValue(const std::string& entryLabel, const std::pair<V, V>& value) {
65  std::stringstream ss;
66  ss << serializeValue(entryLabel, value.first);
67  ss << ", ";
68  ss << serializeValue(entryLabel + "_err", value.second);
69  return ss.str();
70  }
71 
73  std::stringstream ss;
74  ss << "\"version\": \"" << JSON_FORMAT_VERSION << "\",";
75  ss << "\"annotations\": {";
76  bool first = true;
77  for (auto a : annotations.m) {
78  if (!first)
79  ss << ",";
80  ss << "\"" << a.first << "\":\"" << a.second << "\"";
81  first = false;
82  }
83  ss << "}";
84  return ss.str();
85  }
86 
87  template <typename X, typename Y>
88  std::string serialize(const PlotAnnotations& annotations, const std::vector<std::tuple<X, Y> >& data) {
89  // prototype implementation...
90  std::stringstream ss;
91  ss << "{";
92  ss << serializeAnnotations(annotations);
93  ss << ",";
94  ss << "\"data\": [";
95  bool first = true;
96  for (auto d : data) {
97  if (!first)
98  ss << ",";
99  ss << " { " << serializeValue("x", std::get<0>(d)) << ", " << serializeValue("y", std::get<1>(d)) << " }";
100  first = false;
101  }
102  ss << "]";
103  ss << "}";
104  return ss.str();
105  }
106 
107  template <typename X, typename Y, typename Z>
108  std::string serialize(const PlotAnnotations& annotations, const std::vector<std::tuple<X, Y, Z> >& data) {
109  // prototype implementation...
110  std::stringstream ss;
111  ss << "{";
112  ss << serializeAnnotations(annotations);
113  ss << ",";
114  ss << "\"data\": [";
115  bool first = true;
116  for (auto d : data) {
117  if (!first)
118  ss << ",";
119  ss << " { " << serializeValue("x", std::get<0>(d)) << ", " << serializeValue("y", std::get<1>(d)) << ", "
120  << serializeValue("z", std::get<2>(d)) << " }";
121  first = false;
122  }
123  ss << "]";
124  ss << "}";
125  return ss.str();
126  }
127 
128  std::string serialize(const PlotAnnotations& annotations, const std::string& imageFileName) {
129  std::stringstream ss;
130  ss << "{";
131  ss << serializeAnnotations(annotations);
132  ss << ",";
133  ss << "\"file\": \"" << imageFileName << "\"";
134  ss << "}";
135  return ss.str();
136  }
137 
138  struct ModuleVersion {
139  static constexpr const char* const label = "1.0";
140  };
141 
142  // Base class, factorizing the functions exposed in the python interface
143  class PlotBase {
144  public:
145  PlotBase();
146  virtual ~PlotBase() = default;
147  // required in the browser to find corresponding tags
148  std::string payloadType() const;
149 
150  // required in the browser
151  std::string title() const;
152 
153  // required in the browser
154  std::string type() const;
155 
156  // required in the browser
157  bool isSingleIov() const;
158 
159  // required in the browser
160  bool isTwoTags() const;
161 
162  // returns the json file with the plot data
163  std::string data() const;
164 
165  // triggers the processing producing the plot
167  const std::string& tag,
168  const std::string& timeType,
170  cond::Time_t end);
171  //bool process( const std::string& connectionString, const std::string& tag, cond::Time_t begin, cond::Time_t end );
172 
173  bool processTwoTags(const std::string& connectionString,
174  const std::string& tag0,
175  const std::string& tag1,
177  cond::Time_t time1);
178 
179  // not exposed in python:
180  // called internally in process()
181  virtual void init();
182 
183  // not exposed in python:
184  // called internally in process()
185  virtual std::string processData(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs);
186 
187  // to be set in order to limit the iov selection ( and processing ) to 1 iov
188  void setSingleIov(bool flag);
189 
190  void setTwoTags(bool flag);
191 
192  // access to the fetch function of the configured reader, to be used in the processData implementations
193  template <typename PayloadType>
194  std::shared_ptr<PayloadType> fetchPayload(const cond::Hash& payloadHash) {
195  return m_dbSession.fetchPayload<PayloadType>(payloadHash);
196  }
197 
198  cond::Tag_t getTagInfo(const std::string& tag);
199 
200  // access to the timeType of the tag in process
201  //cond::TimeType tagTimeType() const;
202 
203  // access to the underlying db session
204  cond::persistency::Session dbSession();
205 
206  protected:
208  std::string m_tag0 = "";
209  std::string m_tag1 = "";
210 
211  private:
213  //cond::TimeType m_tagTimeType;
214 
215  std::string m_data = "";
216  };
217 
218  // Concrete plot-types implementations
219  template <typename PayloadType, typename X, typename Y>
220  class Plot2D : public PlotBase {
221  public:
222  Plot2D(const std::string& type, const std::string& title, const std::string xLabel, const std::string& yLabel)
223  : PlotBase(), m_plotData() {
224  m_plotAnnotations.m[PlotAnnotations::PLOT_TYPE_K] = type;
225  m_plotAnnotations.m[PlotAnnotations::TITLE_K] = title;
226  m_plotAnnotations.m[PlotAnnotations::XAXIS_K] = xLabel;
227  m_plotAnnotations.m[PlotAnnotations::YAXIS_K] = yLabel;
228  m_plotAnnotations.m[PlotAnnotations::PAYLOAD_TYPE_K] = cond::demangledName(typeid(PayloadType));
229  }
230  ~Plot2D() override = default;
231  std::string serializeData() { return serialize(m_plotAnnotations, m_plotData); }
232 
233  std::string processData(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
234  fill(iovs);
235  return serializeData();
236  }
237 
238  std::shared_ptr<PayloadType> fetchPayload(const cond::Hash& payloadHash) {
239  return PlotBase::fetchPayload<PayloadType>(payloadHash);
240  }
241 
242  virtual bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
243 
244  protected:
245  std::vector<std::tuple<X, Y> > m_plotData;
246  };
247 
248  template <typename PayloadType, typename X, typename Y, typename Z>
249  class Plot3D : public PlotBase {
250  public:
252  const std::string& title,
253  const std::string xLabel,
254  const std::string& yLabel,
255  const std::string& zLabel)
256  : PlotBase(), m_plotData() {
257  m_plotAnnotations.m[PlotAnnotations::PLOT_TYPE_K] = type;
258  m_plotAnnotations.m[PlotAnnotations::TITLE_K] = title;
259  m_plotAnnotations.m[PlotAnnotations::XAXIS_K] = xLabel;
260  m_plotAnnotations.m[PlotAnnotations::YAXIS_K] = yLabel;
261  m_plotAnnotations.m[PlotAnnotations::ZAXIS_K] = zLabel;
262  m_plotAnnotations.m[PlotAnnotations::PAYLOAD_TYPE_K] = cond::demangledName(typeid(PayloadType));
263  }
264  ~Plot3D() override = default;
265  std::string serializeData() { return serialize(m_plotAnnotations, m_plotData); }
266 
267  std::string processData(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
268  fill(iovs);
269  return serializeData();
270  }
271 
272  std::shared_ptr<PayloadType> fetchPayload(const cond::Hash& payloadHash) {
273  return PlotBase::fetchPayload<PayloadType>(payloadHash);
274  }
275 
276  virtual bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
277 
278  protected:
279  std::vector<std::tuple<X, Y, Z> > m_plotData;
280  };
281 
282  template <typename PayloadType, typename Y>
283  class HistoryPlot : public Plot2D<PayloadType, unsigned long long, Y> {
284  public:
286 
287  HistoryPlot(const std::string& title, const std::string& yLabel) : Base("History", title, "iov_since", yLabel) {}
288  ~HistoryPlot() override = default;
289  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
290  for (auto iov : iovs) {
291  std::shared_ptr<PayloadType> payload = Base::fetchPayload(std::get<1>(iov));
292  if (payload.get()) {
293  Y value = getFromPayload(*payload);
294  Base::m_plotData.push_back(std::make_tuple(std::get<0>(iov), value));
295  }
296  }
297  return true;
298  }
299 
300  virtual Y getFromPayload(PayloadType& payload) = 0;
301  };
302 
303  template <typename PayloadType, typename Y>
304  class RunHistoryPlot : public Plot2D<PayloadType, std::tuple<float, std::string>, Y> {
305  public:
307 
309  : Base("RunHistory", title, "iov_since", yLabel) {}
310  ~RunHistoryPlot() override = default;
311  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
312  // for the lumi iovs we need to count the number of lumisections in every runs
313  std::map<cond::Time_t, unsigned int> runs;
314  cond::Tag_t tagInfo = Base::getTagInfo(Base::m_tag0);
315  if (tagInfo.timeType == cond::lumiid) {
316  for (auto iov : iovs) {
317  unsigned int run = std::get<0>(iov) >> 32;
318  auto it = runs.find(run);
319  if (it == runs.end())
320  it = runs.insert(std::make_pair(run, 0)).first;
321  it->second++;
322  }
323  }
324  unsigned int currentRun = 0;
325  float lumiIndex = 0;
326  unsigned int lumiSize = 0;
327  unsigned int rind = 0;
328  float ind = 0;
329  std::string label("");
330  for (auto iov : iovs) {
331  unsigned long long since = std::get<0>(iov);
332  // for the lumi iovs we squeeze the lumi section available in the constant run 'slot' of witdth=1
333  if (tagInfo.timeType == cond::lumiid) {
334  unsigned int run = since >> 32;
335  unsigned int lumi = since & 0xFFFFFFFF;
336  if (run != currentRun) {
337  rind++;
338  lumiIndex = 0;
339  auto it = runs.find(run);
340  if (it == runs.end()) {
341  // it should never happen
342  return false;
343  }
344  lumiSize = it->second;
345  } else {
346  lumiIndex++;
347  }
348  ind = rind + (lumiIndex / lumiSize);
349  label = std::to_string(run) + " : " + std::to_string(lumi);
350  currentRun = run;
351  } else {
352  ind++;
353  // for the timestamp based iovs, it does not really make much sense to use this plot...
354  if (tagInfo.timeType == cond::timestamp) {
355  boost::posix_time::ptime t = cond::time::to_boost(since);
356  label = boost::posix_time::to_simple_string(t);
357  } else {
358  label = std::to_string(since);
359  }
360  }
361  std::shared_ptr<PayloadType> payload = Base::fetchPayload(std::get<1>(iov));
362  if (payload.get()) {
363  Y value = getFromPayload(*payload);
364  Base::m_plotData.push_back(std::make_tuple(std::make_tuple(ind, label), value));
365  }
366  }
367  return true;
368  }
369 
370  virtual Y getFromPayload(PayloadType& payload) = 0;
371  };
372 
373  template <typename PayloadType, typename Y>
374  class TimeHistoryPlot : public Plot2D<PayloadType, std::tuple<unsigned long long, std::string>, Y> {
375  public:
377 
379  : Base("TimeHistory", title, "iov_since", yLabel) {}
380  ~TimeHistoryPlot() override = default;
381  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
383  cond::Tag_t tagInfo = Base::getTagInfo(Base::m_tag0);
384  if (tagInfo.timeType == cond::lumiid || tagInfo.timeType == cond::runnumber) {
385  cond::Time_t min = std::get<0>(iovs.front());
386  cond::Time_t max = std::get<0>(iovs.back());
387  if (tagInfo.timeType == cond::lumiid) {
388  min = min >> 32;
389  max = max >> 32;
390  }
391  runInfo = Base::dbSession().getRunInfo(min, max);
392  }
393  for (auto iov : iovs) {
394  cond::Time_t since = std::get<0>(iov);
395  boost::posix_time::ptime time;
396  std::string label("");
397  if (tagInfo.timeType == cond::lumiid || tagInfo.timeType == cond::runnumber) {
398  unsigned int nlumi = since & 0xFFFFFFFF;
399  if (tagInfo.timeType == cond::lumiid)
400  since = since >> 32;
401  label = std::to_string(since);
402  auto it = runInfo.find(since);
403  if (it == runInfo.end()) {
404  // this should never happen...
405  return false;
406  }
407  time = (*it).start;
408  // add the lumi sections...
409  if (tagInfo.timeType == cond::lumiid) {
411  label += (" : " + std::to_string(nlumi));
412  }
413  } else if (tagInfo.timeType == cond::timestamp) {
414  time = cond::time::to_boost(since);
415  label = boost::posix_time::to_simple_string(time);
416  }
417  std::shared_ptr<PayloadType> payload = Base::fetchPayload(std::get<1>(iov));
418  if (payload.get()) {
419  Y value = getFromPayload(*payload);
420  Base::m_plotData.push_back(std::make_tuple(std::make_tuple(cond::time::from_boost(time), label), value));
421  }
422  }
423  return true;
424  }
425 
426  virtual Y getFromPayload(PayloadType& payload) = 0;
427  };
428 
429  template <typename PayloadType, typename X, typename Y>
430  class ScatterPlot : public Plot2D<PayloadType, X, Y> {
431  public:
433  // the x axis label will be overwritten by the plot rendering application
434  ScatterPlot(const std::string& title, const std::string& xLabel, const std::string& yLabel)
435  : Base("Scatter", title, xLabel, yLabel) {}
436  ~ScatterPlot() override = default;
437  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
438  for (auto iov : iovs) {
439  std::shared_ptr<PayloadType> payload = Base::fetchPayload(std::get<1>(iov));
440  if (payload.get()) {
441  std::tuple<X, Y> value = getFromPayload(*payload);
442  Base::m_plotData.push_back(value);
443  }
444  }
445  return true;
446  }
447 
448  virtual std::tuple<X, Y> getFromPayload(PayloadType& payload) = 0;
449  };
450 
451  //
452  template <typename PayloadType>
453  class Histogram1D : public Plot2D<PayloadType, float, float> {
454  public:
456  // naive implementation, essentially provided as an example...
458  const std::string& xLabel,
459  size_t nbins,
460  float min,
461  float max,
462  const std::string& yLabel = "entries")
463  : Base("Histo1D", title, xLabel, yLabel), m_nbins(nbins), m_min(min), m_max(max) {}
464  ~Histogram1D() override = default;
465  //
466  void init() override {
467  Base::m_plotData.clear();
468  float binSize = (m_max - m_min) / m_nbins;
469  if (binSize > 0) {
470  m_binSize = binSize;
471  Base::m_plotData.resize(m_nbins);
472  for (size_t i = 0; i < m_nbins; i++) {
473  Base::m_plotData[i] = std::make_tuple(m_min + i * m_binSize, 0);
474  }
475  }
476  }
477 
478  // to be used to fill the histogram!
479  void fillWithValue(float value, float weight = 1) {
480  // ignoring underflow/overflows ( they can be easily added - the total entries as well )
481  if (!Base::m_plotData.empty() && (value < m_max) && (value >= m_min)) {
482  size_t ibin = (value - m_min) / m_binSize;
483  std::get<1>(Base::m_plotData[ibin]) += weight;
484  }
485  }
486 
487  // to be used to fill the histogram!
488  void fillWithBinAndValue(size_t bin, float weight = 1) {
489  if (bin >= 0 && bin < Base::m_plotData.size()) {
490  std::get<1>(Base::m_plotData[bin]) = weight;
491  }
492  }
493 
494  // this one can ( and in general should ) be overridden - the implementation should use fillWithValue
495  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
496  for (auto iov : iovs) {
497  std::shared_ptr<PayloadType> payload = Base::fetchPayload(std::get<1>(iov));
498  if (payload.get()) {
499  float value = getFromPayload(*payload);
500  fillWithValue(value);
501  }
502  }
503  return true;
504  }
505 
506  // implement this one if you use the default fill implementation, otherwise ignore it...
507  virtual float getFromPayload(PayloadType& payload) { return 0; }
508 
509  private:
510  float m_binSize = 0;
511  size_t m_nbins;
512  float m_min;
513  float m_max;
514  };
515 
516  //
517  template <typename PayloadType>
518  class Histogram2D : public Plot3D<PayloadType, float, float, float> {
519  public:
521  // naive implementation, essentially provided as an example...
523  const std::string& xLabel,
524  size_t nxbins,
525  float xmin,
526  float xmax,
527  const std::string& yLabel,
528  size_t nybins,
529  float ymin,
530  float ymax)
531  : Base("Histo2D", title, xLabel, yLabel, "entries"),
532  m_nxbins(nxbins),
533  m_xmin(xmin),
534  m_xmax(xmax),
535  m_nybins(nybins),
536  m_ymin(ymin),
537  m_ymax(ymax) {}
538 
539  ~Histogram2D() override = default;
540  //
541  void init() override {
542  Base::m_plotData.clear();
543  float xbinSize = (m_xmax - m_xmin) / m_nxbins;
544  float ybinSize = (m_ymax - m_ymin) / m_nybins;
545  if (xbinSize > 0 && ybinSize > 0) {
546  m_xbinSize = xbinSize;
547  m_ybinSize = ybinSize;
548  Base::m_plotData.resize(m_nxbins * m_nybins);
549  for (size_t i = 0; i < m_nybins; i++) {
550  for (size_t j = 0; j < m_nxbins; j++) {
551  Base::m_plotData[i * m_nxbins + j] = std::make_tuple(m_xmin + j * m_xbinSize, m_ymin + i * m_ybinSize, 0);
552  }
553  }
554  }
555  }
556 
557  // to be used to fill the histogram!
558  void fillWithValue(float xvalue, float yvalue, float weight = 1) {
559  // ignoring underflow/overflows ( they can be easily added - the total entries as well )
560  if (!Base::m_plotData.empty() && xvalue < m_xmax && xvalue >= m_xmin && yvalue < m_ymax && yvalue >= m_ymin) {
561  size_t ixbin = (xvalue - m_xmin) / m_xbinSize;
562  size_t iybin = (yvalue - m_ymin) / m_ybinSize;
563  std::get<2>(Base::m_plotData[iybin * m_nxbins + ixbin]) += weight;
564  }
565  }
566 
567  // this one can ( and in general should ) be overridden - the implementation should use fillWithValue
568  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
569  for (auto iov : iovs) {
570  std::shared_ptr<PayloadType> payload = Base::fetchPayload(std::get<1>(iov));
571  if (payload.get()) {
572  std::tuple<float, float> value = getFromPayload(*payload);
573  fillWithValue(std::get<0>(value), std::get<1>(value));
574  }
575  }
576  return true;
577  }
578 
579  // implement this one if you use the default fill implementation, otherwise ignore it...
580  virtual std::tuple<float, float> getFromPayload(PayloadType& payload) {
581  float x = 0;
582  float y = 0;
583  return std::make_tuple(x, y);
584  }
585 
586  private:
587  size_t m_nxbins;
588  float m_xbinSize = 0;
589  float m_xmin;
590  float m_xmax;
591  float m_ybinSize = 0;
592  size_t m_nybins;
593  float m_ymin;
594  float m_ymax;
595  };
596 
597  //
598  template <typename PayloadType>
599  class PlotImage : public PlotBase {
600  public:
601  explicit PlotImage(const std::string& title) : PlotBase() {
602  m_plotAnnotations.m[PlotAnnotations::PLOT_TYPE_K] = "Image";
603  m_plotAnnotations.m[PlotAnnotations::TITLE_K] = title;
604  std::string payloadTypeName = cond::demangledName(typeid(PayloadType));
605  m_plotAnnotations.m[PlotAnnotations::PAYLOAD_TYPE_K] = payloadTypeName;
606  m_imageFileName = boost::lexical_cast<std::string>((boost::uuids::random_generator())()) + ".png";
607  }
608 
609  std::string serializeData() { return serialize(m_plotAnnotations, m_imageFileName); }
610 
611  std::string processData(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
612  fill(iovs);
613  return serializeData();
614  }
615 
616  std::shared_ptr<PayloadType> fetchPayload(const cond::Hash& payloadHash) {
617  return PlotBase::fetchPayload<PayloadType>(payloadHash);
618  }
619 
620  virtual bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) = 0;
621 
622  protected:
624  };
625 
626  } // namespace payloadInspector
627 
628 } // namespace cond
629 
630 #endif
std::vector< std::tuple< X, Y > > m_plotData
size
Write out results.
type
Definition: HCALResponse.h:21
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
double seconds()
Plot2D< PayloadType, std::tuple< float, std::string >, Y > Base
const boost::posix_time::ptime time0
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
int init
Definition: HydjetWrapper.h:64
Definition: weight.py:1
static const char *const JSON_FORMAT_VERSION
void fillWithValue(float xvalue, float yvalue, float weight=1)
ScatterPlot(const std::string &title, const std::string &xLabel, const std::string &yLabel)
virtual float getFromPayload(PayloadType &payload)
char const * label
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
std::string processData(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
unsigned long long Time_t
Definition: Time.h:14
virtual std::tuple< float, float > getFromPayload(PayloadType &payload)
std::string serializeValue(const std::string &entryLabel, const V &value)
std::vector< std::tuple< X, Y, Z > > m_plotData
Plot2D< PayloadType, X, Y > Base
std::string processData(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
std::string Hash
Definition: Types.h:43
RunHistoryPlot(const std::string &title, const std::string &yLabel)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
#define end
Definition: vmac.h:39
std::string serialize(const PlotAnnotations &annotations, const std::vector< std::tuple< X, Y > > &data)
Definition: value.py:1
void fillWithValue(float value, float weight=1)
T min(T a, T b)
Definition: MathUtil.h:58
Plot2D< PayloadType, std::tuple< unsigned long long, std::string >, Y > Base
Time_t from_boost(boost::posix_time::ptime bt)
d
Definition: ztail.py:151
static const char *const PAYLOAD_TYPE_K
const unsigned int SECONDS_PER_LUMI(23)
Plot3D(const std::string &type, const std::string &title, const std::string xLabel, const std::string &yLabel, const std::string &zLabel)
Histogram1D(const std::string &title, const std::string &xLabel, size_t nbins, float min, float max, const std::string &yLabel="entries")
void fillWithBinAndValue(size_t bin, float weight=1)
std::string processData(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
TimeHistoryPlot(const std::string &title, const std::string &yLabel)
TimeType timeType
Definition: Types.h:63
Iterator find(Time_t target) const
HistoryPlot(const std::string &title, const std::string &yLabel)
std::string serializeAnnotations(const PlotAnnotations &annotations)
Histogram2D(const std::string &title, const std::string &xLabel, size_t nxbins, float xmin, float xmax, const std::string &yLabel, size_t nybins, float ymin, float ymax)
Definition: plugin.cc:23
#define begin
Definition: vmac.h:32
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
cond::persistency::Session m_dbSession
std::map< std::string, std::string > m
double a
Definition: hdecay.h:119
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
Plot2D< PayloadType, float, float > Base
Plot3D< PayloadType, float, float, float > Base
Plot2D(const std::string &type, const std::string &title, const std::string xLabel, const std::string &yLabel)
Plot2D< PayloadType, unsigned long long, Y > Base
boost::posix_time::ptime to_boost(Time_t iValue)
#define constexpr
PlotImage(const std::string &title)