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; }
544  void set_ExclusionMask(double *mask) { ExclusionMask = mask; }
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
ContentSigma::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:277
ContentsWithinExpected::toleranceMean_
float toleranceMean_
Definition: QTest.h:393
personalPlayback.level
level
Definition: personalPlayback.py:22
ContentsWithinExpected
Definition: QTest.h:365
CheckVariance::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1357
ContentsWithinExpected::useEmptyBins_
unsigned int useEmptyBins_
Definition: QTest.h:396
CompareLastFilledBin
Definition: QTest.h:640
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
ContentsWithinExpected::checkMeanTolerance_
bool checkMeanTolerance_
Definition: QTest.h:392
ContentsXRange::xmin_
double xmin_
Definition: QTest.h:166
FixedFlatOccupancy1d::ExclusionMask
double * ExclusionMask
Definition: QTest.h:556
CompareLastFilledBin::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:653
MeanWithinExpected
Algorithm for testing if histogram's mean value is near expected value.
Definition: QTest.h:401
NoisyChannel::setTolerance
void setTolerance(float percentage)
Definition: QTest.h:246
ContentsWithinExpected::ContentsWithinExpected
ContentsWithinExpected(const std::string &name)
Definition: QTest.h:367
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CSC01::epsilon_obs
double epsilon_obs
Definition: QTest.h:583
ContentsYRange::setAllowedYRange
virtual void setAllowedYRange(double ymin, double ymax)
Definition: QTest.h:183
QCriterion::getStatus
int getStatus() const
get test status
Definition: QTest.h:37
ContentSigma::xMin_
unsigned xMin_
Definition: QTest.h:357
QCriterion::QCriterion
QCriterion(std::string qtname)
Definition: QTest.h:51
SimpleTest::minEntries_
unsigned minEntries_
Definition: QTest.h:138
QCriterion::init
void init()
initialize values
Definition: QTest.cc:15
ContentsWithinExpected::setUseEmptyBins
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:377
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
ContentSigma::yMax_
unsigned yMax_
Definition: QTest.h:360
NoisyChannel::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:227
FixedFlatOccupancy1d::epsilon_max
double epsilon_max
Definition: QTest.h:557
SimpleTest
Definition: QTest.h:122
ContentSigma::setNumNeighborsX
void setNumNeighborsX(unsigned ncx)
Definition: QTest.h:295
MeanWithinExpected::setExpectedMean
void setExpectedMean(double mean)
Definition: QTest.h:407
CompareToMedian::setMaxMedian
void setMaxMedian(float max)
Definition: QTest.h:613
MeanWithinExpected::useSigma
void useSigma(double expectedSigma)
Definition: QTest.cc:1151
min
T min(T a, T b)
Definition: MathUtil.h:58
CompareToMedian::binValues
std::vector< float > binValues
Definition: QTest.h:635
CSC01::epsilon_max
double epsilon_max
Definition: QTest.h:581
gather_cfg.cout
cout
Definition: gather_cfg.py:144
QCriterion::errorProb_
float errorProb_
Definition: QTest.h:108
ContentSigma::noisy_
bool noisy_
Definition: QTest.h:346
CompareToMedian::_emptyBins
int _emptyBins
Definition: QTest.h:626
dqm::qstatus::WARNING
static const int WARNING
Definition: MonitorElement.h:53
CompareToMedian::setEmptyBins
void setEmptyBins(int eB)
Definition: QTest.h:612
ContentSigma::numNeighborsY_
unsigned numNeighborsY_
Definition: QTest.h:354
ContentsYRange::ContentsYRange
ContentsYRange(const std::string &name)
Definition: QTest.h:175
QCriterion::getBadChannels
virtual std::vector< DQMChannel > getBadChannels() const
Definition: QTest.h:49
cms::cuda::assert
assert(be >=bs)
ContentsWithinExpected::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:374
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
MonitorElementData::QReport::QValue::qtresult
float qtresult
Definition: MonitorElementCollection.h:59
CheckVariance::CheckVariance
CheckVariance(const std::string &name)
Definition: QTest.h:707
ContentSigma::setYMin
void setYMin(unsigned yMin)
Definition: QTest.h:324
photonAnalyzer_cfi.yMin
yMin
Definition: photonAnalyzer_cfi.py:86
DeadChannel::ymin_
double ymin_
ymin - threshold
Definition: QTest.h:214
FixedFlatOccupancy1d::epsilon_min
double epsilon_min
Definition: QTest.h:557
ContentSigma::setNoisy
void setNoisy(bool noisy)
Definition: QTest.h:319
MonitorElementData::QReport::setBadChannels
void setBadChannels(std::vector< DQMChannel > badChannels)
Definition: MonitorElementCollection.h:118
CompareLastFilledBin::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1304
MonitorElementData::QReport::QValue
Definition: MonitorElementCollection.h:57
NoisyChannel::tolerance_
float tolerance_
Definition: QTest.h:259
ContentsYRange::rangeInitialized_
bool rangeInitialized_
Definition: QTest.h:192
ContentSigma::numYblocks_
unsigned numYblocks_
Definition: QTest.h:351
ContentsXRange
Definition: QTest.h:149
CompareToMedian::setMinMedian
void setMinMedian(float min)
Definition: QTest.h:614
ContentSigma
Check the sigma of each bin against the rest of the chamber by a factor of tolerance/.
Definition: QTest.h:267
FixedFlatOccupancy1d::set_epsilon_min
void set_epsilon_min(double epsilon)
Definition: QTest.h:545
ContentSigma::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:488
CSC01::get_result
int get_result()
Definition: QTest.h:576
ContentsWithinExpected::maxRMS_
float maxRMS_
Definition: QTest.h:395
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
MonitorElementData::QReport::QValue::algorithm
std::string algorithm
Definition: MonitorElementCollection.h:62
QCriterion::getMessage
std::string getMessage() const
get message attached to test
Definition: QTest.h:39
MeanWithinExpected::useRMS
void useRMS()
Definition: QTest.cc:1161
CSC01::S_pass_obs
double S_pass_obs
Definition: QTest.h:584
ContentsWithinExpected::setMeanTolerance
void setMeanTolerance(float fracTolerance)
set (fractional) tolerance for mean
Definition: QTest.h:382
MeanWithinExpected::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:404
CompareLastFilledBin::CompareLastFilledBin
CompareLastFilledBin(const std::string &name)
Definition: QTest.h:643
photonAnalyzer_cfi.xMin
xMin
Definition: photonAnalyzer_cfi.py:82
DeadChannel::DeadChannel
DeadChannel(const std::string &name)
Definition: QTest.h:200
ContentsYRange::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:94
PDRates.average
average
Definition: PDRates.py:139
CompareLastFilledBin::setMessage
void setMessage() override
set status & message after test has run
Definition: QTest.h:661
FixedFlatOccupancy1d::set_Occupancy
void set_Occupancy(double level)
Definition: QTest.h:543
ContentSigma::getNeighborSum
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
QCriterion::algoName
std::string algoName() const
get algorithm name
Definition: QTest.h:43
ContentsWithinExpected::setMeanRange
void setMeanRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1047
SimpleTest::SimpleTest
SimpleTest(const std::string &name, bool keepBadChannels=false)
Definition: QTest.h:124
NoisyChannel::getAverage2D
double getAverage2D(int binX, int binY, const TH2 *h) const
Definition: QTest.cc:412
MeanWithinExpected::useRMS_
bool useRMS_
Definition: QTest.h:413
CompareLastFilledBin::setMin
void setMin(float min)
Definition: QTest.h:657
ContentSigma::setToleranceNoisy
void setToleranceNoisy(float factorNoisy)
Definition: QTest.h:307
CheckVariance
Definition: QTest.h:705
MeanWithinExpected::useSigma_
bool useSigma_
Definition: QTest.h:414
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
ContentsYRange::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:179
CompareToMedian::setStatCut
void setStatCut(float cut)
Definition: QTest.h:615
DeadChannel
test that histogram contents are above Ymin
Definition: QTest.h:198
CompareToMedian::CompareToMedian
CompareToMedian(const std::string &name)
Definition: QTest.h:592
QCriterion::verbose_
int verbose_
Definition: QTest.h:110
ContentSigma::yMin_
unsigned yMin_
Definition: QTest.h:359
CSC01::S_fail_obs
double S_fail_obs
Definition: QTest.h:584
ContentsXRange::rangeInitialized_
bool rangeInitialized_
Definition: QTest.h:168
CSC01::S_pass
double S_pass
Definition: QTest.h:582
NoisyChannel::setNumNeighbors
void setNumNeighbors(unsigned n)
Definition: QTest.h:237
FixedFlatOccupancy1d::get_result
int get_result()
Definition: QTest.h:550
CompareToMedian::~CompareToMedian
~CompareToMedian() override=default
ContentsWithinExpected::checkRMS_
bool checkRMS_
Definition: QTest.h:391
MeanWithinExpected::useRange_
bool useRange_
Definition: QTest.h:415
MonitorElementData::QReport::QValue::message
std::string message
Definition: MonitorElementCollection.h:60
CompareToMedian::setMin
void setMin(float min)
Definition: QTest.h:610
QCriterion::setAlgoName
void setAlgoName(std::string name)
set algorithm name
Definition: QTest.h:96
CompareLastFilledBin::~CompareLastFilledBin
~CompareLastFilledBin() override=default
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
ContentSigma::setXMin
void setXMin(unsigned xMin)
Definition: QTest.h:322
CompareLastFilledBin::setAverage
void setAverage(float average)
Definition: QTest.h:656
h
ContentsYRange::ymax_
double ymax_
Definition: QTest.h:191
FixedFlatOccupancy1d::set_S_pass
void set_S_pass(double S)
Definition: QTest.h:548
ContentSigma::numNeighborsX_
unsigned numNeighborsX_
Definition: QTest.h:352
FixedFlatOccupancy1d::result
int result
Definition: QTest.h:561
ContentsXRange::ContentsXRange
ContentsXRange(const std::string &name)
Definition: QTest.h:151
multiplicitycorr_cfi.yMax
yMax
Definition: multiplicitycorr_cfi.py:6
ContentSigma::numXblocks_
unsigned numXblocks_
Definition: QTest.h:350
QCriterion::setWarningProb
void setWarningProb(float prob)
set probability limit for warning and error (default: 90% and 50%)
Definition: QTest.h:45
CheckVariance::getAlgoName
static std::string getAlgoName()
get algorithm name
Definition: QTest.h:709
FixedFlatOccupancy1d::runTest
float runTest(const MonitorElement *me) override
FixedFlatOccupancy1d::FixedFlatOccupancy1d
FixedFlatOccupancy1d(const std::string &name)
Definition: QTest.h:527
ContentSigma::setToleranceDead
void setToleranceDead(float factorDead)
Definition: QTest.h:313
CSC01::get_S_fail_obs
double get_S_fail_obs()
Definition: QTest.h:574
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ContentsYRange::useEmptyBins_
unsigned int useEmptyBins_
Definition: QTest.h:193
ContentSigma::toleranceNoisy_
float toleranceNoisy_
Definition: QTest.h:348
MonitorElementData::QReport::QValue::code
int code
Definition: MonitorElementCollection.h:58
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
CompareToMedian::setMessage
void setMessage() override
set status & message after test has run
Definition: QTest.h:618
funct::true
true
Definition: Factorize.h:173
QCriterion::setVerbose
void setVerbose(int verbose)
probability limits for warnings, errors
Definition: QTest.h:109
CSC01::S_fail
double S_fail
Definition: QTest.h:582
SimpleTest::keepBadChannels_
bool keepBadChannels_
Definition: QTest.h:140
MonitorElement.h
ContentSigma::rangeInitialized_
bool rangeInitialized_
Definition: QTest.h:356
QCriterion::runTest
float runTest(const MonitorElement *me, QReport &qr, DQMNet::QValue &qv)
Definition: QTest.h:64
CompareLastFilledBin::_min
float _min
Definition: QTest.h:668
NoisyChannel::numNeighbors_
unsigned numNeighbors_
Definition: QTest.h:260
CSC01::set_epsilon_max
void set_epsilon_max(double epsilon)
Definition: QTest.h:570
CompareToMedian::reset
void reset()
Definition: QTest.h:637
MeanWithinExpected::useRange
void useRange(double xmin, double xmax)
Definition: QTest.cc:1141
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CSC01::result
int result
Definition: QTest.h:585
CSC01::runTest
float runTest(const MonitorElement *me) override
CompareToMedian::setMax
void setMax(float max)
Definition: QTest.h:611
SiStripMonitorCluster_cfi.Nbins
Nbins
Definition: SiStripMonitorCluster_cfi.py:32
ContentSigma::setYMax
void setYMax(unsigned yMax)
Definition: QTest.h:325
ContentsXRange::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:155
ContentSigma::toleranceDead_
float toleranceDead_
Definition: QTest.h:349
ContentsXRange::xmax_
double xmax_
Definition: QTest.h:167
MonitorElementData::QReport
Definition: MonitorElementCollection.h:55
ContentsYRange
Definition: QTest.h:173
QCriterion::~QCriterion
virtual ~QCriterion()=default
ContentSigma::getNeighborSigma
double getNeighborSigma(double average, unsigned groupx, unsigned groupy, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const
Definition: QTest.cc:775
ContentSigma::xMax_
unsigned xMax_
Definition: QTest.h:358
average
Definition: average.py:1
ContentSigma::setXMax
void setXMax(unsigned xMax)
Definition: QTest.h:323
CSC01
Definition: QTest.h:565
DQMChannel
MonitorElementData::QReport::DQMChannel DQMChannel
Definition: QTest.h:16
QCriterion::setErrorProb
void setErrorProb(float prob)
Definition: QTest.h:46
FixedFlatOccupancy1d::set_S_fail
void set_S_fail(double S)
Definition: QTest.h:547
FixedFlatOccupancy1d::set_epsilon_max
void set_epsilon_max(double epsilon)
Definition: QTest.h:546
FixedFlatOccupancy1d
Definition: QTest.h:525
NoisyChannel
Check if any channels are noisy compared to neighboring ones.
Definition: QTest.h:220
ContentsYRange::setUseEmptyBins
void setUseEmptyBins(unsigned int useEmptyBins)
Definition: QTest.h:182
CompareToMedian::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1177
FixedFlatOccupancy1d::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:541
NoisyChannel::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:263
FixedFlatOccupancy1d::FailedBins
double * FailedBins[2]
Definition: QTest.h:559
QCriterion::warningProb_
float warningProb_
message attached to test
Definition: QTest.h:108
FixedFlatOccupancy1d::S_fail
double S_fail
Definition: QTest.h:558
MeanWithinExpected::MeanWithinExpected
MeanWithinExpected(const std::string &name)
Definition: QTest.h:403
SimpleTest::badChannels_
std::vector< DQMChannel > badChannels_
Definition: QTest.h:139
DeadChannel::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:204
ContentSigma::dead_
bool dead_
Definition: QTest.h:347
CompareToMedian::nBinsY
int nBinsY
Definition: QTest.h:630
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
CSC01::get_epsilon_obs
double get_epsilon_obs()
Definition: QTest.h:573
QCriterion::WARNING_PROB_THRESHOLD
static const float WARNING_PROB_THRESHOLD
default "probability" values for setting warnings & errors when running tests
Definition: QTest.h:61
QCriterion::getName
std::string getName() const
get name of quality test
Definition: QTest.h:41
MeanWithinExpected::sigma_
double sigma_
Definition: QTest.h:416
MeanWithinExpected::expMean_
double expMean_
Definition: QTest.h:417
ContentsWithinExpected::checkMean_
bool checkMean_
Definition: QTest.h:390
DeadChannel::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:162
CSC01::set_S_fail
void set_S_fail(double S)
Definition: QTest.h:571
eostools.move
def move(src, dest)
Definition: eostools.py:511
QCriterion
Definition: QTest.h:31
ContentSigma::setNumNeighborsY
void setNumNeighborsY(unsigned ncy)
Definition: QTest.h:299
NoisyChannel::getAverage
double getAverage(int bin, const TH1 *h) const
Definition: QTest.cc:375
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
ContentsXRange::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:32
ContentsWithinExpected::minMean_
float minMean_
Definition: QTest.h:394
MeanWithinExpected::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:1081
MonitorElementData::QReport::DQMChannel
Definition: MonitorElementCollection.h:64
QCriterion::prob_
float prob_
name of algorithm
Definition: QTest.h:105
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
NoisyChannel::NoisyChannel
NoisyChannel(const std::string &name)
Definition: QTest.h:222
ContentsXRange::setAllowedXRange
virtual void setAllowedXRange(double xmin, double xmax)
set allowed range in X-axis (default values: histogram's X-range)
Definition: QTest.h:159
ContentsWithinExpected::setRMSRange
void setRMSRange(double xmin, double xmax)
set expected value for mean
Definition: QTest.cc:1058
QReport
MonitorElementData::QReport QReport
Definition: QTest.h:17
ContentSigma::ContentSigma
ContentSigma(const std::string &name)
Definition: QTest.h:269
CompareLastFilledBin::_average
float _average
Definition: QTest.h:669
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
multiplicitycorr_cfi.xMax
xMax
Definition: multiplicitycorr_cfi.py:5
ContentSigma::setNumXblocks
void setNumXblocks(unsigned ncx)
Definition: QTest.h:287
CompareToMedian::nBinsX
int nBinsX
Definition: QTest.h:630
ContentsWithinExpected::minRMS_
float minRMS_
Definition: QTest.h:395
CompareLastFilledBin::_max
float _max
Definition: QTest.h:668
dqm::qstatus::STATUS_OK
static const int STATUS_OK
Definition: MonitorElement.h:52
CompareLastFilledBin::setMax
void setMax(float max)
Definition: QTest.h:658
S
Definition: CSCDBL1TPParametersExtended.h:16
ContentSigma::setNumYblocks
void setNumYblocks(unsigned ncy)
Definition: QTest.h:291
DeadChannel::rangeInitialized_
bool rangeInitialized_
Definition: QTest.h:215
ContentsWithinExpected::runTest
float runTest(const MonitorElement *me) override
Definition: QTest.cc:863
CompareToMedian::_statCut
float _statCut
Definition: QTest.h:628
CSC01::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:568
NoisyChannel::rangeInitialized_
bool rangeInitialized_
Definition: QTest.h:262
mps_fire.result
result
Definition: mps_fire.py:311
FixedFlatOccupancy1d::get_FailedBins
double get_FailedBins()
Definition: QTest.h:549
QCriterion::MonitorElement
dqm::legacy::MonitorElement MonitorElement
(class should be created by DQMStore class)
Definition: QTest.h:35
CSC01::get_S_pass_obs
double get_S_pass_obs()
Definition: QTest.h:575
ContentSigma::setDead
void setDead(bool dead)
Definition: QTest.h:320
FixedFlatOccupancy1d::S_pass
double S_pass
Definition: QTest.h:558
CompareToMedian::getAlgoName
static std::string getAlgoName()
Definition: QTest.h:607
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
MeanWithinExpected::xmax_
double xmax_
Definition: QTest.h:418
QCriterion::status_
int status_
Definition: QTest.h:106
FixedFlatOccupancy1d::b
double b
Definition: QTest.h:555
MonitorElementData::QReport::QValue::qtname
std::string qtname
Definition: MonitorElementCollection.h:61
QCriterion::ERROR_PROB_THRESHOLD
static const float ERROR_PROB_THRESHOLD
Definition: QTest.h:62
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
FixedFlatOccupancy1d::Nbins
int Nbins
Definition: QTest.h:560
CompareToMedian::_min
float _min
Definition: QTest.h:625
SimpleTest::setMinimumEntries
void setMinimumEntries(unsigned n)
set minimum # of entries needed
Definition: QTest.h:128
CompareToMedian::_max
float _max
Definition: QTest.h:625
CompareToMedian::_minMed
float _minMed
Definition: QTest.h:627
MeanWithinExpected::xmin_
double xmin_
Definition: QTest.h:418
dqm::qstatus::ERROR
static const int ERROR
Definition: MonitorElement.h:54
CompareToMedian::nBins
int nBins
Definition: QTest.h:632
ContentsYRange::ymin_
double ymin_
Definition: QTest.h:190
CSC01::CSC01
CSC01(const std::string &name)
Definition: QTest.h:567
TtFullHadEvtBuilder_cfi.prob
prob
Definition: TtFullHadEvtBuilder_cfi.py:33
DeadChannel::setThreshold
void setThreshold(double ymin)
set Ymin (inclusive) threshold for "dead" channel (default: 0)
Definition: QTest.h:208
QCriterion::setMessage
virtual void setMessage()=0
set message after test has run
SimpleTest::setMessage
void setMessage() override
set status & message after test has run
Definition: QTest.h:136
QCriterion::algoName_
std::string algoName_
name of quality test
Definition: QTest.h:104
FixedFlatOccupancy1d::~FixedFlatOccupancy1d
~FixedFlatOccupancy1d() override
Definition: QTest.h:534
CompareToMedian
Definition: QTest.h:589
CompareToMedian::_maxMed
float _maxMed
Definition: QTest.h:627
CSC01::set_S_pass
void set_S_pass(double S)
Definition: QTest.h:572
QCriterion::qtname_
std::string qtname_
Definition: QTest.h:103
QCriterion::message_
std::string message_
quality test status
Definition: QTest.h:107
FixedFlatOccupancy1d::set_ExclusionMask
void set_ExclusionMask(double *mask)
Definition: QTest.h:544
SimpleTest::getBadChannels
std::vector< DQMChannel > getBadChannels() const override
get vector of channels that failed test (not always relevant!)
Definition: QTest.h:130
ContentsWithinExpected::maxMean_
float maxMean_
Definition: QTest.h:394