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.

51  {
52  qtname_ = std::move(qtname);
53  init();
54  }

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

◆ ~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.

43 { return algoName_; }

References algoName_.

◆ 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.

49 { return std::vector<DQMChannel>(); }

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

◆ getMessage()

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

get message attached to test

Definition at line 39 of file QTest.h.

39 { return message_; }

References message_.

◆ getName()

std::string QCriterion::getName ( void  ) const
inline

get name of quality test

Definition at line 41 of file QTest.h.

41 { return qtname_; }

References qtname_.

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

◆ getStatus()

int QCriterion::getStatus ( ) const
inline

get test status

Definition at line 37 of file QTest.h.

37 { return status_; }

References status_.

◆ init()

void QCriterion::init ( void  )

initialize values

Definition at line 15 of file QTest.cc.

15  {
18  setAlgoName("NO_ALGORITHM");
20  message_ = "NO_MESSAGE";
21  verbose_ = 0; // 0 = silent, 1 = algorithmic failures, 2 = info
22 }

References dqm::qstatus::DID_NOT_RUN.

Referenced by QCriterion().

◆ runTest() [1/2]

float QCriterion::runTest ( const MonitorElement me)
protectedvirtual

◆ runTest() [2/2]

float QCriterion::runTest ( const MonitorElement me,
QReport qr,
DQMNet::QValue qv 
)
inline

Definition at line 64 of file QTest.h.

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  }

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

◆ setAlgoName()

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

◆ setErrorProb()

void QCriterion::setErrorProb ( float  prob)
inline

Definition at line 46 of file QTest.h.

46 { errorProb_ = prob; }

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.

109 { verbose_ = verbose; }

References verbose, and 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.

45 { warningProb_ = prob; }

References TtFullHadEvtBuilder_cfi::prob, and warningProb_.

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

QCriterion::init
void init()
initialize values
Definition: QTest.cc:15
dqm::qstatus::DID_NOT_RUN
static const int DID_NOT_RUN
Definition: MonitorElement.h:51
gather_cfg.cout
cout
Definition: gather_cfg.py:144
QCriterion::errorProb_
float errorProb_
Definition: QTest.h:108
dqm::qstatus::WARNING
static const int WARNING
Definition: MonitorElement.h:53
QCriterion::getBadChannels
virtual std::vector< DQMChannel > getBadChannels() const
Definition: QTest.h:49
cms::cuda::assert
assert(be >=bs)
MonitorElementData::QReport::QValue::qtresult
float qtresult
Definition: MonitorElementCollection.h:59
MonitorElementData::QReport::setBadChannels
void setBadChannels(std::vector< DQMChannel > badChannels)
Definition: MonitorElementCollection.h:118
MonitorElementData::QReport::QValue::algorithm
std::string algorithm
Definition: MonitorElementCollection.h:62
QCriterion::verbose_
int verbose_
Definition: QTest.h:110
MonitorElementData::QReport::QValue::message
std::string message
Definition: MonitorElementCollection.h:60
QCriterion::setAlgoName
void setAlgoName(std::string name)
set algorithm name
Definition: QTest.h:96
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
MonitorElementData::QReport::QValue::code
int code
Definition: MonitorElementCollection.h:58
QCriterion::runTest
float runTest(const MonitorElement *me, QReport &qr, DQMNet::QValue &qv)
Definition: QTest.h:64
QCriterion::warningProb_
float warningProb_
message attached to test
Definition: QTest.h:108
QCriterion::WARNING_PROB_THRESHOLD
static const float WARNING_PROB_THRESHOLD
default "probability" values for setting warnings & errors when running tests
Definition: QTest.h:61
eostools.move
def move(src, dest)
Definition: eostools.py:511
QCriterion::prob_
float prob_
name of algorithm
Definition: QTest.h:105
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqm::qstatus::STATUS_OK
static const int STATUS_OK
Definition: MonitorElement.h:52
QCriterion::status_
int status_
Definition: QTest.h:106
MonitorElementData::QReport::QValue::qtname
std::string qtname
Definition: MonitorElementCollection.h:61
QCriterion::ERROR_PROB_THRESHOLD
static const float ERROR_PROB_THRESHOLD
Definition: QTest.h:62
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
dqm::qstatus::ERROR
static const int ERROR
Definition: MonitorElement.h:54
TtFullHadEvtBuilder_cfi.prob
prob
Definition: TtFullHadEvtBuilder_cfi.py:33
QCriterion::setMessage
virtual void setMessage()=0
set message after test has run
QCriterion::algoName_
std::string algoName_
name of quality test
Definition: QTest.h:104
QCriterion::qtname_
std::string qtname_
Definition: QTest.h:103
QCriterion::message_
std::string message_
quality test status
Definition: QTest.h:107