CMS 3D CMS Logo

QTest.h
Go to the documentation of this file.
1 #ifndef DQMSERVICES_CORE_Q_CRITERION_H
2 #define DQMSERVICES_CORE_Q_CRITERION_H
3 
5 #include "TProfile2D.h"
6 #include "TProfile.h"
7 #include "TH2F.h"
8 #include "TH1F.h"
9 #include <sstream>
10 #include <string>
11 #include <map>
12 #include <utility>
13 
14 //#include "DQMServices/Core/interface/DQMStore.h"
15 
18 
31 class QCriterion {
33 
34 public:
37  int getStatus() const { return status_; }
39  std::string getMessage() const { return message_; }
41  std::string getName() const { return qtname_; }
43  std::string algoName() const { return algoName_; }
45  void setWarningProb(float prob) { warningProb_ = prob; }
46  void setErrorProb(float prob) { errorProb_ = prob; }
49  virtual std::vector<DQMChannel> getBadChannels() const { return std::vector<DQMChannel>(); }
50 
52  qtname_ = std::move(qtname);
53  init();
54  }
56  void init();
57 
58  virtual ~QCriterion() = default;
59 
61  static const float WARNING_PROB_THRESHOLD;
62  static const float ERROR_PROB_THRESHOLD;
63 
64  float runTest(const MonitorElement *me, QReport &qr, DQMNet::QValue &qv) {
65  assert(qv.qtname == qtname_);
66 
67  prob_ = runTest(me); // this runTest goes to SimpleTest derivates
68 
69  if (prob_ < errorProb_)
71  else if (prob_ < warningProb_)
73  else
75 
76  setMessage(); // this goes to SimpleTest derivates
77 
78  if (verbose_ == 2)
79  std::cout << " Message = " << message_ << std::endl;
80  if (verbose_ == 2)
81  std::cout << " Name = " << qtname_ << " / Algorithm = " << algoName_ << " / Status = " << status_
82  << " / Prob = " << prob_ << std::endl;
83 
84  qv.code = status_;
85  qv.message = message_;
86  qv.qtname = qtname_;
87  qv.algorithm = algoName_;
88  qv.qtresult = prob_;
90 
91  return prob_;
92  }
93 
94 protected:
97 
98  virtual float runTest(const MonitorElement *me);
99 
101  virtual void setMessage() = 0;
102 
105  float prob_;
106  int status_;
110  int verbose_;
111 
112 private:
116 };
117 
121 
122 class SimpleTest : public QCriterion {
123 public:
124  SimpleTest(const std::string &name, bool keepBadChannels = false)
125  : QCriterion(name), minEntries_(0), keepBadChannels_(keepBadChannels) {}
126 
128  void setMinimumEntries(unsigned n) { minEntries_ = n; }
130  std::vector<DQMChannel> getBadChannels() const override {
132  }
133 
134 protected:
136  void setMessage() override { message_.clear(); }
137 
138  unsigned minEntries_; //< minimum # of entries needed
139  std::vector<DQMChannel> badChannels_;
141 };
142 
143 //===============================================================//
144 //========= Classes for particular QUALITY TESTS ================//
145 //===============================================================//
146 
147 //==================== ContentsXRange =========================//
148 //== Check that histogram contents are between [Xmin, Xmax] ==//
149 class ContentsXRange : public SimpleTest {
150 public:
152  rangeInitialized_ = false;
154  }
155  static std::string getAlgoName() { return "ContentsXRange"; }
156  float runTest(const MonitorElement *me) override;
157 
159  virtual void setAllowedXRange(double xmin, double xmax) {
160  xmin_ = xmin;
161  xmax_ = xmax;
162  rangeInitialized_ = true;
163  }
164 
165 protected:
166  double xmin_;
167  double xmax_;
169 };
170 
171 //==================== ContentsYRange =========================//
172 //== Check that histogram contents are between [Ymin, Ymax] ==//
173 class ContentsYRange : public SimpleTest {
174 public:
176  rangeInitialized_ = false;
178  }
179  static std::string getAlgoName() { return "ContentsYRange"; }
180  float runTest(const MonitorElement *me) override;
181 
182  void setUseEmptyBins(unsigned int useEmptyBins) { useEmptyBins_ = useEmptyBins; }
183  virtual void setAllowedYRange(double ymin, double ymax) {
184  ymin_ = ymin;
185  ymax_ = ymax;
186  rangeInitialized_ = true;
187  }
188 
189 protected:
190  double ymin_;
191  double ymax_;
193  unsigned int useEmptyBins_;
194 };
195 
196 //============================== DeadChannel =================================//
198 class DeadChannel : public SimpleTest {
199 public:
201  rangeInitialized_ = false;
203  }
204  static std::string getAlgoName() { return "DeadChannel"; }
205  float runTest(const MonitorElement *me) override;
206 
208  void setThreshold(double ymin) {
209  ymin_ = ymin;
210  rangeInitialized_ = true;
211  }
212 
213 protected:
214  double ymin_;
216 };
217 
218 //==================== NoisyChannel =========================//
220 class NoisyChannel : public SimpleTest {
221 public:
223  rangeInitialized_ = false;
224  numNeighbors_ = 1;
226  }
227  static std::string getAlgoName() { return "NoisyChannel"; }
228  float runTest(const MonitorElement *me) override;
229 
237  void setNumNeighbors(unsigned n) {
238  if (n > 0)
239  numNeighbors_ = n;
240  }
241 
246  void setTolerance(float percentage) {
247  if (percentage >= 0) {
248  tolerance_ = percentage;
249  rangeInitialized_ = true;
250  }
251  }
252 
253 protected:
256  double getAverage(int bin, const TH1 *h) const;
257  double getAverage2D(int binX, int binY, const TH2 *h) const;
258 
259  float tolerance_; /*< tolerance for considering a channel noisy */
260  unsigned numNeighbors_; /*< # of neighboring channels for calculating average to be used
261  for comparison with channel under consideration */
262  bool rangeInitialized_; /*< init-flag for tolerance */
263 };
264 
265 //===============ContentSigma (Emma Yeager and Chad Freer)=====================//
267 class ContentSigma : public SimpleTest {
268 public:
270  rangeInitialized_ = false;
271  numXblocks_ = 1;
272  numYblocks_ = 1;
273  numNeighborsX_ = 1;
274  numNeighborsY_ = 1;
276  }
277  static std::string getAlgoName() { return "ContentSigma"; }
278 
279  float runTest(const MonitorElement *me) override;
287  void setNumXblocks(unsigned ncx) {
288  if (ncx > 0)
289  numXblocks_ = ncx;
290  }
291  void setNumYblocks(unsigned ncy) {
292  if (ncy > 0)
293  numYblocks_ = ncy;
294  }
295  void setNumNeighborsX(unsigned ncx) {
296  if (ncx > 0)
297  numNeighborsX_ = ncx;
298  }
299  void setNumNeighborsY(unsigned ncy) {
300  if (ncy > 0)
301  numNeighborsY_ = ncy;
302  }
303 
307  void setToleranceNoisy(float factorNoisy) {
308  if (factorNoisy >= 0) {
309  toleranceNoisy_ = factorNoisy;
310  rangeInitialized_ = true;
311  }
312  }
313  void setToleranceDead(float factorDead) {
314  if (factorDead >= 0) {
315  toleranceDead_ = factorDead;
316  rangeInitialized_ = true;
317  }
318  }
319  void setNoisy(bool noisy) { noisy_ = noisy; }
320  void setDead(bool dead) { dead_ = dead; }
321 
322  void setXMin(unsigned xMin) { xMin_ = xMin; }
323  void setXMax(unsigned xMax) { xMax_ = xMax; }
324  void setYMin(unsigned yMin) { yMin_ = yMin; }
325  void setYMax(unsigned yMax) { yMax_ = yMax; }
326 
327 protected:
329  // double getNeighborSum(int binX, int binY, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const;
330  double getNeighborSum(unsigned groupx,
331  unsigned groupy,
332  unsigned Xblocks,
333  unsigned Yblocks,
334  unsigned neighborsX,
335  unsigned neighborsY,
336  const TH1 *h) const;
337  double getNeighborSigma(double average,
338  unsigned groupx,
339  unsigned groupy,
340  unsigned Xblocks,
341  unsigned Yblocks,
342  unsigned neighborsX,
343  unsigned neighborsY,
344  const TH1 *h) const;
345 
346  bool noisy_;
347  bool dead_; /*< declare if test will be checking for noisy channels, dead channels, or both */
348  float toleranceNoisy_; /*< factor by which sigma is compared for noisy channels */
349  float toleranceDead_; /*< factor by which sigma is compared for dead channels*/
350  unsigned numXblocks_;
351  unsigned numYblocks_;
352  unsigned numNeighborsX_; /*< # of neighboring channels along x-axis for calculating average to be used
353  for comparison with channel under consideration */
354  unsigned numNeighborsY_; /*< # of neighboring channels along y-axis for calculating average to be used
355  for comparison with channel under consideration */
356  bool rangeInitialized_; /*< init-flag for tolerance */
357  unsigned xMin_;
358  unsigned xMax_;
359  unsigned yMin_;
360  unsigned yMax_;
361 };
362 
363 //==================== ContentsWithinExpected =========================//
364 // Check that every TH2 channel has mean, RMS within allowed range.
366 public:
368  checkMean_ = checkRMS_ = false;
369  minMean_ = maxMean_ = minRMS_ = maxRMS_ = 0.0;
370  checkMeanTolerance_ = false;
371  toleranceMean_ = -1.0;
373  }
374  static std::string getAlgoName() { return "ContentsWithinExpected"; }
375  float runTest(const MonitorElement *me) override;
376 
377  void setUseEmptyBins(unsigned int useEmptyBins) { useEmptyBins_ = useEmptyBins; }
378  void setMeanRange(double xmin, double xmax);
379  void setRMSRange(double xmin, double xmax);
380 
382  void setMeanTolerance(float fracTolerance) {
383  if (fracTolerance >= 0.0) {
384  toleranceMean_ = fracTolerance;
385  checkMeanTolerance_ = true;
386  }
387  }
388 
389 protected:
390  bool checkMean_; //< if true, check the mean value
391  bool checkRMS_; //< if true, check the RMS value
392  bool checkMeanTolerance_; //< if true, check mean tolerance
393  float toleranceMean_; //< fractional tolerance on mean (use only if checkMeanTolerance_ = true)
394  float minMean_, maxMean_; //< allowed range for mean (use only if checkMean_ = true)
395  float minRMS_, maxRMS_; //< allowed range for mean (use only if checkRMS_ = true)
396  unsigned int useEmptyBins_;
397 };
398 
399 //==================== MeanWithinExpected =========================//
402 public:
404  static std::string getAlgoName() { return "MeanWithinExpected"; }
405  float runTest(const MonitorElement *me) override;
406 
407  void setExpectedMean(double mean) { expMean_ = mean; }
408  void useRange(double xmin, double xmax);
409  void useSigma(double expectedSigma);
410  void useRMS();
411 
412 protected:
413  bool useRMS_; //< if true, will use RMS of distribution
414  bool useSigma_; //< if true, will use expected_sigma
415  bool useRange_; //< if true, will use allowed range
416  double sigma_; //< sigma to be used in probability calculation (use only if useSigma_ = true)
417  double expMean_; //< expected mean value (used only if useSigma_ = true or useRMS_ = true)
418  double xmin_, xmax_; //< allowed range for mean (use only if useRange_ = true)
419 };
420 
421 //==================== AllContentWithinFixedRange =========================//
422 /*class AllContentWithinFixedRange : public SimpleTest
423 {
424 public:
425  AllContentWithinFixedRange(const std::string &name) : SimpleTest(name)
426  {
427  setAlgoName(getAlgoName());
428  }
429  static std::string getAlgoName(void) { return "RuleAllContentWithinFixedRange"; }
430  float runTest(const MonitorElement *me);
431 
432  void set_x_min(double x) { x_min = x; }
433  void set_x_max(double x) { x_max = x; }
434  void set_epsilon_max(double epsilon) { epsilon_max = epsilon; }
435  void set_S_fail(double S) { S_fail = S; }
436  void set_S_pass(double S) { S_pass = S; }
437  double get_epsilon_obs(void) { return epsilon_obs; }
438  double get_S_fail_obs(void) { return S_fail_obs; }
439  double get_S_pass_obs(void) { return S_pass_obs; }
440  int get_result(void) { return result; }
441 
442 protected:
443  TH1F *histogram ; //define Test histo
444  double x_min, x_max;
445  double epsilon_max;
446  double S_fail, S_pass;
447  double epsilon_obs;
448  double S_fail_obs, S_pass_obs;
449  int result;
450 };
451 */
452 //==================== AllContentWithinFloatingRange =========================//
453 /*class AllContentWithinFloatingRange : public SimpleTest
454 {
455 public:
456  AllContentWithinFloatingRange(const std::string &name) : SimpleTest(name)
457  {
458  setAlgoName(getAlgoName());
459  }
460  static std::string getAlgoName(void) { return "RuleAllContentWithinFloatingRange"; }
461 
462  void set_Nrange(int N) { Nrange = N; }
463  void set_epsilon_max(double epsilon) { epsilon_max = epsilon; }
464  void set_S_fail(double S) { S_fail = S; }
465  void set_S_pass(double S) { S_pass = S; }
466  double get_epsilon_obs(void) { return epsilon_obs; }
467  double get_S_fail_obs(void) { return S_fail_obs; }
468  double get_S_pass_obs(void) { return S_pass_obs; }
469  int get_result(void) { return result; }
470 
471  float runTest(const MonitorElement *me );
472 
473 protected:
474  TH1F *histogram ; //define Test histo
475  int Nrange;
476  double epsilon_max;
477  double S_fail, S_pass;
478  double epsilon_obs;
479  double S_fail_obs, S_pass_obs;
480  int result;
481 };*/
482 
483 //==================== FlatOccupancy1d =========================//
484 #if 0 // FIXME: need to know what parameters to set before runTest!
485 class FlatOccupancy1d : public SimpleTest
486 {
487 public:
488  FlatOccupancy1d(const std::string &name) : SimpleTest(name)
489  {
490  Nbins = 0;
491  FailedBins[0] = 0;
492  FailedBins[1] = 0;
493  setAlgoName(getAlgoName());
494  }
495 
496  ~FlatOccupancy1d(void)
497  {
498  delete [] FailedBins[0];
499  delete [] FailedBins[1];
500  }
501 
502  static std::string getAlgoName(void) { return "RuleFlatOccupancy1d"; }
503 
504  void set_ExclusionMask(double *mask) { ExclusionMask = mask; }
505  void set_epsilon_min(double epsilon) { epsilon_min = epsilon; }
506  void set_epsilon_max(double epsilon) { epsilon_max = epsilon; }
507  void set_S_fail(double S) { S_fail = S; }
508  void set_S_pass(double S) { S_pass = S; }
509  double get_FailedBins(void) { return *FailedBins[1]; } // FIXME: WRONG! OFF BY ONE!?
510  int get_result() { return result; }
511 
512  float runTest(const MonitorElement*me);
513 
514 protected:
515  double *ExclusionMask;
516  double epsilon_min, epsilon_max;
517  double S_fail, S_pass;
518  double *FailedBins[2];
519  int Nbins;
520  int result;
521 };
522 #endif
523 
524 //==================== FixedFlatOccupancy1d =========================//
526 public:
528  Nbins = 0;
529  FailedBins[0] = nullptr;
530  FailedBins[1] = nullptr;
532  }
533 
535  if (Nbins > 0) {
536  delete[] FailedBins[0];
537  delete[] FailedBins[1];
538  }
539  }
540 
541  static std::string getAlgoName() { return "RuleFixedFlatOccupancy1d"; }
542 
543  void set_Occupancy(double level) { b = level; }
547  void set_S_fail(double S) { S_fail = S; }
548  void set_S_pass(double S) { S_pass = S; }
549  double get_FailedBins() { return *FailedBins[1]; } // FIXME: WRONG! OFF BY ONE!?
550  int get_result() { return result; }
551 
552  float runTest(const MonitorElement *me) override;
553 
554 protected:
555  double b;
556  double *ExclusionMask;
558  double S_fail, S_pass;
559  double *FailedBins[2];
560  int Nbins;
561  int result;
562 };
563 
564 //==================== CSC01 =========================//
565 class CSC01 : public SimpleTest {
566 public:
568  static std::string getAlgoName() { return "RuleCSC01"; }
569 
571  void set_S_fail(double S) { S_fail = S; }
572  void set_S_pass(double S) { S_pass = S; }
573  double get_epsilon_obs() { return epsilon_obs; }
574  double get_S_fail_obs() { return S_fail_obs; }
575  double get_S_pass_obs() { return S_pass_obs; }
576  int get_result() { return result; }
577 
578  float runTest(const MonitorElement *me) override;
579 
580 protected:
581  double epsilon_max;
582  double S_fail, S_pass;
583  double epsilon_obs;
585  int result;
586 };
587 
588 //======================== CompareToMedian ====================//
589 class CompareToMedian : public SimpleTest {
590 public:
591  //Initialize for TProfile, colRings
593  this->_min = 0.2;
594  this->_max = 3.0;
595  this->_emptyBins = 0;
596  this->_maxMed = 10;
597  this->_minMed = 0;
598  this->nBins = 0;
599  this->_statCut = 0;
600  reset();
602  };
603 
604  ~CompareToMedian() override = default;
605  ;
606 
607  static std::string getAlgoName() { return "CompareToMedian"; }
608 
609  float runTest(const MonitorElement *me) override;
610  void setMin(float min) { _min = min; };
611  void setMax(float max) { _max = max; };
612  void setEmptyBins(int eB) { eB > 0 ? _emptyBins = 1 : _emptyBins = 0; };
613  void setMaxMedian(float max) { _maxMed = max; };
614  void setMinMedian(float min) { _minMed = min; };
615  void setStatCut(float cut) { _statCut = (cut > 0) ? cut : 0; };
616 
617 protected:
618  void setMessage() override {
619  std::ostringstream message;
620  message << "Test " << qtname_ << " (" << algoName_ << "): Entry fraction within range = " << prob_;
621  message_ = message.str();
622  }
623 
624 private:
625  float _min, _max; //Test values
626  int _emptyBins; //use empty bins
627  float _maxMed, _minMed; //Global max for median&mean
628  float _statCut; //Minimal number of non zero entries needed for the quality test
629 
630  int nBinsX, nBinsY; //Dimensions of hystogram
631 
632  int nBins; //Number of (non empty) bins
633 
634  //Vector contain bin values
635  std::vector<float> binValues;
636 
637  void reset() { binValues.clear(); };
638 };
639 //======================== CompareLastFilledBin ====================//
641 public:
642  //Initialize for TProfile, colRings
644  this->_min = 0.0;
645  this->_max = 1.0;
646  this->_average = 0.0;
648  };
649 
650  ~CompareLastFilledBin() override = default;
651  ;
652 
653  static std::string getAlgoName() { return "CompareLastFilledBin"; }
654 
655  float runTest(const MonitorElement *me) override;
656  void setAverage(float average) { _average = average; };
657  void setMin(float min) { _min = min; };
658  void setMax(float max) { _max = max; };
659 
660 protected:
661  void setMessage() override {
662  std::ostringstream message;
663  message << "Test " << qtname_ << " (" << algoName_ << "): Last Bin filled with desired value = " << prob_;
664  message_ = message.str();
665  }
666 
667 private:
668  float _min, _max; //Test values
669  float _average;
670 };
671 
672 //==================== AllContentAlongDiagonal =========================//
673 #if 0 // FIXME: need to know what parameters to set before runTest!
674 class AllContentAlongDiagonal : public SimpleTest
675 
676 public:
677  AllContentAlongDiagonal(const std::string &name) : SimpleTest(name)
678  {
679  setAlgoName(getAlgoName());
680  }
681  static std::string getAlgoName(void) { return "RuleAllContentAlongDiagonal"; }
682 
683  void set_epsilon_max(double epsilon) { epsilon_max = epsilon; }
684  void set_S_fail(double S) { S_fail = S; }
685  void set_S_pass(double S) { S_pass = S; }
686  double get_epsilon_obs() { return epsilon_obs; }
687  double get_S_fail_obs() { return S_fail_obs; }
688  double get_S_pass_obs() { return S_pass_obs; }
689  int get_result() { return result; }
690 
691  //public:
692  //using SimpleTest::runTest;
693  float runTest(const MonitorElement*me);
694 
695 protected:
696  double epsilon_max;
697  double S_fail, S_pass;
698  double epsilon_obs;
699  double S_fail_obs, S_pass_obs;
700  int result;
701 };
702 #endif
703 //==================== CheckVariance =========================//
704 //== Check the variance of a TProfile//
705 class CheckVariance : public SimpleTest {
706 public:
709  static std::string getAlgoName() { return "CheckVariance"; }
710  float runTest(const MonitorElement *me) override;
711 };
712 #endif // DQMSERVICES_CORE_Q_CRITERION_H
void setErrorProb(float prob)
Definition: QTest.h:46
MonitorElementData::QReport::DQMChannel DQMChannel
Definition: QTest.h:16
void set_epsilon_min(double epsilon)
Definition: QTest.h:545
void setStatCut(float cut)
Definition: QTest.h:615
double get_S_pass_obs()
Definition: QTest.h:575
void setDead(bool dead)
Definition: QTest.h:320
double xmin_
Definition: QTest.h:418
unsigned numYblocks_
Definition: QTest.h:351
void setAlgoName(std::string name)
set algorithm name
Definition: QTest.h:96
std::string getName() const
get name of quality test
Definition: QTest.h:41
test that histogram contents are above Ymin
Definition: QTest.h:198
double epsilon_max
Definition: QTest.h:557
double ymin_
ymin - threshold
Definition: QTest.h:214
double epsilon_max
Definition: QTest.h:581
CSC01(const std::string &name)
Definition: QTest.h:567
SimpleTest(const std::string &name, bool keepBadChannels=false)
Definition: QTest.h:124
void set_ExclusionMask(double *mask)
Definition: QTest.h:544
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:182
void setMin(float min)
Definition: QTest.h:610
double epsilon_obs
Definition: QTest.h:583
double get_FailedBins()
Definition: QTest.h:549
int verbose_
Definition: QTest.h:110
void setXMax(unsigned xMax)
Definition: QTest.h:323
float _statCut
Definition: QTest.h:628
bool verbose
int status_
Definition: QTest.h:106
virtual void setAllowedXRange(double xmin, double xmax)
set allowed range in X-axis (default values: histogram&#39;s X-range)
Definition: QTest.h:159
void setMessage() override
set status & message after test has run
Definition: QTest.h:136
double getAverage(int bin, const TH1 *h) const
Definition: QTest.cc:375
float runTest(const MonitorElement *me, QReport &qr, DQMNet::QValue &qv)
Definition: QTest.h:64
double * ExclusionMask
Definition: QTest.h:556
unsigned yMax_
Definition: QTest.h:360
std::string algoName_
name of quality test
Definition: QTest.h:104
static const int WARNING
double getAverage2D(int binX, int binY, const TH2 *h) const
Definition: QTest.cc:412
int get_result()
Definition: QTest.h:576
void setRMSRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1058
void useSigma(double expectedSigma)
Definition: QTest.cc:1151
double S_pass
Definition: QTest.h:582
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1081
virtual ~QCriterion()=default
int _emptyBins
Definition: QTest.h:626
double S_pass_obs
Definition: QTest.h:584
assert(be >=bs)
void setMax(float max)
Definition: QTest.h:611
float runTest(const MonitorElement *me) override
Definition: QTest.cc:863
void setMin(float min)
Definition: QTest.h:657
constexpr uint32_t mask
Definition: gpuClustering.h:26
double xmax_
Definition: QTest.h:418
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1357
std::string qtname_
Definition: QTest.h:103
void setNumNeighbors(unsigned n)
Definition: QTest.h:237
void init()
initialize values
Definition: QTest.cc:15
Algorithm for testing if histogram&#39;s mean value is near expected value.
Definition: QTest.h:401
~CompareLastFilledBin() override=default
CheckVariance(const std::string &name)
Definition: QTest.h:707
DeadChannel(const std::string &name)
Definition: QTest.h:200
ContentsXRange(const std::string &name)
Definition: QTest.h:151
Check if any channels are noisy compared to neighboring ones.
Definition: QTest.h:220
ContentSigma(const std::string &name)
Definition: QTest.h:269
double epsilon_min
Definition: QTest.h:557
static std::string getAlgoName()
Definition: QTest.h:607
bool rangeInitialized_
Definition: QTest.h:168
double getNeighborSigma(double average, unsigned groupx, unsigned groupy, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const
Definition: QTest.cc:775
float runTest(const MonitorElement *me) override
float errorProb_
Definition: QTest.h:108
void setYMax(unsigned yMax)
Definition: QTest.h:325
double get_S_fail_obs()
Definition: QTest.h:574
int getStatus() const
get test status
Definition: QTest.h:37
static std::string getAlgoName()
Definition: QTest.h:404
double S_fail_obs
Definition: QTest.h:584
float runTest(const MonitorElement *me) override
float _minMed
Definition: QTest.h:627
FixedFlatOccupancy1d(const std::string &name)
Definition: QTest.h:527
void setYMin(unsigned yMin)
Definition: QTest.h:324
void setEmptyBins(int eB)
Definition: QTest.h:612
void set_Occupancy(double level)
Definition: QTest.h:543
void set_epsilon_max(double epsilon)
Definition: QTest.h:570
float _maxMed
Definition: QTest.h:627
float prob_
name of algorithm
Definition: QTest.h:105
dqm::legacy::MonitorElement MonitorElement
(class should be created by DQMStore class)
Definition: QTest.h:35
static std::string getAlgoName()
Definition: QTest.h:155
unsigned numXblocks_
Definition: QTest.h:350
CompareLastFilledBin(const std::string &name)
Definition: QTest.h:643
static const float ERROR_PROB_THRESHOLD
Definition: QTest.h:62
void setTolerance(float percentage)
Definition: QTest.h:246
void setMessage() override
set status & message after test has run
Definition: QTest.h:661
double xmax_
Definition: QTest.h:167
unsigned int useEmptyBins_
Definition: QTest.h:396
float runTest(const MonitorElement *me) override
Definition: QTest.cc:263
void setMinimumEntries(unsigned n)
set minimum # of entries needed
Definition: QTest.h:128
float toleranceNoisy_
Definition: QTest.h:348
double S_fail
Definition: QTest.h:582
void reset()
Definition: QTest.h:637
bool checkMeanTolerance_
Definition: QTest.h:392
ContentsWithinExpected(const std::string &name)
Definition: QTest.h:367
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1304
void setBadChannels(std::vector< DQMChannel > badChannels)
void setExpectedMean(double mean)
Definition: QTest.h:407
bool keepBadChannels_
Definition: QTest.h:140
double xmin_
Definition: QTest.h:166
bool rangeInitialized_
Definition: QTest.h:356
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:377
double sigma_
Definition: QTest.h:416
void setMaxMedian(float max)
Definition: QTest.h:613
std::string message_
quality test status
Definition: QTest.h:107
int result
Definition: QTest.h:585
unsigned numNeighborsY_
Definition: QTest.h:354
void useRange(double xmin, double xmax)
Definition: QTest.cc:1141
void set_epsilon_max(double epsilon)
Definition: QTest.h:546
void setNumNeighborsX(unsigned ncx)
Definition: QTest.h:295
bool dead_
Definition: QTest.h:347
std::vector< float > binValues
Definition: QTest.h:635
void setToleranceNoisy(float factorNoisy)
Definition: QTest.h:307
Check the sigma of each bin against the rest of the chamber by a factor of tolerance/.
Definition: QTest.h:267
double * FailedBins[2]
Definition: QTest.h:559
MonitorElementData::QReport QReport
Definition: QTest.h:17
void setMessage() override
set status & message after test has run
Definition: QTest.h:618
float toleranceDead_
Definition: QTest.h:349
static std::string getAlgoName()
Definition: QTest.h:374
unsigned numNeighborsX_
Definition: QTest.h:352
NoisyChannel(const std::string &name)
Definition: QTest.h:222
CompareToMedian(const std::string &name)
Definition: QTest.h:592
virtual void setMessage()=0
set message after test has run
unsigned yMin_
Definition: QTest.h:359
float runTest(const MonitorElement *me) override
Definition: QTest.cc:32
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1177
~FixedFlatOccupancy1d() override
Definition: QTest.h:534
float runTest(const MonitorElement *me) override
Definition: QTest.cc:488
double ymin_
Definition: QTest.h:190
void set_S_pass(double S)
Definition: QTest.h:548
std::vector< DQMChannel > badChannels_
Definition: QTest.h:139
void setNumYblocks(unsigned ncy)
Definition: QTest.h:291
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:45
std::vector< DQMChannel > getBadChannels() const override
get vector of channels that failed test (not always relevant!)
Definition: QTest.h:130
static std::string getAlgoName()
Definition: QTest.h:204
MeanWithinExpected(const std::string &name)
Definition: QTest.h:403
double get_epsilon_obs()
Definition: QTest.h:573
float tolerance_
Definition: QTest.h:259
void setVerbose(int verbose)
probability limits for warnings, errors
Definition: QTest.h:109
unsigned xMin_
Definition: QTest.h:357
void setMax(float max)
Definition: QTest.h:658
void setMeanRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1047
static std::string getAlgoName()
Definition: QTest.h:541
float _max
Definition: QTest.h:625
static std::string getAlgoName()
get algorithm name
Definition: QTest.h:709
void set_S_fail(double S)
Definition: QTest.h:547
float runTest(const MonitorElement *me) override
Definition: QTest.cc:162
bool rangeInitialized_
Definition: QTest.h:192
double expMean_
Definition: QTest.h:417
void setNoisy(bool noisy)
Definition: QTest.h:319
QCriterion(std::string qtname)
Definition: QTest.h:51
void setNumNeighborsY(unsigned ncy)
Definition: QTest.h:299
~CompareToMedian() override=default
static const int STATUS_OK
double getNeighborSum(unsigned groupx, unsigned groupy, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const
for each bin get sum of the surrounding neighbors
Definition: QTest.cc:695
ContentsYRange(const std::string &name)
Definition: QTest.h:175
unsigned minEntries_
Definition: QTest.h:138
float runTest(const MonitorElement *me) override
Definition: QTest.cc:94
void setXMin(unsigned xMin)
Definition: QTest.h:322
static std::string getAlgoName()
Definition: QTest.h:277
void setMeanTolerance(float fracTolerance)
set (fractional) tolerance for mean
Definition: QTest.h:382
void setThreshold(double ymin)
set Ymin (inclusive) threshold for "dead" channel (default: 0)
Definition: QTest.h:208
void set_S_fail(double S)
Definition: QTest.h:571
void setNumXblocks(unsigned ncx)
Definition: QTest.h:287
bool rangeInitialized_
Definition: QTest.h:215
void setAverage(float average)
Definition: QTest.h:656
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void setToleranceDead(float factorDead)
Definition: QTest.h:313
virtual void setAllowedYRange(double ymin, double ymax)
Definition: QTest.h:183
static std::string getAlgoName()
Definition: QTest.h:568
unsigned xMax_
Definition: QTest.h:358
void set_S_pass(double S)
Definition: QTest.h:572
bool noisy_
Definition: QTest.h:346
unsigned int useEmptyBins_
Definition: QTest.h:193
virtual std::vector< DQMChannel > getBadChannels() const
Definition: QTest.h:49
float warningProb_
message attached to test
Definition: QTest.h:108
bool rangeInitialized_
Definition: QTest.h:262
Definition: QTest.h:565
std::string getMessage() const
get message attached to test
Definition: QTest.h:39
def move(src, dest)
Definition: eostools.py:511
float _min
Definition: QTest.h:625
static const int ERROR
double ymax_
Definition: QTest.h:191
std::string algoName() const
get algorithm name
Definition: QTest.h:43
static std::string getAlgoName()
Definition: QTest.h:227
void setMinMedian(float min)
Definition: QTest.h:614
static const float WARNING_PROB_THRESHOLD
default "probability" values for setting warnings & errors when running tests
Definition: QTest.h:61
unsigned numNeighbors_
Definition: QTest.h:260
static std::string getAlgoName()
Definition: QTest.h:179
static std::string getAlgoName()
Definition: QTest.h:653