CMS 3D CMS Logo

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

#include <QTestConfigure.h>

Public Types

typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 

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 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 EnableContentSigmaTest (std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
 Creates ContentSigmaROOT 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 19 of file QTestConfigure.h.

Member Typedef Documentation

Definition at line 21 of file QTestConfigure.h.

Definition at line 22 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 343 of file QTestConfigure.cc.

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

Referenced by enableTests(), and testsReady().

345  {
346  QCriterion *qc1;
347  if (!bei->getQCriterion(testName)) {
348  testsConfigured.push_back(testName);
349  qc1 = bei->createQTest(CheckVariance::getAlgoName(), testName);
350  } else {
351  qc1 = bei->getQCriterion(testName);
352  }
353  CheckVariance *me_qc1 = (CheckVariance *)qc1;
354 
355  double warning = atof(findOrDefault(params, "warning", "0"));
356  double error = atof(findOrDefault(params, "error", "0"));
357  me_qc1->setWarningProb(warning);
358  me_qc1->setErrorProb(error);
359 }
void setErrorProb(float prob)
Definition: QTest.h:78
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:77
static std::string getAlgoName()
get algorithm name
Definition: QTest.h:743
void QTestConfigure::EnableCompareLastFilledBinTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates EnableCompareLastFilledBinTest test.

Definition at line 320 of file QTestConfigure.cc.

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

Referenced by enableTests(), and testsReady().

322  {
323  QCriterion *qc1;
324  if (!bei->getQCriterion(testName)) {
325  testsConfigured.push_back(testName);
326  qc1 = bei->createQTest(CompareLastFilledBin::getAlgoName(), testName);
327  } else {
328  qc1 = bei->getQCriterion(testName);
329  }
331 
332  double warning = atof(findOrDefault(params, "warning", "0"));
333  double error = atof(findOrDefault(params, "error", "0"));
334  double avVal = atof(findOrDefault(params, "AvVal", "0"));
335  double minVal = atof(findOrDefault(params, "MinVal", "0"));
336  double maxVal = atof(findOrDefault(params, "MaxVal", "0"));
337  me_qc1->setWarningProb(warning);
338  me_qc1->setErrorProb(error);
339  me_qc1->setAverage(avVal);
340  me_qc1->setMin(minVal);
341  me_qc1->setMax(maxVal);
342 }
void setErrorProb(float prob)
Definition: QTest.h:78
void setMin(float min)
Definition: QTest.h:691
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:77
void setMax(float max)
Definition: QTest.h:692
void setAverage(float average)
Definition: QTest.h:690
static std::string getAlgoName()
Definition: QTest.h:687
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 232 of file QTestConfigure.cc.

References dqm::dqmstoreimpl::DQMStore::createQTest(), findOrDefault(), CompareToMedian::getAlgoName(), dqm::dqmstoreimpl::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().

234  {
235  QCriterion *qc1;
236  if (!bei->getQCriterion(testName)) {
237  testsConfigured.push_back(testName);
238  qc1 = bei->createQTest(CompareToMedian::getAlgoName(), testName);
239  } else {
240  qc1 = bei->getQCriterion(testName);
241  }
242  CompareToMedian *vtm = (CompareToMedian *)qc1;
243  vtm->setMin((double)atof(findOrDefault(params, "MinRel", "0")));
244  vtm->setMax((double)atof(findOrDefault(params, "MaxRel", "0")));
245  vtm->setEmptyBins((int)atoi(findOrDefault(params, "UseEmptyBins", "0")));
246  vtm->setMinMedian((double)atof(findOrDefault(params, "MinAbs", "0")));
247  vtm->setMaxMedian((double)atof(findOrDefault(params, "MaxAbs", "0")));
248  vtm->setWarningProb((double)atof(findOrDefault(params, "warning", "0")));
249  vtm->setErrorProb((double)atof(findOrDefault(params, "error", "0")));
250  vtm->setStatCut((double)atof(findOrDefault(params, "StatCut", "0")));
251 }
void setErrorProb(float prob)
Definition: QTest.h:78
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()
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:77
void setMinMedian(float min)
Definition: QTest.h:648
void QTestConfigure::EnableContentSigmaTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentSigmaROOT test.

Definition at line 143 of file QTestConfigure.cc.

References dqm::dqmstoreimpl::DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), ContentSigma::getAlgoName(), dqm::dqmstoreimpl::DQMStore::getQCriterion(), createfilelist::int, ContentSigma::setDead(), QCriterion::setErrorProb(), ContentSigma::setNoisy(), ContentSigma::setNumNeighborsX(), ContentSigma::setNumNeighborsY(), ContentSigma::setNumXblocks(), ContentSigma::setNumYblocks(), ContentSigma::setToleranceDead(), ContentSigma::setToleranceNoisy(), QCriterion::setWarningProb(), ContentSigma::setXMax(), ContentSigma::setXMin(), ContentSigma::setYMax(), ContentSigma::setYMin(), testsConfigured, MessageLogger_cfi::warning, multiplicitycorr_cfi::xMax, photonAnalyzer_cfi::xMin, multiplicitycorr_cfi::yMax, and photonAnalyzer_cfi::yMin.

