492 if (!
me->getRootObject())
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";
558 unsigned Xbinnum = 1;
559 unsigned Ybinnum = 1;
563 if (neighborsX == 999) {
566 if (neighborsY == 999) {
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);
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);
655 double thresholdDead = ROOT::Math::normal_cdf(-1 *
toleranceDead_);
657 int failureNoisy = 0;
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);
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)
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
static std::string getAlgoName()
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.