#include <QTest.h>
Public Member Functions | |
std::string | algoName (void) const |
get algorithm name | |
virtual std::vector< DQMChannel > | getBadChannels (void) const |
std::string | getMessage (void) const |
get message attached to test | |
std::string | getName (void) const |
get name of quality test | |
int | getStatus (void) const |
(class should be created by DQMStore class) | |
void | setErrorProb (float prob) |
void | setWarningProb (float prob) |
set probability limit for warning and error (default: 90% and 50%) | |
Protected Member Functions | |
void | init (void) |
initialize values | |
QCriterion (std::string qtname) | |
virtual float | runTest (const MonitorElement *me) |
float | runTest (const MonitorElement *me, QReport &qr, DQMNet::QValue &qv) |
void | setAlgoName (std::string name) |
set algorithm name | |
virtual void | setMessage (void)=0 |
set message after test has run | |
void | setVerbose (int verbose) |
probability limits for warnings, errors | |
virtual | ~QCriterion (void) |
Protected Attributes | |
std::string | algoName_ |
name of quality test | |
float | errorProb_ |
std::string | message_ |
quality test status | |
float | prob_ |
name of algorithm | |
std::string | qtname_ |
int | status_ |
int | verbose_ |
float | warningProb_ |
message attached to test | |
Static Private Attributes | |
static const float | ERROR_PROB_THRESHOLD = 0.50 |
static const float | WARNING_PROB_THRESHOLD = 0.90 |
default "probability" values for setting warnings & errors when running tests | |
Friends | |
class | DQMStore |
for creating and deleting class instances | |
class | MonitorElement |
for running the test |
Base class for quality tests run on Monitoring Elements;
Currently supporting the following tests:
QCriterion::QCriterion | ( | std::string | qtname | ) | [inline, protected] |
virtual QCriterion::~QCriterion | ( | void | ) | [inline, protected, virtual] |
std::string QCriterion::algoName | ( | void | ) | const [inline] |
virtual std::vector<DQMChannel> QCriterion::getBadChannels | ( | void | ) | const [inline, virtual] |
get vector of channels that failed test (not relevant for all quality tests!)
Reimplemented in SimpleTest.
Definition at line 64 of file QTest.h.
Referenced by runTest().
{ return std::vector<DQMChannel>(); }
std::string QCriterion::getMessage | ( | void | ) | const [inline] |
std::string QCriterion::getName | ( | void | ) | const [inline] |
get name of quality test
Definition at line 56 of file QTest.h.
References qtname_.
Referenced by MonitorElement::addQReport(), and MonitorElement::runQTests().
{ return qtname_; }
int QCriterion::getStatus | ( | void | ) | const [inline] |
void QCriterion::init | ( | void | ) | [protected] |
initialize values
Definition at line 17 of file QTest.cc.
References dqm::qstatus::DID_NOT_RUN.
Referenced by QCriterion().
{ errorProb_ = ERROR_PROB_THRESHOLD; warningProb_ = WARNING_PROB_THRESHOLD; setAlgoName("NO_ALGORITHM"); status_ = dqm::qstatus::DID_NOT_RUN; message_ = "NO_MESSAGE"; verbose_ = 0; // 0 = silent, 1 = algorithmic failures, 2 = info }
float QCriterion::runTest | ( | const MonitorElement * | me | ) | [protected, virtual] |
Reimplemented in Comp2RefEqualH, Comp2RefChi2, Comp2RefKolmogorov, ContentsXRange, ContentsYRange, DeadChannel, NoisyChannel, ContentsWithinExpected, MeanWithinExpected, FixedFlatOccupancy1d, CSC01, CompareToMedian, and CompareLastFilledBin.
Definition at line 27 of file QTest.cc.
References raiseDQMError().
Referenced by MonitorElement::runQTests(), and runTest().
{ raiseDQMError("QCriterion", "virtual runTest method called" ); return 0.; }
float QCriterion::runTest | ( | const MonitorElement * | me, |
QReport & | qr, | ||
DQMNet::QValue & | qv | ||
) | [inline, protected] |
Definition at line 78 of file QTest.h.
References algoName_, DQMNet::QValue::algorithm, QReport::badChannels_, DQMNet::QValue::code, gather_cfg::cout, dqm::qstatus::ERROR, errorProb_, getBadChannels(), DQMNet::QValue::message, message_, prob_, QReport::qcriterion_, DQMNet::QValue::qtname, qtname_, DQMNet::QValue::qtresult, runTest(), setMessage(), status_, dqm::qstatus::STATUS_OK, verbose_, dqm::qstatus::WARNING, and warningProb_.
{ assert(qr.qcriterion_ == this); assert(qv.qtname == qtname_); prob_ = runTest(me); // this runTest goes to SimpleTest derivates if (prob_ < errorProb_) status_ = dqm::qstatus::ERROR; else if (prob_ < warningProb_) status_ = dqm::qstatus::WARNING; else status_ = dqm::qstatus::STATUS_OK; setMessage(); // this goes to SimpleTest derivates if (verbose_==2) std::cout << " Message = " << message_ << std::endl; if (verbose_==2) std::cout << " Name = " << qtname_ << " / Algorithm = " << algoName_ << " / Status = " << status_ << " / Prob = " << prob_ << std::endl; qv.code = status_; qv.message = message_; qv.qtname = qtname_; qv.algorithm = algoName_; qv.qtresult = prob_; qr.badChannels_ = getBadChannels(); return prob_; }
void QCriterion::setAlgoName | ( | std::string | name | ) | [inline, protected] |
set algorithm name
Definition at line 76 of file QTest.h.
References algoName_, and mergeVDriftHistosByStation::name.
Referenced by Comp2RefChi2::Comp2RefChi2(), Comp2RefEqualH::Comp2RefEqualH(), Comp2RefKolmogorov::Comp2RefKolmogorov(), CompareLastFilledBin::CompareLastFilledBin(), CompareToMedian::CompareToMedian(), ContentsWithinExpected::ContentsWithinExpected(), ContentsXRange::ContentsXRange(), ContentsYRange::ContentsYRange(), CSC01::CSC01(), DeadChannel::DeadChannel(), FixedFlatOccupancy1d::FixedFlatOccupancy1d(), MeanWithinExpected::MeanWithinExpected(), and NoisyChannel::NoisyChannel().
void QCriterion::setErrorProb | ( | float | prob | ) | [inline] |
Definition at line 61 of file QTest.h.
References errorProb_.
Referenced by createMeanValueTest(), createXRangeTest(), createYRangeTest(), QTestConfigure::EnableComp2RefChi2Test(), QTestConfigure::EnableComp2RefEqualHTest(), QTestConfigure::EnableComp2RefKolmogorovTest(), QTestConfigure::EnableCompareLastFilledBinTest(), QTestConfigure::EnableCompareToMedianTest(), QTestConfigure::EnableContentsWithinExpectedTest(), QTestConfigure::EnableDeadChannelTest(), QTestConfigure::EnableMeanWithinExpectedTest(), QTestConfigure::EnableNoisyChannelTest(), QTestConfigure::EnableXRangeTest(), and QTestConfigure::EnableYRangeTest().
{ errorProb_ = prob; }
virtual void QCriterion::setMessage | ( | void | ) | [protected, pure virtual] |
set message after test has run
Implemented in SimpleTest, Comp2RefChi2, CompareToMedian, and CompareLastFilledBin.
Referenced by runTest().
void QCriterion::setVerbose | ( | int | verbose | ) | [inline, protected] |
probability limits for warnings, errors
Definition at line 115 of file QTest.h.
References validate_alignment_devdb10_cfg::verbose, and verbose_.
Referenced by DQMStore::createQTest().
void QCriterion::setWarningProb | ( | float | prob | ) | [inline] |
set probability limit for warning and error (default: 90% and 50%)
Definition at line 60 of file QTest.h.
References warningProb_.
Referenced by createMeanValueTest(), createXRangeTest(), createYRangeTest(), QTestConfigure::EnableComp2RefChi2Test(), QTestConfigure::EnableComp2RefEqualHTest(), QTestConfigure::EnableComp2RefKolmogorovTest(), QTestConfigure::EnableCompareLastFilledBinTest(), QTestConfigure::EnableCompareToMedianTest(), QTestConfigure::EnableContentsWithinExpectedTest(), QTestConfigure::EnableDeadChannelTest(), QTestConfigure::EnableMeanWithinExpectedTest(), QTestConfigure::EnableNoisyChannelTest(), QTestConfigure::EnableXRangeTest(), and QTestConfigure::EnableYRangeTest().
{ warningProb_ = prob; }
friend class DQMStore [friend] |
friend class MonitorElement [friend] |
std::string QCriterion::algoName_ [protected] |
name of quality test
Definition at line 110 of file QTest.h.
Referenced by algoName(), runTest(), setAlgoName(), CompareLastFilledBin::setMessage(), and CompareToMedian::setMessage().
const float QCriterion::ERROR_PROB_THRESHOLD = 0.50 [static, private] |
float QCriterion::errorProb_ [protected] |
Definition at line 114 of file QTest.h.
Referenced by runTest(), setErrorProb(), and Comp2RefChi2::setMessage().
std::string QCriterion::message_ [protected] |
quality test status
Definition at line 113 of file QTest.h.
Referenced by getMessage(), runTest(), SimpleTest::setMessage(), CompareLastFilledBin::setMessage(), CompareToMedian::setMessage(), and Comp2RefChi2::setMessage().
float QCriterion::prob_ [protected] |
name of algorithm
Definition at line 111 of file QTest.h.
Referenced by runTest(), CompareLastFilledBin::setMessage(), and CompareToMedian::setMessage().
std::string QCriterion::qtname_ [protected] |
Definition at line 109 of file QTest.h.
Referenced by getName(), QCriterion(), runTest(), CompareLastFilledBin::setMessage(), and CompareToMedian::setMessage().
int QCriterion::status_ [protected] |
Definition at line 112 of file QTest.h.
Referenced by getStatus(), and runTest().
int QCriterion::verbose_ [protected] |
Definition at line 116 of file QTest.h.
Referenced by runTest(), and setVerbose().
const float QCriterion::WARNING_PROB_THRESHOLD = 0.90 [static, private] |
float QCriterion::warningProb_ [protected] |
message attached to test
Definition at line 114 of file QTest.h.
Referenced by runTest(), Comp2RefChi2::setMessage(), and setWarningProb().