3 #include "Math/ProbFuncMathCore.h" 16 errorProb_ = ERROR_PROB_THRESHOLD;
17 warningProb_ = WARNING_PROB_THRESHOLD;
18 setAlgoName(
"NO_ALGORITHM");
20 message_ =
"NO_MESSAGE";
37 if (!
me->getRootObject())
42 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
57 <<
" ME " <<
me->getFullname() <<
" does not contain TH1F/TH1S/TH1D, exiting\n";
61 if (!rangeInitialized_) {
63 setAllowedXRange(
h->GetXaxis()->GetXmin(),
h->GetXaxis()->GetXmax());
67 int ncx =
h->GetXaxis()->GetNbins();
79 double x =
h->GetBinCenter(
bin);
81 if (x < xmin_ || x > xmax_)
88 return (sum - fail) / sum;
99 if (!
me->getRootObject())
104 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
115 <<
" ME " <<
me->getFullname() <<
" does not contain TH1F/TH1S/TH1D, exiting\n";
119 if (!rangeInitialized_ || !
h->GetXaxis())
121 int ncx =
h->GetXaxis()->GetNbins();
134 bool failure =
false;
135 failure = (contents < ymin_ || contents > ymax_);
138 badChannels_.push_back(
chan);
143 return 1. * (ncx - fail) / ncx;
148 bool failure =
false;
150 failure = (contents < ymin_ || contents > ymax_);
155 return 1. * (ncx - fail) / ncx;
163 badChannels_.clear();
166 if (!
me->getRootObject())
172 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
199 <<
" ME " <<
me->getFullname() <<
" does not contain TH1F/TH1S/TH1D/TH2F/TH2S/TH2D, exiting\n";
207 if (!rangeInitialized_ || !h1->GetXaxis())
209 int ncx = h1->GetXaxis()->GetNbins();
217 bool failure =
false;
221 badChannels_.push_back(
chan);
226 return 1. * (ncx - fail) / ncx;
231 else if (h2 !=
nullptr) {
232 int ncx = h2->GetXaxis()->GetNbins();
233 int ncy = h2->GetYaxis()->GetNbins();
236 for (
int cx = 1; cx <= ncx; ++cx) {
237 for (
int cy = 1; cy <= ncy; ++cy) {
238 double contents = h2->GetBinContent(h2->GetBin(cx, cy));
239 bool failure =
false;
243 badChannels_.push_back(
chan);
249 return 1. * (ncx * ncy - fail) / (ncx * ncy);
253 <<
" TH1/TH2F are NULL, exiting\n";
264 badChannels_.clear();
267 if (!
me->getRootObject())
273 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
279 nbins =
me->getTH1F()->GetXaxis()->GetNbins();
284 nbins =
me->getTH1S()->GetXaxis()->GetNbins();
289 nbins =
me->getTH1D()->GetXaxis()->GetNbins();
294 nbinsX =
me->getTH2F()->GetXaxis()->GetNbins();
295 nbinsY =
me->getTH2F()->GetYaxis()->GetNbins();
300 nbinsX =
me->getTH2S()->GetXaxis()->GetNbins();
301 nbinsY =
me->getTH2S()->GetYaxis()->GetNbins();
306 nbinsX =
me->getTH2F()->GetXaxis()->GetNbins();
307 nbinsY =
me->getTH2F()->GetYaxis()->GetNbins();
312 <<
" ME " <<
me->getFullname() <<
" does not contain TH1F/TH1S/TH1D or TH2F/TH2S/TH2D, exiting\n";
328 if (!rangeInitialized_ || !
h->GetXaxis()) {
334 bool failure =
false;
341 badChannels_.push_back(
chan);
347 }
else if (h2 !=
nullptr) {
348 for (binY =
first; binY <= lastY; ++binY) {
349 for (binX =
first; binX <= lastX; ++binX) {
350 double contents = h2->GetBinContent(binX, binY);
351 double average = getAverage2D(binX, binY, h2);
352 bool failure =
false;
358 badChannels_.push_back(
chan);
368 <<
" TH1/TH2F are NULL, exiting\n";
377 int ncx =
h->GetXaxis()->GetNbins();
379 int bin_start, bin_end;
383 bin_start =
bin - numNeighbors_;
384 bin_end =
bin + numNeighbors_;
386 if (bin_start <
first) {
387 add_right =
first - bin_start;
389 bin_end += add_right;
395 add_left = bin_end - ncx;
397 bin_start -= add_left;
398 if (bin_start <
first)
402 sum +=
h->Integral(bin_start, bin_end);
403 sum -=
h->GetBinContent(
bin);
417 int ncx = h2->GetXaxis()->GetNbins();
418 int ncy = h2->GetYaxis()->GetNbins();
420 int neighborsX, neighborsY;
421 neighborsX = numNeighbors_;
422 neighborsY = numNeighbors_;
423 int bin_startX, bin_endX;
426 int bin_startY, bin_endY;
430 bin_startX = binX - neighborsX;
431 bin_endX = binX + neighborsX;
433 if (bin_startX <
firstX) {
434 add_rightX =
firstX - bin_startX;
436 bin_endX += add_rightX;
441 if (bin_endX > ncx) {
442 add_leftX = bin_endX - ncx;
444 bin_startX -= add_leftX;
449 bin_startY = binY - neighborsY;
450 bin_endY = binY + neighborsY;
452 if (bin_startY <
firstY) {
453 add_topY =
firstY - bin_startY;
455 bin_endY += add_topY;
460 if (bin_endY > ncy) {
461 add_downY = bin_endY - ncy;
463 bin_startY -= add_downY;
468 sum += h2->Integral(bin_startX, bin_endX, bin_startY, bin_endY);
469 sum -= h2->GetBinContent(binX, binY);
471 int dimensionX = 2 * neighborsX + 1;
472 int dimensionY = 2 * neighborsY + 1;
474 if (dimensionX > h2->GetNbinsX())
475 dimensionX = h2->GetNbinsX();
476 if (dimensionY > h2->GetNbinsY())
477 dimensionY = h2->GetNbinsY();
479 return sum / (dimensionX * dimensionY - 1);
489 badChannels_.clear();
492 if (!
me->getRootObject())
497 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
504 nbinsX =
me->getTH1F()->GetXaxis()->GetNbins();
505 nbinsY =
me->getTH1F()->GetYaxis()->GetNbins();
510 nbinsX =
me->getTH1S()->GetXaxis()->GetNbins();
511 nbinsY =
me->getTH1S()->GetYaxis()->GetNbins();
516 nbinsX =
me->getTH1D()->GetXaxis()->GetNbins();
517 nbinsY =
me->getTH1D()->GetYaxis()->GetNbins();
522 nbinsX =
me->getTH2F()->GetXaxis()->GetNbins();
523 nbinsY =
me->getTH2F()->GetYaxis()->GetNbins();
528 nbinsX =
me->getTH2S()->GetXaxis()->GetNbins();
529 nbinsY =
me->getTH2S()->GetYaxis()->GetNbins();
534 nbinsX =
me->getTH2D()->GetXaxis()->GetNbins();
535 nbinsY =
me->getTH2D()->GetYaxis()->GetNbins();
540 <<
" ME " <<
me->getFullname() <<
" does not contain TH1F/TH1S/TH1D or TH2F/TH2S/TH2D, exiting\n";
546 if (!rangeInitialized_ || !
h->GetXaxis())
554 unsigned XBlocks = numXblocks_;
555 unsigned YBlocks = numYblocks_;
556 unsigned neighborsX = numNeighborsX_;
557 unsigned neighborsY = numNeighborsY_;
558 unsigned Xbinnum = 1;
559 unsigned Ybinnum = 1;
563 if (neighborsX == 999) {
566 if (neighborsY == 999) {
573 if (xMin_ != 0 && xMax_ != 0) {
574 if ((xMax_ <=
nbinsX) && (xMin_ <= xMax_)) {
575 nbinsX = xMax_ - xMin_ + 1;
581 if (yMin_ != 0 && yMax_ != 0) {
582 if ((yMax_ <=
nbinsY) && (yMin_ <= yMax_)) {
583 nbinsY = yMax_ - yMin_ + 1;
589 if (neighborsX * 2 >=
nbinsX) {
591 neighborsX =
nbinsX / 2 - 1;
593 neighborsX = (
nbinsX - 1) / 2;
597 if (neighborsY * 2 >=
nbinsY) {
599 neighborsY =
nbinsY / 2 - 1;
601 neighborsY = (
nbinsY - 1) / 2;
605 if (XBlocks == 999) {
608 if (YBlocks == 999) {
612 Xbinnum =
nbinsX / XBlocks;
613 Ybinnum =
nbinsY / YBlocks;
614 for (
unsigned groupx = 0; groupx < XBlocks; ++groupx) {
615 for (
unsigned groupy = 0; groupy < YBlocks; ++groupy) {
617 for (
unsigned binx = 0; binx < Xbinnum; ++binx) {
618 for (
unsigned biny = 0; biny < Ybinnum; ++biny) {
619 if (groupx * Xbinnum +
xMin + binx <=
xMax && groupy * Ybinnum +
yMin + biny <=
yMax) {
620 blocksum +=
abs(
h->GetBinContent(groupx * Xbinnum +
xMin + binx, groupy * Ybinnum +
yMin + biny));
625 double sum = getNeighborSum(groupx, groupy, XBlocks, YBlocks, neighborsX, neighborsY,
h);
628 if (neighborsX > groupx) {
629 XWidth = neighborsX + groupx + 1;
630 }
else if (neighborsX > (XBlocks - (groupx + 1))) {
631 XWidth = (XBlocks - groupx) + neighborsX;
633 XWidth = 2 * neighborsX + 1;
635 if (neighborsY > groupy) {
636 YWidth = neighborsY + groupy + 1;
637 }
else if (neighborsY > (YBlocks - (groupy + 1))) {
638 YWidth = (YBlocks - groupy) + neighborsY;
640 YWidth = 2 * neighborsY + 1;
643 double average = sum / (XWidth * YWidth - 1);
644 double sigma = getNeighborSigma(
average, groupx, groupy, XBlocks, YBlocks, neighborsX, neighborsY,
h);
647 double sigma_2 =
sqrt(sigma) /
sqrt(XWidth * YWidth - 2);
648 double sigma_real = sigma_2 / (XWidth * YWidth - 1);
650 double avg_uncrt = 3 * sigma_real;
652 double probNoisy = ROOT::Math::poisson_cdf_c(blocksum - 1,
average + avg_uncrt);
653 double probDead = ROOT::Math::poisson_cdf(blocksum,
average - avg_uncrt);
654 double thresholdNoisy = ROOT::Math::normal_cdf_c(toleranceNoisy_);
655 double thresholdDead = ROOT::Math::normal_cdf(-1 * toleranceDead_);
657 int failureNoisy = 0;
661 if (noisy_ && dead_) {
663 failureNoisy = probNoisy < thresholdNoisy;
665 failureDead = probDead < thresholdDead;
669 failureNoisy = probNoisy < thresholdNoisy;
673 failureDead = probDead < thresholdDead;
684 if (failureNoisy || failureDead) {
691 return 1. * ((XBlocks * YBlocks) - fail) / (XBlocks * YBlocks);
701 const TH1*
h)
const {
703 unsigned nbinsX =
h->GetXaxis()->GetNbins();
704 unsigned nbinsY =
h->GetYaxis()->GetNbins();
709 unsigned Xbinnum = 1;
710 unsigned Ybinnum = 1;
715 if (xMin_ != 0 && xMax_ != 0) {
716 if ((xMax_ <=
nbinsX) && (xMin_ <= xMax_)) {
717 nbinsX = xMax_ - xMin_ + 1;
722 if (yMin_ != 0 && yMax_ != 0) {
723 if ((yMax_ <=
nbinsY) && (yMin_ <= yMax_)) {
724 nbinsY = yMax_ - yMin_ + 1;
730 if (Xblocks == 999) {
733 if (Yblocks == 999) {
737 Xbinnum =
nbinsX / Xblocks;
738 Ybinnum =
nbinsY / Yblocks;
740 unsigned xLow, xHi, yLow, yHi;
741 if (groupx > neighborsX) {
742 xLow = (groupx - neighborsX) * Xbinnum +
xMin;
749 xHi = (groupx + 1 + neighborsX) * Xbinnum +
xMin;
753 if (groupy > neighborsY) {
754 yLow = (groupy - neighborsY) * Ybinnum +
yMin;
761 yHi = (groupy + 1 + neighborsY) * Ybinnum +
yMin;
766 for (
unsigned xbin = xLow; xbin <= xHi; ++xbin) {
767 for (
unsigned ybin = yLow; ybin <= yHi; ++ybin) {
768 sum +=
h->GetBinContent(xbin, ybin);
782 const TH1*
h)
const {
784 unsigned nbinsX =
h->GetXaxis()->GetNbins();
785 unsigned nbinsY =
h->GetYaxis()->GetNbins();
790 unsigned Xbinnum = 1;
791 unsigned Ybinnum = 1;
794 if (xMin_ != 0 && xMax_ != 0) {
795 if ((xMax_ <=
nbinsX) && (xMin_ <= xMax_)) {
796 nbinsX = xMax_ - xMin_ + 1;
801 if (yMin_ != 0 && yMax_ != 0) {
802 if ((yMax_ <=
nbinsY) && (yMin_ <= yMax_)) {
803 nbinsY = yMax_ - yMin_ + 1;
808 if (Xblocks == 999) {
811 if (Yblocks == 999) {
815 Xbinnum =
nbinsX / Xblocks;
816 Ybinnum =
nbinsY / Yblocks;
818 unsigned xLow, xHi, yLow, yHi;
819 for (
unsigned x_block_count = 0; x_block_count <= 2 * neighborsX; ++x_block_count) {
820 for (
unsigned y_block_count = 0; y_block_count <= 2 * neighborsY; ++y_block_count) {
822 if (groupx + x_block_count > neighborsX) {
823 xLow = (groupx + x_block_count - neighborsX) * Xbinnum +
xMin;
830 xHi = xLow + Xbinnum;
834 if (groupy + y_block_count > neighborsY) {
835 yLow = (groupy + y_block_count - neighborsY) * Ybinnum +
yMin;
842 yHi = yLow + Ybinnum;
847 for (
unsigned x_block_bin = xLow; x_block_bin <= xHi; ++x_block_bin) {
848 for (
unsigned y_block_bin = yLow; y_block_bin <= yHi; ++y_block_bin) {
849 block_sum +=
h->GetBinContent(x_block_bin, y_block_bin);
864 badChannels_.clear();
867 if (!
me->getRootObject())
872 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
880 ncx =
me->getTH2F()->GetXaxis()->GetNbins();
881 ncy =
me->getTH2F()->GetYaxis()->GetNbins();
886 ncx =
me->getTH2S()->GetXaxis()->GetNbins();
887 ncy =
me->getTH2S()->GetYaxis()->GetNbins();
892 ncx =
me->getTH2D()->GetXaxis()->GetNbins();
893 ncy =
me->getTH2D()->GetYaxis()->GetNbins();
898 ncx =
me->getTProfile()->GetXaxis()->GetNbins();
900 h =
me->getTProfile();
904 ncx =
me->getTProfile2D()->GetXaxis()->GetNbins();
905 ncy =
me->getTProfile2D()->GetYaxis()->GetNbins();
906 h =
me->getTProfile2D();
909 std::cout <<
"QTest:ContentsWithinExpected" 910 <<
" ME does not contain TH2F/TH2S/TH2D/TPROFILE/TPROFILE2D, exiting\n";
918 if (checkMeanTolerance_) {
920 for (
int cx = 1; cx <= ncx; ++cx) {
921 for (
int cy = 1; cy <= ncy; ++cy) {
923 sum +=
h->GetBinContent(
h->GetBin(cx, cy));
926 sum +=
h->GetBinContent(
h->GetBin(cx, cy));
929 sum +=
h->GetBinContent(
h->GetBin(cx, cy));
932 if (
me->getTProfile()->GetBinEntries(
h->GetBin(cx)) >= minEntries_ / (ncx)) {
933 sum +=
h->GetBinContent(
h->GetBin(cx));
937 if (
me->getTProfile2D()->GetBinEntries(
h->GetBin(cx, cy)) >= minEntries_ / (ncx * ncy)) {
938 sum +=
h->GetBinContent(
h->GetBin(cx, cy));
952 for (
int cx = 1; cx <= ncx; ++cx) {
953 for (
int cy = 1; cy <= ncy; ++cy) {
954 bool failMean =
false;
955 bool failRMS =
false;
956 bool failMeanTolerance =
false;
959 me->getTProfile()->GetBinEntries(
h->GetBin(cx)) < minEntries_ / (ncx))
963 me->getTProfile2D()->GetBinEntries(
h->GetBin(cx, cy)) < minEntries_ / (ncx * ncy))
967 double mean =
h->GetBinContent(
h->GetBin(cx, cy));
968 failMean = (mean < minMean_ || mean > maxMean_);
972 double rms =
h->GetBinError(
h->GetBin(cx, cy));
973 failRMS = (rms < minRMS_ || rms > maxRMS_);
976 if (checkMeanTolerance_) {
977 double mean =
h->GetBinContent(
h->GetBin(cx, cy));
981 if (failMean || failRMS || failMeanTolerance) {
983 DQMChannel chan(cx, cy, 0,
h->GetBinContent(
h->GetBin(cx, cy)),
h->GetBinError(
h->GetBin(cx, cy)));
984 badChannels_.push_back(
chan);
986 DQMChannel chan(cx, cy, 0,
h->GetBinContent(
h->GetBin(cx, cy)),
h->GetBinError(
h->GetBin(cx, cy)));
987 badChannels_.push_back(
chan);
989 DQMChannel chan(cx, cy, 0,
h->GetBinContent(
h->GetBin(cx, cy)),
h->GetBinError(
h->GetBin(cx, cy)));
990 badChannels_.push_back(
chan);
993 cx, cy,
int(
me->getTProfile()->GetBinEntries(
h->GetBin(cx))), 0,
h->GetBinError(
h->GetBin(cx)));
994 badChannels_.push_back(
chan);
998 int(
me->getTProfile2D()->GetBinEntries(
h->GetBin(cx, cy))),
999 h->GetBinContent(
h->GetBin(cx, cy)),
1000 h->GetBinError(
h->GetBin(cx, cy)));
1001 badChannels_.push_back(
chan);
1007 return 1. * (ncx * ncy - fail) / (ncx * ncy);
1013 ncx =
me->getTH2F()->GetXaxis()->GetNbins();
1014 ncy =
me->getTH2F()->GetYaxis()->GetNbins();
1017 ncx =
me->getTH2S()->GetXaxis()->GetNbins();
1018 ncy =
me->getTH2S()->GetYaxis()->GetNbins();
1021 ncx =
me->getTH2D()->GetXaxis()->GetNbins();
1022 ncy =
me->getTH2D()->GetYaxis()->GetNbins();
1026 std::cout <<
"QTest:ContentsWithinExpected AS" 1027 <<
" ME does not contain TH2F/TH2S/TH2D, exiting\n";
1033 for (
int cx = 1; cx <= ncx; ++cx) {
1034 for (
int cy = 1; cy <= ncy; ++cy) {
1035 bool failure =
false;
1036 double Content =
h->GetBinContent(
h->GetBin(cx, cy));
1038 failure = (Content < minMean_ || Content > maxMean_);
1043 return 1. * (ncx * ncy - fail) / (ncx * ncy);
1050 std::cout <<
"QTest:ContentsWitinExpected" 1051 <<
" Illogical range: (" <<
xmin <<
", " <<
xmax <<
"\n";
1061 std::cout <<
"QTest:ContentsWitinExpected" 1062 <<
" Illogical range: (" <<
xmin <<
", " <<
xmax <<
"\n";
1084 if (!
me->getRootObject())
1089 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
1091 if (minEntries_ != 0 &&
me->getEntries() < minEntries_)
1103 <<
" ME " <<
me->getFullname() <<
" does not contain TH1F/TH1S/TH1D, exiting\n";
1108 double mean =
h->GetMean();
1109 if (mean <= xmax_ && mean >= xmin_)
1113 }
else if (useSigma_) {
1115 double chi = (
h->GetMean() - expMean_) / sigma_;
1116 return TMath::Prob(chi * chi, 1);
1120 <<
" Error, sigma_ is zero, exiting\n";
1123 }
else if (useRMS_) {
1124 if (
h->GetRMS() != 0.) {
1125 double chi = (
h->GetMean() - expMean_) /
h->GetRMS();
1126 return TMath::Prob(chi * chi, 1);
1130 <<
" Error, RMS is zero, exiting\n";
1136 <<
" Error, neither Range, nor Sigma, nor RMS, exiting\n";
1143 useSigma_ = useRMS_ =
false;
1149 <<
" Illogical range: (" << xmin_ <<
", " << xmax_ <<
"\n";
1153 useRMS_ = useRange_ =
false;
1154 sigma_ = expectedSigma;
1158 <<
" Expected sigma = " << sigma_ <<
"\n";
1163 useSigma_ = useRange_ =
false;
1179 badChannels_.clear();
1183 if (!
me->getRootObject())
1188 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
1189 std::cout <<
"\tMin = " << _min <<
"; Max = " << _max <<
"\n";
1190 std::cout <<
"\tMinMedian = " << _minMed <<
"; MaxMedian = " << _maxMed <<
"\n";
1191 std::cout <<
"\tUseEmptyBins = " << (_emptyBins ?
"Yes" :
"No") <<
"\n";
1195 h =
me->getTProfile2D();
1198 std::cout <<
"QTest:ContentsWithinExpected" 1199 <<
" ME does not contain TPROFILE2D, exiting\n";
1203 nBinsX =
h->GetNbinsX();
1204 nBinsY =
h->GetNbinsY();
1209 for (
int binX = 1; binX <= nBinsX; binX++) {
1212 for (
int binY = 1; binY <= nBinsY; binY++) {
1213 int bin =
h->GetBin(binX, binY);
1215 if (
content == 0 && !_emptyBins)
1218 entries =
me->getTProfile2D()->GetBinEntries(
bin);
1220 if (binValues.empty())
1222 nbins += binValues.size();
1225 if (!binValues.empty()) {
1226 int medPos = (
int)binValues.size() / 2;
1227 nth_element(binValues.begin(), binValues.begin() + medPos, binValues.end());
1228 median = *(binValues.begin() + medPos);
1234 std::cout <<
"QTest: Median is 0; the fixed cuts: [" << _minMed <<
"; " << _maxMed <<
"] are used\n";
1236 for (
int binY = 1; binY <= nBinsY; binY++) {
1237 int bin =
h->GetBin(binX, binY);
1239 entries =
me->getTProfile2D()->GetBinEntries(
bin);
1244 badChannels_.push_back(
chan);
1252 if (
median * entries < _statCut)
1257 for (
int binY = 1; binY <= nBinsY; binY++) {
1258 int bin =
h->GetBin(binX, binY);
1260 entries =
me->getTProfile2D()->GetBinEntries(
bin);
1264 badChannels_.push_back(
chan);
1271 float minCut =
median * _min;
1272 float maxCut =
median * _max;
1273 for (
int binY = 1; binY <= nBinsY; binY++) {
1274 int bin =
h->GetBin(binX, binY);
1276 entries =
me->getTProfile2D()->GetBinEntries(
bin);
1281 badChannels_.push_back(
chan);
1289 std::cout <<
"QTest:CompareToMedian: Histogram is empty" << std::endl;
1307 if (!
me->getRootObject())
1312 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
1313 std::cout <<
"\tMin = " << _min <<
"; Max = " << _max <<
"\n";
1321 std::cout <<
"QTest:ContentsWithinExpected" 1322 <<
" ME does not contain TH1F or TH2F, exiting\n";
1330 if (h1 !=
nullptr) {
1331 lastBinX = h1->FindLastBinAbove(_average, 1);
1332 lastBinVal = h1->GetBinContent(lastBinX);
1333 if (h1->GetEntries() == 0 || lastBinVal < 0)
1335 }
else if (h2 !=
nullptr) {
1336 lastBinX = h2->FindLastBinAbove(_average, 1);
1337 lastBinY = h2->FindLastBinAbove(_average, 2);
1338 if (h2->GetEntries() == 0 || lastBinX < 0 || lastBinY < 0)
1340 lastBinVal = h2->GetBinContent(h2->GetBin(lastBinX, lastBinY));
1343 std::cout <<
"QTest:" << getAlgoName() <<
" Histogram does not exist" << std::endl;
1347 std::cout <<
"Min and Max values " << _min <<
" " << _max <<
" Av value " << _average <<
" lastBinX " << lastBinX
1348 <<
" lastBinY " << lastBinY <<
" lastBinVal " << lastBinVal << std::endl;
1349 if (lastBinVal > _min && lastBinVal <= _max)
1358 badChannels_.clear();
1362 if (!
me->getRootObject())
1367 std::cout <<
"QTest:" << getAlgoName() <<
"::runTest called on " <<
me->getFullname() <<
"\n";
1376 h =
me->getTProfile();
1380 <<
" ME " <<
me->getFullname() <<
" does not contain TH1F/TH1D/TPROFILE, exiting\n";
1384 int ncx =
h->GetXaxis()->GetNbins();
1394 double avg = sum / ncx;
1401 double Variance = TMath::Sqrt(sum2 / ncx);
double getAverage(int bin, const TH1 *h) const
float runTest(const MonitorElement *me, QReport &qr, DQMNet::QValue &qv)
double getAverage2D(int binX, int binY, const TH2 *h) const
void setRMSRange(double xmin, double xmax)
set expected value for mean
void useSigma(double expectedSigma)
float runTest(const MonitorElement *me) override
float runTest(const MonitorElement *me) override
float runTest(const MonitorElement *me) override
void init()
initialize values
double getNeighborSigma(double average, unsigned groupx, unsigned groupy, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const
Abs< T >::type abs(const T &t)
static const int DID_NOT_RUN
static const float ERROR_PROB_THRESHOLD
float runTest(const MonitorElement *me) override
float runTest(const MonitorElement *me) override
void useRange(double xmin, double xmax)
float runTest(const MonitorElement *me) override
float runTest(const MonitorElement *me) override
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
void setMeanRange(double xmin, double xmax)
set expected value for mean
float runTest(const MonitorElement *me) override
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
float runTest(const MonitorElement *me) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
uint32_t dimension(pat::CandKinResolution::Parametrization parametrization)
Returns the number of free parameters in a parametrization (3 or 4)
void reset(double vett[256])
static const float WARNING_PROB_THRESHOLD
default "probability" values for setting warnings & errors when running tests