Referenced by enableTests(), and testsReady().

145  {
146  QCriterion *qc1;
147  if (!bei->getQCriterion(testName)) {
148  testsConfigured.push_back(testName);
149  qc1 = bei->createQTest(ContentSigma::getAlgoName(), testName);
150  } else {
151  qc1 = bei->getQCriterion(testName);
152  }
153  ContentSigma *me_qc1 = (ContentSigma *)qc1;
154  unsigned int Xblocks = (unsigned int)atof(findOrDefault(params, "Xblocks", "0"));
155  unsigned int Yblocks = (unsigned int)atof(findOrDefault(params, "Yblocks", "0"));
156  unsigned int neighborsX = (unsigned int)atof(findOrDefault(params, "neighboursX", "0"));
157  unsigned int neighborsY = (unsigned int)atof(findOrDefault(params, "neighboursY", "0"));
158  double toleranceNoisy = atof(findOrDefault(params, "toleranceNoisy", "0"));
159  double toleranceDead = atof(findOrDefault(params, "toleranceDead", "0"));
160  int noisy = atoi(findOrDefault(params, "noisy", "0"));
161  int dead = atoi(findOrDefault(params, "dead", "0"));
162  unsigned int xMin = (unsigned int)atof(findOrDefault(params, "xMin", "1"));
163  unsigned int xMax = (unsigned int)atof(findOrDefault(params, "xMax", "500"));
164  unsigned int yMin = (unsigned int)atof(findOrDefault(params, "yMin", "1"));
165  unsigned int yMax = (unsigned int)atof(findOrDefault(params, "yMax", "500"));
166  double warning = atof(findOrDefault(params, "warning", "0"));
167  double error = atof(findOrDefault(params, "error", "0"));
168  me_qc1->setNumXblocks(Xblocks);
169  me_qc1->setNumYblocks(Yblocks);
170  me_qc1->setNumNeighborsX(neighborsX);
171  me_qc1->setNumNeighborsY(neighborsY);
172  me_qc1->setToleranceNoisy(toleranceNoisy);
173  me_qc1->setToleranceDead(toleranceDead);
174  me_qc1->setNoisy(noisy);
175  me_qc1->setDead(dead);
176  me_qc1->setXMin(xMin);
177  me_qc1->setXMax(xMax);
178  me_qc1->setYMin(yMin);
179  me_qc1->setYMax(yMax);
180  me_qc1->setWarningProb(warning);
181  me_qc1->setErrorProb(error);
182 }
void setErrorProb(float prob)
Definition: QTest.h:78
void setDead(bool dead)
Definition: QTest.h:354
void setXMax(unsigned xMax)
Definition: QTest.h:357
void setYMax(unsigned yMax)
Definition: QTest.h:359
void setYMin(unsigned yMin)
Definition: QTest.h:358
std::vector< std::string > testsConfigured
const char * findOrDefault(const std::map< std::string, std::string > &, const char *, const char *) const
void setNumNeighborsX(unsigned ncx)
Definition: QTest.h:329
void setToleranceNoisy(float factorNoisy)
Definition: QTest.h:341
Check the sigma of each bin against the rest of the chamber by a factor of tolerance/.
Definition: QTest.h:301
void setNumYblocks(unsigned ncy)
Definition: QTest.h:325
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:77
void setNoisy(bool noisy)
Definition: QTest.h:353
void setNumNeighborsY(unsigned ncy)
Definition: QTest.h:333
void setXMin(unsigned xMin)
Definition: QTest.h:356
static std::string getAlgoName()
Definition: QTest.h:311
void setNumXblocks(unsigned ncx)
Definition: QTest.h:321
void setToleranceDead(float factorDead)
Definition: QTest.h:347
void QTestConfigure::EnableContentsWithinExpectedTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsWithinRangeROOT test.

