390 int nBinsX = diffHist->GetNbinsX();
391 int nBinsY = diffHist->GetNbinsY();
395 int maxBinStrip, centralBinStrip;
397 maxBinStrip = nBinsX;
402 centralBinStrip = nBinsX / 2 + 1;
404 double pAxisSymmetryValue = ps.
getParameter<
double>(
"axisSymmetryValue");
409 int upBinStrip = centralBinStrip;
410 int lowBinStrip = centralBinStrip;
413 if (nBinsX % 2 == 0) {
418 std::unique_ptr<double[]> maxAvgs(
new double[maxBinStrip - upBinStrip + 1]);
420 int nActualStrips = 0;
421 for (
int i = 0,
j = upBinStrip,
k = lowBinStrip;
j <= maxBinStrip;
i++,
j++,
k--) {
422 double avg1 =
getAvrg(diffHist, iTestName, pAxis, nBinsY,
j, pAverageMode);
423 double avg2 =
getAvrg(diffHist, iTestName, pAxis, nBinsY,
k, pAverageMode);
432 vector<double> defaultMu0up;
433 defaultMu0up.push_back(13.7655);
434 defaultMu0up.push_back(184.742);
435 defaultMu0up.push_back(50735.3);
436 defaultMu0up.push_back(-97.6793);
438 TF1 tf(
"myFunc",
"[0]*(TMath::Log(x*[1]+[2]))+[3]", 10., 11000.);
440 for (
unsigned int i = 0;
i <
params.size();
i++) {
445 vector<double> defaultMu0low;
446 defaultMu0low.push_back(2.19664);
447 defaultMu0low.push_back(1.94546);
448 defaultMu0low.push_back(-99.3263);
449 defaultMu0low.push_back(19.388);
452 for (
unsigned int i = 0;
i <
params.size();
i++) {
459 cout <<
"statsup= " << statsup <<
", statslow= " << statslow << endl;
462 enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) >
TMath::Max(statsup, statslow);
464 cout <<
"stats: " << TMath::MinElement(nActualStrips, maxAvgs.get())
466 <<
", threshold: " <<
TMath::Max(statsup, statslow) << endl;
472 for (; upBinStrip <= maxBinStrip; upBinStrip++, lowBinStrip--) {
473 double avg =
getAvrg(diffHist, iTestName, pAxis, nBinsY, upBinStrip, pAverageMode);
475 diffHist, iTestName, lowBinStrip, nBinsY, pAxis, avg, ps, deadChannels);
477 avg =
getAvrg(diffHist, iTestName, pAxis, nBinsY, lowBinStrip, pAverageMode);
479 diffHist, iTestName, upBinStrip, nBinsY, pAxis, avg, ps, deadChannels);
485 else if (pAxis == 2) {
486 int maxBinStrip, centralBinStrip;
488 maxBinStrip = nBinsY;
492 centralBinStrip = nBinsY / 2 + 1;
494 double pAxisSymmetryValue = ps.
getParameter<
double>(
"axisSymmetryValue");
499 int lowBinStrip = centralBinStrip, upBinStrip = centralBinStrip;
502 if (nBinsX % 2 == 0) {
508 std::unique_ptr<double[]> maxAvgs(
new double[maxBinStrip - upBinStrip + 1]);
509 int nActualStrips = 0;
510 for (
int i = 0,
j = upBinStrip,
k = lowBinStrip;
j <= maxBinStrip;
i++,
j++,
k--) {
511 double avg1 =
getAvrg(diffHist, iTestName, pAxis, nBinsX,
j, pAverageMode);
512 double avg2 =
getAvrg(diffHist, iTestName, pAxis, nBinsX,
k, pAverageMode);
519 vector<double> defaultMu0up;
520 defaultMu0up.push_back(13.7655);
521 defaultMu0up.push_back(184.742);
522 defaultMu0up.push_back(50735.3);
523 defaultMu0up.push_back(-97.6793);
526 TF1 tf(
"myFunc",
"[0]*(TMath::Log(x*[1]+[2]))+[3]", 10., 11000.);
527 for (
unsigned int i = 0;
i <
params.size();
i++) {
532 vector<double> defaultMu0low;
533 defaultMu0low.push_back(2.19664);
534 defaultMu0low.push_back(1.94546);
535 defaultMu0low.push_back(-99.3263);
536 defaultMu0low.push_back(19.388);
539 for (
unsigned int i = 0;
i <
params.size();
i++) {
544 cout <<
"statsup= " << statsup <<
", statslow= " << statslow << endl;
546 enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) >
TMath::Max(statsup, statslow);
548 cout <<
"stats: " << TMath::MinElement(nActualStrips, maxAvgs.get())
550 <<
", threshold: " <<
TMath::Max(statsup, statslow) << endl;
556 for (; upBinStrip <= maxBinStrip; upBinStrip++, lowBinStrip--) {
557 double avg =
getAvrg(diffHist, iTestName, pAxis, nBinsX, upBinStrip, pAverageMode);
559 diffHist, iTestName, lowBinStrip, nBinsX, pAxis, avg, ps, deadChannels);
561 avg =
getAvrg(diffHist, iTestName, pAxis, nBinsX, lowBinStrip, pAverageMode);
563 diffHist, iTestName, upBinStrip, nBinsX, pAxis, avg, ps, deadChannels);
568 cout <<
"Invalid axis" << endl;
T getParameter(std::string const &) const
void getBinCoordinateOnAxisWithValue(TH2F *h2f, double content, int &coord, int axis)
double getAvrg(TH2F *h2f, std::string test, int axis, int nBins, int binStrip, int avrgMode)
T getUntrackedParameter(std::string const &, T const &) const
bool isStripMasked(std::string test, int binStrip, int axis)
unsigned int getNBinsHistogram(std::string test)
int compareWithStrip(TH2F *histo, std::string test, int binStrip, int nBins, int axis, double avg, const edm::ParameterSet &ps, std::vector< std::pair< int, double > > &deadChannels)
unsigned int getNBinsMasked(std::string test)
TH2F * getDifferentialHistogram(std::string test)
L1TOccupancyClientHistogramService * hservice_