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