Definition at line 283 of file QTestConfigure.cc.

References dqm::dqmstoreimpl::DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), ContentsWithinExpected::getAlgoName(), dqm::dqmstoreimpl::DQMStore::getQCriterion(), createfilelist::int, dtFineDelayCorr_cfi::minEntries, QCriterion::setErrorProb(), ContentsWithinExpected::setMeanRange(), ContentsWithinExpected::setMeanTolerance(), SimpleTest::setMinimumEntries(), ContentsWithinExpected::setRMSRange(), ContentsWithinExpected::setUseEmptyBins(), QCriterion::setWarningProb(), testsConfigured, PedestalClient_cfi::toleranceMean, and MessageLogger_cfi::warning.

Referenced by enableTests(), and testsReady().

285  {
286  QCriterion *qc1;
287  if (!bei->getQCriterion(testName)) {
288  testsConfigured.push_back(testName);
289  qc1 = bei->createQTest(ContentsWithinExpected::getAlgoName(), testName);
290  } else {
291  qc1 = bei->getQCriterion(testName);
292  }
294  unsigned int useEmptyBins = (unsigned int)atof(findOrDefault(params, "useEmptyBins", "0"));
295  double warning = atof(findOrDefault(params, "warning", "0"));
296  double error = atof(findOrDefault(params, "error", "0"));
297  double minMean = atof(findOrDefault(params, "minMean", "0"));
298  double maxMean = atof(findOrDefault(params, "maxMean", "0"));
299  double minRMS = atof(findOrDefault(params, "minRMS", "0"));
300  double maxRMS = atof(findOrDefault(params, "maxRMS", "0"));
301  double toleranceMean = atof(findOrDefault(params, "toleranceMean", "0"));
302  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
303  me_qc1->setUseEmptyBins(useEmptyBins);
304  me_qc1->setWarningProb(warning);
305  me_qc1->setErrorProb(error);
306 
307  if (minMean != 0 || maxMean != 0)
308  me_qc1->setMeanRange(minMean, maxMean);
309 
310  if (minRMS != 0 || maxRMS != 0)
311  me_qc1->setRMSRange(minRMS, maxRMS);
312 
313  if (toleranceMean != 0)
314  me_qc1->setMeanTolerance(toleranceMean);
315 
316  if (minEntries != 0)
317  me_qc1->setMinimumEntries(minEntries);
318 }
void setErrorProb(float prob)
Definition: QTest.h:78
void setRMSRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1062
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:162
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:411
static std::string getAlgoName()
Definition: QTest.h:408
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:77
void setMeanRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1051
void setMeanTolerance(float fracTolerance)
set (fractional) tolerance for mean
Definition: QTest.h:416
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 102 of file QTestConfigure.cc.

References dqm::dqmstoreimpl::DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), DeadChannel::getAlgoName(), dqm::dqmstoreimpl::DQMStore::getQCriterion(), createfilelist::int, QCriterion::setErrorProb(), DeadChannel::setThreshold(), QCriterion::setWarningProb(), testsConfigured, MessageLogger_cff::threshold, and MessageLogger_cfi::warning.

Referenced by enableTests(), and testsReady().

