9 double xmin = sig->GetXaxis()->GetXmin();
10 double xmax = sig->GetXaxis()->GetXmax();
11 double step_size = (xmax - xmin) /
static_cast<double>(steps);
12 double sig_tot = sig->Integral();
13 double lower_limit = 0;
14 double upper_limit = 0;
15 double ofrac = (1. - frac) / 2.;
16 for (
unsigned j = 0; j < steps; ++j) {
18 sig, xmin, xmin + (step_size *
static_cast<double>(j)));
19 if (integral / sig_tot > ofrac) {
20 lower_limit = xmin + (step_size *
static_cast<double>(j));
24 for (
unsigned j = 0; j < steps; ++j) {
26 sig, xmax - (step_size *
static_cast<double>(j)), xmax);
27 if (integral / sig_tot > ofrac) {
28 upper_limit = xmax - (step_size *
static_cast<double>(j));
39 TAxis
const* axis = hist->GetXaxis();
40 int bmin = axis->FindFixBin(xmin);
41 int bmax = axis->FindFixBin(xmax);
42 double integral = hist->Integral(bmin, bmax);
43 integral -= hist->GetBinContent(bmin) * (xmin - axis->GetBinLowEdge(bmin)) /
44 axis->GetBinWidth(bmin);
45 integral -= hist->GetBinContent(bmax) * (axis->GetBinUpEdge(bmax) - xmax) /
46 axis->GetBinWidth(bmax);
double IntegrateFloatRange(TH1F const *hist, double xmin, double xmax)