Skip to content

Commit

Permalink
Properly update QReport flags.
Browse files Browse the repository at this point in the history
Methods like `hasError` use the flags on the DQMNet::Core object, which
need to be updated after every QTest change.

Also clean up the API a bit by inlining `addQTest`.
  • Loading branch information
schneiml committed Nov 27, 2019
1 parent 65d892c commit d7c0f0f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 2 additions & 0 deletions DQMServices/Components/plugins/QualityTester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ void QualityTester::performTests(DQMStore::IGetter& igetter) {
assert(qr);
assert(qv);
qtest->runTest(me, *qr, *qv);
// this propagates the result into the DQMNet object flags
me->updateQReportStats();
}
}

Expand Down
6 changes: 2 additions & 4 deletions DQMServices/Core/interface/MonitorElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ namespace dqm::impl {
std::vector<QReport *> getQReports() const;
/// access QReport, potentially adding it.
void getQReport(bool create, const std::string &qtname, QReport *&qr, DQMNet::QValue *&qv);
/// propagate QReport status bits after change
void updateQReportStats();

/// get warnings from last set of quality tests
std::vector<QReport *> getQWarnings() const;
Expand Down Expand Up @@ -428,10 +430,6 @@ namespace dqm::impl {
void copyFunctions(TH1 *from, TH1 *to);
void copyFrom(TH1 *from);

// --- Operations on MEs that are normally reset at end of monitoring cycle ---
void addQReport(const DQMNet::QValue &desc);
void updateQReportStats();

public:
const uint32_t run() const { return data_.run; }
const uint32_t lumi() const { return data_.lumi; }
Expand Down
6 changes: 5 additions & 1 deletion DQMServices/Core/src/DQMStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,11 @@ namespace dqm::dqmstoreimpl {
return false;
}

me->addQReport(qv);
QReport* qr_ref;
DQMNet::QValue* qv_ref;
me->getQReport(true, qv.qtname, qr_ref, qv_ref);
*qv_ref = qv;
me->update();
}
} else {
std::cout << "*** DQMStore: WARNING: cannot extract object '" << obj->GetName() << "' of type '"
Expand Down
9 changes: 0 additions & 9 deletions DQMServices/Core/src/MonitorElement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1103,15 +1103,6 @@ namespace dqm::impl {
qv = &data_.qreports[pos];
}

/// Add quality report, from DQMStore.
void MonitorElement::addQReport(const DQMNet::QValue &desc) {
QReport *qr;
DQMNet::QValue *qv;
getQReport(true, desc.qtname, qr, qv);
*qv = desc;
update();
}

/// Refresh QReport stats, usually after MEs were read in from a file.
void MonitorElement::updateQReportStats() {
data_.flags &= ~DQMNet::DQM_PROP_REPORT_ALARM;
Expand Down

0 comments on commit d7c0f0f

Please sign in to comment.