295 const double difprec = 1
e-5;
306 << me-> getFullname() <<
"\n";
335 <<
" ME does not contain TH1F/TH1S/TH1D/TProfile, exiting\n";
340 int ncx1 = h->GetXaxis()->GetNbins();
341 int ncx2 = ref_->GetXaxis()->GetNbins();
346 <<
" different number of channels! ("
347 << ncx1 <<
", " << ncx2 <<
"), exiting\n";
351 double diff1 =
TMath::Abs(h->GetXaxis()->GetXmin() - ref_->GetXaxis()->GetXmin());
352 double diff2 =
TMath::Abs(h->GetXaxis()->GetXmax() - ref_->GetXaxis()->GetXmax());
353 if (diff1 > difprec || diff2 > difprec)
357 <<
" histograms with different binning, exiting\n";
362 Bool_t afunc1 = kFALSE; Bool_t afunc2 = kFALSE;
363 double sum1 = 0, sum2 = 0;
364 double ew1, ew2, w1 = 0,
w2 = 0;
366 for (bin=1;bin<=ncx1;bin++)
368 sum1 += h->GetBinContent(bin);
369 sum2 += ref_->GetBinContent(bin);
370 ew1 = h->GetBinError(bin);
371 ew2 = ref_->GetBinError(bin);
380 <<
" Test Histogram: " << h->GetName()
381 <<
": integral is zero, exiting\n";
388 <<
" Ref Histogram: " << ref_->GetName()
389 <<
": integral is zero, exiting\n";
393 double tsum1 = sum1;
double tsum2 = sum2;
394 tsum1 += h->GetBinContent(0);
395 tsum2 += ref_->GetBinContent(0);
396 tsum1 += h->GetBinContent(ncx1+1);
397 tsum2 += ref_->GetBinContent(ncx1+1);
402 double ne1 = h->GetEntries();
403 double ne2 = ref_->GetEntries();
405 double difsum1 = (ne1-tsum1)/tsum1;
407 if (difsum1 > difprec &&
int(ne1) != ncx1)
409 if (h->GetSumw2N() == 0)
413 <<
" Weighted events and no Sumw2 for "
414 << h->GetName() <<
"\n";
418 esum1 = sum1*sum1/w1;
422 double difsum2 = (ne2-tsum2)/tsum2;
424 if (difsum2 > difprec &&
int(ne2) != ncx1)
426 if (ref_->GetSumw2N() == 0)
430 <<
" Weighted events and no Sumw2 for "
431 << ref_->GetName() <<
"\n";
435 esum2 = sum2*sum2/
w2;
439 double s1 = 1/tsum1;
double s2 = 1/tsum2;
441 double dfmax =0, rsum1 = 0, rsum2 = 0;
446 for ( bin=first; bin<=
last; bin++)
448 rsum1 += s1*h->GetBinContent(bin);
449 rsum2 += s2*ref_->GetBinContent(bin);
455 if (afunc1) z = dfmax*TMath::Sqrt(esum2);
456 else if (afunc2) z = dfmax*TMath::Sqrt(esum1);
457 else z = dfmax*TMath::Sqrt(esum1*esum2/(esum1+esum2));
463 <<
" Numerical problems with histogram "
464 << h->GetName() <<
"\n";
468 <<
" Numerical problems with histogram "
469 << ref_->GetName() <<
"\n";
471 return TMath::KolmogorovProb(z);
TH1F * getRefTH1F(void) const
TH1S * getTH1S(void) const
common ppss p3p6s2 common epss epspn46 common const1 w2
TH1D * getTH1D(void) const
static std::string getAlgoName(void)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Kind kind(void) const
Get the type of the monitor element.
TObject * getRootObject(void) const
TH1F * getTH1F(void) const
TProfile * getRefTProfile(void) const
TProfile * getTProfile(void) const
TObject * getRefRootObject(void) const
TH1S * getRefTH1S(void) const
TH1D * getRefTH1D(void) const