29 std::array<std::size_t, 2u> minMaxBins, std::size_t expand,
32 std::vector<std::size_t> rBins;
37 auto fill_linear = [&](std::size_t lmin, std::size_t lmax) ->
void {
38 for (std::size_t
b = lmin;
b <= lmax; ++
b) {
42 std::size_t bmin = minMaxBins[0
u];
43 std::size_t bmax = minMaxBins[1
u];
46 if (type != Acts::detail::AxisBoundaryType::Closed) {
47 rBins.reserve(bmax - bmin + 1
u + 2 * expand);
49 if (type == Acts::detail::AxisBoundaryType::Bound) {
50 bmin = (int(bmin) - int(expand) > 0) ? bmin - expand : 1
u;
51 bmax = (bmax + expand <= nBins) ? bmax + expand : nBins;
52 }
else if (type == Acts::detail::AxisBoundaryType::Open) {
53 bmin = (int(bmin) - int(expand) >= 0) ? bmin - expand : 0
u;
54 bmax = (bmax + expand <= nBins + 1
u) ? bmax + expand : nBins + 1
u;
56 fill_linear(bmin, bmax);
59 std::size_t span = bmax - bmin + 1
u + 2 * expand;
61 if (2 * span < nBins and (bmax + expand <= nBins) and
62 (
int(bmin) -
int(expand) > 0)) {
64 Acts::detail::AxisBoundaryType::Bound);
65 }
else if (2 * span < nBins) {
66 bmin = int(bmin) - int(expand) > 0 ? bmin - expand : 1
u;
67 bmax = bmax + expand <= nBins ? bmax + expand : nBins;
68 fill_linear(bmin, bmax);
70 if (bmax + expand > nBins) {
71 std::size_t overstep = (bmax + expand - nBins);
72 fill_linear(1
u, overstep);
74 if (
int(bmin) -
int(expand) < 1) {
75 std::size_t understep = abs(
int(bmin) -
int(expand));
76 fill_linear(nBins - understep, nBins);
81 fill_linear(bmax - expand, nBins);
82 fill_linear(1, bmin + expand);