33 mParameters = iParameters;
46 TH2F* pHistogram = getDifferentialHistogram(iHistName);
47 int nBinsX = pHistogram->GetNbinsX();
48 int nBinsY = pHistogram->GetNbinsY();
49 int nMasked = getNBinsMasked(iHistName);
50 unsigned int nBinsActive = (nBinsX * nBinsY) - nMasked;
64 TH2F*
histo = mHistograms[iHistName].first;
65 vector<pair<int, int> >*
m =
new vector<pair<int, int> >();
68 printf(
"Masked areas for: %s\n", iHistName.c_str());
71 for (
unsigned int i = 0;
i < iMaskedAreas.size();
i++) {
83 if (iTypeUnits == 0) {
84 sTypeUnits =
"Histogram Units";
85 }
else if (iTypeUnits == 1) {
86 sTypeUnits =
"Bin Units";
88 sTypeUnits =
"Unknown Units";
91 "Area %3i: xmin=%6.2f xmax=%6.2f ymin=%6.2f ymax=%6.2f %s\n",
i,
xmin,
xmax,
ymin,
ymax, sTypeUnits.c_str());
94 int xfirst, yfirst,
xlast, ylast;
109 if (iTypeUnits == 0) {
118 histo->GetBinXYZ(globalMinBin, xfirst, yfirst, binZ);
119 histo->GetBinXYZ(globalMaxBin,
xlast, ylast, binZ);
123 if (
histo->GetXaxis()->GetBinLowEdge(globalMaxBin) ==
xmax) {
126 if (
histo->GetYaxis()->GetBinLowEdge(globalMaxBin) ==
ymax) {
141 for (
int x = xfirst; x <=
xlast; x++) {
142 for (
int y = yfirst; y <= ylast; y++) {
151 delete[] mMaskedBins[iHistName];
152 mMaskedBins[iHistName] =
m;
164 return (*mMaskedBins[iHistName]);
176 return mMaskedBins[iHistName]->size();
191 vector<pair<int, int> >
m = (*mMaskedBins[iHistName]);
196 for (
unsigned int i = 0;
i <
m.size();
i++) {
197 pair<int, int>&
p =
m[
i];
198 if (
p.first == iStrip) {
199 oHist->SetBinContent(
p.first,
p.second, 0.0);
205 else if (iAxis == 2) {
206 for (
unsigned int i = 0;
i <
m.size();
i++) {
207 pair<int, int>&
p =
m[
i];
208 if (
p.second == iStrip) {
209 oHist->SetBinContent(
p.first,
p.second, 0.0);
215 cout <<
"invalid axis" << endl;
233 vector<pair<int, int> >* thisHistMaskedBins = mMaskedBins[iHistName];
235 bool binIsMasked =
false;
237 for (
unsigned int i = 0;
i < thisHistMaskedBins->size();
i++) {
238 if ((*thisHistMaskedBins)[
i].first == iBinX && (*thisHistMaskedBins)[
i].second == iBinY) {
258 bool stripIsMasked =
true;
259 vector<pair<int, int> >* thisHistMaskedBins = mMaskedBins[iHistName];
264 for (
unsigned int i = 0;
i < thisHistMaskedBins->size();
i++) {
265 if ((*thisHistMaskedBins)[
i].first == iBinStrip) {
269 stripIsMasked = getDifferentialHistogram(iHistName)->GetYaxis()->GetNbins() ==
count;
274 for (
unsigned int i = 0;
i < thisHistMaskedBins->size();
i++) {
275 if ((*thisHistMaskedBins)[
i].second == iBinStrip) {
279 stripIsMasked = getDifferentialHistogram(iHistName)->GetXaxis()->GetNbins() ==
count;
282 return stripIsMasked;
296 string iHistLocation) {
297 pair<TH2F*, TH2F*> histPair;
300 TH2F* pHist = getRebinnedHistogram(igetter, iHistName, iHistLocation);
302 if (mHistValid[iHistName]) {
303 histPair.first = pHist;
305 TH2F* histDiff =
new TH2F(*histPair.first);
307 histPair.second = histDiff;
309 mHistograms[iHistName] = histPair;
312 mHistDiffMinus1[iHistName] =
new TH2F(*histDiff);
329 string iHistLocation) {
335 histMonitor =
nullptr;
336 mHistValid[iHistName] =
false;
338 mHistValid[iHistName] =
true;
339 histMonitor =
new TH2F(*(igetter.
get(iHistLocation)->
getTH2F()));
342 int rebinFactorX = 1;
343 int rebinFactorY = 1;
345 vector<ParameterSet> testParameters = mParameters.getParameter<vector<ParameterSet> >(
"testParams");
346 for (
unsigned int i = 0;
i < testParameters.size();
i++) {
347 if (testParameters[
i].getParameter<string>(
"testName") == iHistName) {
356 if (rebinFactorX != 1) {
357 histMonitor->RebinY(rebinFactorX);
359 if (rebinFactorY != 1) {
360 histMonitor->RebinY(rebinFactorY);
376 string iHistLocation,
378 if (mHistValid[iHistName]) {
379 TH2F* histo_curr = getRebinnedHistogram(
380 igetter, iHistLocation, iHistLocation);
382 TH2F* histo_old =
new TH2F(*histo_curr);
383 histo_curr->Add(mHistograms[iHistName].
first, -1.0);
385 mLSListDiff[iHistName].push_back(iLS);
387 delete mHistograms[iHistName].first;
388 mHistograms[iHistName].first = histo_old;
389 mHistograms[iHistName].second->Add(histo_curr);
402 if (mHistValid[iHistName]) {
403 mHistograms[iHistName].second->Add(mHistDiffMinus1[iHistName]);
404 mLSListDiff[iHistName].insert(
405 mLSListDiff[iHistName].
end(), mLSListDiffMinus1[iHistName].begin(), mLSListDiffMinus1[iHistName].
end());
416 if (mHistValid[iHistName]) {
418 delete mHistDiffMinus1[iHistName];
419 mHistDiffMinus1[iHistName] =
new TH2F(*mHistograms[iHistName].
second);
422 mHistograms[iHistName].second->Reset();
425 mLSListDiffMinus1[iHistName] = mLSListDiff[iHistName];
426 mLSListDiff[iHistName].clear();
450 if (mHistValid[iHistName]) {
451 return mHistograms[iHistName].second;