45 fsName.ReplaceAll(
" ",
"");
53 fpHistBase = (TH2F*) gPad->GetPrimitive(
"htemp");
65 for (
int iS = 0; iS <
fNslices; ++iS) {
67 int iBinMin = sliceSize * iS;
68 int iBinMax = sliceSize * (iS + 1) - 1;
76 pGrUpper->SetMarkerColor(kOrange + 2);
77 pGrUpper->SetMarkerStyle(20);
78 pGrUpper->Draw(
"PSAME");
80 pGrLower->SetMarkerColor(kOrange + 2);
81 pGrLower->SetMarkerStyle(20);
82 pGrLower->Draw(
"PSAME");
95 assert(iBinMin <= iBinMax);
96 float lEdge =
fpHistBase->GetXaxis()->GetBinLowEdge(iBinMin + 1);
97 float uEdge =
fpHistBase->GetXaxis()->GetBinUpEdge(iBinMax + 1);
98 float sliceCenter = (lEdge + uEdge) * 0.5;
99 const char* parTitle =
fpHistBase->GetXaxis()->GetTitle();
100 TString sSliceTitle = Form(
"%.2f < %s < %.2f (bins %d-%d)", lEdge, parTitle, uEdge, iBinMin, iBinMax);
101 TString sSliceName = Form(
"%s_slice%d-%d",
fpHistBase->GetName(), iBinMin, iBinMax);
102 TH1F* pHistSlice = (TH1F*)
fpHistBase->ProjectionY(sSliceName, iBinMin, iBinMax);
103 pHistSlice->SetTitle(sSliceTitle);
106 constexpr float maximumScale = 1.1;
107 pHistSlice->SetMaximum(pHistSlice->GetMaximum() * maximumScale);
108 pHistSlice->Draw(
"");
114 float windowMin = 0.f;
115 float windowMax = 0.f;
116 float nEntriesTot = pHistSlice->GetEntries();
119 for (
int iBin = 1; contentL < nEntriesTot *
fEps * 0.5; ++iBin) {
120 windowMin = pHistSlice->GetXaxis()->GetBinLowEdge(iBin);
121 contentL += pHistSlice->GetBinContent(iBin);
125 for (
int iBin = pHistSlice->GetXaxis()->GetNbins(); contentR < nEntriesTot *
fEps * 0.5; --iBin) {
126 windowMax = pHistSlice->GetXaxis()->GetBinUpEdge(iBin);
127 contentR += pHistSlice->GetBinContent(iBin);
131 TBox* pWindowBox =
new TBox(windowMin, pHistSlice->GetMinimum(), windowMax, pHistSlice->GetMaximum());
132 pWindowBox->SetFillColor(kGreen);
133 pWindowBox->Draw(
"SAME");
134 pHistSlice->Draw(
"SAME");
136 return std::tie(windowMin, windowMax, sliceCenter);