CMS 3D CMS Logo

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

◆ MonitorElement

(class should be created by DQMStore class)

Definition at line 35 of file QTest.h.

Constructor & Destructor Documentation

◆ QCriterion()

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(src, dest)
Definition: eostools.py:511

◆ ~QCriterion()

virtual QCriterion::~QCriterion ( )
virtualdefault

Member Function Documentation

◆ algoName()

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

◆ getBadChannels()

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>(); }

◆ getMessage()

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

◆ getName()

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

◆ getStatus()

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

◆ init()

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 "probability" values for setting warnings & errors when running tests
Definition: QTest.h:61

◆ runTest() [1/2]

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(), hlt_dqm_clientPB-live_cfg::me, 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)
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
virtual std::vector< DQMChannel > getBadChannels() const
Definition: QTest.h:49
float warningProb_
message attached to test
Definition: QTest.h:108
static const int ERROR

◆ runTest() [2/2]

float QCriterion::runTest ( const MonitorElement me)
protectedvirtual

◆ setAlgoName()

void QCriterion::setAlgoName ( std::string  name)
inlineprotected

◆ setErrorProb()

void QCriterion::setErrorProb ( float  prob)
inline

Definition at line 46 of file QTest.h.

References errorProb_, and TtFullHadEvtBuilder_cfi::prob.

◆ setMessage()

virtual void QCriterion::setMessage ( )
protectedpure virtual

set message after test has run

Implemented in CompareLastFilledBin, CompareToMedian, and SimpleTest.

Referenced by runTest().

◆ setVerbose()

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
bool verbose

◆ setWarningProb()

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 TtFullHadEvtBuilder_cfi::prob, and warningProb_.

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

Friends And Related Function Documentation

◆ dqm::impl::MonitorElement

friend class dqm::impl::MonitorElement
friend

Definition at line 115 of file QTest.h.

◆ dqm::legacy::MonitorElement

friend class dqm::legacy::MonitorElement
friend

for running the test

Definition at line 114 of file QTest.h.

Member Data Documentation

◆ algoName_

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().

◆ ERROR_PROB_THRESHOLD

const float QCriterion::ERROR_PROB_THRESHOLD = 0.50
static

Definition at line 62 of file QTest.h.

Referenced by QualityTester::makeQCriterion().

◆ errorProb_

float QCriterion::errorProb_
protected

Definition at line 108 of file QTest.h.

Referenced by runTest(), and setErrorProb().

◆ message_

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().

◆ prob_

float QCriterion::prob_
protected

name of algorithm

Definition at line 105 of file QTest.h.

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

◆ qtname_

std::string QCriterion::qtname_
protected

◆ status_

int QCriterion::status_
protected

Definition at line 106 of file QTest.h.

Referenced by getStatus(), and runTest().

◆ verbose_

int QCriterion::verbose_
protected

Definition at line 110 of file QTest.h.

Referenced by runTest(), and setVerbose().

◆ WARNING_PROB_THRESHOLD

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().

◆ warningProb_

float QCriterion::warningProb_
protected

message attached to test

Definition at line 108 of file QTest.h.

Referenced by runTest(), and setWarningProb().