CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends
QCriterion Class Referenceabstract

#include <QTest.h>

Inheritance diagram for QCriterion:
SimpleTest CheckVariance CompareLastFilledBin CompareToMedian ContentSigma ContentsWithinExpected ContentsXRange ContentsYRange CSC01 DeadChannel FixedFlatOccupancy1d MeanWithinExpected NoisyChannel

Public Types

typedef dqm::legacy::MonitorElement MonitorElement
 (class should be created by DQMStore class) More...
 

Public Member Functions

std::string algoName () const
 get algorithm name More...
 
virtual std::vector< DQMChannelgetBadChannels () const
 
std::string getMessage () const
 get message attached to test More...
 
std::string getName () const
 get name of quality test More...
 
int getStatus () const
 get test status More...
 
void init ()
 initialize values More...
 
 QCriterion (std::string qtname)
 
float runTest (const MonitorElement *me, QReport &qr, DQMNet::QValue &qv)
 
void setErrorProb (float prob)
 
void setWarningProb (float prob)
 set probability limit for warning and error (default: 90% and 50%) More...
 
virtual ~QCriterion ()=default
 

Static Public 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 More...
 

Protected Member Functions

virtual float runTest (const MonitorElement *me)
 
void setAlgoName (std::string name)
 set algorithm name More...
 
virtual void setMessage ()=0
 set message after test has run More...
 
void setVerbose (int verbose)
 probability limits for warnings, errors More...
 

Protected Attributes

std::string algoName_
 name of quality test More...
 
float errorProb_
 
std::string message_
 quality test status More...
 
float prob_
 name of algorithm More...
 
std::string qtname_
 
int status_
 
int verbose_
 
float warningProb_
 message attached to test More...
 

Friends

class dqm::impl::MonitorElement
 
class dqm::legacy::MonitorElement
 for running the test More...
 

Detailed Description

Base class for quality tests run on Monitoring Elements;

Currently supporting the following tests:

Definition at line 31 of file QTest.h.

Member Typedef Documentation

(class should be created by DQMStore class)

Definition at line 35 of file QTest.h.

Constructor & Destructor Documentation

QCriterion::QCriterion ( std::string  qtname)
inline

Definition at line 51 of file QTest.h.

References init(), eostools::move(), and qtname_.

51  {
52  qtname_ = std::move(qtname);
53  init();
54  }
std::string qtname_
Definition: QTest.h:103
void init()
initialize values
Definition: QTest.cc:15
def move
Definition: eostools.py:511
virtual QCriterion::~QCriterion ( )
virtualdefault

Member Function Documentation

std::string QCriterion::algoName ( ) const
inline

get algorithm name

Definition at line 43 of file QTest.h.

References algoName_.

43 { return algoName_; }
std::string algoName_
name of quality test
Definition: QTest.h:104
virtual std::vector<DQMChannel> QCriterion::getBadChannels ( ) const
inlinevirtual

get vector of channels that failed test (not relevant for all quality tests!)

Reimplemented in SimpleTest.

Definition at line 49 of file QTest.h.

Referenced by SimpleTest::getBadChannels(), and runTest().

49 { return std::vector<DQMChannel>(); }
std::string QCriterion::getMessage ( ) const
inline

get message attached to test

Definition at line 39 of file QTest.h.

References message_.

39 { return message_; }
std::string message_
quality test status
Definition: QTest.h:107
std::string QCriterion::getName ( void  ) const
inline

get name of quality test

Definition at line 41 of file QTest.h.

References qtname_.

Referenced by plotting.Plot::draw(), and QualityTester::performTests().

41 { return qtname_; }
std::string qtname_
Definition: QTest.h:103
int QCriterion::getStatus ( ) const
inline

get test status

Definition at line 37 of file QTest.h.

References status_.

37 { return status_; }
int status_
Definition: QTest.h:106
void QCriterion::init ( void  )

initialize values

Definition at line 15 of file QTest.cc.

References dqm::qstatus::DID_NOT_RUN.

Referenced by QCriterion().

15  {
18  setAlgoName("NO_ALGORITHM");
20  message_ = "NO_MESSAGE";
21  verbose_ = 0; // 0 = silent, 1 = algorithmic failures, 2 = info
22 }
void setAlgoName(std::string name)
set algorithm name
Definition: QTest.h:96
int verbose_
Definition: QTest.h:110
int status_
Definition: QTest.h:106
float errorProb_
Definition: QTest.h:108
static const int DID_NOT_RUN
static const float ERROR_PROB_THRESHOLD
Definition: QTest.h:62
std::string message_
quality test status
Definition: QTest.h:107
float warningProb_
message attached to test
Definition: QTest.h:108
static const float WARNING_PROB_THRESHOLD
default &quot;probability&quot; values for setting warnings &amp; errors when running tests
Definition: QTest.h:61
float QCriterion::runTest ( const MonitorElement me,
QReport qr,
DQMNet::QValue qv 
)
inline

Definition at line 64 of file QTest.h.

