CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
QTestConfigure Class Reference

#include <QTestConfigure.h>

Public Member Functions

void disableTests (const std::vector< std::string > &testsOFFList, DQMStore *bei)
 Disables the Quality Tests in the string list. More...
 
bool enableTests (const std::map< std::string, std::map< std::string, std::string > > &tests, DQMStore *bei)
 Creates and defines quality tests. More...
 
 QTestConfigure ()
 Constructor. More...
 
std::vector< std::string > testsReady ()
 Returns the vector containing the names of the quality tests that have been created. More...
 
 ~QTestConfigure ()
 Destructor. More...
 

Private Member Functions

void EnableCheckVarianceTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates CheckVariance test. More...
 
void EnableComp2Ref2DChi2Test (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates Comp2Ref2DChi2 test. More...
 
void EnableComp2RefChi2Test (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates Comp2RefChi2 test. More...
 
void EnableComp2RefEqualHTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates Comp2RefEqualH test. More...
 
void EnableComp2RefKolmogorovTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates EnableComp2RefKolmogorov test. More...
 
void EnableCompareLastFilledBinTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates EnableCompareLastFilledBinTest test. More...
 
void EnableCompareToMedianTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates ContentsWithinRangeROOT test. More...
 
void EnableContentsWithinExpectedTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates ContentsWithinRangeROOT test. More...
 
void EnableDeadChannelTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates ContentsYRangeASROOT test. More...
 
void EnableMeanWithinExpectedTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates MeanWithinExpectedROOT test. More...
 
void EnableNoisyChannelTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates NoisyChannelROOT test. More...
 
void EnableXRangeTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates ContentsXRangeROOT test. More...
 
void EnableYRangeTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates ContentsXRangeASROOT test. More...
 
const char * findOrDefault (const std::map< std::string, std::string > &, const char *, const char *) const
 

Private Attributes

std::vector< std::string > testsConfigured
 

Detailed Description

Definition at line 20 of file QTestConfigure.h.

Constructor & Destructor Documentation

QTestConfigure::QTestConfigure ( )
inline

Constructor.

Definition at line 25 of file QTestConfigure.h.

25 {}
QTestConfigure::~QTestConfigure ( )
inline

Member Function Documentation

void QTestConfigure::disableTests ( const std::vector< std::string > &  testsOFFList,
DQMStore bei 
)

Disables the Quality Tests in the string list.

Referenced by ~QTestConfigure().

void QTestConfigure::EnableCheckVarianceTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates CheckVariance test.

Definition at line 379 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), CheckVariance::getAlgoName(), DQMStore::getQCriterion(), QCriterion::setErrorProb(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

381  {
382  QCriterion * qc1;
383  if(! bei->getQCriterion(testName) ){
384  testsConfigured.push_back(testName);
385  qc1 = bei->createQTest(CheckVariance::getAlgoName(),testName);
386  }else{
387  qc1 = bei->getQCriterion(testName);
388 
389  }
390  CheckVariance * me_qc1 = (CheckVariance *) qc1;
391 
392  double warning = atof(findOrDefault(params, "warning", "0"));
393  double error = atof(findOrDefault(params, "error", "0"));
394  me_qc1->setWarningProb(warning);
395  me_qc1->setErrorProb(error);
396 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
static std::string getAlgoName(void)
get algorithm name
Definition: QTest.h:751
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void QTestConfigure::EnableComp2Ref2DChi2Test ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates Comp2Ref2DChi2 test.

Definition at line 103 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), Comp2Ref2DChi2::getAlgoName(), DQMStore::getQCriterion(), QCriterion::setErrorProb(), SimpleTest::setMinimumEntries(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

105  {
106  QCriterion * qc1;
107  if (! bei->getQCriterion(testName)) {
108  testsConfigured.push_back(testName);
109  qc1 = bei->createQTest(Comp2Ref2DChi2::getAlgoName(), testName);
110  } else {
111  qc1 = bei->getQCriterion(testName);
112  }
113  Comp2Ref2DChi2 * me_qc1 = (Comp2Ref2DChi2 *) qc1;
114  double warning = atof(findOrDefault(params, "warning", "0"));
115  double error = atof(findOrDefault(params, "error", "0"));
116  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
117  me_qc1->setWarningProb(warning);
118  me_qc1->setErrorProb(error);
119  if ( minEntries != 0 )
120  me_qc1->setMinimumEntries(minEntries);
121 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setMinimumEntries(unsigned n)
set minimum # of entries needed
Definition: QTest.h:144
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
static std::string getAlgoName(void)
Definition: QTest.h:219
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void QTestConfigure::EnableComp2RefChi2Test ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates Comp2RefChi2 test.

Definition at line 86 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), Comp2RefChi2::getAlgoName(), DQMStore::getQCriterion(), QCriterion::setErrorProb(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

88  {
89  QCriterion * qc1;
90  if (! bei->getQCriterion(testName)) {
91  testsConfigured.push_back(testName);
92  qc1 = bei->createQTest(Comp2RefChi2::getAlgoName(), testName);
93  } else {
94  qc1 = bei->getQCriterion(testName);
95  }
96  Comp2RefChi2 * me_qc1 = (Comp2RefChi2 *) qc1;
97  double warning = atof(findOrDefault(params, "warning", "0"));
98  double error = atof(findOrDefault(params, "error", "0"));
99  me_qc1->setWarningProb(warning);
100  me_qc1->setErrorProb(error);
101 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
static std::string getAlgoName(void)
Definition: QTest.h:191
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void QTestConfigure::EnableComp2RefEqualHTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates Comp2RefEqualH test.

Definition at line 69 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), Comp2RefEqualH::getAlgoName(), DQMStore::getQCriterion(), QCriterion::setErrorProb(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

71  {
72  QCriterion * qc1;
73  if (! bei->getQCriterion(testName)) {
74  testsConfigured.push_back(testName);
75  qc1 = bei->createQTest(Comp2RefEqualH::getAlgoName(), testName);
76  } else {
77  qc1 = bei->getQCriterion(testName);
78  }
79  Comp2RefEqualH * me_qc1 = (Comp2RefEqualH *) qc1;
80  double warning = atof(findOrDefault(params, "warning", "0"));
81  double error = atof(findOrDefault(params, "error", "0"));
82  me_qc1->setWarningProb(warning);
83  me_qc1->setErrorProb(error);
84 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
static std::string getAlgoName(void)
Definition: QTest.h:178
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void QTestConfigure::EnableComp2RefKolmogorovTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates EnableComp2RefKolmogorov test.

Definition at line 123 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), Comp2RefKolmogorov::getAlgoName(), DQMStore::getQCriterion(), QCriterion::setErrorProb(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

125  {
126  QCriterion * qc1;
127  if (! bei->getQCriterion(testName)) {
128  testsConfigured.push_back(testName);
129  qc1 = bei->createQTest(Comp2RefKolmogorov::getAlgoName(), testName);
130  } else {
131  qc1 = bei->getQCriterion(testName);
132  }
133  Comp2RefKolmogorov * me_qc1 = (Comp2RefKolmogorov *) qc1;
134  double warning = atof(findOrDefault(params, "warning", "0"));
135  double error = atof(findOrDefault(params, "error", "0"));
136  me_qc1->setWarningProb(warning);
137  me_qc1->setErrorProb(error);
138 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
std::vector< std::string > testsConfigured
static std::string getAlgoName(void)
Definition: QTest.h:247
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
Comparison to reference using the Kolmogorov algorithm.
Definition: QTest.h:240
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void QTestConfigure::EnableCompareLastFilledBinTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates EnableCompareLastFilledBinTest test.

Definition at line 356 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), CompareLastFilledBin::getAlgoName(), DQMStore::getQCriterion(), CompareLastFilledBin::setAverage(), QCriterion::setErrorProb(), CompareLastFilledBin::setMax(), CompareLastFilledBin::setMin(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

358  {
359  QCriterion * qc1;
360  if (! bei->getQCriterion(testName)) {
361  testsConfigured.push_back(testName);
362  qc1 = bei->createQTest(CompareLastFilledBin::getAlgoName(), testName);
363  } else {
364  qc1 = bei->getQCriterion(testName);
365  }
366  CompareLastFilledBin * me_qc1 = (CompareLastFilledBin *) qc1;
367 
368  double warning = atof(findOrDefault(params, "warning", "0"));
369  double error = atof(findOrDefault(params, "error", "0"));
370  double avVal = atof(findOrDefault(params, "AvVal", "0"));
371  double minVal = atof(findOrDefault(params, "MinVal", "0"));
372  double maxVal = atof(findOrDefault(params, "MaxVal", "0"));
373  me_qc1->setWarningProb(warning);
374  me_qc1->setErrorProb(error);
375  me_qc1->setAverage(avVal);
376  me_qc1->setMin(minVal);
377  me_qc1->setMax(maxVal);
378 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
void setMin(float min)
Definition: QTest.h:693
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
void setMax(float max)
Definition: QTest.h:694
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void setAverage(float average)
Definition: QTest.h:692
static std::string getAlgoName(void)
Definition: QTest.h:689
void QTestConfigure::EnableCompareToMedianTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsWithinRangeROOT test.

Creates CompareToMedian test

Definition at line 268 of file QTestConfigure.cc.

References DQMStore::createQTest(), findOrDefault(), CompareToMedian::getAlgoName(), DQMStore::getQCriterion(), CompareToMedian::setEmptyBins(), QCriterion::setErrorProb(), CompareToMedian::setMax(), CompareToMedian::setMaxMedian(), CompareToMedian::setMin(), CompareToMedian::setMinMedian(), CompareToMedian::setStatCut(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

270  {
271  QCriterion *qc1;
272  if (! bei->getQCriterion(testName)) {
273  testsConfigured.push_back(testName);
274  qc1 = bei->createQTest(CompareToMedian::getAlgoName(), testName);
275  } else {
276  qc1 = bei->getQCriterion(testName);
277  }
278  CompareToMedian* vtm = (CompareToMedian*) qc1;
279  vtm->setMin( (double) atof(findOrDefault(params, "MinRel", "0")));
280  vtm->setMax( (double) atof(findOrDefault(params, "MaxRel", "0")));
281  vtm->setEmptyBins( (int) atoi(findOrDefault(params, "UseEmptyBins", "0")));
282  vtm->setMinMedian( (double) atof(findOrDefault(params, "MinAbs", "0")));
283  vtm->setMaxMedian( (double) atof(findOrDefault(params, "MaxAbs", "0")));
284  vtm->setWarningProb( (double) atof(findOrDefault(params, "warning", "0")));
285  vtm->setErrorProb( (double) atof(findOrDefault(params, "error", "0")));
286  vtm->setStatCut( (double) atof(findOrDefault(params, "StatCut", "0")));
287 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
void setStatCut(float cut)
Definition: QTest.h:649
void setMin(float min)
Definition: QTest.h:644
void setMax(float max)
Definition: QTest.h:645
static std::string getAlgoName(void)
Definition: QTest.h:641
void setEmptyBins(int eB)
Definition: QTest.h:646
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setMaxMedian(float max)
Definition: QTest.h:647
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void setMinMedian(float min)
Definition: QTest.h:648
void QTestConfigure::EnableContentsWithinExpectedTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsWithinRangeROOT test.

Definition at line 319 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), ContentsWithinExpected::getAlgoName(), DQMStore::getQCriterion(), createfilelist::int, QCriterion::setErrorProb(), ContentsWithinExpected::setMeanRange(), ContentsWithinExpected::setMeanTolerance(), SimpleTest::setMinimumEntries(), ContentsWithinExpected::setRMSRange(), ContentsWithinExpected::setUseEmptyBins(), QCriterion::setWarningProb(), and testsConfigured.

Referenced by enableTests(), and testsReady().

321  {
322  QCriterion * qc1;
323  if (! bei->getQCriterion(testName)) {
324  testsConfigured.push_back(testName);
325  qc1 = bei->createQTest(ContentsWithinExpected::getAlgoName(), testName);
326  } else {
327  qc1 = bei->getQCriterion(testName);
328  }
330  unsigned int useEmptyBins = (unsigned int) atof(findOrDefault(params, "useEmptyBins", "0"));
331  double warning = atof(findOrDefault(params, "warning", "0"));
332  double error = atof(findOrDefault(params, "error", "0"));
333  double minMean = atof(findOrDefault(params, "minMean", "0"));
334  double maxMean = atof(findOrDefault(params, "maxMean", "0"));
335  double minRMS = atof(findOrDefault(params, "minRMS", "0"));
336  double maxRMS = atof(findOrDefault(params, "maxRMS", "0"));
337  double toleranceMean = atof(findOrDefault(params, "toleranceMean", "0"));
338  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
339  me_qc1->setUseEmptyBins(useEmptyBins);
340  me_qc1->setWarningProb(warning);
341  me_qc1->setErrorProb(error);
342 
343  if ( minMean != 0 || maxMean != 0 )
344  me_qc1->setMeanRange(minMean, maxMean);
345 
346  if ( minRMS != 0 || maxRMS != 0 )
347  me_qc1->setRMSRange(minRMS, maxRMS);
348 
349  if ( toleranceMean != 0 )
350  me_qc1->setMeanTolerance(toleranceMean);
351 
352  if ( minEntries != 0 )
353  me_qc1->setMinimumEntries(minEntries);
354 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
static std::string getAlgoName(void)
Definition: QTest.h:390
void setRMSRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1224
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setMinimumEntries(unsigned n)
set minimum # of entries needed
Definition: QTest.h:144
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:393
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
void setMeanRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1212
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void setMeanTolerance(float fracTolerance)
set (fractional) tolerance for mean
Definition: QTest.h:400
void QTestConfigure::EnableDeadChannelTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsYRangeASROOT test.

Creates DeadChannelROOT test

Definition at line 182 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), DeadChannel::getAlgoName(), DQMStore::getQCriterion(), createfilelist::int, QCriterion::setErrorProb(), DeadChannel::setThreshold(), QCriterion::setWarningProb(), testsConfigured, and electronIdCutBased_cfi::threshold.

Referenced by enableTests(), and testsReady().

184  {
185  QCriterion * qc1;
186  if (! bei->getQCriterion(testName)) {
187  testsConfigured.push_back(testName);
188  qc1 = bei->createQTest(DeadChannel::getAlgoName(), testName);
189  } else {
190  qc1 = bei->getQCriterion(testName);
191  }
192  DeadChannel * me_qc1 = ( DeadChannel *) qc1;
193  unsigned int threshold =(unsigned int) atof(findOrDefault(params, "threshold", "0"));
194  double warning = atof(findOrDefault(params, "warning", "0"));
195  double error = atof(findOrDefault(params, "error", "0"));
196  me_qc1->setThreshold(threshold);
197  me_qc1->setWarningProb(warning);
198  me_qc1->setErrorProb(error);
199 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
test that histogram contents are above Ymin
Definition: QTest.h:306
static std::string getAlgoName(void)
Definition: QTest.h:314
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void setThreshold(double ymin)
set Ymin (inclusive) threshold for "dead" channel (default: 0)
Definition: QTest.h:318
void QTestConfigure::EnableMeanWithinExpectedTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates MeanWithinExpectedROOT test.

Definition at line 222 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), MeanWithinExpected::getAlgoName(), DQMStore::getQCriterion(), RecoTauDiscriminantConfiguration::mean, QCriterion::setErrorProb(), MeanWithinExpected::setExpectedMean(), SimpleTest::setMinimumEntries(), QCriterion::setWarningProb(), testsConfigured, MeanWithinExpected::useRange(), MeanWithinExpected::useRMS(), MeanWithinExpected::useSigma(), TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

Referenced by enableTests(), and testsReady().

224  {
225  QCriterion * qc1;
226  if (! bei->getQCriterion(testName)) {
227  testsConfigured.push_back(testName);
228  qc1 = bei->createQTest(MeanWithinExpected::getAlgoName(), testName);
229  } else {
230  qc1 = bei->getQCriterion(testName);
231  }
232  MeanWithinExpected * me_qc1 = (MeanWithinExpected *) qc1;
233  double warning = atof(findOrDefault(params, "warning", "0"));
234  double error = atof(findOrDefault(params, "error", "0"));
235  double mean = atof(findOrDefault(params, "mean", "0"));
236  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
237  double useRMSVal = atof(findOrDefault(params, "useRMS", "0"));
238  double useSigmaVal = atof(findOrDefault(params, "useSigma", "0"));
239  double useRangeVal = atof(findOrDefault(params, "useRange", "0"));
240  me_qc1->setWarningProb(warning);
241  me_qc1->setErrorProb(error);
242  me_qc1->setExpectedMean(mean);
243 
244  if (minEntries != 0)
245  me_qc1->setMinimumEntries(minEntries);
246 
247  if (useRMSVal && useSigmaVal && useRangeVal)
248  return;
249 
250  if (useRMSVal) {
251  me_qc1->useRMS();
252  return;
253  }
254 
255  if (useSigmaVal) {
256  me_qc1->useSigma(useSigmaVal);
257  return;
258  }
259 
260  if(useRangeVal) {
261  float xmin = atof(findOrDefault(params, "xmin", "0"));
262  float xmax = atof(findOrDefault(params, "xmax", "0"));
263  me_qc1->useRange(xmin,xmax);
264  return;
265  }
266 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
void useRMS(void)
Definition: QTest.cc:1348
void useSigma(double expectedSigma)
Definition: QTest.cc:1337
Algorithm for testing if histogram&#39;s mean value is near expected value.
Definition: QTest.h:422
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setMinimumEntries(unsigned n)
set minimum # of entries needed
Definition: QTest.h:144
void setExpectedMean(double mean)
Definition: QTest.h:432
void useRange(double xmin, double xmax)
Definition: QTest.cc:1327
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
static std::string getAlgoName(void)
Definition: QTest.h:429
void QTestConfigure::EnableNoisyChannelTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates NoisyChannelROOT test.

Definition at line 201 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), NoisyChannel::getAlgoName(), DQMStore::getQCriterion(), createfilelist::int, QCriterion::setErrorProb(), NoisyChannel::setNumNeighbors(), NoisyChannel::setTolerance(), QCriterion::setWarningProb(), testsConfigured, and RecoTauCleanerPlugins::tolerance.

Referenced by enableTests(), and testsReady().

203  {
204  QCriterion * qc1;
205  if (! bei->getQCriterion(testName)) {
206  testsConfigured.push_back(testName);
207  qc1 = bei->createQTest(NoisyChannel::getAlgoName(), testName);
208  } else {
209  qc1 = bei->getQCriterion(testName);
210  }
211  NoisyChannel * me_qc1 = (NoisyChannel *) qc1;
212  unsigned int neighbors = (unsigned int) atof(findOrDefault(params, "neighbours", "0"));
213  double tolerance = atof(findOrDefault(params, "tolerance", "0"));
214  double warning = atof(findOrDefault(params, "warning", "0"));
215  double error = atof(findOrDefault(params, "error", "0"));
216  me_qc1->setNumNeighbors (neighbors);
217  me_qc1->setTolerance (tolerance);
218  me_qc1->setWarningProb(warning);
219  me_qc1->setErrorProb(error);
220 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
static std::string getAlgoName(void)
Definition: QTest.h:341
void setNumNeighbors(unsigned n)
Definition: QTest.h:351
Check if any channels are noisy compared to neighboring ones.
Definition: QTest.h:332
std::vector< std::string > testsConfigured
void setTolerance(float percentage)
Definition: QTest.h:357
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
bool QTestConfigure::enableTests ( const std::map< std::string, std::map< std::string, std::string > > &  tests,
DQMStore bei 
)

Creates and defines quality tests.

Definition at line 28 of file QTestConfigure.cc.

References EnableCheckVarianceTest(), EnableComp2Ref2DChi2Test(), EnableComp2RefChi2Test(), EnableComp2RefEqualHTest(), EnableComp2RefKolmogorovTest(), EnableCompareLastFilledBinTest(), EnableCompareToMedianTest(), EnableContentsWithinExpectedTest(), EnableDeadChannelTest(), EnableMeanWithinExpectedTest(), EnableNoisyChannelTest(), EnableXRangeTest(), EnableYRangeTest(), Comp2RefEqualH::getAlgoName(), Comp2RefChi2::getAlgoName(), Comp2Ref2DChi2::getAlgoName(), Comp2RefKolmogorov::getAlgoName(), ContentsXRange::getAlgoName(), ContentsYRange::getAlgoName(), DeadChannel::getAlgoName(), NoisyChannel::getAlgoName(), ContentsWithinExpected::getAlgoName(), MeanWithinExpected::getAlgoName(), CompareToMedian::getAlgoName(), CompareLastFilledBin::getAlgoName(), CheckVariance::getAlgoName(), AlCaHLTBitMon_QueryRunRegistry::string, utils_v2::tests, and testsConfigured.

Referenced by QTestHandle::configureTests(), and ~QTestConfigure().

30  {
31  testsConfigured.clear();
32  std::map<std::string, std::map<std::string, std::string> >::const_iterator itr;
33  for (itr = tests.begin(); itr!= tests.end();++itr) {
34  const std::map<std::string, std::string> &params= itr->second;
35 
36  std::string testName = itr->first;
37  std::string testType = params.at("type");
38 
39  if(!std::strcmp(testType.c_str(),ContentsXRange::getAlgoName().c_str()))
40  this->EnableXRangeTest(testName, params,bei);
41  if(!std::strcmp(testType.c_str(),ContentsYRange::getAlgoName().c_str()))
42  this->EnableYRangeTest(testName, params,bei);
43  if(!std::strcmp(testType.c_str(),DeadChannel::getAlgoName().c_str()))
44  this->EnableDeadChannelTest(testName, params,bei);
45  if(!std::strcmp(testType.c_str(),NoisyChannel::getAlgoName().c_str()))
46  this->EnableNoisyChannelTest(testName, params,bei);
47  if(!std::strcmp(testType.c_str(),MeanWithinExpected::getAlgoName().c_str()))
48  this->EnableMeanWithinExpectedTest(testName, params,bei);
49  if(!std::strcmp(testType.c_str(),Comp2RefEqualH::getAlgoName().c_str()))
50  this->EnableComp2RefEqualHTest(testName, params,bei);
51  if(!std::strcmp(testType.c_str(), Comp2RefChi2::getAlgoName().c_str()))
52  this->EnableComp2RefChi2Test(testName, params,bei);
53  if(!std::strcmp(testType.c_str(), Comp2Ref2DChi2::getAlgoName().c_str()))
54  this->EnableComp2Ref2DChi2Test(testName, params,bei);
55  if(!std::strcmp(testType.c_str(),Comp2RefKolmogorov::getAlgoName().c_str()))
56  this->EnableComp2RefKolmogorovTest(testName, params,bei);
57  if(!std::strcmp(testType.c_str(),ContentsWithinExpected::getAlgoName().c_str()))
58  this->EnableContentsWithinExpectedTest(testName, params, bei);
59  if(!std::strcmp(testType.c_str(),CompareToMedian::getAlgoName().c_str()))
60  this->EnableCompareToMedianTest(testName, params, bei);
61  if(!std::strcmp(testType.c_str(),CompareLastFilledBin::getAlgoName().c_str()))
62  this->EnableCompareLastFilledBinTest(testName, params, bei);
63  if(!std::strcmp(testType.c_str(),CheckVariance::getAlgoName().c_str()))
64  this->EnableCheckVarianceTest(testName, params, bei);
65  }
66  return false;
67 }
static std::string getAlgoName(void)
get algorithm name
Definition: QTest.h:751
static std::string getAlgoName(void)
Definition: QTest.h:341
static std::string getAlgoName(void)
Definition: QTest.h:390
void EnableNoisyChannelTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates NoisyChannelROOT test.
static std::string getAlgoName(void)
Definition: QTest.h:262
void EnableYRangeTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsXRangeASROOT test.
void EnableComp2Ref2DChi2Test(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates Comp2Ref2DChi2 test.
void EnableCompareToMedianTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsWithinRangeROOT test.
static std::string getAlgoName(void)
Definition: QTest.h:314
static std::string getAlgoName(void)
Definition: QTest.h:641
void EnableCheckVarianceTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates CheckVariance test.
void EnableComp2RefEqualHTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates Comp2RefEqualH test.
std::vector< std::string > testsConfigured
static std::string getAlgoName(void)
Definition: QTest.h:247
void EnableXRangeTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsXRangeROOT test.
void EnableMeanWithinExpectedTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates MeanWithinExpectedROOT test.
static std::string getAlgoName(void)
Definition: QTest.h:287
static std::string getAlgoName(void)
Definition: QTest.h:178
static std::string getAlgoName(void)
Definition: QTest.h:191
void EnableDeadChannelTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsYRangeASROOT test.
static std::string getAlgoName(void)
Definition: QTest.h:219
void EnableComp2RefKolmogorovTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates EnableComp2RefKolmogorov test.
void EnableContentsWithinExpectedTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsWithinRangeROOT test.
void EnableCompareLastFilledBinTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates EnableCompareLastFilledBinTest test.
static std::string getAlgoName(void)
Definition: QTest.h:689
static std::string getAlgoName(void)
Definition: QTest.h:429
void EnableComp2RefChi2Test(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates Comp2RefChi2 test.
void QTestConfigure::EnableXRangeTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsXRangeROOT test.

Definition at line 140 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), ContentsXRange::getAlgoName(), DQMStore::getQCriterion(), ContentsXRange::setAllowedXRange(), QCriterion::setErrorProb(), QCriterion::setWarningProb(), testsConfigured, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

Referenced by enableTests(), and testsReady().

142  {
143  QCriterion * qc1;
144  if (! bei->getQCriterion(testName)) {
145  testsConfigured.push_back(testName);
146  qc1 = bei->createQTest(ContentsXRange::getAlgoName(),testName);
147  } else {
148  qc1 = bei->getQCriterion(testName);
149  }
150  ContentsXRange * me_qc1 = (ContentsXRange *) qc1;
151  double xmin = atof(findOrDefault(params, "xmin", "0"));
152  double xmax = atof(findOrDefault(params, "xmax", "0"));
153  double warning = atof(findOrDefault(params, "warning", "0"));
154  double error = atof(findOrDefault(params, "error", "0"));
155  me_qc1->setAllowedXRange(xmin, xmax);
156  me_qc1->setWarningProb(warning);
157  me_qc1->setErrorProb(error);
158 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
virtual void setAllowedXRange(double xmin, double xmax)
set allowed range in X-axis (default values: histogram&#39;s X-range)
Definition: QTest.h:266
static std::string getAlgoName(void)
Definition: QTest.h:262
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
void QTestConfigure::EnableYRangeTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsXRangeASROOT test.

Creates ContentsYRangeROOT test

Definition at line 160 of file QTestConfigure.cc.

References DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), ContentsYRange::getAlgoName(), DQMStore::getQCriterion(), createfilelist::int, ContentsYRange::setAllowedYRange(), QCriterion::setErrorProb(), ContentsYRange::setUseEmptyBins(), QCriterion::setWarningProb(), testsConfigured, Phase2TrackerMonitorDigi_cff::ymax, and Phase2TrackerMonitorDigi_cff::ymin.

Referenced by enableTests(), and testsReady().

162  {
163  QCriterion * qc1;
164  if (! bei->getQCriterion(testName)) {
165  testsConfigured.push_back(testName);
166  qc1 = bei->createQTest(ContentsYRange::getAlgoName(), testName);
167  } else {
168  qc1 = bei->getQCriterion(testName);
169  }
170  ContentsYRange * me_qc1 = (ContentsYRange *) qc1;
171  double ymin = atof(findOrDefault(params, "ymin", "0"));
172  double ymax = atof(findOrDefault(params, "ymax", "0"));
173  double warning = atof(findOrDefault(params, "warning", "0"));
174  double error = atof(findOrDefault(params, "error", "0"));
175  unsigned int useEmptyBins = (unsigned int)atof(findOrDefault(params, "useEmptyBins", "0"));
176  me_qc1->setAllowedYRange(ymin, ymax);
177  me_qc1->setWarningProb(warning);
178  me_qc1->setErrorProb(error);
179  me_qc1->setUseEmptyBins(useEmptyBins);
180 }
void setErrorProb(float prob)
Definition: QTest.h:63
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3299
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:290
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
static std::string getAlgoName(void)
Definition: QTest.h:287
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:62
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3310
virtual void setAllowedYRange(double ymin, double ymax)
Definition: QTest.h:291
const char * QTestConfigure::findOrDefault ( const std::map< std::string, std::string > &  m,
const char *  item,
const char *  default_value 
) const
private

Definition at line 15 of file QTestConfigure.cc.

References LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EnableCheckVarianceTest(), EnableComp2Ref2DChi2Test(), EnableComp2RefChi2Test(), EnableComp2RefEqualHTest(), EnableComp2RefKolmogorovTest(), EnableCompareLastFilledBinTest(), EnableCompareToMedianTest(), EnableContentsWithinExpectedTest(), EnableDeadChannelTest(), EnableMeanWithinExpectedTest(), EnableNoisyChannelTest(), EnableXRangeTest(), EnableYRangeTest(), and testsReady().

17  {
18  std::map<std::string, std::string>::const_iterator iter;
19  if (( iter = m.find(std::string(item))) != m.end()) {
20  return (*iter).second.c_str();
21  }
22  LogDebug("QTestConfigure") << "Warning, using default value for parameter "
23  << item << " with default_value: "
24  << default_value << std::endl;
25  return default_value;
26 }
#define LogDebug(id)
std::vector<std::string> QTestConfigure::testsReady ( )
inline

Member Data Documentation

std::vector<std::string> QTestConfigure::testsConfigured
private