104  {
105  QCriterion *qc1;
106  if (!bei->getQCriterion(testName)) {
107  testsConfigured.push_back(testName);
108  qc1 = bei->createQTest(DeadChannel::getAlgoName(), testName);
109  } else {
110  qc1 = bei->getQCriterion(testName);
111  }
112  DeadChannel *me_qc1 = (DeadChannel *)qc1;
113  unsigned int threshold = (unsigned int)atof(findOrDefault(params, "threshold", "0"));
114  double warning = atof(findOrDefault(params, "warning", "0"));
115  double error = atof(findOrDefault(params, "error", "0"));
116  me_qc1->setThreshold(threshold);
117  me_qc1->setWarningProb(warning);
118  me_qc1->setErrorProb(error);
119 }
void setErrorProb(float prob)
Definition: QTest.h:78
test that histogram contents are above Ymin
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:77
static std::string getAlgoName()
Definition: QTest.h:238
void setThreshold(double ymin)
set Ymin (inclusive) threshold for "dead" channel (default: 0)
Definition: QTest.h:242
void QTestConfigure::EnableMeanWithinExpectedTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates MeanWithinExpectedROOT test.

Definition at line 186 of file QTestConfigure.cc.

References dqm::dqmstoreimpl::DQMStore::createQTest(), relativeConstraints::error, findOrDefault(), MeanWithinExpected::getAlgoName(), dqm::dqmstoreimpl::DQMStore::getQCriterion(), SiStripPI::mean, dtFineDelayCorr_cfi::minEntries, QCriterion::setErrorProb(), MeanWithinExpected::setExpectedMean(), SimpleTest::setMinimumEntries(), QCriterion::setWarningProb(), testsConfigured, MeanWithinExpected::useRange(), MeanWithinExpected::useRMS(), MeanWithinExpected::useSigma(), MessageLogger_cfi::warning, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

Referenced by enableTests(), and testsReady().

188  {
189  QCriterion *qc1;
190  if (!bei->getQCriterion(testName)) {
191  testsConfigured.push_back(testName);
192  qc1 = bei->createQTest(MeanWithinExpected::getAlgoName(), testName);
193  } else {
194  qc1 = bei->getQCriterion(testName);
195  }
196  MeanWithinExpected *me_qc1 = (MeanWithinExpected *)qc1;
197  double warning = atof(findOrDefault(params, "warning", "0"));
198  double error = atof(findOrDefault(params, "error", "0"));
199  double mean = atof(findOrDefault(params, "mean", "0"));
200  int minEntries = atoi(findOrDefault(params, "minEntries", "0"));
201  double useRMSVal = atof(findOrDefault(params, "useRMS", "0"));
202  double useSigmaVal = atof(findOrDefault(params, "useSigma", "0"));
203  double useRangeVal = atof(findOrDefault(params, "useRange", "0"));
204  me_qc1->setWarningProb(warning);
205  me_qc1->setErrorProb(error);
206  me_qc1->setExpectedMean(mean);
207 
208  if (minEntries != 0)
209  me_qc1->setMinimumEntries(minEntries);
210 
211  if (useRMSVal && useSigmaVal && useRangeVal)
212  return;
213 
214  if (useRMSVal) {
215  me_qc1->useRMS();
216  return;
217  }
218 
219  if (useSigmaVal) {
220  me_qc1->useSigma(useSigmaVal);
221  return;
222  }
223 
224  if (useRangeVal) {
225  float xmin = atof(findOrDefault(params, "xmin", "0"));
226  float xmax = atof(findOrDefault(params, "xmax", "0"));
227  me_qc1->useRange(xmin, xmax);
228  return;
229  }
230 }
void setErrorProb(float prob)
Definition: QTest.h:78
void useSigma(double expectedSigma)
Definition: QTest.cc:1155
Algorithm for testing if histogram&#39;s mean value is near expected value.
Definition: QTest.h:435
static std::string getAlgoName()
Definition: QTest.h:438
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:162
void setExpectedMean(double mean)
Definition: QTest.h:441
void useRange(double xmin, double xmax)
Definition: QTest.cc:1145
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:77
void QTestConfigure::EnableNoisyChannelTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates NoisyChannelROOT test.

Definition at line 121 of file QTestConfigure.cc.

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

Referenced by enableTests(), and testsReady().

