399 int nBinsX = diffHist->GetNbinsX();
400 int nBinsY = diffHist->GetNbinsY();
404 int maxBinStrip, centralBinStrip;
406 maxBinStrip = nBinsX;
411 centralBinStrip = nBinsX / 2 + 1;
413 double pAxisSymmetryValue = ps.
getParameter<
double>(
"axisSymmetryValue");
418 int upBinStrip = centralBinStrip;
419 int lowBinStrip = centralBinStrip;
422 if (nBinsX % 2 == 0) {
427 std::unique_ptr<double[]> maxAvgs(
new double[maxBinStrip - upBinStrip + 1]);
429 int nActualStrips = 0;
430 for (
int i = 0,
j = upBinStrip,
k = lowBinStrip;
j <= maxBinStrip;
i++,
j++,
k--) {
431 double avg1 =
getAvrg(diffHist, iTestName, pAxis, nBinsY, j, pAverageMode);
432 double avg2 =
getAvrg(diffHist, iTestName, pAxis, nBinsY,
k, pAverageMode);
441 vector<double> defaultMu0up;
442 defaultMu0up.push_back(13.7655);
443 defaultMu0up.push_back(184.742);
444 defaultMu0up.push_back(50735.3);
445 defaultMu0up.push_back(-97.6793);
447 TF1 tf(
"myFunc",
"[0]*(TMath::Log(x*[1]+[2]))+[3]", 10., 11000.);
449 for (
unsigned int i = 0;
i < params.size();
i++) {
450 tf.SetParameter(
i, params[
i]);
454 vector<double> defaultMu0low;
455 defaultMu0low.push_back(2.19664);
456 defaultMu0low.push_back(1.94546);
457 defaultMu0low.push_back(-99.3263);
458 defaultMu0low.push_back(19.388);
461 for (
unsigned int i = 0;
i < params.size();
i++) {
462 tf.SetParameter(
i, params[
i]);
468 cout <<
"statsup= " << statsup <<
", statslow= " << statslow << endl;
471 enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) >
TMath::Max(statsup, statslow);
473 cout <<
"stats: " << TMath::MinElement(nActualStrips, maxAvgs.get())
475 <<
", threshold: " <<
TMath::Max(statsup, statslow) << endl;
481 for (; upBinStrip <= maxBinStrip; upBinStrip++, lowBinStrip--) {
482 double avg =
getAvrg(diffHist, iTestName, pAxis, nBinsY, upBinStrip, pAverageMode);
484 diffHist, iTestName, lowBinStrip, nBinsY, pAxis, avg, ps, deadChannels);
486 avg =
getAvrg(diffHist, iTestName, pAxis, nBinsY, lowBinStrip, pAverageMode);
488 diffHist, iTestName, upBinStrip, nBinsY, pAxis, avg, ps, deadChannels);
494 else if (pAxis == 2) {
495 int maxBinStrip, centralBinStrip;
497 maxBinStrip = nBinsY;
501 centralBinStrip = nBinsY / 2 + 1;
503 double pAxisSymmetryValue = ps.
getParameter<
double>(
"axisSymmetryValue");
508 int lowBinStrip = centralBinStrip, upBinStrip = centralBinStrip;
511 if (nBinsX % 2 == 0) {
517 std::unique_ptr<double[]> maxAvgs(
new double[maxBinStrip - upBinStrip + 1]);
518 int nActualStrips = 0;
519 for (
int i = 0, j = upBinStrip,
k = lowBinStrip; j <= maxBinStrip;
i++, j++,
k--) {
520 double avg1 =
getAvrg(diffHist, iTestName, pAxis, nBinsX, j, pAverageMode);
521 double avg2 =
getAvrg(diffHist, iTestName, pAxis, nBinsX,
k, pAverageMode);
528 vector<double> defaultMu0up;
529 defaultMu0up.push_back(13.7655);
530 defaultMu0up.push_back(184.742);
531 defaultMu0up.push_back(50735.3);
532 defaultMu0up.push_back(-97.6793);
534 vector<double> params = ps.
getUntrackedParameter<std::vector<double> >(
"params_mu0_up", defaultMu0up);
535 TF1 tf(
"myFunc",
"[0]*(TMath::Log(x*[1]+[2]))+[3]", 10., 11000.);
536 for (
unsigned int i = 0;
i < params.size();
i++) {
537 tf.SetParameter(
i, params[
i]);
541 vector<double> defaultMu0low;
542 defaultMu0low.push_back(2.19664);
543 defaultMu0low.push_back(1.94546);
544 defaultMu0low.push_back(-99.3263);
545 defaultMu0low.push_back(19.388);
548 for (
unsigned int i = 0;
i < params.size();
i++) {
549 tf.SetParameter(
i, params[
i]);
553 cout <<
"statsup= " << statsup <<
", statslow= " << statslow << endl;
555 enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) >
TMath::Max(statsup, statslow);
557 cout <<
"stats: " << TMath::MinElement(nActualStrips, maxAvgs.get())
559 <<
", threshold: " <<
TMath::Max(statsup, statslow) << endl;
565 for (; upBinStrip <= maxBinStrip; upBinStrip++, lowBinStrip--) {
566 double avg =
getAvrg(diffHist, iTestName, pAxis, nBinsX, upBinStrip, pAverageMode);
568 diffHist, iTestName, lowBinStrip, nBinsX, pAxis, avg, ps, deadChannels);
570 avg =
getAvrg(diffHist, iTestName, pAxis, nBinsX, lowBinStrip, pAverageMode);
572 diffHist, iTestName, upBinStrip, nBinsX, pAxis, avg, ps, deadChannels);
577 cout <<
"Invalid axis" << endl;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T 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)
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_