1 #define __STDC_FORMAT_MACROS 1
19 <<
"' cannot be invoked on monitor"
21 << name <<
"' because it is not a ROOT object.";
23 auto *
h =
static_cast<TH1 *
>(tobj);
24 int ndim =
h->GetDimension();
25 if (reqdim < 0 || reqdim > ndim)
27 <<
"' cannot be invoked on monitor"
29 << name <<
"' because it requires " << reqdim
30 <<
" dimensions; this"
32 <<
typeid(*h).name() <<
"' has " << ndim <<
" dimensions";
38 this->
mutable_ = std::make_shared<MutableMonitorElementData>();
94 if (access.
key.
scope_ == MonitorElementData::Scope::LUMI) {
153 THashList *l1 = (
const_cast<TAxis *
>(
a1))->GetLabels();
154 THashList *l2 = (
const_cast<TAxis *
>(
a2))->GetLabels();
162 if (l1->GetSize() != l2->GetSize()) {
165 for (
int i = 1;
i <= a1->GetNbins(); ++
i) {
166 TString
label1 = a1->GetBinLabel(
i);
167 TString
label2 = a2->GetBinLabel(
i);
168 if (label1 != label2) {
263 int index = entries + 1;
267 if (entries >= nbins) {
269 xlow = entries - nbins + 3;
276 double N = entries - nbins + 1.;
277 if (ye == 0. || y1err == 0. || y2err == 0.) {
279 double sum = N * y1 + y2;
282 double s = (N + 1.) * (N * y1 * y1 + y2 * y2) - sum * sum;
284 y1err =
sqrt(s) / (N + 1.);
289 double denom = (1. / y1err + 1. / y2err);
290 double mean = (y1 / y1err + y2 / y2err) / denom;
292 y1err =
sqrt(((y1 - mean) * (y1 - mean) / y1err + (y2 - mean) * (y2 - mean) / y2err) / denom / 2.);
310 sprintf(buffer,
"%d", xlow * xscale);
313 sprintf(buffer,
"%d", xup * xscale);
411 result.reserve(6 + 2 *
data_.
objname.size() + val.size());
427 size_t len = sprintf(buf,
"t=%" PRIu32,
data_.
tag);
461 size_t buflen = sprintf(buf,
"qr=st:%d:%.*g:", qv.
code, DBL_DIG + 2, qv.
qtresult);
463 result.reserve(7 + 2 * titlelen + buflen + qv.
algorithm.size() + qv.
message.size());
489 template <
typename FILTER>
492 std::vector<MonitorElementData::QReport *>
result;
497 result.push_back(const_cast<MonitorElementData::QReport *>(&qr));
525 <<
"' cannot be invoked on monitor"
533 <<
"' cannot be invoked on monitor"
535 <<
data_.
objname <<
"' because it is not a root object";
541 <<
"' cannot be invoked on monitor"
543 <<
data_.
objname <<
"' because it is not a root object";
638 return static_cast<TProfile2D
const *
>(
accessRootObject(
access, __PRETTY_FUNCTION__, 1))->GetBin(binx, biny);
649 return static_cast<TProfile
const *
>(
accessRootObject(
access, __PRETTY_FUNCTION__, 1))->GetBinEntries(bin);
651 return static_cast<TProfile2D const *>(
accessRootObject(
access, __PRETTY_FUNCTION__, 1))->GetBinEntries(bin);
664 return static_cast<TProfile2D
const *
>(
accessRootObject(
access, __PRETTY_FUNCTION__, 1))->GetBinEntries(globBin);
680 return getAxis(
access, __PRETTY_FUNCTION__, axis)->GetTitle();
733 static_cast<TProfile2D *>(
accessRootObject(
access, __PRETTY_FUNCTION__, 1))->SetBinEntries(bin, nentries);
752 TH1
const *numH =
static_cast<TH1
const *
>(num->
getRootObject());
753 TH1
const *denomH =
static_cast<TH1
const *
>(denom->
getRootObject());
758 std::array<const MonitorElement *, 3> order{{
this,
num, denom}};
759 std::sort(order.begin(), order.end(), [](
auto const *lhs,
auto const *rhs) {
760 return lhs->mutable_->data_.value_.object_.get() < rhs->mutable_->data_.value_.object_.get();
763 auto a0 = order[0]->access();
764 auto a1 = order[1]->access();
765 auto a2 = order[2]->access();
768 thisH->Divide(numH, denomH, c1, c2, options);
777 if (
getAxis(
access, __PRETTY_FUNCTION__, axis)->GetNbins() >= bin) {
778 getAxis(
access, __PRETTY_FUNCTION__, axis)->SetBinLabel(bin, label.c_str());
789 <<
"setBinLabel: attempting to set label of non-existent bin number for ME: "
797 getAxis(
access, __PRETTY_FUNCTION__, axis)->SetRangeUser(xmin, xmax);
803 getAxis(
access, __PRETTY_FUNCTION__, axis)->SetTitle(title.c_str());
809 getAxis(
access, __PRETTY_FUNCTION__, axis)->SetTimeDisplay(value);
815 getAxis(
access, __PRETTY_FUNCTION__, axis)->SetTimeFormat(format);
835 throw cms::Exception(
"MonitorElementError") <<
"No such axis " << axis
836 <<
" in monitor element"
838 <<
data_.
objname <<
"' of type '" <<
typeid(*h).name() <<
"'";
845 TAxis
const *
a =
nullptr;
854 throw cms::Exception(
"MonitorElementError") <<
"No such axis " << axis
855 <<
" in monitor element"
857 <<
data_.
objname <<
"' of type '" <<
typeid(*h).name() <<
"'";
895 return getAxis(
access, __PRETTY_FUNCTION__, axis)->GetXmin();
900 return getAxis(
access, __PRETTY_FUNCTION__, axis)->GetXmax();
919 if (
value == TH1::kConsider)
958 if (pos ==
end && !create)
960 else if (pos ==
end) {
965 q.
message =
"NO_MESSAGE_ASSIGNED";
972 qv = &(qr->getValue());
virtual std::string getTitle() const
get MonitorElement title
static const uint32_t DQM_PROP_REPORT_WARN
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
std::shared_ptr< MutableMonitorElementData > mutable_
virtual DQM_DEPRECATED void setCanExtend(unsigned int value)
virtual double integral() const
get integral of bins
virtual void disableAlphanumeric()
std::shared_ptr< MutableMonitorElementData > release()
TAxis const * getAxis(Access const &access, const char *func, int axis) const
virtual int getNbinsY() const
get # of bins in Y-axis
virtual double getAxisMin(int axis=1) const
virtual void setEntries(double nentries)
set # of entries
virtual void setAxisTimeDisplay(int value, int axis=1)
set x-, y-, or z-axis to display time values
MonitorElementData::Key const & key
virtual void setOption(const char *option)
virtual void setAxisTimeFormat(const char *format="", int axis=1)
set the format of the time values that are displayed on an axis
edm::propagate_const< std::unique_ptr< TH1 > > object_
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
virtual double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
virtual int64_t getIntValue() const
virtual int getNbinsZ() const
get # of bins in Z-axis
virtual std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
Kind kind() const
Get the type of the monitor element.
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
virtual bool getStatOverflows()
const MonitorElementData::QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
MonitorElement(MonitorElementData &&data)
void packQualityData(std::string &into) const
serialise quality report information into a string.
std::vector< MonitorElementData::QReport * > getQOthers() const
from last set of quality tests
void incompatible(const char *func) const
void switchData(MonitorElement *other)
int getStatus() const
get test status
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
DQM_DEPRECATED void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
std::vector< MonitorElementData::QReport * > getQErrors() const
get errors from last set of quality tests
MonitorElementData::QReport QReport
std::vector< MonitorElementData::QReport * > getQReports() const
get map of QReports
std::string const & getDirname() const
virtual void setXTitle(std::string const &title)
virtual TProfile2D * getTProfile2D()
virtual int getNbinsX() const
get # of bins in X-axis
virtual void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
virtual double getEntries() const
get # of entries
std::string tagString() const
void switchObject(std::unique_ptr< TH1 > &&newobject)
if(conf_.getParameter< bool >("UseStripCablingDB"))
void doFill(int64_t x)
"Fill" ME method for int64_t
MonitorElementData cloneMEData()
static const int DID_NOT_RUN
virtual ~MonitorElement()
static const uint32_t DQM_PROP_REPORT_ERROR
static const uint32_t DQM_PROP_REPORT_OTHER
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)
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual TProfile * getTProfile()
MonitorElementData::Value & value
void packScalarData(std::string &into, const char *prefix) const
convert scalar data into a string.
std::vector< MonitorElementData::QReport * > filterQReports(FILTER filter) const
MonitorElementData::Value const & value
void update()
Mark the object updated.
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual void setYTitle(std::string const &title)
virtual void setBinEntries(int bin, double nentries)
set # of bin entries (to be used for profiles)
virtual int getBin(int binx, int biny) const
get global bin number (for 2-D profiles)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
static constexpr float a0
virtual double getMeanError(int axis=1) const
MonitorElementData::Key const & key
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual DQM_DEPRECATED void setStatOverflows(bool value)
static void packQualityData(std::string &into, const QReports &qr)
std::string valueString() const
virtual double getBinEntries(int bin) const
get # of bin entries (for profiles)
std::string const & getObjectname() const
constexpr element_type const * get() const
std::vector< MonitorElementData::QReport * > getQWarnings() const
get warnings from last set of quality tests
std::vector< QReport > qreports_
char data[epos_bytes_allocation]
virtual double getFloatValue() const
const Access access() const
virtual const std::string & getStringValue() const
std::string tagLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
virtual double getRMSError(int axis=1) const
get RMS uncertainty of histogram along x, y or z axis(axis=1,2,3 respectively)
std::string getFullname() const
get full name of ME including Pathname
static const int STATUS_OK
virtual void enableSumw2()
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
QValue & getValue()
access underlying value
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
static TH1 * checkRootObject(const std::string &name, TObject *tobj, const char *func, int reqdim)
static const uint32_t DQM_PROP_NEW
Log< level::Warning, false > LogWarning
TH1 const * accessRootObject(Access const &access, const char *func, int reqdim) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual TObject const * getRootObject() const
std::string effLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
static const uint32_t DQM_PROP_LUMI
virtual double getAxisMax(int axis=1) const
virtual void divide(const MonitorElement *, const MonitorElement *, double, double, const char *)
Replace entries with results of dividing num by denom.
std::string qualityTagString(const DQMNet::QValue &qv) const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)