123  {
124  QCriterion *qc1;
125  if (!bei->getQCriterion(testName)) {
126  testsConfigured.push_back(testName);
127  qc1 = bei->createQTest(NoisyChannel::getAlgoName(), testName);
128  } else {
129  qc1 = bei->getQCriterion(testName);
130  }
131  NoisyChannel *me_qc1 = (NoisyChannel *)qc1;
132  unsigned int neighbors = (unsigned int)atof(findOrDefault(params, "neighbours", "0"));
133  double tolerance = atof(findOrDefault(params, "tolerance", "0"));
134  double warning = atof(findOrDefault(params, "warning", "0"));
135  double error = atof(findOrDefault(params, "error", "0"));
136  me_qc1->setNumNeighbors(neighbors);
137  me_qc1->setTolerance(tolerance);
138  me_qc1->setWarningProb(warning);
139  me_qc1->setErrorProb(error);
140 }
void setErrorProb(float prob)
Definition: QTest.h:78
const double tolerance
void setNumNeighbors(unsigned n)
Definition: QTest.h:271
Check if any channels are noisy compared to neighboring ones.
Definition: QTest.h:254
std::vector< std::string > testsConfigured
void setTolerance(float percentage)
Definition: QTest.h:280
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:77
static std::string getAlgoName()
Definition: QTest.h:261
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 26 of file QTestConfigure.cc.

References EnableCheckVarianceTest(), EnableCompareLastFilledBinTest(), EnableCompareToMedianTest(), EnableContentSigmaTest(), EnableContentsWithinExpectedTest(), EnableDeadChannelTest(), EnableMeanWithinExpectedTest(), EnableNoisyChannelTest(), EnableXRangeTest(), EnableYRangeTest(), ContentsXRange::getAlgoName(), ContentsYRange::getAlgoName(), DeadChannel::getAlgoName(), NoisyChannel::getAlgoName(), ContentSigma::getAlgoName(), ContentsWithinExpected::getAlgoName(), MeanWithinExpected::getAlgoName(), CompareToMedian::getAlgoName(), CompareLastFilledBin::getAlgoName(), CheckVariance::getAlgoName(), CalibrationSummaryClient_cfi::params, AlCaHLTBitMon_QueryRunRegistry::string, L1TBPTX_cfi::testName, utils_v2::tests, and testsConfigured.

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

27  {
28  testsConfigured.clear();
29  std::map<std::string, std::map<std::string, std::string> >::const_iterator itr;
30  for (itr = tests.begin(); itr != tests.end(); ++itr) {
31  const std::map<std::string, std::string> &params = itr->second;
32 
33  std::string testName = itr->first;
34  std::string testType = params.at("type");
35 
36  if (!std::strcmp(testType.c_str(), ContentsXRange::getAlgoName().c_str()))
37  this->EnableXRangeTest(testName, params, bei);
38  if (!std::strcmp(testType.c_str(), ContentsYRange::getAlgoName().c_str()))
39  this->EnableYRangeTest(testName, params, bei);
40  if (!std::strcmp(testType.c_str(), DeadChannel::getAlgoName().c_str()))
41  this->EnableDeadChannelTest(testName, params, bei);
42  if (!std::strcmp(testType.c_str(), NoisyChannel::getAlgoName().c_str()))
43  this->EnableNoisyChannelTest(testName, params, bei);
44  if (!std::strcmp(testType.c_str(), ContentSigma::getAlgoName().c_str()))
45  this->EnableContentSigmaTest(testName, params, bei);
46  if (!std::strcmp(testType.c_str(), MeanWithinExpected::getAlgoName().c_str()))
47  this->EnableMeanWithinExpectedTest(testName, params, bei);
48  if (!std::strcmp(testType.c_str(), ContentsWithinExpected::getAlgoName().c_str()))
49  this->EnableContentsWithinExpectedTest(testName, params, bei);
50  if (!std::strcmp(testType.c_str(), CompareToMedian::getAlgoName().c_str()))
51  this->EnableCompareToMedianTest(testName, params, bei);
52  if (!std::strcmp(testType.c_str(), CompareLastFilledBin::getAlgoName().c_str()))
53  this->EnableCompareLastFilledBinTest(testName, params, bei);
54  if (!std::strcmp(testType.c_str(), CheckVariance::getAlgoName().c_str()))
55  this->EnableCheckVarianceTest(testName, params, bei);
56  }
57  return false;
58 }
void EnableContentSigmaTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentSigmaROOT test.
void EnableNoisyChannelTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates NoisyChannelROOT test.
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.
void EnableCheckVarianceTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates CheckVariance test.
static std::string getAlgoName()
Definition: QTest.h:641
static std::string getAlgoName()
Definition: QTest.h:438
std::vector< std::string > testsConfigured
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()
Definition: QTest.h:189
static std::string getAlgoName()
Definition: QTest.h:408
static std::string getAlgoName()
Definition: QTest.h:238
static std::string getAlgoName()
get algorithm name
Definition: QTest.h:743
void EnableDeadChannelTest(std::string testName, const std::map< std::string, std::string > &params, DQMStore *bei)
Creates ContentsYRangeASROOT test.
static std::string getAlgoName()
Definition: QTest.h:311
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()
Definition: QTest.h:261
static std::string getAlgoName()
Definition: QTest.h:213
static std::string getAlgoName()
Definition: QTest.h:687
void QTestConfigure::EnableXRangeTest ( std::string  testName,
const std::map< std::string, std::string > &  params,
DQMStore bei 
)
private