References algoName_, MonitorElementData::QReport::QValue::algorithm, cms::cuda::assert(), MonitorElementData::QReport::QValue::code, gather_cfg::cout, dqm::qstatus::ERROR, errorProb_, getBadChannels(), MonitorElementData::QReport::QValue::message, message_, prob_, MonitorElementData::QReport::QValue::qtname, qtname_, MonitorElementData::QReport::QValue::qtresult, MonitorElementData::QReport::setBadChannels(), setMessage(), status_, dqm::qstatus::STATUS_OK, verbose_, dqm::qstatus::WARNING, and warningProb_.

Referenced by QualityTester::performTests().

64  {
65  assert(qv.qtname == qtname_);
66 
67  prob_ = runTest(me); // this runTest goes to SimpleTest derivates
68 
69  if (prob_ < errorProb_)
71  else if (prob_ < warningProb_)
73  else
75 
76  setMessage(); // this goes to SimpleTest derivates
77 
78  if (verbose_ == 2)
79  std::cout << " Message = " << message_ << std::endl;
80  if (verbose_ == 2)
81  std::cout << " Name = " << qtname_ << " / Algorithm = " << algoName_ << " / Status = " << status_
82  << " / Prob = " << prob_ << std::endl;
83 
84  qv.code = status_;
85  qv.message = message_;
86  qv.qtname = qtname_;
87  qv.algorithm = algoName_;
88  qv.qtresult = prob_;
90 
91  return prob_;
92  }
int verbose_
Definition: QTest.h:110
int status_
Definition: QTest.h:106
float runTest(const MonitorElement *me, QReport &qr, DQMNet::QValue &qv)
Definition: QTest.h:64
std::string algoName_
name of quality test
Definition: QTest.h:104
static const int WARNING
assert(be >=bs)
virtual std::vector< DQMChannel > getBadChannels() const
Definition: QTest.h:49
std::string qtname_
Definition: QTest.h:103
float errorProb_
Definition: QTest.h:108
float prob_
name of algorithm
Definition: QTest.h:105
void setBadChannels(std::vector< DQMChannel > badChannels)
std::string message_
quality test status
Definition: QTest.h:107
virtual void setMessage()=0
set message after test has run
static const int STATUS_OK
tuple cout
Definition: gather_cfg.py:144
float warningProb_
message attached to test
Definition: QTest.h:108
static const int ERROR
float QCriterion::runTest ( const MonitorElement me)
protectedvirtual
void QCriterion::setAlgoName ( std::string  name)
inlineprotected
void QCriterion::setErrorProb ( float  prob)
inline

Definition at line 46 of file QTest.h.

References errorProb_.

46 { errorProb_ = prob; }
float errorProb_
Definition: QTest.h:108
virtual void QCriterion::setMessage ( )
protectedpure virtual

set message after test has run

Implemented in CompareLastFilledBin, CompareToMedian, and SimpleTest.

Referenced by runTest().

void QCriterion::setVerbose ( int  verbose)
inlineprotected

probability limits for warnings, errors

Definition at line 109 of file QTest.h.

References verbose, and verbose_.

109 { verbose_ = verbose; }
int verbose_
Definition: QTest.h:110
static constexpr int verbose
void QCriterion::setWarningProb ( float  prob)
inline

set probability limit for warning and error (default: 90% and 50%)

Definition at line 45 of file QTest.h.

References warningProb_.

45 { warningProb_ = prob; }
float warningProb_
message attached to test
Definition: QTest.h:108

Friends And Related Function Documentation

friend class dqm::impl::MonitorElement
friend

Definition at line 115 of file QTest.h.

friend class dqm::legacy::MonitorElement
friend

for running the test

Definition at line 114 of file QTest.h.

Member Data Documentation

std::string QCriterion::algoName_
protected

name of quality test

Definition at line 104 of file QTest.h.

Referenced by algoName(), runTest(), setAlgoName(), CompareToMedian::setMessage(), and CompareLastFilledBin::setMessage().

const float QCriterion::ERROR_PROB_THRESHOLD = 0.50
static

Definition at line 62 of file QTest.h.

Referenced by QualityTester::makeQCriterion().

float QCriterion::errorProb_
protected

Definition at line 108 of file QTest.h.

Referenced by runTest(), and setErrorProb().

std::string QCriterion::message_
protected

quality test status

Definition at line 107 of file QTest.h.

Referenced by getMessage(), runTest(), SimpleTest::setMessage(), CompareToMedian::setMessage(), and CompareLastFilledBin::setMessage().

float QCriterion::prob_
protected

name of algorithm

Definition at line 105 of file QTest.h.

Referenced by runTest(), CompareToMedian::setMessage(), and CompareLastFilledBin::setMessage().

std::string QCriterion::qtname_
protected
int QCriterion::status_
protected

Definition at line 106 of file QTest.h.

Referenced by getStatus(), and runTest().

int QCriterion::verbose_
protected

Definition at line 110 of file QTest.h.

Referenced by runTest(), and setVerbose().

const float QCriterion::WARNING_PROB_THRESHOLD = 0.90
static

default "probability" values for setting warnings & errors when running tests

Definition at line 61 of file QTest.h.

Referenced by QualityTester::makeQCriterion().

float QCriterion::warningProb_
protected

message attached to test

Definition at line 108 of file QTest.h.

Referenced by runTest(), and setWarningProb().