508 nbinsX = me->
getTH1F()->GetXaxis()->GetNbins();
509 nbinsY = me->
getTH1F()->GetYaxis()->GetNbins();
514 nbinsX = me->
getTH1S()->GetXaxis()->GetNbins();
515 nbinsY = me->
getTH1S()->GetYaxis()->GetNbins();
520 nbinsX = me->
getTH1D()->GetXaxis()->GetNbins();
521 nbinsY = me->
getTH1D()->GetYaxis()->GetNbins();
526 nbinsX = me->
getTH2F()->GetXaxis()->GetNbins();
527 nbinsY = me->
getTH2F()->GetYaxis()->GetNbins();
532 nbinsX = me->
getTH2S()->GetXaxis()->GetNbins();
533 nbinsY = me->
getTH2S()->GetYaxis()->GetNbins();
538 nbinsX = me->
getTH2D()->GetXaxis()->GetNbins();
539 nbinsY = me->
getTH2D()->GetYaxis()->GetNbins();
544 <<
" ME " << me->
getFullname() <<
" does not contain TH1F/TH1S/TH1D or TH2F/TH2S/TH2D, exiting\n";
562 unsigned Xbinnum = 1;
563 unsigned Ybinnum = 1;
567 if (neighborsX == 999) {
570 if (neighborsY == 999) {
593 if (neighborsX * 2 >= nbinsX) {
594 if (nbinsX % 2 == 0) {
595 neighborsX = nbinsX / 2 - 1;
597 neighborsX = (nbinsX - 1) / 2;
601 if (neighborsY * 2 >= nbinsY) {
602 if (nbinsY % 2 == 0) {
603 neighborsY = nbinsY / 2 - 1;
605 neighborsY = (nbinsY - 1) / 2;
609 if (XBlocks == 999) {
612 if (YBlocks == 999) {
616 Xbinnum = nbinsX / XBlocks;
617 Ybinnum = nbinsY / YBlocks;
618 for (
unsigned groupx = 0; groupx < XBlocks; ++groupx) {
619 for (
unsigned groupy = 0; groupy < YBlocks; ++groupy) {
621 for (
unsigned binx = 0; binx < Xbinnum; ++binx) {
622 for (
unsigned biny = 0; biny < Ybinnum; ++biny) {
623 if (groupx * Xbinnum + xMin + binx <= xMax && groupy * Ybinnum + yMin + biny <= yMax) {
624 blocksum +=
abs(h->GetBinContent(groupx * Xbinnum + xMin + binx, groupy * Ybinnum + yMin + biny));
629 double sum =
getNeighborSum(groupx, groupy, XBlocks, YBlocks, neighborsX, neighborsY, h);
632 if (neighborsX > groupx) {
633 XWidth = neighborsX + groupx + 1;
634 }
else if (neighborsX > (XBlocks - (groupx + 1))) {
635 XWidth = (XBlocks - groupx) + neighborsX;
637 XWidth = 2 * neighborsX + 1;
639 if (neighborsY > groupy) {
640 YWidth = neighborsY + groupy + 1;
641 }
else if (neighborsY > (YBlocks - (groupy + 1))) {
642 YWidth = (YBlocks - groupy) + neighborsY;
644 YWidth = 2 * neighborsY + 1;
647 double average = sum / (XWidth * YWidth - 1);
648 double sigma =
getNeighborSigma(average, groupx, groupy, XBlocks, YBlocks, neighborsX, neighborsY, h);
650 sigma -= (average - blocksum) * (average - blocksum);
651 double sigma_2 =
sqrt(sigma) /
sqrt(XWidth * YWidth - 2);
652 double sigma_real = sigma_2 / (XWidth * YWidth - 1);
654 double avg_uncrt = 3 * sigma_real;
656 double probNoisy = ROOT::Math::poisson_cdf_c(blocksum - 1, average + avg_uncrt);
657 double probDead = ROOT::Math::poisson_cdf(blocksum, average - avg_uncrt);
659 double thresholdDead = ROOT::Math::normal_cdf(-1 *
toleranceDead_);
661 int failureNoisy = 0;
666 if (blocksum > average) {
667 failureNoisy = probNoisy < thresholdNoisy;
669 failureDead = probDead < thresholdDead;
672 if (blocksum > average) {
673 failureNoisy = probNoisy < thresholdNoisy;
676 if (blocksum < average) {
677 failureDead = probDead < thresholdDead;
688 if (failureNoisy || failureDead) {
695 return 1. * ((XBlocks * YBlocks) - fail) / (XBlocks * YBlocks);
virtual TH2D * getTH2D() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual TH2F * getTH2F() const
virtual TH1F * getTH1F() const
Kind kind() const
Get the type of the monitor element.
virtual TH1S * getTH1S() const
const std::string getFullname() const
get full name of ME including Pathname
Abs< T >::type abs(const T &t)
virtual TH2S * getTH2S() const
double getNeighborSigma(double average, unsigned groupx, unsigned groupy, unsigned Xblocks, unsigned Yblocks, unsigned neighborsX, unsigned neighborsY, const TH1 *h) const
virtual TH1D * getTH1D() const
std::vector< DQMChannel > badChannels_
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
TObject * getRootObject() const override
static std::string getAlgoName()