CMS 3D CMS Logo

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

#include <QTest.h>

Inheritance diagram for QCriterion:
SimpleTest Comp2RefChi2 Comp2RefEqualH Comp2RefKolmogorov CompareLastFilledBin CompareToMedian ContentsWithinExpected ContentsXRange ContentsYRange CSC01 DeadChannel FixedFlatOccupancy1d MeanWithinExpected NoisyChannel

Public Member Functions

std::string algoName (void) const
 get algorithm name More...
 
virtual std::vector< DQMChannelgetBadChannels (void) const
 
std::string getMessage (void) const
 get message attached to test More...
 
std::string getName (void) const
 get name of quality test More...
 
int getStatus (void) const
 (class should be created by DQMStore class) 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 (void)
 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 (void)=0
 set message after test has run More...
 
void setVerbose (int verbose)
 probability limits for warnings, errors More...
 
virtual ~QCriterion (void)
 

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

Constructor & Destructor Documentation

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

Definition at line 68 of file QTest.h.

References init(), and qtname_.

68 { qtname_ = qtname; init(); }
std::string qtname_
Definition: QTest.h:109
void init(void)
initialize values
Definition: QTest.cc:17
virtual QCriterion::~QCriterion ( void  )
inlineprotectedvirtual

Definition at line 72 of file QTest.h.

72 {}

Member Function Documentation

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

get algorithm name

Definition at line 58 of file QTest.h.

References algoName_.

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

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

Reimplemented in SimpleTest.

Definition at line 64 of file QTest.h.

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

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

get message attached to test

Definition at line 54 of file QTest.h.

References message_.

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

get name of quality test

Definition at line 56 of file QTest.h.

References qtname_.

Referenced by MonitorElement::addQReport(), and MonitorElement::runQTests().

56 { return qtname_; }
std::string qtname_
Definition: QTest.h:109
int QCriterion::getStatus ( void  ) const
inline

(class should be created by DQMStore class)

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

Definition at line 52 of file QTest.h.

References status_.

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

initialize values

Definition at line 17 of file QTest.cc.

References dqm::qstatus::DID_NOT_RUN.

Referenced by QCriterion().

18 {
21  setAlgoName("NO_ALGORITHM");
23  message_ = "NO_MESSAGE";
24  verbose_ = 0; // 0 = silent, 1 = algorithmic failures, 2 = info
25 }
void setAlgoName(std::string name)
set algorithm name
Definition: QTest.h:76
int verbose_
Definition: QTest.h:116
int status_
Definition: QTest.h:112
float errorProb_
Definition: QTest.h:114
static const int DID_NOT_RUN
static const float ERROR_PROB_THRESHOLD
Definition: QTest.h:121
std::string message_
quality test status
Definition: QTest.h:113
float warningProb_
message attached to test
Definition: QTest.h:114
static const float WARNING_PROB_THRESHOLD
default &quot;probability&quot; values for setting warnings &amp; errors when running tests
Definition: QTest.h:120
float QCriterion::runTest ( const MonitorElement me)
protectedvirtual

Reimplemented in CompareLastFilledBin, CompareToMedian, CSC01, FixedFlatOccupancy1d, MeanWithinExpected, ContentsWithinExpected, NoisyChannel, DeadChannel, ContentsYRange, ContentsXRange, Comp2RefKolmogorov, Comp2RefChi2, and Comp2RefEqualH.

Definition at line 27 of file QTest.cc.

References raiseDQMError().

Referenced by MonitorElement::runQTests(), and runTest().

28 {
29  raiseDQMError("QCriterion", "virtual runTest method called" );
30  return 0.;
31 }
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
float QCriterion::runTest ( const MonitorElement me,
QReport qr,
DQMNet::QValue qv 
)
inlineprotected

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

78  {
79  assert(qr.qcriterion_ == this);
80  assert(qv.qtname == qtname_);
81 
82  prob_ = runTest(me); // this runTest goes to SimpleTest derivates
83 
87 
88  setMessage(); // this goes to SimpleTest derivates
89 
90  if (verbose_==2) std::cout << " Message = " << message_ << std::endl;
91  if (verbose_==2) std::cout << " Name = " << qtname_ <<
92  " / Algorithm = " << algoName_ <<
93  " / Status = " << status_ <<
94  " / Prob = " << prob_ << std::endl;
95 
96  qv.code = status_;
97  qv.message = message_;
98  qv.qtname = qtname_;
99  qv.algorithm = algoName_;
100  qv.qtresult = prob_;
102 
103  return prob_;
104  }
QCriterion * qcriterion_
Definition: QReport.h:51
std::string algorithm
Definition: DQMNet.h:92
int verbose_
Definition: QTest.h:116
int status_
Definition: QTest.h:112
std::string algoName_
name of quality test
Definition: QTest.h:110
static const int WARNING
std::string qtname_
Definition: QTest.h:109
float errorProb_
Definition: QTest.h:114
float prob_
name of algorithm
Definition: QTest.h:111
virtual std::vector< DQMChannel > getBadChannels(void) const
Definition: QTest.h:64
std::string qtname
Definition: DQMNet.h:91
std::string message_
quality test status
Definition: QTest.h:113
virtual float runTest(const MonitorElement *me)
Definition: QTest.cc:27
std::vector< DQMChannel > badChannels_
Definition: QReport.h:52
std::string message
Definition: DQMNet.h:90
static const int STATUS_OK
tuple cout
Definition: gather_cfg.py:121
float qtresult
Definition: DQMNet.h:89
float warningProb_
message attached to test
Definition: QTest.h:114
virtual void setMessage(void)=0
set message after test has run
static const int ERROR
void QCriterion::setAlgoName ( std::string  name)
inlineprotected
void QCriterion::setErrorProb ( float  prob)
inline
virtual void QCriterion::setMessage ( void  )
protectedpure virtual

set message after test has run

Implemented in CompareLastFilledBin, CompareToMedian, Comp2RefChi2, and SimpleTest.

Referenced by runTest().

void QCriterion::setVerbose ( int  verbose)
inlineprotected

probability limits for warnings, errors

Definition at line 115 of file QTest.h.

References validate_alignment_devdb10_cfg::verbose, and verbose_.

Referenced by DQMStore::createQTest().

void QCriterion::setWarningProb ( float  prob)
inline

Friends And Related Function Documentation

friend class DQMStore
friend

for creating and deleting class instances

Definition at line 124 of file QTest.h.

friend class MonitorElement
friend

for running the test

Definition at line 126 of file QTest.h.

Member Data Documentation

std::string QCriterion::algoName_
protected

name of quality test

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

float QCriterion::errorProb_
protected

Definition at line 114 of file QTest.h.

Referenced by runTest(), setErrorProb(), and Comp2RefChi2::setMessage().

std::string QCriterion::message_
protected
float QCriterion::prob_
protected

name of algorithm

Definition at line 111 of file QTest.h.

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

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

Definition at line 112 of file QTest.h.

Referenced by getStatus(), and runTest().

int QCriterion::verbose_
protected

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

float QCriterion::warningProb_
protected

message attached to test

Definition at line 114 of file QTest.h.

Referenced by runTest(), Comp2RefChi2::setMessage(), and setWarningProb().