#include <QTestConfigure.h>
Public Member Functions | |
void | disableTests (const std::vector< std::string > &testsOFFList, DQMStore *bei) |
Disables the Quality Tests in the string list. | |
bool | enableTests (const std::map< std::string, std::map< std::string, std::string > > &tests, DQMStore *bei) |
Creates and defines quality tests. | |
QTestConfigure () | |
Constructor. | |
std::vector< std::string > | testsReady () |
Returns the vector containing the names of the quality tests that have been created. | |
~QTestConfigure () | |
Destructor. | |
Private Member Functions | |
void | EnableComp2RefChi2Test (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates Comp2RefChi2 test. | |
void | EnableComp2RefEqualHTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates Comp2RefEqualH test. | |
void | EnableComp2RefKolmogorovTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates EnableComp2RefKolmogorov test. | |
void | EnableCompareLastFilledBinTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates EnableCompareLastFilledBinTest test. | |
void | EnableCompareToMedianTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates ContentsWithinRangeROOT test. | |
void | EnableContentsWithinExpectedTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates ContentsWithinRangeROOT test. | |
void | EnableDeadChannelTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates ContentsYRangeASROOT test. | |
void | EnableMeanWithinExpectedTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates MeanWithinExpectedROOT test. | |
void | EnableNoisyChannelTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates NoisyChannelROOT test. | |
void | EnableXRangeTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates ContentsXRangeROOT test. | |
void | EnableYRangeTest (std::string testName, const std::map< std::string, std::string > ¶ms, DQMStore *bei) |
Creates ContentsXRangeASROOT test. | |
const char * | findOrDefault (const std::map< std::string, std::string > &, const char *, const char *) const |
Private Attributes | |
std::vector< std::string > | testsConfigured |
* Class that creates and defined quality tests based on the xml configuration file parsed by QTestConfigurationParser.
Definition at line 22 of file QTestConfigure.h.
QTestConfigure::QTestConfigure | ( | ) | [inline] |
QTestConfigure::~QTestConfigure | ( | ) | [inline] |
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(Comp2RefChi2::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } Comp2RefChi2 * me_qc1 = (Comp2RefChi2 *) qc1; double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(Comp2RefEqualH::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } Comp2RefEqualH * me_qc1 = (Comp2RefEqualH *) qc1; double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(Comp2RefKolmogorov::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } Comp2RefKolmogorov * me_qc1 = (Comp2RefKolmogorov *) qc1; double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(CompareLastFilledBin::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } CompareLastFilledBin * me_qc1 = (CompareLastFilledBin *) qc1; double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); double avVal = atof(findOrDefault(params, "AvVal", "0")); double minVal = atof(findOrDefault(params, "MinVal", "0")); double maxVal = atof(findOrDefault(params, "MaxVal", "0")); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); me_qc1->setAverage(avVal); me_qc1->setMin(minVal); me_qc1->setMax(maxVal); }
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().
{ QCriterion *qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(CompareToMedian::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } CompareToMedian* vtm = (CompareToMedian*) qc1; vtm->setMin( (double) atof(findOrDefault(params, "MinRel", "0"))); vtm->setMax( (double) atof(findOrDefault(params, "MaxRel", "0"))); vtm->setEmptyBins( (int) atoi(findOrDefault(params, "UseEmptyBins", "0"))); vtm->setMinMedian( (double) atof(findOrDefault(params, "MinAbs", "0"))); vtm->setMaxMedian( (double) atof(findOrDefault(params, "MaxAbs", "0"))); vtm->setWarningProb( (double) atof(findOrDefault(params, "warning", "0"))); vtm->setErrorProb( (double) atof(findOrDefault(params, "error", "0"))); vtm->setStatCut( (double) atof(findOrDefault(params, "StatCut", "0"))); }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(ContentsWithinExpected::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } ContentsWithinExpected * me_qc1 = (ContentsWithinExpected *) qc1; unsigned int useEmptyBins = (unsigned int) atof(findOrDefault(params, "useEmptyBins", "0")); double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); double minMean = atof(findOrDefault(params, "minMean", "0")); double maxMean = atof(findOrDefault(params, "maxMean", "0")); double minRMS = atof(findOrDefault(params, "minRMS", "0")); double maxRMS = atof(findOrDefault(params, "maxRMS", "0")); double toleranceMean = atof(findOrDefault(params, "toleranceMean", "0")); int minEntries = atoi(findOrDefault(params, "minEntries", "0")); me_qc1->setUseEmptyBins(useEmptyBins); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); if ( minMean != 0 || maxMean != 0 ) me_qc1->setMeanRange(minMean, maxMean); if ( minRMS != 0 || maxRMS != 0 ) me_qc1->setRMSRange(minRMS, maxRMS); if ( toleranceMean != 0 ) me_qc1->setMeanTolerance(toleranceMean); if ( minEntries != 0 ) me_qc1->setMinimumEntries(minEntries); }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(DeadChannel::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } DeadChannel * me_qc1 = ( DeadChannel *) qc1; unsigned int threshold =(unsigned int) atof(findOrDefault(params, "threshold", "0")); double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); me_qc1->setThreshold(threshold); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(MeanWithinExpected::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } MeanWithinExpected * me_qc1 = (MeanWithinExpected *) qc1; double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); double mean = atof(findOrDefault(params, "mean", "0")); int minEntries = atoi(findOrDefault(params, "minEntries", "0")); double useRMSVal = atof(findOrDefault(params, "useRMS", "0")); double useSigmaVal = atof(findOrDefault(params, "useSigma", "0")); double useRangeVal = atof(findOrDefault(params, "useRange", "0")); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); me_qc1->setExpectedMean(mean); if (minEntries != 0) me_qc1->setMinimumEntries(minEntries); if (useRMSVal && useSigmaVal && useRangeVal) return; if (useRMSVal) { me_qc1->useRMS(); return; } if (useSigmaVal) { me_qc1->useSigma(useSigmaVal); return; } if(useRangeVal) { float xmin = atof(findOrDefault(params, "xmin", "0")); float xmax = atof(findOrDefault(params, "xmax", "0")); me_qc1->useRange(xmin,xmax); return; } }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(NoisyChannel::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } NoisyChannel * me_qc1 = (NoisyChannel *) qc1; unsigned int neighbors = (unsigned int) atof(findOrDefault(params, "neighbours", "0")); double tolerance = atof(findOrDefault(params, "tolerance", "0")); double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); me_qc1->setNumNeighbors (neighbors); me_qc1->setTolerance (tolerance); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); }
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(), CompareToMedian::getAlgoName(), DeadChannel::getAlgoName(), MeanWithinExpected::getAlgoName(), Comp2RefKolmogorov::getAlgoName(), Comp2RefChi2::getAlgoName(), ContentsYRange::getAlgoName(), NoisyChannel::getAlgoName(), ContentsXRange::getAlgoName(), ContentsWithinExpected::getAlgoName(), CompareLastFilledBin::getAlgoName(), AlCaHLTBitMon_QueryRunRegistry::string, utils_v2::tests, and testsConfigured.
Referenced by QTestHandle::configureTests().
{ testsConfigured.clear(); std::map<std::string, std::map<std::string, std::string> >::const_iterator itr; for (itr = tests.begin(); itr!= tests.end();++itr) { const std::map<std::string, std::string> ¶ms= itr->second; std::string testName = itr->first; std::string testType = params.at("type"); if(!std::strcmp(testType.c_str(),ContentsXRange::getAlgoName().c_str())) this->EnableXRangeTest(testName, params,bei); if(!std::strcmp(testType.c_str(),ContentsYRange::getAlgoName().c_str())) this->EnableYRangeTest(testName, params,bei); if(!std::strcmp(testType.c_str(),DeadChannel::getAlgoName().c_str())) this->EnableDeadChannelTest(testName, params,bei); if(!std::strcmp(testType.c_str(),NoisyChannel::getAlgoName().c_str())) this->EnableNoisyChannelTest(testName, params,bei); if(!std::strcmp(testType.c_str(),MeanWithinExpected::getAlgoName().c_str())) this->EnableMeanWithinExpectedTest(testName, params,bei); if(!std::strcmp(testType.c_str(),Comp2RefEqualH::getAlgoName().c_str())) this->EnableComp2RefEqualHTest(testName, params,bei); if(!std::strcmp(testType.c_str(), Comp2RefChi2::getAlgoName().c_str())) this->EnableComp2RefChi2Test(testName, params,bei); if(!std::strcmp(testType.c_str(),Comp2RefKolmogorov::getAlgoName().c_str())) this->EnableComp2RefKolmogorovTest(testName, params,bei); if(!std::strcmp(testType.c_str(),ContentsWithinExpected::getAlgoName().c_str())) this->EnableContentsWithinExpectedTest(testName, params, bei); if(!std::strcmp(testType.c_str(),CompareToMedian::getAlgoName().c_str())) this->EnableCompareToMedianTest(testName, params, bei); if(!std::strcmp(testType.c_str(),CompareLastFilledBin::getAlgoName().c_str())) this->EnableCompareLastFilledBinTest(testName, params, bei); } return false; }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(ContentsXRange::getAlgoName(),testName); } else { qc1 = bei->getQCriterion(testName); } ContentsXRange * me_qc1 = (ContentsXRange *) qc1; double xmin = atof(findOrDefault(params, "xmin", "0")); double xmax = atof(findOrDefault(params, "xmax", "0")); double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); me_qc1->setAllowedXRange(xmin, xmax); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); }
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().
{ QCriterion * qc1; if (! bei->getQCriterion(testName)) { testsConfigured.push_back(testName); qc1 = bei->createQTest(ContentsYRange::getAlgoName(), testName); } else { qc1 = bei->getQCriterion(testName); } ContentsYRange * me_qc1 = (ContentsYRange *) qc1; double ymin = atof(findOrDefault(params, "ymin", "0")); double ymax = atof(findOrDefault(params, "ymax", "0")); double warning = atof(findOrDefault(params, "warning", "0")); double error = atof(findOrDefault(params, "error", "0")); unsigned int useEmptyBins = (unsigned int)atof(findOrDefault(params, "useEmptyBins", "0")); me_qc1->setAllowedYRange(ymin, ymax); me_qc1->setWarningProb(warning); me_qc1->setErrorProb(error); me_qc1->setUseEmptyBins(useEmptyBins); }
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().
{ std::map<std::string, std::string>::const_iterator iter; if (( iter = m.find(std::string(item))) != m.end()) { return (*iter).second.c_str(); } edm::LogWarning("QTestConfigure") << "Warning, using default value for parameter " << item << " with default_value: " << default_value << std::endl; return default_value; }
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.
{return testsConfigured;}
std::vector<std::string> QTestConfigure::testsConfigured [private] |
Definition at line 101 of file QTestConfigure.h.
Referenced by EnableComp2RefChi2Test(), EnableComp2RefEqualHTest(), EnableComp2RefKolmogorovTest(), EnableCompareLastFilledBinTest(), EnableCompareToMedianTest(), EnableContentsWithinExpectedTest(), EnableDeadChannelTest(), EnableMeanWithinExpectedTest(), EnableNoisyChannelTest(), enableTests(), EnableXRangeTest(), EnableYRangeTest(), and testsReady().