CMS 3D CMS Logo

MonitorElement.cc
Go to the documentation of this file.
1 #define __STDC_FORMAT_MACROS 1
3 #include "TClass.h"
4 #include "TMath.h"
5 #include "TList.h"
6 #include "THashList.h"
7 #include <iostream>
8 #include <cassert>
9 #include <cfloat>
10 #include <cinttypes>
11 
13 
14 namespace dqm::impl {
15 
16  static TH1 *checkRootObject(const std::string &name, TObject *tobj, const char *func, int reqdim) {
17  if (!tobj)
18  throw cms::Exception("MonitorElementError") << "Method '" << func
19  << "' cannot be invoked on monitor"
20  " element '"
21  << name << "' because it is not a ROOT object.";
22 
23  auto *h = static_cast<TH1 *>(tobj);
24  int ndim = h->GetDimension();
25  if (reqdim < 0 || reqdim > ndim)
26  throw cms::Exception("MonitorElementError") << "Method '" << func
27  << "' cannot be invoked on monitor"
28  " element '"
29  << name << "' because it requires " << reqdim
30  << " dimensions; this"
31  " object of type '"
32  << typeid(*h).name() << "' has " << ndim << " dimensions";
33 
34  return h;
35  }
36 
38  this->mutable_ = new MutableMonitorElementData();
39  this->mutable_->data_ = std::move(data);
40  this->is_owned_ = true;
42  }
45 
48  auto access = this->access();
49  out.key_ = access.key;
50  out.value_.scalar_ = access.value.scalar_;
51  if (access.value.object_) {
52  out.value_.object_ = std::unique_ptr<TH1>(static_cast<TH1 *>(access.value.object_->Clone()));
53  }
54  return out;
55  }
56 
58  assert(this->is_owned_ == expectOwned);
60  this->mutable_ = nullptr;
61  this->is_owned_ = false;
62  assert(!expectOwned || data);
63  return data;
64  }
65 
67  assert(other);
68  this->mutable_ = other->mutable_;
69  this->is_owned_ = false;
71  }
72 
74  this->mutable_ = data;
75  this->is_owned_ = true;
77  }
78 
79  void MonitorElement::switchObject(std::unique_ptr<TH1> &&newobject) {
80  auto access = this->accessMut();
81  // Assume kind etc. matches.
82  // This should free the old object.
83  access.value.object_ = std::move(newobject);
84  }
85 
87  auto access = this->accessMut();
89  }
90 
92  data_.flags &= ~DQMNet::DQM_PROP_TYPE_MASK;
94 
95  // mark as updated.
97 
98  // lumi flag is approximately equivalent to Scope::LUMI.
100  if (access.key.scope_ == MonitorElementData::Scope::LUMI) {
102  }
103 
104  // these are unsupported and always off.
105  data_.flags &= ~DQMNet::DQM_PROP_HAS_REFERENCE;
106  data_.flags &= ~DQMNet::DQM_PROP_TAGGED;
107  data_.flags &= ~DQMNet::DQM_PROP_RESET;
108  data_.flags &= ~DQMNet::DQM_PROP_ACCUMULATE;
109 
110  // we use ROOT's internal efficiency flag as the truth
111  data_.flags &= ~DQMNet::DQM_PROP_EFFICIENCY_PLOT;
112  if (access.value.object_ && access.value.object_->TestBit(TH1::kIsAverage)) {
114  }
115 
116  data_.tag = 0;
117 
118  // don't touch version (a timestamp).
119 
120  // we could set proper values here, but nobody should use them.
121  data_.run = 0;
122  data_.lumi = 0;
123 
124  // these are relics from the threaded migration and should not be used anywhere.
125  data_.streamId = 0;
126  data_.moduleId = 0;
127 
128  // leaking a pointer here, but that should be fine.
130 
132 
133  data_.flags &= ~DQMNet::DQM_PROP_REPORT_ALARM;
134  data_.qreports.clear();
135  for (QReport const &qr : access.value.qreports_) {
136  data_.qreports.push_back(qr.getValue());
137  switch (qr.getStatus()) {
139  break;
142  break;
143  case dqm::qstatus::ERROR:
145  break;
146  default:
148  break;
149  }
150  }
151  }
152 
154  if (is_owned_)
155  delete mutable_;
156  }
157 
158  //utility function to check the consistency of the axis labels
159  //taken from TH1::CheckBinLabels which is not public
160  bool MonitorElement::CheckBinLabels(const TAxis *a1, const TAxis *a2) {
161  // check that axis have same labels
162  THashList *l1 = (const_cast<TAxis *>(a1))->GetLabels();
163  THashList *l2 = (const_cast<TAxis *>(a2))->GetLabels();
164 
165  if (!l1 && !l2)
166  return true;
167  if (!l1 || !l2) {
168  return false;
169  }
170  // check now labels sizes are the same
171  if (l1->GetSize() != l2->GetSize()) {
172  return false;
173  }
174  for (int i = 1; i <= a1->GetNbins(); ++i) {
175  TString label1 = a1->GetBinLabel(i);
176  TString label2 = a2->GetBinLabel(i);
177  if (label1 != label2) {
178  return false;
179  }
180  }
181  return true;
182  }
183 
186  auto access = this->accessMut();
187  update();
188  if (kind() == Kind::STRING) {
190  } else {
191  incompatible(__PRETTY_FUNCTION__);
192  }
193  }
194 
196  void MonitorElement::Fill(double x) {
197  auto access = this->accessMut();
198  update();
199  if (kind() == Kind::INT)
200  access.value.scalar_.num = static_cast<int64_t>(x);
201  else if (kind() == Kind::REAL)
202  access.value.scalar_.real = x;
203  else if (kind() == Kind::TH1F)
204  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(x, 1);
205  else if (kind() == Kind::TH1S)
206  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(x, 1);
207  else if (kind() == Kind::TH1D)
208  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(x, 1);
209  else
210  incompatible(__PRETTY_FUNCTION__);
211  }
212 
214  void MonitorElement::doFill(int64_t x) {
215  auto access = this->accessMut();
216  update();
217  if (kind() == Kind::INT)
218  access.value.scalar_.num = static_cast<int64_t>(x);
219  else if (kind() == Kind::REAL)
220  access.value.scalar_.real = static_cast<double>(x);
221  else if (kind() == Kind::TH1F)
222  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(static_cast<double>(x), 1);
223  else if (kind() == Kind::TH1S)
224  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(static_cast<double>(x), 1);
225  else if (kind() == Kind::TH1D)
226  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(static_cast<double>(x), 1);
227  else
228  incompatible(__PRETTY_FUNCTION__);
229  }
230 
232  void MonitorElement::Fill(double x, double yw) {
233  auto access = this->accessMut();
234  update();
235  if (kind() == Kind::TH1F)
236  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(x, yw);
237  else if (kind() == Kind::TH1S)
238  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(x, yw);
239  else if (kind() == Kind::TH1D)
240  accessRootObject(access, __PRETTY_FUNCTION__, 1)->Fill(x, yw);
241  else if (kind() == Kind::TH2F)
242  static_cast<TH2F *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, yw, 1);
243  else if (kind() == Kind::TH2S)
244  static_cast<TH2S *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, yw, 1);
245  else if (kind() == Kind::TH2D)
246  static_cast<TH2D *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, yw, 1);
247  else if (kind() == Kind::TPROFILE)
248  static_cast<TProfile *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->Fill(x, yw, 1);
249  else
250  incompatible(__PRETTY_FUNCTION__);
251  }
252 
256  void MonitorElement::ShiftFillLast(double y, double ye, int xscale) {
257  // TODO: this should take the lock only once to be actually safe.
258  // But since it is not const, we don't even claim it is thread-safe.
259  update();
260  if (kind() == Kind::TH1F || kind() == Kind::TH1S || kind() == Kind::TH1D) {
261  int nbins = getNbinsX();
262  auto entries = (int)getEntries();
263  // first fill bins from left to right
264  int index = entries + 1;
265  int xlow = 2;
266  int xup = nbins;
267  // if more entries than bins then start shifting
268  if (entries >= nbins) {
269  index = nbins;
270  xlow = entries - nbins + 3;
271  xup = entries + 1;
272  // average first bin
273  double y1 = getBinContent(1);
274  double y2 = getBinContent(2);
275  double y1err = getBinError(1);
276  double y2err = getBinError(2);
277  double N = entries - nbins + 1.;
278  if (ye == 0. || y1err == 0. || y2err == 0.) {
279  // for errors zero calculate unweighted mean and its error
280  double sum = N * y1 + y2;
281  y1 = sum / (N + 1.);
282  // FIXME check if correct
283  double s = (N + 1.) * (N * y1 * y1 + y2 * y2) - sum * sum;
284  if (s >= 0.)
285  y1err = sqrt(s) / (N + 1.);
286  else
287  y1err = 0.;
288  } else {
289  // for errors non-zero calculate weighted mean and its error
290  double denom = (1. / y1err + 1. / y2err);
291  double mean = (y1 / y1err + y2 / y2err) / denom;
292  // FIXME check if correct
293  y1err = sqrt(((y1 - mean) * (y1 - mean) / y1err + (y2 - mean) * (y2 - mean) / y2err) / denom / 2.);
294  y1 = mean; // set y1 to mean for filling below
295  }
296  setBinContent(1, y1);
297  setBinError(1, y1err);
298  // shift remaining bins to the left
299  for (int i = 3; i <= nbins; i++) {
301  setBinError(i - 1, getBinError(i));
302  }
303  }
304  // fill last bin with new values
305  setBinContent(index, y);
306  setBinError(index, ye);
307  // set entries
308  setEntries(entries + 1);
309  // set axis labels and reset drawing option
310  char buffer[10];
311  sprintf(buffer, "%d", xlow * xscale);
313  setBinLabel(2, a);
314  sprintf(buffer, "%d", xup * xscale);
316  setBinLabel(nbins, b);
317  setBinLabel(1, "av.");
318  } else
319  incompatible(__PRETTY_FUNCTION__);
320  }
322  void MonitorElement::Fill(double x, double y, double zw) {
323  auto access = this->accessMut();
324  update();
325  if (kind() == Kind::TH2F)
326  static_cast<TH2F *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, zw);
327  else if (kind() == Kind::TH2S)
328  static_cast<TH2S *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, zw);
329  else if (kind() == Kind::TH2D)
330  static_cast<TH2D *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, zw);
331  else if (kind() == Kind::TH3F)
332  static_cast<TH3F *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, zw, 1);
333  else if (kind() == Kind::TPROFILE)
334  static_cast<TProfile *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, zw);
335  else if (kind() == Kind::TPROFILE2D)
336  static_cast<TProfile2D *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, zw, 1);
337  else
338  incompatible(__PRETTY_FUNCTION__);
339  }
340 
342  void MonitorElement::Fill(double x, double y, double z, double w) {
343  auto access = this->accessMut();
344  update();
345  if (kind() == Kind::TH3F)
346  static_cast<TH3F *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, z, w);
347  else if (kind() == Kind::TPROFILE2D)
348  static_cast<TProfile2D *>(accessRootObject(access, __PRETTY_FUNCTION__, 2))->Fill(x, y, z, w);
349  else
350  incompatible(__PRETTY_FUNCTION__);
351  }
352 
355  auto access = this->accessMut();
356  update();
357  if (kind() == Kind::INT)
358  access.value.scalar_.num = 0;
359  else if (kind() == Kind::REAL)
360  access.value.scalar_.real = 0;
361  else if (kind() == Kind::STRING)
362  access.value.scalar_.str.clear();
363  else
364  return accessRootObject(access, __PRETTY_FUNCTION__, 1)->Reset();
365  }
366 
368  void MonitorElement::packScalarData(std::string &into, const char *prefix) const {
369  auto access = this->access();
370  char buf[64];
371  if (kind() == Kind::INT) {
372  snprintf(buf, sizeof(buf), "%s%" PRId64, prefix, access.value.scalar_.num);
373  into = buf;
374  } else if (kind() == Kind::REAL) {
375  snprintf(buf, sizeof(buf), "%s%.*g", prefix, DBL_DIG + 2, access.value.scalar_.real);
376  into = buf;
377  } else if (kind() == Kind::STRING) {
378  into.reserve(strlen(prefix) + access.value.scalar_.str.size());
379  into += prefix;
380  into += access.value.scalar_.str;
381  } else
382  incompatible(__PRETTY_FUNCTION__);
383  }
384 
387 
392  if (kind() == Kind::INT)
393  packScalarData(result, "i=");
394  else if (kind() == Kind::REAL)
395  packScalarData(result, "f=");
396  else if (kind() == Kind::STRING)
397  packScalarData(result, "s=");
398  else
399  incompatible(__PRETTY_FUNCTION__);
400 
401  return result;
402  }
403 
410  result.reserve(6 + 2 * data_.objname.size() + val.size());
411  result += '<';
412  result += data_.objname;
413  result += '>';
414  result += val;
415  result += '<';
416  result += '/';
417  result += data_.objname;
418  result += '>';
419  return result;
420  }
421 
424  char buf[32];
426  size_t len = sprintf(buf, "t=%" PRIu32, data_.tag);
427 
428  result.reserve(6 + 2 * data_.objname.size() + len);
429  result += '<';
430  result += data_.objname;
431  result += '>';
432  result += buf;
433  result += '<';
434  result += '/';
435  result += data_.objname;
436  result += '>';
437  return result;
438  }
439 
443 
444  result.reserve(6 + 2 * data_.objname.size() + 3);
445  result += '<';
446  result += data_.objname;
447  result += '>';
448  result += "e=1";
449  result += '<';
450  result += '/';
451  result += data_.objname;
452  result += '>';
453  return result;
454  }
455 
457  char buf[64];
459  size_t titlelen = data_.objname.size() + qv.qtname.size() + 1;
460  size_t buflen = sprintf(buf, "qr=st:%d:%.*g:", qv.code, DBL_DIG + 2, qv.qtresult);
461 
462  result.reserve(7 + 2 * titlelen + buflen + qv.algorithm.size() + qv.message.size());
463  result += '<';
464  result += data_.objname;
465  result += '.';
466  result += qv.qtname;
467  result += '>';
468  result += buf;
469  result += qv.algorithm;
470  result += ':';
471  result += qv.message;
472  result += '<';
473  result += '/';
474  result += data_.objname;
475  result += '.';
476  result += qv.qtname;
477  result += '>';
478  return result;
479  }
480 
483  DQMNet::QValue *qv;
484  const_cast<MonitorElement *>(this)->getQReport(false, qtname, qr, qv);
485  return qr;
486  }
487 
488  template <typename FILTER>
489  std::vector<MonitorElementData::QReport *> MonitorElement::filterQReports(FILTER filter) const {
490  auto access = this->access();
491  std::vector<MonitorElementData::QReport *> result;
493  if (filter(qr)) {
494  // const_cast here because this API always violated cons'ness. Should
495  // make the result type const and fix all usages.
496  result.push_back(const_cast<MonitorElementData::QReport *>(&qr));
497  }
498  }
499  return result;
500  }
501 
502  std::vector<MonitorElementData::QReport *> MonitorElement::getQReports() const {
503  return filterQReports([](MonitorElementData::QReport const &qr) { return true; });
504  }
505 
506  std::vector<MonitorElementData::QReport *> MonitorElement::getQWarnings() const {
507  return filterQReports(
508  [](MonitorElementData::QReport const &qr) { return qr.getStatus() == dqm::qstatus::WARNING; });
509  }
510 
511  std::vector<MonitorElementData::QReport *> MonitorElement::getQErrors() const {
512  return filterQReports([](MonitorElementData::QReport const &qr) { return qr.getStatus() == dqm::qstatus::ERROR; });
513  }
514 
515  std::vector<MonitorElementData::QReport *> MonitorElement::getQOthers() const {
516  return filterQReports([](MonitorElementData::QReport const &qr) {
519  });
520  }
521 
522  void MonitorElement::incompatible(const char *func) const {
523  throw cms::Exception("MonitorElementError") << "Method '" << func
524  << "' cannot be invoked on monitor"
525  " element '"
526  << data_.objname << "'";
527  }
528 
529  TH1 const *MonitorElement::accessRootObject(Access const &access, const char *func, int reqdim) const {
530  if (kind() < Kind::TH1F)
531  throw cms::Exception("MonitorElement") << "Method '" << func
532  << "' cannot be invoked on monitor"
533  " element '"
534  << data_.objname << "' because it is not a root object";
535  return access.value.object_.get();
536  }
537  TH1 *MonitorElement::accessRootObject(AccessMut const &access, const char *func, int reqdim) const {
538  if (kind() < Kind::TH1F)
539  throw cms::Exception("MonitorElement") << "Method '" << func
540  << "' cannot be invoked on monitor"
541  " element '"
542  << data_.objname << "' because it is not a root object";
543  return checkRootObject(data_.objname, access.value.object_.get(), func, reqdim);
544  }
545 
546  /*** getter methods (wrapper around ROOT methods) ****/
547  //
549  double MonitorElement::getMean(int axis /* = 1 */) const {
550  auto access = this->access();
551  return accessRootObject(access, __PRETTY_FUNCTION__, axis - 1)->GetMean(axis);
552  }
553 
556  double MonitorElement::getMeanError(int axis /* = 1 */) const {
557  auto access = this->access();
558  return accessRootObject(access, __PRETTY_FUNCTION__, axis - 1)->GetMeanError(axis);
559  }
560 
562  double MonitorElement::getRMS(int axis /* = 1 */) const {
563  auto access = this->access();
564  return accessRootObject(access, __PRETTY_FUNCTION__, axis - 1)->GetRMS(axis);
565  }
566 
568  double MonitorElement::getRMSError(int axis /* = 1 */) const {
569  auto access = this->access();
570  return accessRootObject(access, __PRETTY_FUNCTION__, axis - 1)->GetRMSError(axis);
571  }
572 
575  auto access = this->access();
576  return accessRootObject(access, __PRETTY_FUNCTION__, 1)->GetNbinsX();
577  }
578 
581  auto access = this->access();
582  return accessRootObject(access, __PRETTY_FUNCTION__, 2)->GetNbinsY();
583  }
584 
587  auto access = this->access();
588  return accessRootObject(access, __PRETTY_FUNCTION__, 3)->GetNbinsZ();
589  }
590 
592  double MonitorElement::getBinContent(int binx) const {
593  auto access = this->access();
594  return accessRootObject(access, __PRETTY_FUNCTION__, 1)->GetBinContent(binx);
595  }
596 
598  double MonitorElement::getBinContent(int binx, int biny) const {
599  auto access = this->access();
600  return accessRootObject(access, __PRETTY_FUNCTION__, 2)->GetBinContent(binx, biny);
601  }
602 
604  double MonitorElement::getBinContent(int binx, int biny, int binz) const {
605  auto access = this->access();
606  return accessRootObject(access, __PRETTY_FUNCTION__, 3)->GetBinContent(binx, biny, binz);
607  }
608 
610  double MonitorElement::getBinError(int binx) const {
611  auto access = this->access();
612  return accessRootObject(access, __PRETTY_FUNCTION__, 1)->GetBinError(binx);
613  }
614 
616  double MonitorElement::getBinError(int binx, int biny) const {
617  auto access = this->access();
618  return accessRootObject(access, __PRETTY_FUNCTION__, 2)->GetBinError(binx, biny);
619  }
620 
622  double MonitorElement::getBinError(int binx, int biny, int binz) const {
623  auto access = this->access();
624  return accessRootObject(access, __PRETTY_FUNCTION__, 3)->GetBinError(binx, biny, binz);
625  }
626 
628  double MonitorElement::getEntries() const {
629  auto access = this->access();
630  return accessRootObject(access, __PRETTY_FUNCTION__, 1)->GetEntries();
631  }
632 
634  int MonitorElement::getBin(int binx, int biny) const {
635  auto access = this->access();
636  if (kind() == Kind::TPROFILE2D)
637  return static_cast<TProfile2D const *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->GetBin(binx, biny);
638  else {
639  incompatible(__PRETTY_FUNCTION__);
640  return 0;
641  }
642  }
643 
645  double MonitorElement::getBinEntries(int bin) const {
646  auto access = this->access();
647  if (kind() == Kind::TPROFILE)
648  return static_cast<TProfile const *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->GetBinEntries(bin);
649  else if (kind() == Kind::TPROFILE2D)
650  return static_cast<TProfile2D const *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->GetBinEntries(bin);
651  else {
652  incompatible(__PRETTY_FUNCTION__);
653  return 0;
654  }
655  }
656 
658  double MonitorElement::getBinEntries(int binx, int biny) const {
659  auto access = this->access();
660  if (kind() == Kind::TPROFILE2D) {
661  int globBin =
662  static_cast<TProfile2D const *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->GetBin(binx, biny);
663  return static_cast<TProfile2D const *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->GetBinEntries(globBin);
664  } else {
665  incompatible(__PRETTY_FUNCTION__);
666  return 0;
667  }
668  }
669 
671  double MonitorElement::integral() const {
672  auto access = this->access();
673  return accessRootObject(access, __PRETTY_FUNCTION__, 1)->Integral();
674  }
675 
677  std::string MonitorElement::getAxisTitle(int axis /* = 1 */) const {
678  auto access = this->access();
679  return getAxis(access, __PRETTY_FUNCTION__, axis)->GetTitle();
680  }
681 
684  auto access = this->access();
685  return accessRootObject(access, __PRETTY_FUNCTION__, 1)->GetTitle();
686  }
687 
688  /*** setter methods (wrapper around ROOT methods) ****/
689  //
691  void MonitorElement::setBinContent(int binx, double content) {
692  auto access = this->accessMut();
693  accessRootObject(access, __PRETTY_FUNCTION__, 1)->SetBinContent(binx, content);
694  }
695 
697  void MonitorElement::setBinContent(int binx, int biny, double content) {
698  auto access = this->accessMut();
699  accessRootObject(access, __PRETTY_FUNCTION__, 2)->SetBinContent(binx, biny, content);
700  }
701 
703  void MonitorElement::setBinContent(int binx, int biny, int binz, double content) {
704  auto access = this->accessMut();
705  accessRootObject(access, __PRETTY_FUNCTION__, 3)->SetBinContent(binx, biny, binz, content);
706  }
707 
709  void MonitorElement::setBinError(int binx, double error) {
710  auto access = this->accessMut();
711  accessRootObject(access, __PRETTY_FUNCTION__, 1)->SetBinError(binx, error);
712  }
713 
715  void MonitorElement::setBinError(int binx, int biny, double error) {
716  auto access = this->accessMut();
717  accessRootObject(access, __PRETTY_FUNCTION__, 2)->SetBinError(binx, biny, error);
718  }
719 
721  void MonitorElement::setBinError(int binx, int biny, int binz, double error) {
722  auto access = this->accessMut();
723  accessRootObject(access, __PRETTY_FUNCTION__, 3)->SetBinError(binx, biny, binz, error);
724  }
725 
727  void MonitorElement::setBinEntries(int bin, double nentries) {
728  auto access = this->accessMut();
729  if (kind() == Kind::TPROFILE)
730  static_cast<TProfile *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->SetBinEntries(bin, nentries);
731  else if (kind() == Kind::TPROFILE2D)
732  static_cast<TProfile2D *>(accessRootObject(access, __PRETTY_FUNCTION__, 1))->SetBinEntries(bin, nentries);
733  else
734  incompatible(__PRETTY_FUNCTION__);
735  }
736 
738  void MonitorElement::setEntries(double nentries) {
739  auto access = this->accessMut();
740  accessRootObject(access, __PRETTY_FUNCTION__, 1)->SetEntries(nentries);
741  }
742 
745  const MonitorElement *num, const MonitorElement *denom, double c1, double c2, const char *options) {
746  if (num->kind() < Kind::TH1F)
747  num->incompatible(__PRETTY_FUNCTION__);
748  if (denom->kind() < Kind::TH1F)
749  denom->incompatible(__PRETTY_FUNCTION__);
750 
751  TH1 const *numH = static_cast<TH1 const *>(num->getRootObject());
752  TH1 const *denomH = static_cast<TH1 const *>(denom->getRootObject());
753  TH1 *thisH = getTH1();
754 
755  //Need to take locks in a consistent order to avoid deadlocks. Use pointer value order of underlying ROOT object..
756  //This is known as the monitor pattern.
757  std::array<const MonitorElement *, 3> order{{this, num, denom}};
758  std::sort(order.begin(), order.end(), [](auto const *lhs, auto const *rhs) {
759  return lhs->mutable_->data_.value_.object_.get() < rhs->mutable_->data_.value_.object_.get();
760  });
761 
762  auto a0 = order[0]->access();
763  auto a1 = order[1]->access();
764  auto a2 = order[2]->access();
765 
766  //Have ROOT do check that the types are compatible
767  thisH->Divide(numH, denomH, c1, c2, options);
768  }
769 
771  void MonitorElement::setBinLabel(int bin, const std::string &label, int axis /* = 1 */) {
772  bool fail = false;
773  {
774  auto access = this->accessMut();
775  update();
776  if (getAxis(access, __PRETTY_FUNCTION__, axis)->GetNbins() >= bin) {
777  getAxis(access, __PRETTY_FUNCTION__, axis)->SetBinLabel(bin, label.c_str());
778  } else {
779  fail = true;
780  }
781  }
782  // do this with the ME lock released to prevent a deadlock
783  if (fail) {
784  // this also takes the lock, make sure to release it before going to edm
785  // (which might take more locks)
786  auto name = getFullname();
787  edm::LogWarning("MonitorElement") << "*** MonitorElement: WARNING:"
788  << "setBinLabel: attempting to set label of non-existent bin number for ME: "
789  << name << " \n";
790  }
791  }
792 
794  void MonitorElement::setAxisRange(double xmin, double xmax, int axis /* = 1 */) {
795  auto access = this->accessMut();
796  getAxis(access, __PRETTY_FUNCTION__, axis)->SetRangeUser(xmin, xmax);
797  }
798 
800  void MonitorElement::setAxisTitle(const std::string &title, int axis /* = 1 */) {
801  auto access = this->accessMut();
802  getAxis(access, __PRETTY_FUNCTION__, axis)->SetTitle(title.c_str());
803  }
804 
806  void MonitorElement::setAxisTimeDisplay(int value, int axis /* = 1 */) {
807  auto access = this->accessMut();
808  getAxis(access, __PRETTY_FUNCTION__, axis)->SetTimeDisplay(value);
809  }
810 
812  void MonitorElement::setAxisTimeFormat(const char *format /* = "" */, int axis /* = 1 */) {
813  auto access = this->accessMut();
814  getAxis(access, __PRETTY_FUNCTION__, axis)->SetTimeFormat(format);
815  }
816 
819  auto access = this->accessMut();
820  accessRootObject(access, __PRETTY_FUNCTION__, 1)->SetTitle(title.c_str());
821  }
822 
823  TAxis *MonitorElement::getAxis(AccessMut const &access, const char *func, int axis) const {
824  TH1 *h = accessRootObject(access, func, axis - 1);
825  TAxis *a = nullptr;
826  if (axis == 1)
827  a = h->GetXaxis();
828  else if (axis == 2)
829  a = h->GetYaxis();
830  else if (axis == 3)
831  a = h->GetZaxis();
832 
833  if (!a)
834  throw cms::Exception("MonitorElementError") << "No such axis " << axis
835  << " in monitor element"
836  " '"
837  << data_.objname << "' of type '" << typeid(*h).name() << "'";
838 
839  return a;
840  }
841 
842  TAxis const *MonitorElement::getAxis(Access const &access, const char *func, int axis) const {
843  TH1 const *h = accessRootObject(access, func, axis - 1);
844  TAxis const *a = nullptr;
845  if (axis == 1)
846  a = h->GetXaxis();
847  else if (axis == 2)
848  a = h->GetYaxis();
849  else if (axis == 3)
850  a = h->GetZaxis();
851 
852  if (!a)
853  throw cms::Exception("MonitorElementError") << "No such axis " << axis
854  << " in monitor element"
855  " '"
856  << data_.objname << "' of type '" << typeid(*h).name() << "'";
857 
858  return a;
859  }
860 
862  auto access = this->accessMut();
863  update();
864  access.value.object_->SetXTitle(title.c_str());
865  }
867  auto access = this->accessMut();
868  update();
869  access.value.object_->SetYTitle(title.c_str());
870  }
871 
873  auto access = this->accessMut();
874  update();
875  if (access.value.object_->GetSumw2() == nullptr) {
876  access.value.object_->Sumw2();
877  }
878  }
879 
881  auto access = this->accessMut();
882  update();
883  access.value.object_->GetXaxis()->SetNoAlphanumeric(false);
884  access.value.object_->GetYaxis()->SetNoAlphanumeric(false);
885  }
886 
887  void MonitorElement::setOption(const char *option) {
888  auto access = this->accessMut();
889  update();
890  access.value.object_->SetOption(option);
891  }
892  double MonitorElement::getAxisMin(int axis) const {
893  auto access = this->access();
894  return getAxis(access, __PRETTY_FUNCTION__, axis)->GetXmin();
895  }
896 
897  double MonitorElement::getAxisMax(int axis) const {
898  auto access = this->access();
899  return getAxis(access, __PRETTY_FUNCTION__, axis)->GetXmax();
900  }
901 
902  void MonitorElement::setCanExtend(unsigned int value) {
903  auto access = this->accessMut();
904  access.value.object_->SetCanExtend(value);
905  }
906 
908  auto access = this->accessMut();
909  if (value == kTRUE)
910  access.value.object_->SetStatOverflows(TH1::kConsider);
911  else
912  access.value.object_->SetStatOverflows(TH1::kIgnore);
913  }
914 
916  auto access = this->accessMut();
917  auto value = access.value.object_->GetStatOverflows();
918  if (value == TH1::kConsider)
919  return true;
920  else
921  return false;
922  }
923 
924  int64_t MonitorElement::getIntValue() const {
925  assert(kind() == Kind::INT);
926  auto access = this->access();
927  return access.value.scalar_.num;
928  }
930  assert(kind() == Kind::REAL);
931  auto access = this->access();
932  return access.value.scalar_.real;
933  }
935  assert(kind() == Kind::STRING);
936  auto access = this->access();
937  return access.value.scalar_.str;
938  }
939 
941  const std::string &qtname,
943  DQMNet::QValue *&qv) {
944  auto access = this->accessMut();
945 
947 
948  assert(access.value.qreports_.size() == data_.qreports.size());
949 
950  qr = nullptr;
951  qv = nullptr;
952 
953  size_t pos = 0, end = access.value.qreports_.size();
954  while (pos < end && data_.qreports[pos].qtname != qtname)
955  ++pos;
956 
957  if (pos == end && !create)
958  return;
959  else if (pos == end) {
962  q.qtresult = 0;
963  q.qtname = qtname;
964  q.message = "NO_MESSAGE_ASSIGNED";
965  q.algorithm = "UNKNOWN_ALGORITHM";
968  }
969 
970  qr = &access.value.qreports_[pos];
971  qv = &(qr->getValue());
972  }
973 
974  // -------------------------------------------------------------------
975  // TODO: all of these are UNSAFE and have to be NON-const.
976  TObject const *MonitorElement::getRootObject() const {
977  auto access = this->access();
978  return access.value.object_.get();
979  }
980 
982  auto access = this->accessMut();
983  return accessRootObject(access, __PRETTY_FUNCTION__, 0);
984  }
985 
987  auto access = this->accessMut();
988  assert(kind() == Kind::TH1F);
989  return static_cast<TH1F *>(accessRootObject(access, __PRETTY_FUNCTION__, 1));
990  }
991 
993  auto access = this->accessMut();
994  assert(kind() == Kind::TH1S);
995  return static_cast<TH1S *>(accessRootObject(access, __PRETTY_FUNCTION__, 1));
996  }
997 
999  auto access = this->accessMut();
1000  assert(kind() == Kind::TH1D);
1001  return static_cast<TH1D *>(accessRootObject(access, __PRETTY_FUNCTION__, 1));
1002  }
1003 
1005  auto access = this->accessMut();
1006  assert(kind() == Kind::TH2F);
1007  return static_cast<TH2F *>(accessRootObject(access, __PRETTY_FUNCTION__, 2));
1008  }
1009 
1011  auto access = this->accessMut();
1012  assert(kind() == Kind::TH2S);
1013  return static_cast<TH2S *>(accessRootObject(access, __PRETTY_FUNCTION__, 2));
1014  }
1015 
1017  auto access = this->accessMut();
1018  assert(kind() == Kind::TH2D);
1019  return static_cast<TH2D *>(accessRootObject(access, __PRETTY_FUNCTION__, 2));
1020  }
1021 
1023  auto access = this->accessMut();
1024  assert(kind() == Kind::TH3F);
1025  return static_cast<TH3F *>(accessRootObject(access, __PRETTY_FUNCTION__, 3));
1026  }
1027 
1029  auto access = this->accessMut();
1030  assert(kind() == Kind::TPROFILE);
1031  return static_cast<TProfile *>(accessRootObject(access, __PRETTY_FUNCTION__, 1));
1032  }
1033 
1035  auto access = this->accessMut();
1037  return static_cast<TProfile2D *>(accessRootObject(access, __PRETTY_FUNCTION__, 2));
1038  }
1039 
1040 } // namespace dqm::impl
dqm::impl
Definition: MonitorElement.h:74
dqm::impl::MonitorElement::divide
virtual void divide(const MonitorElement *, const MonitorElement *, double, double, const char *)
Replace entries with results of dividing num by denom.
Definition: MonitorElement.cc:744
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
dqm::impl::MonitorElement::getNbinsZ
virtual int getNbinsZ() const
get # of bins in Z-axis
Definition: MonitorElement.cc:586
dqm::impl::MonitorElement::mutable_
MutableMonitorElementData * mutable_
Definition: MonitorElement.h:139
dqm::impl::MonitorElement::setCanExtend
virtual DQM_DEPRECATED void setCanExtend(unsigned int value)
Definition: MonitorElement.cc:902
dqm::impl::MonitorElement::getBinEntries
virtual double getBinEntries(int bin) const
get # of bin entries (for profiles)
Definition: MonitorElement.cc:645
dqm::impl::MonitorElement::disableAlphanumeric
virtual void disableAlphanumeric()
Definition: MonitorElement.cc:880
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
dqm::impl::Access::key
const MonitorElementData::Key & key
Definition: MonitorElement.h:80
MessageLogger.h
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
dqm::impl::MonitorElement::data_
DQMNet::CoreObject data_
Definition: MonitorElement.h:236
MonitorElementData::Kind::INT
dqm::impl::MonitorElement::setEntries
virtual void setEntries(double nentries)
set # of entries
Definition: MonitorElement.cc:738
dqm::impl::MonitorElement::setTitle
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
Definition: MonitorElement.cc:818
dqm::impl::MonitorElement::setAxisTimeDisplay
virtual void setAxisTimeDisplay(int value, int axis=1)
set x-, y-, or z-axis to display time values
Definition: MonitorElement.cc:806
makePileupJSON.denom
denom
Definition: makePileupJSON.py:147
dqm::impl::MonitorElement::getTH1S
virtual TH1S * getTH1S()
Definition: MonitorElement.cc:992
dqm::impl::MonitorElement::setOption
virtual void setOption(const char *option)
Definition: MonitorElement.cc:887
dqm::qstatus::DID_NOT_RUN
static const int DID_NOT_RUN
Definition: MonitorElement.h:51
dqm::impl::MonitorElement::tagLabelString
std::string tagLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
Definition: MonitorElement.cc:423
MonitorElementData::Path::getObjectname
std::string const & getObjectname() const
Definition: MonitorElementCollection.h:172
MonitorElementData::Scalar::num
int64_t num
Definition: MonitorElementCollection.h:46
MonitorElementData::Kind::TH1S
MonitorElementData::Scalar::real
double real
Definition: MonitorElementCollection.h:47
MonitorElementData::Kind::TH1F
dqm::impl::MonitorElement::CheckBinLabels
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
Definition: MonitorElement.cc:160
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
dqm::impl::MonitorElement::getAxisTitle
virtual std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:677
pos
Definition: PixelAliasList.h:18
MonitorElementData::Kind::STRING
dqm::qstatus::WARNING
static const int WARNING
Definition: MonitorElement.h:53
dqm::impl::MonitorElement::integral
virtual double integral() const
get integral of bins
Definition: MonitorElement.cc:671
dqm::impl::MonitorElement::effLabelString
std::string effLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
Definition: MonitorElement.cc:441
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:48
cms::cuda::assert
assert(be >=bs)
edm::propagate_const::get
constexpr element_type const * get() const
Definition: propagate_const.h:64
dqm::impl::MonitorElement::getTH1D
virtual TH1D * getTH1D()
Definition: MonitorElement.cc:998
dqm::impl::checkRootObject
static TH1 * checkRootObject(const std::string &name, TObject *tobj, const char *func, int reqdim)
Definition: MonitorElement.cc:16
dqm::impl::MonitorElement::getTH3F
virtual TH3F * getTH3F()
Definition: MonitorElement.cc:1022
dqm::impl::MonitorElement::setAxisTimeFormat
virtual void setAxisTimeFormat(const char *format="", int axis=1)
set the format of the time values that are displayed on an axis
Definition: MonitorElement.cc:812
dqm::impl::MonitorElement::getQReports
std::vector< MonitorElementData::QReport * > getQReports() const
get map of QReports
Definition: MonitorElement.cc:502
dqm::impl::MonitorElement::getRMSError
virtual double getRMSError(int axis=1) const
get RMS uncertainty of histogram along x, y or z axis(axis=1,2,3 respectively)
Definition: MonitorElement.cc:568
MonitorElementData::QReport::QValue::qtresult
float qtresult
Definition: MonitorElementCollection.h:59
dqm::impl::AccessMut
Definition: MonitorElement.h:84
dqm::impl::MonitorElement::MonitorElement
MonitorElement(MonitorElementData &&data)
Definition: MonitorElement.cc:37
dqm::impl::MonitorElement::getQOthers
std::vector< MonitorElementData::QReport * > getQOthers() const
from last set of quality tests
Definition: MonitorElement.cc:515
MonitorElementData::QReport::QValue
Definition: MonitorElementCollection.h:57
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
dqm::impl::MonitorElement::access
const Access access() const
Definition: MonitorElement.h:151
dqm::impl::MonitorElement::accessRootObject
const TH1 * accessRootObject(Access const &access, const char *func, int reqdim) const
Definition: MonitorElement.cc:529
dqm::impl::MonitorElement::filterQReports
std::vector< MonitorElementData::QReport * > filterQReports(FILTER filter) const
Definition: MonitorElement.cc:489
dqm::impl::MonitorElement::switchData
void switchData(MonitorElement *other)
Definition: MonitorElement.cc:66
relativeConstraints.error
error
Definition: relativeConstraints.py:53
dqm::impl::MonitorElement::kind
Kind kind() const
Get the type of the monitor element.
Definition: MonitorElement.h:247
MonitorElementData::key_
Key key_
Definition: MonitorElementCollection.h:245
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:94
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
dqm::impl::MonitorElement::valueString
std::string valueString() const
Definition: MonitorElement.cc:390
MonitorElementData::Kind::TH2D
MonitorElementData::QReport::QValue::algorithm
std::string algorithm
Definition: MonitorElementCollection.h:62
testProducerWithPsetDescEmpty_cfi.a2
a2
Definition: testProducerWithPsetDescEmpty_cfi.py:35
DQMNet::CoreObject::flags
uint32_t flags
Definition: DQMNet.h:89
DQMNet::packQualityData
static void packQualityData(std::string &into, const QReports &qr)
Definition: DQMNet.cc:158
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
dqm::impl::MonitorElement::getStatOverflows
virtual bool getStatOverflows()
Definition: MonitorElement.cc:915
MonitorElementData::Kind::TH2F
MonitorElementData::Value::qreports_
std::vector< QReport > qreports_
Definition: MonitorElementCollection.h:159
options
Definition: options.py:1
dqm::impl::MonitorElement::getTH2F
virtual TH2F * getTH2F()
Definition: MonitorElement.cc:1004
alignCSCRings.s
s
Definition: alignCSCRings.py:92
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
dqm::impl::MonitorElement::getQErrors
std::vector< MonitorElementData::QReport * > getQErrors() const
get errors from last set of quality tests
Definition: MonitorElement.cc:511
dqm::impl::MonitorElement::getTProfile2D
virtual TProfile2D * getTProfile2D()
Definition: MonitorElement.cc:1034
DQMNet
Definition: DQMNet.h:26
MonitorElementData::Path::getDirname
std::string const & getDirname() const
Definition: MonitorElementCollection.h:171
DQMNet::CoreObject::streamId
uint32_t streamId
Definition: DQMNet.h:94
DQMNet::CoreObject::lumi
uint32_t lumi
Definition: DQMNet.h:93
bTagCommon_cff.label2
label2
Definition: bTagCommon_cff.py:168
DQMNet::CoreObject::tag
uint32_t tag
Definition: DQMNet.h:90
w
const double w
Definition: UKUtility.cc:23
MonitorElementData::Value::scalar_
Scalar scalar_
Definition: MonitorElementCollection.h:157
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DQMNet::DQM_PROP_REPORT_WARN
static const uint32_t DQM_PROP_REPORT_WARN
Definition: DQMNet.h:50
mps_fire.end
end
Definition: mps_fire.py:242
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
dqm::impl::MonitorElement::ShiftFillLast
DQM_DEPRECATED void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
Definition: MonitorElement.cc:256
MonitorElementData::QReport::QValue::message
std::string message
Definition: MonitorElementCollection.h:60
dqm::impl::MonitorElement::getTH2S
virtual TH2S * getTH2S()
Definition: MonitorElement.cc:1010
DQMNet::DQM_PROP_EFFICIENCY_PLOT
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
Definition: DQMNet.h:64
N
#define N
Definition: blowfish.cc:9
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
QReport
MonitorElementData::QReport QReport
Definition: MonitorElement.h:39
DQMNet::DQM_PROP_NEW
static const uint32_t DQM_PROP_NEW
Definition: DQMNet.h:59
dqm::impl::Access
Definition: MonitorElement.h:78
dqm::impl::MonitorElement::getRMS
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:562
dqm::impl::MonitorElement::doFill
void doFill(int64_t x)
"Fill" ME method for int64_t
Definition: MonitorElement.cc:214
trackingPlots.other
other
Definition: trackingPlots.py:1460
dqm::impl::MonitorElement::getTH1F
virtual TH1F * getTH1F()
Definition: MonitorElement.cc:986
MonitorElementData::Key::kind_
Kind kind_
Definition: MonitorElementCollection.h:230
h
dqm::impl::MonitorElement::setXTitle
virtual void setXTitle(std::string const &title)
Definition: MonitorElement.cc:861
dqm::impl::MonitorElement::packScalarData
void packScalarData(std::string &into, const char *prefix) const
convert scalar data into a string.
Definition: MonitorElement.cc:368
DQMNet::CoreObject::objname
std::string objname
Definition: DQMNet.h:97
b
double b
Definition: hdecay.h:118
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
dqm::impl::MonitorElement::getTH1
virtual TH1 * getTH1()
Definition: MonitorElement.cc:981
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
dqm::impl::MonitorElement::setAxisRange
virtual void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:794
dqm::impl::MonitorElement::getEntries
virtual double getEntries() const
get # of entries
Definition: MonitorElement.cc:628
MonitorElementData::QReport::QValue::code
int code
Definition: MonitorElementCollection.h:58
dqm::impl::MonitorElement::getQReport
const MonitorElementData::QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
Definition: MonitorElement.cc:481
dqm::impl::MonitorElement::getFloatValue
virtual double getFloatValue() const
Definition: MonitorElement.cc:929
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
dqm::impl::MonitorElement::switchObject
void switchObject(std::unique_ptr< TH1 > &&newobject)
Definition: MonitorElement.cc:79
Skims_PA_cff.content
content
Definition: Skims_PA_cff.py:19
MonitorElement.h
dqm::impl::MutableMonitorElementData::data_
MonitorElementData data_
Definition: MonitorElement.h:91
MonitorElementData::Key::path_
Path path_
Definition: MonitorElementCollection.h:225
a
double a
Definition: hdecay.h:119
dqm::impl::MonitorElement::getNbinsY
virtual int getNbinsY() const
get # of bins in Y-axis
Definition: MonitorElement.cc:580
DQMNet::DQM_PROP_REPORT_ERROR
static const uint32_t DQM_PROP_REPORT_ERROR
Definition: DQMNet.h:49
dqm::impl::MonitorElement::cloneMEData
MonitorElementData cloneMEData()
Definition: MonitorElement.cc:46
DQMNet::DQM_PROP_REPORT_OTHER
static const uint32_t DQM_PROP_REPORT_OTHER
Definition: DQMNet.h:51
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
dqm::impl::MonitorElement::accessMut
AccessMut accessMut()
Definition: MonitorElement.h:160
dqm::impl::MonitorElement::~MonitorElement
virtual ~MonitorElement()
Definition: MonitorElement.cc:153
eventshapeDQM_cfi.order
order
Definition: eventshapeDQM_cfi.py:8
MonitorElementData::QReport
Definition: MonitorElementCollection.h:55
DQMNet::CoreObject::qreports
QReports qreports
Definition: DQMNet.h:98
createfilelist.int
int
Definition: createfilelist.py:10
dqm::impl::MonitorElement::getQWarnings
std::vector< MonitorElementData::QReport * > getQWarnings() const
get warnings from last set of quality tests
Definition: MonitorElement.cc:506
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
dqm::impl::MonitorElement::setBinEntries
virtual void setBinEntries(int bin, double nentries)
set # of bin entries (to be used for profiles)
Definition: MonitorElement.cc:727
dqm::impl::MonitorElement::setYTitle
virtual void setYTitle(std::string const &title)
Definition: MonitorElement.cc:866
value
Definition: value.py:1
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
dqm::impl::MonitorElement::getTProfile
virtual TProfile * getTProfile()
Definition: MonitorElement.cc:1028
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
dqm::impl::MonitorElement::is_owned_
bool is_owned_
Definition: MonitorElement.h:141
dqm::impl::MonitorElement::getTitle
virtual std::string getTitle() const
get MonitorElement title
Definition: MonitorElement.cc:683
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
MonitorElementData::Kind::TH1D
dqm::impl::MonitorElement::getTH2D
virtual TH2D * getTH2D()
Definition: MonitorElement.cc:1016
dqm::impl::MonitorElement::setStatOverflows
virtual DQM_DEPRECATED void setStatOverflows(bool value)
Definition: MonitorElement.cc:907
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
dqm::impl::MutableMonitorElementData
Definition: MonitorElement.h:90
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
dqm::impl::MonitorElement::update
void update()
Mark the object updated.
Definition: MonitorElement.h:221
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
dqm::impl::MonitorElement::getFullname
std::string getFullname() const
get full name of ME including Pathname
Definition: MonitorElement.h:256
MonitorElementData::Key::scope_
Scope scope_
Definition: MonitorElementCollection.h:229
dqm::impl::MonitorElement::getRootObject
virtual const TObject * getRootObject() const
Definition: MonitorElement.cc:976
dqm::impl::MonitorElement::packQualityData
void packQualityData(std::string &into) const
serialise quality report information into a string.
Definition: MonitorElement.cc:386
MonitorElementData::QReport::getStatus
int getStatus() const
get test status
Definition: MonitorElementCollection.h:100
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
MonitorElementData::Kind::TH2S
MonitorElementData::Value::object_
edm::propagate_const< std::unique_ptr< TH1 > > object_
Definition: MonitorElementCollection.h:158
heppy_batch.val
val
Definition: heppy_batch.py:351
eostools.move
def move(src, dest)
Definition: eostools.py:511
MonitorElementData::Kind::TPROFILE2D
dqm::impl::MonitorElement::qualityTagString
std::string qualityTagString(const DQMNet::QValue &qv) const
Definition: MonitorElement.cc:456
MonitorElementData::Kind::TH3F
dqm::impl::MonitorElement::getAxisMax
virtual double getAxisMax(int axis=1) const
Definition: MonitorElement.cc:897
bTagCommon_cff.label1
label1
Definition: bTagCommon_cff.py:167
dqm::impl::MonitorElement::tagString
std::string tagString() const
Definition: MonitorElement.cc:407
dqm::impl::MonitorElement::getBin
virtual int getBin(int binx, int biny) const
get global bin number (for 2-D profiles)
Definition: MonitorElement.cc:634
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:245
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
dqm::impl::MonitorElement::getAxisMin
virtual double getAxisMin(int axis=1) const
Definition: MonitorElement.cc:892
dqm::impl::MonitorElement::setBinError
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
Definition: MonitorElement.cc:709
dqm::impl::MonitorElement::getStringValue
virtual const std::string & getStringValue() const
Definition: MonitorElement.cc:934
format
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DQMNet::CoreObject::run
uint32_t run
Definition: DQMNet.h:92
dqm::impl::MonitorElement::getMean
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:549
MonitorElementData::Scalar::str
std::string str
Definition: MonitorElementCollection.h:48
dqm::qstatus::STATUS_OK
static const int STATUS_OK
Definition: MonitorElement.h:52
MonitorElementData
Definition: MonitorElementCollection.h:43
DQMNet::CoreObject::moduleId
uint32_t moduleId
Definition: DQMNet.h:95
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
DQMNet::DQM_PROP_LUMI
static const uint32_t DQM_PROP_LUMI
Definition: DQMNet.h:61
mps_fire.result
result
Definition: mps_fire.py:311
zw
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:75
dqm::impl::MonitorElement::incompatible
void incompatible(const char *func) const
Definition: MonitorElement.cc:522
DQMNet::CoreObject::dirname
std::string dirname
Definition: DQMNet.h:96
dqm::impl::MonitorElement::enableSumw2
virtual void enableSumw2()
Definition: MonitorElement.cc:872
dqm::impl::MonitorElement::getMeanError
virtual double getMeanError(int axis=1) const
Definition: MonitorElement.cc:556
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
dqm::impl::MonitorElement::syncCoreObject
void syncCoreObject()
Definition: MonitorElement.cc:86
MonitorElementData::QReport::QValue::qtname
std::string qtname
Definition: MonitorElementCollection.h:61
dqm::impl::MonitorElement::getBinError
virtual double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
Definition: MonitorElement.cc:610
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
dqm::qstatus::ERROR
static const int ERROR
Definition: MonitorElement.h:54
dqm::impl::MonitorElement::release
MutableMonitorElementData * release(bool expectOwned)
Definition: MonitorElement.cc:57
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
MonitorElementData::Kind::TPROFILE
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
dqm::impl::Access::value
const MonitorElementData::Value & value
Definition: MonitorElement.h:81
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
dqm::impl::MonitorElement::getIntValue
virtual int64_t getIntValue() const
Definition: MonitorElement.cc:924
MonitorElementData::QReport::getValue
QValue & getValue()
access underlying value
Definition: MonitorElementCollection.h:96
label
const char * label
Definition: PFTauDecayModeTools.cc:11
MonitorElementData::Kind::REAL
hcallasereventfilter2012_cfi.prefix
prefix
Definition: hcallasereventfilter2012_cfi.py:10
dqm::impl::MonitorElement::getAxis
const TAxis * getAxis(Access const &access, const char *func, int axis) const
Definition: MonitorElement.cc:842