![]() |
![]() |
#include <DQMServices/Core/interface/QTest.h>
Public Member Functions | |
std::string | algoName (void) const |
get algorithm name | |
virtual std::vector< DQMChannel > | getBadChannels (void) const |
get vector of channels that failed test (not relevant for all quality tests!) | |
std::string | getMessage (void) const |
get message attached to test | |
std::string | getName (void) const |
get name of quality test | |
int | getStatus (void) const |
get test status (see Core/interface/DQMDefinitions.h) | |
void | setErrorProb (float prob) |
set probability limit for test error (default: 50%) | |
void | setWarningProb (float prob) |
set probability limit for test warning (default: 90%) | |
bool | wasModified (void) const |
(class should be created by DQMStore class) | |
Protected Member Functions | |
void | init (void) |
initialize values | |
QCriterion (std::string qtname) | |
float | runTest (const MonitorElement *me, QReport &qr, DQMNet::QValue &qv) |
virtual float | runTest (const MonitorElement *me) |
void | setAlgoName (std::string name) |
set algorithm name | |
void | setDisabled (void) |
set status & message for disabled tests | |
void | setInvalid (void) |
set status & message for invalid tests | |
virtual void | setMessage (void)=0 |
set message after test has run | |
void | update (void) |
call method when something in the algorithm changes | |
bool | validProb (float prob) const |
true if probability value is valid | |
virtual | ~QCriterion (void) |
Protected Attributes | |
std::string | algoName_ |
flag for indicating algorithm modifications since last time it ran | |
bool | enabled_ |
float | errorProb_ |
std::string | message_ |
quality test status (see Core/interface/QTestStatus.h) | |
float | prob_ |
probability limits for warnings, errors | |
std::string | qtname_ |
message attached to test | |
int | status_ |
if true will run test | |
float | warningProb_ |
name of algorithm | |
bool | wasModified_ |
name of quality 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 |
Currently supporting the following tests:
Definition at line 60 of file QTest.h.
QCriterion::QCriterion | ( | std::string | qtname | ) | [inline, protected] |
virtual QCriterion::~QCriterion | ( | void | ) | [inline, protected, virtual] |
std::string QCriterion::algoName | ( | void | ) | const [inline] |
get algorithm name
Definition at line 75 of file QTest.h.
References algoName_.
Referenced by setDisabled(), and setInvalid().
00075 { return algoName_; }
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 82 of file QTest.h.
Referenced by SimpleTest::getBadChannels(), and runTest().
std::string QCriterion::getMessage | ( | void | ) | const [inline] |
std::string QCriterion::getName | ( | void | ) | const [inline] |
get name of quality test
Definition at line 73 of file QTest.h.
References qtname_.
Referenced by MonitorElement::addQReport(), and MonitorElement::runQTests().
00073 { return qtname_; }
initialize values
Definition at line 20 of file QTest.cc.
References dqm::qstatus::DID_NOT_RUN, ERROR_PROB_THRESHOLD, errorProb_, message_, setAlgoName(), status_, WARNING_PROB_THRESHOLD, warningProb_, and wasModified_.
Referenced by QCriterion().
00021 { 00022 wasModified_ = true; 00023 errorProb_ = ERROR_PROB_THRESHOLD; 00024 warningProb_ = WARNING_PROB_THRESHOLD; 00025 setAlgoName("NO_ALGORITHM"); 00026 status_ = dqm::qstatus::DID_NOT_RUN; 00027 message_ = "NO_MESSAGE"; 00028 }
float QCriterion::runTest | ( | const MonitorElement * | me, | |
QReport & | qr, | |||
DQMNet::QValue & | qv | |||
) | [inline, protected] |
Definition at line 96 of file QTest.h.
References algoName_, DQMNet::QValue::algorithm, QReport::badChannels_, DQMNet::QValue::code, dqm::qstatus::ERROR, errorProb_, getBadChannels(), DQMNet::QValue::message, message_, prob_, QReport::qcriterion_, DQMNet::QValue::qtname, qtname_, DQMNet::QValue::qtresult, runTest(), setInvalid(), setMessage(), status_, dqm::qstatus::STATUS_OK, validProb(), dqm::qstatus::WARNING, and warningProb_.
00096 { 00097 assert(qr.qcriterion_ == this); 00098 assert(qv.qtname == qtname_); 00099 //this runTest goes to SimpleTest 00100 prob_ = runTest(me); 00101 if (! validProb(prob_)) setInvalid(); 00102 else if (prob_ < errorProb_) status_ = dqm::qstatus::ERROR; 00103 else if (prob_ < warningProb_) status_ = dqm::qstatus::WARNING; 00104 else status_ = dqm::qstatus::STATUS_OK; 00105 setMessage(); 00106 00107 /* // debug output 00108 cout << " Message: " << message_ << endl; 00109 cout << " Name = " << qtname_ << 00110 " Algorithm = " << algoName_ << 00111 " Prob = " << prob_ << 00112 " Status = " << status_ << endl; 00113 */ 00114 00115 qv.code = status_; 00116 qv.message = message_; 00117 qv.qtname = qtname_; 00118 qv.algorithm = algoName_; 00119 qv.qtresult = prob_; 00120 qr.badChannels_ = getBadChannels(); 00121 00122 return prob_; 00123 }
float QCriterion::runTest | ( | const MonitorElement * | me | ) | [protected, virtual] |
Reimplemented in Comp2RefEqualH, Comp2RefChi2, Comp2RefKolmogorov, ContentsXRange, ContentsYRange, DeadChannel, NoisyChannel, ContentsWithinExpected, MeanWithinExpected, AllContentWithinFixedRange, AllContentWithinFloatingRange, FixedFlatOccupancy1d, and CSC01.
Definition at line 52 of file QTest.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
Referenced by MonitorElement::runQTests(), and runTest().
00053 { 00054 cout << " QCriterion:: virtual runTest method called " << endl; 00055 return -1; 00056 }
void QCriterion::setAlgoName | ( | std::string | name | ) | [inline, protected] |
set algorithm name
Definition at line 94 of file QTest.h.
References algoName_.
Referenced by AllContentWithinFixedRange::AllContentWithinFixedRange(), AllContentWithinFloatingRange::AllContentWithinFloatingRange(), Comp2RefChi2::Comp2RefChi2(), Comp2RefEqualH::Comp2RefEqualH(), Comp2RefKolmogorov::Comp2RefKolmogorov(), ContentsWithinExpected::ContentsWithinExpected(), ContentsXRange::ContentsXRange(), ContentsYRange::ContentsYRange(), CSC01::CSC01(), DeadChannel::DeadChannel(), FixedFlatOccupancy1d::FixedFlatOccupancy1d(), init(), MeanWithinExpected::MeanWithinExpected(), and NoisyChannel::NoisyChannel().
set status & message for disabled tests
Definition at line 32 of file QTest.cc.
References algoName(), dqm::qstatus::DISABLED, message_, qtname_, and status_.
00033 { 00034 status_ = dqm::qstatus::DISABLED; 00035 std::ostringstream message; 00036 message << " Test " << qtname_ << " (" << algoName() 00037 << ") has been disabled "; 00038 message_ = message.str(); 00039 }
void QCriterion::setErrorProb | ( | float | prob | ) | [inline] |
set probability limit for test error (default: 50%)
Definition at line 79 of file QTest.h.
References errorProb_, and validProb().
Referenced by createMeanValueTest(), createXRangeTest(), createYRangeTest(), QTestConfigure::EnableComp2RefChi2Test(), QTestConfigure::EnableComp2RefEqualHTest(), QTestConfigure::EnableComp2RefKolmogorovTest(), QTestConfigure::EnableContentsWithinExpectedTest(), QTestConfigure::EnableDeadChannelTest(), QTestConfigure::EnableMeanWithinExpectedTest(), QTestConfigure::EnableNoisyChannelTest(), QTestConfigure::EnableXRangeTest(), and QTestConfigure::EnableYRangeTest().
00079 { if (validProb(prob)) errorProb_ = prob; }
set status & message for invalid tests
Definition at line 43 of file QTest.cc.
References algoName(), dqm::qstatus::INVALID, message_, qtname_, and status_.
Referenced by runTest().
00044 { 00045 status_ = dqm::qstatus::INVALID; 00046 std::ostringstream message; 00047 message << " Test " << qtname_ << " (" << algoName() 00048 << ") cannot run due to problems "; 00049 message_ = message.str(); 00050 }
set message after test has run
Implemented in SimpleTest, Comp2RefChi2, ContentsXRange, ContentsYRange, DeadChannel, NoisyChannel, ContentsWithinExpected, and MeanWithinExpected.
Referenced by runTest().
void QCriterion::setWarningProb | ( | float | prob | ) | [inline] |
set probability limit for test warning (default: 90%)
Definition at line 77 of file QTest.h.
References validProb(), and warningProb_.
Referenced by createMeanValueTest(), createXRangeTest(), createYRangeTest(), QTestConfigure::EnableComp2RefChi2Test(), QTestConfigure::EnableComp2RefEqualHTest(), QTestConfigure::EnableComp2RefKolmogorovTest(), QTestConfigure::EnableContentsWithinExpectedTest(), QTestConfigure::EnableDeadChannelTest(), QTestConfigure::EnableMeanWithinExpectedTest(), QTestConfigure::EnableNoisyChannelTest(), QTestConfigure::EnableXRangeTest(), and QTestConfigure::EnableYRangeTest().
00077 { if (validProb(prob)) warningProb_ = prob; }
call method when something in the algorithm changes
Definition at line 126 of file QTest.h.
References wasModified_.
Referenced by SimpleTest::setMinimumEntries().
00126 { wasModified_ = true; }
bool QCriterion::validProb | ( | float | prob | ) | const [inline, protected] |
true if probability value is valid
Definition at line 128 of file QTest.h.
Referenced by runTest(), setErrorProb(), and setWarningProb().
(class should be created by DQMStore class)
true if QCriterion has been modified since last time it ran
Definition at line 67 of file QTest.h.
References wasModified_.
Referenced by MonitorElement::runQTests().
00067 { return wasModified_; }
friend class DQMStore [friend] |
friend class MonitorElement [friend] |
std::string QCriterion::algoName_ [protected] |
flag for indicating algorithm modifications since last time it ran
Definition at line 141 of file QTest.h.
Referenced by algoName(), runTest(), setAlgoName(), SimpleTest::setMessage(), MeanWithinExpected::setMessage(), Comp2RefChi2::setMessage(), ContentsXRange::setMessage(), ContentsYRange::setMessage(), NoisyChannel::setMessage(), DeadChannel::setMessage(), and ContentsWithinExpected::setMessage().
bool QCriterion::enabled_ [protected] |
const float QCriterion::ERROR_PROB_THRESHOLD = 0.50 [static, private] |
float QCriterion::errorProb_ [protected] |
Definition at line 142 of file QTest.h.
Referenced by init(), runTest(), setErrorProb(), and Comp2RefChi2::setMessage().
std::string QCriterion::message_ [protected] |
quality test status (see Core/interface/QTestStatus.h)
Definition at line 138 of file QTest.h.
Referenced by getMessage(), init(), runTest(), setDisabled(), setInvalid(), SimpleTest::setMessage(), MeanWithinExpected::setMessage(), Comp2RefChi2::setMessage(), ContentsXRange::setMessage(), ContentsYRange::setMessage(), NoisyChannel::setMessage(), DeadChannel::setMessage(), and ContentsWithinExpected::setMessage().
float QCriterion::prob_ [protected] |
probability limits for warnings, errors
test result [0, 1] ; (a) for comparison to reference : probability that histogram is consistent w/ reference (b) for "contents within range": fraction of entries that fall within allowed range
Definition at line 148 of file QTest.h.
Referenced by runTest(), SimpleTest::setMessage(), MeanWithinExpected::setMessage(), Comp2RefChi2::setMessage(), ContentsXRange::setMessage(), ContentsYRange::setMessage(), NoisyChannel::setMessage(), ContentsWithinExpected::setMessage(), and DeadChannel::setMessage().
std::string QCriterion::qtname_ [protected] |
message attached to test
Definition at line 139 of file QTest.h.
Referenced by getName(), QCriterion(), runTest(), setDisabled(), setInvalid(), SimpleTest::setMessage(), MeanWithinExpected::setMessage(), Comp2RefChi2::setMessage(), ContentsXRange::setMessage(), ContentsYRange::setMessage(), NoisyChannel::setMessage(), ContentsWithinExpected::setMessage(), and DeadChannel::setMessage().
int QCriterion::status_ [protected] |
if true will run test
Definition at line 137 of file QTest.h.
Referenced by getStatus(), init(), runTest(), setDisabled(), and setInvalid().
const float QCriterion::WARNING_PROB_THRESHOLD = 0.90 [static, private] |
float QCriterion::warningProb_ [protected] |
name of algorithm
Definition at line 142 of file QTest.h.
Referenced by init(), runTest(), Comp2RefChi2::setMessage(), and setWarningProb().
bool QCriterion::wasModified_ [protected] |