398 int nBinsX = diffHist->GetNbinsX();
399 int nBinsY = diffHist->GetNbinsY();
403 int maxBinStrip, centralBinStrip;
405 maxBinStrip = nBinsX;
410 centralBinStrip = nBinsX / 2 + 1;
412 double pAxisSymmetryValue = ps.
getParameter<
double>(
"axisSymmetryValue");
417 int upBinStrip = centralBinStrip;
418 int lowBinStrip = centralBinStrip;
421 if (nBinsX % 2 == 0) {
426 std::unique_ptr<double[]> maxAvgs(
new double[maxBinStrip - upBinStrip + 1]);
428 int nActualStrips = 0;
429 for (
int i = 0,
j = upBinStrip,
k = lowBinStrip;
j <= maxBinStrip;
i++,
j++,
k--) {
430 double avg1 =
getAvrg(diffHist, iTestName, pAxis, nBinsY,
j, pAverageMode);
431 double avg2 =
getAvrg(diffHist, iTestName, pAxis, nBinsY,
k, pAverageMode);
440 vector<double> defaultMu0up;
441 defaultMu0up.push_back(13.7655);
442 defaultMu0up.push_back(184.742);
443 defaultMu0up.push_back(50735.3);
444 defaultMu0up.push_back(-97.6793);
446 TF1 tf(
"myFunc",
"[0]*(TMath::Log(x*[1]+[2]))+[3]", 10., 11000.);
448 for (
unsigned int i = 0;
i <
params.size();
i++) {
453 vector<double> defaultMu0low;
454 defaultMu0low.push_back(2.19664);
455 defaultMu0low.push_back(1.94546);
456 defaultMu0low.push_back(-99.3263);
457 defaultMu0low.push_back(19.388);
460 for (
unsigned int i = 0;
i <
params.size();
i++) {
467 cout <<
"statsup= " << statsup <<
", statslow= " << statslow << endl;
470 enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) >
TMath::Max(statsup, statslow);
472 cout <<
"stats: " << TMath::MinElement(nActualStrips, maxAvgs.get())
474 <<
", threshold: " <<
TMath::Max(statsup, statslow) << endl;
480 for (; upBinStrip <= maxBinStrip; upBinStrip++, lowBinStrip--) {
481 double avg =
getAvrg(diffHist, iTestName, pAxis, nBinsY, upBinStrip, pAverageMode);
483 diffHist, iTestName, lowBinStrip, nBinsY, pAxis, avg, ps, deadChannels);
485 avg =
getAvrg(diffHist, iTestName, pAxis, nBinsY, lowBinStrip, pAverageMode);
487 diffHist, iTestName, upBinStrip, nBinsY, pAxis, avg, ps, deadChannels);
493 else if (pAxis == 2) {
494 int maxBinStrip, centralBinStrip;
496 maxBinStrip = nBinsY;
500 centralBinStrip = nBinsY / 2 + 1;
502 double pAxisSymmetryValue = ps.
getParameter<
double>(
"axisSymmetryValue");
507 int lowBinStrip = centralBinStrip, upBinStrip = centralBinStrip;
510 if (nBinsX % 2 == 0) {
516 std::unique_ptr<double[]> maxAvgs(
new double[maxBinStrip - upBinStrip + 1]);
517 int nActualStrips = 0;
518 for (
int i = 0,
j = upBinStrip,
k = lowBinStrip;
j <= maxBinStrip;
i++,
j++,
k--) {
519 double avg1 =
getAvrg(diffHist, iTestName, pAxis, nBinsX,
j, pAverageMode);
520 double avg2 =
getAvrg(diffHist, iTestName, pAxis, nBinsX,
k, pAverageMode);
527 vector<double> defaultMu0up;
528 defaultMu0up.push_back(13.7655);
529 defaultMu0up.push_back(184.742);
530 defaultMu0up.push_back(50735.3);
531 defaultMu0up.push_back(-97.6793);
534 TF1 tf(
"myFunc",
"[0]*(TMath::Log(x*[1]+[2]))+[3]", 10., 11000.);
535 for (
unsigned int i = 0;
i <
params.size();
i++) {
540 vector<double> defaultMu0low;
541 defaultMu0low.push_back(2.19664);
542 defaultMu0low.push_back(1.94546);
543 defaultMu0low.push_back(-99.3263);
544 defaultMu0low.push_back(19.388);
547 for (
unsigned int i = 0;
i <
params.size();
i++) {
552 cout <<
"statsup= " << statsup <<
", statslow= " << statslow << endl;
554 enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) >
TMath::Max(statsup, statslow);
556 cout <<
"stats: " << TMath::MinElement(nActualStrips, maxAvgs.get())
558 <<
", threshold: " <<
TMath::Max(statsup, statslow) << endl;
564 for (; upBinStrip <= maxBinStrip; upBinStrip++, lowBinStrip--) {
565 double avg =
getAvrg(diffHist, iTestName, pAxis, nBinsX, upBinStrip, pAverageMode);
567 diffHist, iTestName, lowBinStrip, nBinsX, pAxis, avg, ps, deadChannels);
569 avg =
getAvrg(diffHist, iTestName, pAxis, nBinsX, lowBinStrip, pAverageMode);
571 diffHist, iTestName, upBinStrip, nBinsX, pAxis, avg, ps, deadChannels);
576 cout <<
"Invalid axis" << endl;