CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 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

Destructor.

Definition at line 27 of file QTestConfigure.h.

27 {}

Member Function Documentation

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

Disables the Quality Tests in the string list.

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

Creates CheckVariance test.

Definition at line 358 of file QTestConfigure.cc.

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

Referenced by enableTests().

360  {
361  QCriterion * qc1;
362  if(! bei->getQCriterion(testName) ){
363  testsConfigured.push_back(testName);
364  qc1 = bei->createQTest(CheckVariance::getAlgoName(),testName);
365  }else{
366  qc1 = bei->getQCriterion(testName);
367 
368  }
369  CheckVariance * me_qc1 = (CheckVariance *) qc1;
370 
371  double warning = atof(findOrDefault(params, "warning", "0"));
372  double error = atof(findOrDefault(params, "error", "0"));
373  me_qc1->setWarningProb(warning);
374  me_qc1->setErrorProb(error);
375 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
static std::string getAlgoName(void)
get algorithm name
Definition: QTest.h:722
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:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void QTestConfigure::EnableComp2RefChi2Test ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates Comp2RefChi2 test.

Definition at line 84 of file QTestConfigure.cc.

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

Referenced by enableTests().

86  {
87  QCriterion * qc1;
88  if (! bei->getQCriterion(testName)) {
89  testsConfigured.push_back(testName);
90  qc1 = bei->createQTest(Comp2RefChi2::getAlgoName(), testName);
91  } else {
92  qc1 = bei->getQCriterion(testName);
93  }
94  Comp2RefChi2 * me_qc1 = (Comp2RefChi2 *) qc1;
95  double warning = atof(findOrDefault(params, "warning", "0"));
96  double error = atof(findOrDefault(params, "error", "0"));
97  me_qc1->setWarningProb(warning);
98  me_qc1->setErrorProb(error);
99 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
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:61
static std::string getAlgoName(void)
Definition: QTest.h:190
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void QTestConfigure::EnableComp2RefEqualHTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates Comp2RefEqualH test.

Definition at line 67 of file QTestConfigure.cc.

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

Referenced by enableTests().

69  {
70  QCriterion * qc1;
71  if (! bei->getQCriterion(testName)) {
72  testsConfigured.push_back(testName);
73  qc1 = bei->createQTest(Comp2RefEqualH::getAlgoName(), testName);
74  } else {
75  qc1 = bei->getQCriterion(testName);
76  }
77  Comp2RefEqualH * me_qc1 = (Comp2RefEqualH *) qc1;
78  double warning = atof(findOrDefault(params, "warning", "0"));
79  double error = atof(findOrDefault(params, "error", "0"));
80  me_qc1->setWarningProb(warning);
81  me_qc1->setErrorProb(error);
82 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
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:177
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void QTestConfigure::EnableComp2RefKolmogorovTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates EnableComp2RefKolmogorov test.

Definition at line 102 of file QTestConfigure.cc.

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

Referenced by enableTests().

104  {
105  QCriterion * qc1;
106  if (! bei->getQCriterion(testName)) {
107  testsConfigured.push_back(testName);
108  qc1 = bei->createQTest(Comp2RefKolmogorov::getAlgoName(), testName);
109  } else {
110  qc1 = bei->getQCriterion(testName);
111  }
112  Comp2RefKolmogorov * me_qc1 = (Comp2RefKolmogorov *) qc1;
113  double warning = atof(findOrDefault(params, "warning", "0"));
114  double error = atof(findOrDefault(params, "error", "0"));
115  me_qc1->setWarningProb(warning);
116  me_qc1->setErrorProb(error);
117 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
std::vector< std::string > testsConfigured
static std::string getAlgoName(void)
Definition: QTest.h:218
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:61
Comparison to reference using the Kolmogorov algorithm.
Definition: QTest.h:211
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void QTestConfigure::EnableCompareLastFilledBinTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates EnableCompareLastFilledBinTest test.

Definition at line 335 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().

337  {
338  QCriterion * qc1;
339  if (! bei->getQCriterion(testName)) {
340  testsConfigured.push_back(testName);
341  qc1 = bei->createQTest(CompareLastFilledBin::getAlgoName(), testName);
342  } else {
343  qc1 = bei->getQCriterion(testName);
344  }
345  CompareLastFilledBin * me_qc1 = (CompareLastFilledBin *) qc1;
346 
347  double warning = atof(findOrDefault(params, "warning", "0"));
348  double error = atof(findOrDefault(params, "error", "0"));
349  double avVal = atof(findOrDefault(params, "AvVal", "0"));
350  double minVal = atof(findOrDefault(params, "MinVal", "0"));
351  double maxVal = atof(findOrDefault(params, "MaxVal", "0"));
352  me_qc1->setWarningProb(warning);
353  me_qc1->setErrorProb(error);
354  me_qc1->setAverage(avVal);
355  me_qc1->setMin(minVal);
356  me_qc1->setMax(maxVal);
357 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
void setMin(float min)
Definition: QTest.h:664
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:61
void setMax(float max)
Definition: QTest.h:665
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void setAverage(float average)
Definition: QTest.h:663
static std::string getAlgoName(void)
Definition: QTest.h:660
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 247 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().

249  {
250  QCriterion *qc1;
251  if (! bei->getQCriterion(testName)) {
252  testsConfigured.push_back(testName);
253  qc1 = bei->createQTest(CompareToMedian::getAlgoName(), testName);
254  } else {
255  qc1 = bei->getQCriterion(testName);
256  }
257  CompareToMedian* vtm = (CompareToMedian*) qc1;
258  vtm->setMin( (double) atof(findOrDefault(params, "MinRel", "0")));
259  vtm->setMax( (double) atof(findOrDefault(params, "MaxRel", "0")));
260  vtm->setEmptyBins( (int) atoi(findOrDefault(params, "UseEmptyBins", "0")));
261  vtm->setMinMedian( (double) atof(findOrDefault(params, "MinAbs", "0")));
262  vtm->setMaxMedian( (double) atof(findOrDefault(params, "MaxAbs", "0")));
263  vtm->setWarningProb( (double) atof(findOrDefault(params, "warning", "0")));
264  vtm->setErrorProb( (double) atof(findOrDefault(params, "error", "0")));
265  vtm->setStatCut( (double) atof(findOrDefault(params, "StatCut", "0")));
266 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
void setStatCut(float cut)
Definition: QTest.h:620
void setMin(float min)
Definition: QTest.h:615
void setMax(float max)
Definition: QTest.h:616
static std::string getAlgoName(void)
Definition: QTest.h:612
void setEmptyBins(int eB)
Definition: QTest.h:617
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:618
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void setMinMedian(float min)
Definition: QTest.h:619
void QTestConfigure::EnableContentsWithinExpectedTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsWithinRangeROOT test.

Definition at line 298 of file QTestConfigure.cc.

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

Referenced by enableTests().

300  {
301  QCriterion * qc1;
302  if (! bei->getQCriterion(testName)) {
303  testsConfigured.push_back(testName);
304  qc1 = bei->createQTest(ContentsWithinExpected::getAlgoName(), testName);
305  } else {
306  qc1 = bei->getQCriterion(testName);
307  }
309  unsigned int useEmptyBins = (unsigned int) atof(findOrDefault(params, "useEmptyBins", "0"));
310  double warning = atof(findOrDefault(params, "warning", "0"));
311  double error = atof(findOrDefault(params, "error", "0"));
312  double minMean = atof(findOrDefault(params, "minMean", "0"));
313  double maxMean = atof(findOrDefault(params, "maxMean", "0"));
314  double minRMS = atof(findOrDefault(params, "minRMS", "0"));
315  double maxRMS = atof(findOrDefault(params, "maxRMS", "0"));
316  double toleranceMean = atof(findOrDefault(params, "toleranceMean", "0"));
317  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
318  me_qc1->setUseEmptyBins(useEmptyBins);
319  me_qc1->setWarningProb(warning);
320  me_qc1->setErrorProb(error);
321 
322  if ( minMean != 0 || maxMean != 0 )
323  me_qc1->setMeanRange(minMean, maxMean);
324 
325  if ( minRMS != 0 || maxRMS != 0 )
326  me_qc1->setRMSRange(minRMS, maxRMS);
327 
328  if ( toleranceMean != 0 )
329  me_qc1->setMeanTolerance(toleranceMean);
330 
331  if ( minEntries != 0 )
332  me_qc1->setMinimumEntries(minEntries);
333 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
static std::string getAlgoName(void)
Definition: QTest.h:361
void setRMSRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1123
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:143
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:364
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:61
void setMeanRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1111
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void setMeanTolerance(float fracTolerance)
set (fractional) tolerance for mean
Definition: QTest.h:371
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 161 of file QTestConfigure.cc.

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

Referenced by enableTests().

163  {
164  QCriterion * qc1;
165  if (! bei->getQCriterion(testName)) {
166  testsConfigured.push_back(testName);
167  qc1 = bei->createQTest(DeadChannel::getAlgoName(), testName);
168  } else {
169  qc1 = bei->getQCriterion(testName);
170  }
171  DeadChannel * me_qc1 = ( DeadChannel *) qc1;
172  unsigned int threshold =(unsigned int) atof(findOrDefault(params, "threshold", "0"));
173  double warning = atof(findOrDefault(params, "warning", "0"));
174  double error = atof(findOrDefault(params, "error", "0"));
175  me_qc1->setThreshold(threshold);
176  me_qc1->setWarningProb(warning);
177  me_qc1->setErrorProb(error);
178 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
test that histogram contents are above Ymin
Definition: QTest.h:277
static std::string getAlgoName(void)
Definition: QTest.h:285
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:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
void setThreshold(double ymin)
set Ymin (inclusive) threshold for &quot;dead&quot; channel (default: 0)
Definition: QTest.h:289
void QTestConfigure::EnableMeanWithinExpectedTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates MeanWithinExpectedROOT test.

Definition at line 201 of file QTestConfigure.cc.

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

Referenced by enableTests().

203  {
204  QCriterion * qc1;
205  if (! bei->getQCriterion(testName)) {
206  testsConfigured.push_back(testName);
207  qc1 = bei->createQTest(MeanWithinExpected::getAlgoName(), testName);
208  } else {
209  qc1 = bei->getQCriterion(testName);
210  }
211  MeanWithinExpected * me_qc1 = (MeanWithinExpected *) qc1;
212  double warning = atof(findOrDefault(params, "warning", "0"));
213  double error = atof(findOrDefault(params, "error", "0"));
214  double mean = atof(findOrDefault(params, "mean", "0"));
215  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
216  double useRMSVal = atof(findOrDefault(params, "useRMS", "0"));
217  double useSigmaVal = atof(findOrDefault(params, "useSigma", "0"));
218  double useRangeVal = atof(findOrDefault(params, "useRange", "0"));
219  me_qc1->setWarningProb(warning);
220  me_qc1->setErrorProb(error);
221  me_qc1->setExpectedMean(mean);
222 
223  if (minEntries != 0)
224  me_qc1->setMinimumEntries(minEntries);
225 
226  if (useRMSVal && useSigmaVal && useRangeVal)
227  return;
228 
229  if (useRMSVal) {
230  me_qc1->useRMS();
231  return;
232  }
233 
234  if (useSigmaVal) {
235  me_qc1->useSigma(useSigmaVal);
236  return;
237  }
238 
239  if(useRangeVal) {
240  float xmin = atof(findOrDefault(params, "xmin", "0"));
241  float xmax = atof(findOrDefault(params, "xmax", "0"));
242  me_qc1->useRange(xmin,xmax);
243  return;
244  }
245 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
void useRMS(void)
Definition: QTest.cc:1247
void useSigma(double expectedSigma)
Definition: QTest.cc:1236
Algorithm for testing if histogram&#39;s mean value is near expected value.
Definition: QTest.h:393
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:143
void setExpectedMean(double mean)
Definition: QTest.h:403
void useRange(double xmin, double xmax)
Definition: QTest.cc:1226
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
static std::string getAlgoName(void)
Definition: QTest.h:400
void QTestConfigure::EnableNoisyChannelTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates NoisyChannelROOT test.

Definition at line 180 of file QTestConfigure.cc.

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

Referenced by enableTests().

182  {
183  QCriterion * qc1;
184  if (! bei->getQCriterion(testName)) {
185  testsConfigured.push_back(testName);
186  qc1 = bei->createQTest(NoisyChannel::getAlgoName(), testName);
187  } else {
188  qc1 = bei->getQCriterion(testName);
189  }
190  NoisyChannel * me_qc1 = (NoisyChannel *) qc1;
191  unsigned int neighbors = (unsigned int) atof(findOrDefault(params, "neighbours", "0"));
192  double tolerance = atof(findOrDefault(params, "tolerance", "0"));
193  double warning = atof(findOrDefault(params, "warning", "0"));
194  double error = atof(findOrDefault(params, "error", "0"));
195  me_qc1->setNumNeighbors (neighbors);
196  me_qc1->setTolerance (tolerance);
197  me_qc1->setWarningProb(warning);
198  me_qc1->setErrorProb(error);
199 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
static std::string getAlgoName(void)
Definition: QTest.h:312
void setNumNeighbors(unsigned n)
Definition: QTest.h:322
Check if any channels are noisy compared to neighboring ones.
Definition: QTest.h:303
std::vector< std::string > testsConfigured
void setTolerance(float percentage)
Definition: QTest.h:328
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:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
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(), EnableComp2RefChi2Test(), EnableComp2RefEqualHTest(), EnableComp2RefKolmogorovTest(), EnableCompareLastFilledBinTest(), EnableCompareToMedianTest(), EnableContentsWithinExpectedTest(), EnableDeadChannelTest(), EnableMeanWithinExpectedTest(), EnableNoisyChannelTest(), EnableXRangeTest(), EnableYRangeTest(), Comp2RefEqualH::getAlgoName(), Comp2RefChi2::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().

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(),Comp2RefKolmogorov::getAlgoName().c_str()))
54  this->EnableComp2RefKolmogorovTest(testName, params,bei);
55  if(!std::strcmp(testType.c_str(),ContentsWithinExpected::getAlgoName().c_str()))
56  this->EnableContentsWithinExpectedTest(testName, params, bei);
57  if(!std::strcmp(testType.c_str(),CompareToMedian::getAlgoName().c_str()))
58  this->EnableCompareToMedianTest(testName, params, bei);
59  if(!std::strcmp(testType.c_str(),CompareLastFilledBin::getAlgoName().c_str()))
60  this->EnableCompareLastFilledBinTest(testName, params, bei);
61  if(!std::strcmp(testType.c_str(),CheckVariance::getAlgoName().c_str()))
62  this->EnableCheckVarianceTest(testName, params, bei);
63  }
64  return false;
65 }
static std::string getAlgoName(void)
get algorithm name
Definition: QTest.h:722
static std::string getAlgoName(void)
Definition: QTest.h:312
dictionary tests
Definition: utils_v2.py:385
static std::string getAlgoName(void)
Definition: QTest.h:361
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:233
void EnableYRangeTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsXRangeASROOT 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:285
static std::string getAlgoName(void)
Definition: QTest.h:612
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:218
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:258
static std::string getAlgoName(void)
Definition: QTest.h:177
static std::string getAlgoName(void)
Definition: QTest.h:190
void EnableDeadChannelTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsYRangeASROOT test.
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:660
static std::string getAlgoName(void)
Definition: QTest.h:400
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 119 of file QTestConfigure.cc.

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

Referenced by enableTests().

121  {
122  QCriterion * qc1;
123  if (! bei->getQCriterion(testName)) {
124  testsConfigured.push_back(testName);
125  qc1 = bei->createQTest(ContentsXRange::getAlgoName(),testName);
126  } else {
127  qc1 = bei->getQCriterion(testName);
128  }
129  ContentsXRange * me_qc1 = (ContentsXRange *) qc1;
130  double xmin = atof(findOrDefault(params, "xmin", "0"));
131  double xmax = atof(findOrDefault(params, "xmax", "0"));
132  double warning = atof(findOrDefault(params, "warning", "0"));
133  double error = atof(findOrDefault(params, "error", "0"));
134  me_qc1->setAllowedXRange(xmin, xmax);
135  me_qc1->setWarningProb(warning);
136  me_qc1->setErrorProb(error);
137 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
virtual void setAllowedXRange(double xmin, double xmax)
set allowed range in X-axis (default values: histogram&#39;s X-range)
Definition: QTest.h:237
static std::string getAlgoName(void)
Definition: QTest.h:233
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:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
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 139 of file QTestConfigure.cc.

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

Referenced by enableTests().

141  {
142  QCriterion * qc1;
143  if (! bei->getQCriterion(testName)) {
144  testsConfigured.push_back(testName);
145  qc1 = bei->createQTest(ContentsYRange::getAlgoName(), testName);
146  } else {
147  qc1 = bei->getQCriterion(testName);
148  }
149  ContentsYRange * me_qc1 = (ContentsYRange *) qc1;
150  double ymin = atof(findOrDefault(params, "ymin", "0"));
151  double ymax = atof(findOrDefault(params, "ymax", "0"));
152  double warning = atof(findOrDefault(params, "warning", "0"));
153  double error = atof(findOrDefault(params, "error", "0"));
154  unsigned int useEmptyBins = (unsigned int)atof(findOrDefault(params, "useEmptyBins", "0"));
155  me_qc1->setAllowedYRange(ymin, ymax);
156  me_qc1->setWarningProb(warning);
157  me_qc1->setErrorProb(error);
158  me_qc1->setUseEmptyBins(useEmptyBins);
159 }
void setErrorProb(float prob)
Definition: QTest.h:62
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3195
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:261
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:258
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:61
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3206
virtual void setAllowedYRange(double ymin, double ymax)
Definition: QTest.h:262
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 getDQMSummary::iter, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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  edm::LogWarning("QTestConfigure") << "Warning, using default value for parameter "
23  << item << " with default_value: "
24  << default_value << std::endl;
25  return default_value;
26 }
std::vector<std::string> QTestConfigure::testsReady ( )
inline

Returns the vector containing the names of the quality tests that have been created.

Definition at line 33 of file QTestConfigure.h.

References testsConfigured.

33 {return testsConfigured;}
std::vector< std::string > testsConfigured

Member Data Documentation

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