CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Private 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 (see Core/interface/DQMDefinitions.h) More...
 
void setErrorProb (float prob)
 
void setWarningProb (float prob)
 set probability limit for warning and error (default: 90% and 50%) More...
 

Protected Member Functions

void init ()
 initialize values More...
 
 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 More...
 
virtual void setMessage ()=0
 set message after test has run More...
 
void setVerbose (int verbose)
 probability limits for warnings, errors More...
 
virtual ~QCriterion ()=default
 

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

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

Friends

class dqm::dqmstoreimpl::DQMStore
 for creating and deleting class instances More...
 
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 63 of file QTest.h.

Member Typedef Documentation

(class should be created by DQMStore class)

Definition at line 67 of file QTest.h.

Constructor & Destructor Documentation

QCriterion::QCriterion ( std::string  qtname)
inlineprotected

Definition at line 84 of file QTest.h.

References init(), hlt_dqm_clientPB-live_cfg::me, eostools::move(), qtname_, runTest(), and ~QCriterion().

84  {
85  qtname_ = std::move(qtname);
86  init();
87  }
std::string qtname_
Definition: QTest.h:131
void init()
initialize values
Definition: QTest.cc:16
def move(src, dest)
Definition: eostools.py:511
virtual QCriterion::~QCriterion ( )
protectedvirtualdefault

Referenced by QCriterion().

Member Function Documentation

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

get algorithm name

Definition at line 75 of file QTest.h.

References algoName_.

75 { return algoName_; }
std::string algoName_
name of quality test
Definition: QTest.h:132
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 81 of file QTest.h.

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

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

get message attached to test

Definition at line 71 of file QTest.h.

References message_.

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

get name of quality test

Definition at line 73 of file QTest.h.

References qtname_.

Referenced by dqm::impl::MonitorElement::addQReport(), plotting.Plot::draw(), and dqm::legacy::MonitorElement::runQTests().

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

get test status (see Core/interface/DQMDefinitions.h)

Definition at line 69 of file QTest.h.

References status_.

69 { return status_; }
int status_
Definition: QTest.h:134
void QCriterion::init ( void  )
protected

initialize values

Definition at line 16 of file QTest.cc.

References dqm::qstatus::DID_NOT_RUN.

Referenced by QCriterion().

16  {
19  setAlgoName("NO_ALGORITHM");
21  message_ = "NO_MESSAGE";
22  verbose_ = 0; // 0 = silent, 1 = algorithmic failures, 2 = info
23 }
void setAlgoName(std::string name)
set algorithm name
Definition: QTest.h:95
int verbose_
Definition: QTest.h:138
int status_
Definition: QTest.h:134
float errorProb_
Definition: QTest.h:136
static const int DID_NOT_RUN
static const float ERROR_PROB_THRESHOLD
Definition: QTest.h:143
std::string message_
quality test status
Definition: QTest.h:135
float warningProb_
message attached to test
Definition: QTest.h:136
static const float WARNING_PROB_THRESHOLD
default "probability" values for setting warnings & errors when running tests
Definition: QTest.h:142
float QCriterion::runTest ( const MonitorElement me)
protectedvirtual
float QCriterion::runTest ( const MonitorElement me,
QReport qr,
DQMNet::QValue qv 
)
inlineprotected

Definition at line 97 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_.

97  {
98  assert(qr.qcriterion_ == this);
99  assert(qv.qtname == qtname_);
100 
101  prob_ = runTest(me); // this runTest goes to SimpleTest derivates
102 
103  if (prob_ < errorProb_)
105  else if (prob_ < warningProb_)
107  else
109 
110  setMessage(); // this goes to SimpleTest derivates
111 
112  if (verbose_ == 2)
113  std::cout << " Message = " << message_ << std::endl;
114  if (verbose_ == 2)
115  std::cout << " Name = " << qtname_ << " / Algorithm = " << algoName_ << " / Status = " << status_
116  << " / Prob = " << prob_ << std::endl;
117 
118  qv.code = status_;
119  qv.message = message_;
120  qv.qtname = qtname_;
121  qv.algorithm = algoName_;
122  qv.qtresult = prob_;
124 
125  return prob_;
126  }
QCriterion * qcriterion_
Definition: QReport.h:51
std::string algorithm
Definition: DQMNet.h:90
int verbose_
Definition: QTest.h:138
int status_
Definition: QTest.h:134
std::string algoName_
name of quality test
Definition: QTest.h:132
static const int WARNING
virtual std::vector< DQMChannel > getBadChannels() const
Definition: QTest.h:81
std::string qtname_
Definition: QTest.h:131
float errorProb_
Definition: QTest.h:136
float prob_
name of algorithm
Definition: QTest.h:133
std::string qtname
Definition: DQMNet.h:89
std::string message_
quality test status
Definition: QTest.h:135
virtual void setMessage()=0
set message after test has run
virtual float runTest(const MonitorElement *me)
Definition: QTest.cc:25
std::vector< DQMChannel > badChannels_
Definition: QReport.h:52
std::string message
Definition: DQMNet.h:88
static const int STATUS_OK
float qtresult
Definition: DQMNet.h:87
float warningProb_
message attached to test
Definition: QTest.h:136
static const int ERROR
void QCriterion::setAlgoName ( std::string  name)
inlineprotected
void QCriterion::setErrorProb ( float  prob)
inline
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 137 of file QTest.h.

References verbose, and verbose_.

Referenced by dqm::dqmstoreimpl::DQMStore::createQTest().

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

Friends And Related Function Documentation

friend class dqm::dqmstoreimpl::DQMStore
friend

for creating and deleting class instances

Definition at line 146 of file QTest.h.

friend class dqm::impl::MonitorElement
friend

Definition at line 149 of file QTest.h.

friend class dqm::legacy::MonitorElement
friend

for running the test

Definition at line 148 of file QTest.h.

Member Data Documentation

std::string QCriterion::algoName_
protected

name of quality test

Definition at line 132 of file QTest.h.

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

const float QCriterion::ERROR_PROB_THRESHOLD = 0.50
staticprivate

Definition at line 143 of file QTest.h.

float QCriterion::errorProb_
protected

Definition at line 136 of file QTest.h.

Referenced by runTest(), and setErrorProb().

std::string QCriterion::message_
protected

quality test status

Definition at line 135 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 133 of file QTest.h.

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

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

Definition at line 134 of file QTest.h.

Referenced by getStatus(), and runTest().

int QCriterion::verbose_
protected

Definition at line 138 of file QTest.h.

Referenced by runTest(), and setVerbose().

const float QCriterion::WARNING_PROB_THRESHOLD = 0.90
staticprivate

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

Definition at line 142 of file QTest.h.

float QCriterion::warningProb_
protected

message attached to test

Definition at line 136 of file QTest.h.

Referenced by runTest(), and setWarningProb().