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 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 22 of file QTestConfigure.h.

Constructor & Destructor Documentation

QTestConfigure::QTestConfigure ( )
inline

Constructor.

Definition at line 27 of file QTestConfigure.h.

27 {}
QTestConfigure::~QTestConfigure ( )
inline

Destructor.

Definition at line 29 of file QTestConfigure.h.

29 {}

Member Function Documentation

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

Disables the Quality Tests in the string list.

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

Creates Comp2RefChi2 test.

Definition at line 85 of file QTestConfigure.cc.

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

Referenced by enableTests().

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

Creates Comp2RefEqualH test.

Definition at line 68 of file QTestConfigure.cc.

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

Referenced by enableTests().

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

Creates EnableComp2RefKolmogorov test.

Definition at line 103 of file QTestConfigure.cc.

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

Referenced by enableTests().

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

Creates EnableCompareLastFilledBinTest test.

Definition at line 336 of file QTestConfigure.cc.

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

Referenced by enableTests().

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

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

Creates ContentsWithinRangeROOT test.

Definition at line 299 of file QTestConfigure.cc.

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

Referenced by enableTests().

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

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

Referenced by enableTests().

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

Creates MeanWithinExpectedROOT test.

Definition at line 202 of file QTestConfigure.cc.

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

Referenced by enableTests().

204  {
205  QCriterion * qc1;
206  if (! bei->getQCriterion(testName)) {
207  testsConfigured.push_back(testName);
208  qc1 = bei->createQTest(MeanWithinExpected::getAlgoName(), testName);
209  } else {
210  qc1 = bei->getQCriterion(testName);
211  }
212  MeanWithinExpected * me_qc1 = (MeanWithinExpected *) qc1;
213  double warning = atof(findOrDefault(params, "warning", "0"));
214  double error = atof(findOrDefault(params, "error", "0"));
215  double mean = atof(findOrDefault(params, "mean", "0"));
216  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
217  double useRMSVal = atof(findOrDefault(params, "useRMS", "0"));
218  double useSigmaVal = atof(findOrDefault(params, "useSigma", "0"));
219  double useRangeVal = atof(findOrDefault(params, "useRange", "0"));
220  me_qc1->setWarningProb(warning);
221  me_qc1->setErrorProb(error);
222  me_qc1->setExpectedMean(mean);
223 
224  if (minEntries != 0)
225  me_qc1->setMinimumEntries(minEntries);
226 
227  if (useRMSVal && useSigmaVal && useRangeVal)
228  return;
229 
230  if (useRMSVal) {
231  me_qc1->useRMS();
232  return;
233  }
234 
235  if (useSigmaVal) {
236  me_qc1->useSigma(useSigmaVal);
237  return;
238  }
239 
240  if(useRangeVal) {
241  float xmin = atof(findOrDefault(params, "xmin", "0"));
242  float xmax = atof(findOrDefault(params, "xmax", "0"));
243  me_qc1->useRange(xmin,xmax);
244  return;
245  }
246 }
void setErrorProb(float prob)
Definition: QTest.h:61
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:2602
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:392
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:142
void setExpectedMean(double mean)
Definition: QTest.h:402
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:60
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:2613
static std::string getAlgoName(void)
Definition: QTest.h:399
void QTestConfigure::EnableNoisyChannelTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates NoisyChannelROOT test.

Definition at line 181 of file QTestConfigure.cc.

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

Referenced by enableTests().

183  {
184  QCriterion * qc1;
185  if (! bei->getQCriterion(testName)) {
186  testsConfigured.push_back(testName);
187  qc1 = bei->createQTest(NoisyChannel::getAlgoName(), testName);
188  } else {
189  qc1 = bei->getQCriterion(testName);
190  }
191  NoisyChannel * me_qc1 = (NoisyChannel *) qc1;
192  unsigned int neighbors = (unsigned int) atof(findOrDefault(params, "neighbours", "0"));
193  double tolerance = atof(findOrDefault(params, "tolerance", "0"));
194  double warning = atof(findOrDefault(params, "warning", "0"));
195  double error = atof(findOrDefault(params, "error", "0"));
196  me_qc1->setNumNeighbors (neighbors);
197  me_qc1->setTolerance (tolerance);
198  me_qc1->setWarningProb(warning);
199  me_qc1->setErrorProb(error);
200 }
void setErrorProb(float prob)
Definition: QTest.h:61
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:2602
static std::string getAlgoName(void)
Definition: QTest.h:311
void setNumNeighbors(unsigned n)
Definition: QTest.h:321
Check if any channels are noisy compared to neighboring ones.
Definition: QTest.h:302
std::vector< std::string > testsConfigured
void setTolerance(float percentage)
Definition: QTest.h:327
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:60
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:2613
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 30 of file QTestConfigure.cc.

References 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(), AlCaHLTBitMon_QueryRunRegistry::string, utils_v2::tests, and testsConfigured.

Referenced by QTestHandle::configureTests().

32  {
33  testsConfigured.clear();
34  std::map<std::string, std::map<std::string, std::string> >::const_iterator itr;
35  for (itr = tests.begin(); itr!= tests.end();++itr) {
36  const std::map<std::string, std::string> &params= itr->second;
37 
38  std::string testName = itr->first;
39  std::string testType = params.at("type");
40 
41  if(!std::strcmp(testType.c_str(),ContentsXRange::getAlgoName().c_str()))
42  this->EnableXRangeTest(testName, params,bei);
43  if(!std::strcmp(testType.c_str(),ContentsYRange::getAlgoName().c_str()))
44  this->EnableYRangeTest(testName, params,bei);
45  if(!std::strcmp(testType.c_str(),DeadChannel::getAlgoName().c_str()))
46  this->EnableDeadChannelTest(testName, params,bei);
47  if(!std::strcmp(testType.c_str(),NoisyChannel::getAlgoName().c_str()))
48  this->EnableNoisyChannelTest(testName, params,bei);
49  if(!std::strcmp(testType.c_str(),MeanWithinExpected::getAlgoName().c_str()))
50  this->EnableMeanWithinExpectedTest(testName, params,bei);
51  if(!std::strcmp(testType.c_str(),Comp2RefEqualH::getAlgoName().c_str()))
52  this->EnableComp2RefEqualHTest(testName, params,bei);
53  if(!std::strcmp(testType.c_str(), Comp2RefChi2::getAlgoName().c_str()))
54  this->EnableComp2RefChi2Test(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 
64  }
65  return false;
66 }
static std::string getAlgoName(void)
Definition: QTest.h:311
dictionary tests
Definition: utils_v2.py:385
static std::string getAlgoName(void)
Definition: QTest.h:360
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:232
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:284
static std::string getAlgoName(void)
Definition: QTest.h:611
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:217
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:257
static std::string getAlgoName(void)
Definition: QTest.h:176
static std::string getAlgoName(void)
Definition: QTest.h:189
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:659
static std::string getAlgoName(void)
Definition: QTest.h:399
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 120 of file QTestConfigure.cc.

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

Referenced by enableTests().

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

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

Referenced by enableTests().

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

Definition at line 17 of file QTestConfigure.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

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

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

Definition at line 35 of file QTestConfigure.h.

References testsConfigured.

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

Member Data Documentation

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