1 #ifndef DQMSERVICES_CORE_Q_CRITERION_H 2 #define DQMSERVICES_CORE_Q_CRITERION_H 5 #include "TProfile2D.h" 32 class FlatOccupancy1d;
41 class AllContentAlongDiagonal;
81 virtual std::vector<DQMChannel>
getBadChannels()
const {
return std::vector<DQMChannel>(); }
93 virtual float runTest(
const MonitorElement *
me);
116 <<
" / Prob = " <<
prob_ << std::endl;
159 :
QCriterion(name), minEntries_(0), keepBadChannels_(keepBadChannels) {}
186 rangeInitialized_ =
false;
196 rangeInitialized_ =
true;
210 rangeInitialized_ =
false;
220 rangeInitialized_ =
true;
235 rangeInitialized_ =
false;
244 rangeInitialized_ =
true;
257 rangeInitialized_ =
false;
281 if (percentage >= 0) {
282 tolerance_ = percentage;
283 rangeInitialized_ =
true;
290 double getAverage(
int bin,
const TH1 *
h)
const;
291 double getAverage2D(
int binX,
int binY,
const TH2 *h)
const;
304 rangeInitialized_ =
false;
331 numNeighborsX_ = ncx;
335 numNeighborsY_ = ncy;
342 if (factorNoisy >= 0) {
343 toleranceNoisy_ = factorNoisy;
344 rangeInitialized_ =
true;
348 if (factorDead >= 0) {
349 toleranceDead_ = factorDead;
350 rangeInitialized_ =
true;
364 double getNeighborSum(
unsigned groupx,
371 double getNeighborSigma(
double average,
402 checkMean_ = checkRMS_ =
false;
403 minMean_ = maxMean_ = minRMS_ = maxRMS_ = 0.0;
404 checkMeanTolerance_ =
false;
405 toleranceMean_ = -1.0;
412 void setMeanRange(
double xmin,
double xmax);
413 void setRMSRange(
double xmin,
double xmax);
417 if (fracTolerance >= 0.0) {
418 toleranceMean_ = fracTolerance;
419 checkMeanTolerance_ =
true;
442 void useRange(
double xmin,
double xmax);
443 void useSigma(
double expectedSigma);
518 #if 0 // FIXME: need to know what parameters to set before runTest! 530 ~FlatOccupancy1d(
void)
532 delete [] FailedBins[0];
533 delete [] FailedBins[1];
536 static std::string getAlgoName(
void) {
return "RuleFlatOccupancy1d"; }
538 void set_ExclusionMask(
double *mask) { ExclusionMask = mask; }
540 void set_epsilon_max(
double epsilon) { epsilon_max =
epsilon; }
541 void set_S_fail(
double S) { S_fail =
S; }
542 void set_S_pass(
double S) { S_pass =
S; }
543 double get_FailedBins(
void) {
return *FailedBins[1]; }
544 int get_result() {
return result; }
549 double *ExclusionMask;
550 double epsilon_min, epsilon_max;
551 double S_fail, S_pass;
552 double *FailedBins[2];
563 FailedBins[0] =
nullptr;
564 FailedBins[1] =
nullptr;
570 delete[] FailedBins[0];
571 delete[] FailedBins[1];
593 double *FailedBins[2];
629 this->_emptyBins = 0;
646 void setEmptyBins(
int eB) { eB > 0 ? _emptyBins = 1 : _emptyBins = 0; };
653 std::ostringstream message;
671 void reset() { binValues.clear(); };
680 this->_average = 0.0;
696 std::ostringstream message;
697 message <<
"Test " <<
qtname_ <<
" (" <<
algoName_ <<
"): Last Bin filled with desired value = " <<
prob_;
707 #if 0 // FIXME: need to know what parameters to set before runTest! 708 class AllContentAlongDiagonal :
public SimpleTest 711 AllContentAlongDiagonal(const std::string &name) :
SimpleTest(name)
715 static std::string getAlgoName(
void) {
return "RuleAllContentAlongDiagonal"; }
718 void set_S_fail(
double S) { S_fail =
S; }
719 void set_S_pass(
double S) { S_pass =
S; }
720 double get_epsilon_obs() {
return epsilon_obs; }
721 double get_S_fail_obs() {
return S_fail_obs; }
722 double get_S_pass_obs() {
return S_pass_obs; }
723 int get_result() {
return result; }
731 double S_fail, S_pass;
733 double S_fail_obs, S_pass_obs;
746 #endif // DQMSERVICES_CORE_Q_CRITERION_H
void setErrorProb(float prob)
void set_epsilon_min(double epsilon)
FlatOccupancy1d RuleFlatOccupancy1d
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void setAlgoName(std::string name)
set algorithm name
test that histogram contents are above Ymin
double ymin_
ymin - threshold
CSC01(const std::string &name)
SimpleTest(const std::string &name, bool keepBadChannels=false)
FlatOccupancy1d FlatOccupancy1dROOT
void set_ExclusionMask(double *mask)
void setUseEmptyBins(unsigned int useEmptyBins)
void setXMax(unsigned xMax)
virtual void setAllowedXRange(double xmin, double xmax)
set allowed range in X-axis (default values: histogram's X-range)
AllContentAlongDiagonal AllContentAlongDiagonalROOT
void setMessage() override
set status & message after test has run
std::vector< DQMChannel > getBadChannels() const override
get vector of channels that failed test (not always relevant!)
float runTest(const MonitorElement *me, QReport &qr, DQMNet::QValue &qv)
std::string algoName_
name of quality test
virtual ~QCriterion()=default
virtual std::vector< DQMChannel > getBadChannels() const
void setNumNeighbors(unsigned n)
std::string getMessage() const
get message attached to test
void init()
initialize values
Algorithm for testing if histogram's mean value is near expected value.
CheckVariance(const std::string &name)
DeadChannel(const std::string &name)
ContentsXRange(const std::string &name)
Check if any channels are noisy compared to neighboring ones.
ContentSigma(const std::string &name)
void setYMax(unsigned yMax)
static std::string getAlgoName()
FixedFlatOccupancy1d(const std::string &name)
void setYMin(unsigned yMin)
void set_Occupancy(double level)
void set_epsilon_max(double epsilon)
float prob_
name of algorithm
dqm::legacy::MonitorElement MonitorElement
(class should be created by DQMStore class)
static std::string getAlgoName()
CompareLastFilledBin(const std::string &name)
static const float ERROR_PROB_THRESHOLD
void setTolerance(float percentage)
void setMessage() override
set status & message after test has run
unsigned int useEmptyBins_
void setMinimumEntries(unsigned n)
set minimum # of entries needed
int getStatus() const
get test status (see Core/interface/DQMDefinitions.h)
ContentsWithinExpected(const std::string &name)
void setExpectedMean(double mean)
void setUseEmptyBins(unsigned int useEmptyBins)
std::string message_
quality test status
void set_epsilon_max(double epsilon)
void setNumNeighborsX(unsigned ncx)
void setToleranceNoisy(float factorNoisy)
Check the sigma of each bin against the rest of the chamber by a factor of tolerance/.
static std::string getAlgoName()
NoisyChannel(const std::string &name)
virtual void setMessage()=0
set message after test has run
AllContentAlongDiagonal RuleAllContentAlongDiagonal
~FixedFlatOccupancy1d() override
virtual float runTest(const MonitorElement *me)
void set_S_pass(double S)
std::string algoName() const
get algorithm name
std::vector< DQMChannel > badChannels_
void setNumYblocks(unsigned ncy)
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
double S(const TLorentzVector &, const TLorentzVector &)
static std::string getAlgoName()
MeanWithinExpected(const std::string &name)
void setVerbose(int verbose)
probability limits for warnings, errors
static std::string getAlgoName()
static std::string getAlgoName()
get algorithm name
void set_S_fail(double S)
void setNoisy(bool noisy)
QCriterion(std::string qtname)
void setNumNeighborsY(unsigned ncy)
std::vector< DQMChannel > badChannels_
std::string getName() const
get name of quality test
static const int STATUS_OK
ContentsYRange(const std::string &name)
void setXMin(unsigned xMin)
static std::string getAlgoName()
void setMeanTolerance(float fracTolerance)
set (fractional) tolerance for mean
void setThreshold(double ymin)
set Ymin (inclusive) threshold for "dead" channel (default: 0)
void set_S_fail(double S)
void setNumXblocks(unsigned ncx)
void setAverage(float average)
void setToleranceDead(float factorDead)
virtual void setAllowedYRange(double ymin, double ymax)
static std::string getAlgoName()
void reset(double vett[256])
void set_S_pass(double S)
unsigned int useEmptyBins_
float warningProb_
message attached to test
static std::string getAlgoName()
static const float WARNING_PROB_THRESHOLD
default "probability" values for setting warnings & errors when running tests
static std::string getAlgoName()
static std::string getAlgoName()