Creates ContentsXRangeROOT test.

Definition at line 60 of file QTestConfigure.cc.

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

Referenced by enableTests(), and testsReady().

62  {
63  QCriterion *qc1;
64  if (!bei->getQCriterion(testName)) {
65  testsConfigured.push_back(testName);
66  qc1 = bei->createQTest(ContentsXRange::getAlgoName(), testName);
67  } else {
68  qc1 = bei->getQCriterion(testName);
69  }
70  ContentsXRange *me_qc1 = (ContentsXRange *)qc1;
71  double xmin = atof(findOrDefault(params, "xmin", "0"));
72  double xmax = atof(findOrDefault(params, "xmax", "0"));
73  double warning = atof(findOrDefault(params, "warning", "0"));
74  double error = atof(findOrDefault(params, "error", "0"));
75  me_qc1->setAllowedXRange(xmin, xmax);
76  me_qc1->setWarningProb(warning);
77  me_qc1->setErrorProb(error);
78 }
void setErrorProb(float prob)
Definition: QTest.h:78
virtual void setAllowedXRange(double xmin, double xmax)
set allowed range in X-axis (default values: histogram&#39;s X-range)
Definition: QTest.h:193
std::vector< std::string > testsConfigured
static std::string getAlgoName()
Definition: QTest.h:189
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:77
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 80 of file QTestConfigure.cc.

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

Referenced by enableTests(), and testsReady().

82  {
83  QCriterion *qc1;
84  if (!bei->getQCriterion(testName)) {
85  testsConfigured.push_back(testName);
86  qc1 = bei->createQTest(ContentsYRange::getAlgoName(), testName);
87  } else {
88  qc1 = bei->getQCriterion(testName);
89  }
90  ContentsYRange *me_qc1 = (ContentsYRange *)qc1;
91  double ymin = atof(findOrDefault(params, "ymin", "0"));
92  double ymax = atof(findOrDefault(params, "ymax", "0"));
93  double warning = atof(findOrDefault(params, "warning", "0"));
94  double error = atof(findOrDefault(params, "error", "0"));
95  unsigned int useEmptyBins = (unsigned int)atof(findOrDefault(params, "useEmptyBins", "0"));
96  me_qc1->setAllowedYRange(ymin, ymax);
97  me_qc1->setWarningProb(warning);
98  me_qc1->setErrorProb(error);
99  me_qc1->setUseEmptyBins(useEmptyBins);
100 }
void setErrorProb(float prob)
Definition: QTest.h:78
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:216
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:77
virtual void setAllowedYRange(double ymin, double ymax)
Definition: QTest.h:217
static std::string getAlgoName()
Definition: QTest.h:213
const char * QTestConfigure::findOrDefault ( const std::map< std::string, std::string > &  m,
const char *  item,
const char *  default_value 
) const
private

Definition at line 14 of file QTestConfigure.cc.

References LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EnableCheckVarianceTest(), EnableCompareLastFilledBinTest(), EnableCompareToMedianTest(), EnableContentSigmaTest(), EnableContentsWithinExpectedTest(), EnableDeadChannelTest(), EnableMeanWithinExpectedTest(), EnableNoisyChannelTest(), EnableXRangeTest(), EnableYRangeTest(), and testsReady().

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

Member Data Documentation

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