9 typedef std::pair<double, double>
pair;
10 typedef std::vector<pair>
array;
16 for (
int i = 0;
i <
N;
i++) {
17 const double H =
h->GetBinContent(
i) + (!
head.empty() ?
head.back().second : 0);
18 const double T =
h->GetBinContent(
N -
i) + (!
tail.empty() ?
tail.back().second : 0);
20 head.push_back(
pair(
h->GetBinWidth(
i) +
h->GetBinLowEdge(
i),
H));
41 array::const_iterator binNext(
next(
bin,
end)), binPrev(
prev(
bin, begin)), binPPrev(
prev(binPrev, begin));
43 const double DX(binNext->first - binPPrev->first), DY((binNext->second - binPPrev->second) /
Total),
45 dX(
bin->first - binPrev->first), dY((
bin->second - binPrev->second) /
Total),
47 avgX((
bin->first + binPrev->first) / 2), avgY((
bin->second + binPrev->second) / (2 *
Total)),
49 x_q(avgX + dX / dY * (
f - avgY)), xerr_q(
std::max(fabs(DX / DY), fabs(dX / dY)) *
sqrt(
f * (1 -
f) /
Total));
51 return pair(x_q, xerr_q);
65 while (binNext <
end - 1 && (++binNext)->
second ==
bin->second)
T next(T bin, T end) const
pair operator()(const double frac) const
U second(std::pair< T, U > const &p)
pair fromTail(const double frac) const
T prev(T bin, T begin) const
pair fromHead(const double frac) const
pair operator[](const double frac) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
pair calculateQ(const double frac, const bool fromHead) const
std::pair< double, double > pair
std::vector< pair > array