22 std::vector<ActsFatras::Channelizer::ChannelSegment>
34 const auto&
start = segment[0];
35 const auto&
end = segment[1];
39 std::vector<ChannelStep> cSteps;
40 Bin2D bstart = {0, 0};
43 if (surface.
type() == Acts::Surface::SurfaceType::Plane) {
45 bstart = {
static_cast<unsigned int>(segmentation.
bin(
start, 0)),
46 static_cast<unsigned int>(segmentation.
bin(
start, 1))};
47 bend = {
static_cast<unsigned int>(segmentation.
bin(
end, 0)),
48 static_cast<unsigned int>(segmentation.
bin(
end, 1))};
54 if (bstart[0] != bend[0]) {
55 double k = segment2d.y() / segment2d.x();
58 const auto& xboundaries = segmentation.
binningData()[0].boundaries();
59 std::vector<double> xbbounds = {
60 xboundaries.begin() +
std::min(bstart[0], bend[0]) + 1,
61 xboundaries.begin() + std::max(bstart[0], bend[0]) + 1};
62 for (
const auto x : xbbounds) {
64 {(bstart[0] < bend[0] ? 1 : -1), 0}, {
x, k *
x + d},
start});
68 if (bstart[1] != bend[1]) {
69 double k = segment2d.x() / segment2d.y();
71 const auto& yboundaries = segmentation.
binningData()[1].boundaries();
72 std::vector<double> ybbounds = {
73 yboundaries.begin() +
std::min(bstart[1], bend[1]) + 1,
74 yboundaries.begin() + std::max(bstart[1], bend[1]) + 1};
75 for (
const auto y : ybbounds) {
77 {0, (bstart[1] < bend[1] ? 1 : -1)}, {k *
y + d,
y},
start});
81 }
else if (surface.
type() == Acts::Surface::SurfaceType::Disc) {
88 bstart = {
static_cast<unsigned int>(segmentation.
bin(pstart, 0)),
89 static_cast<unsigned int>(segmentation.
bin(pstart, 1))};
90 bend = {
static_cast<unsigned int>(segmentation.
bin(pend, 0)),
91 static_cast<unsigned int>(segmentation.
bin(pend, 1))};
99 double phiend = pend[1];
102 if (bstart[0] != bend[0]) {
103 const auto& rboundaries = segmentation.
binningData()[0].boundaries();
104 std::vector<double> rbbounds = {
105 rboundaries.begin() +
std::min(bstart[0], bend[0]) + 1,
106 rboundaries.begin() + std::max(bstart[0], bend[0]) + 1};
107 for (
const auto&
r : rbbounds) {
108 auto radIntersection =
110 r,
std::min(phistart, phiend), std::max(phistart, phiend),
112 cSteps.push_back(
ChannelStep{{(bstart[0] < bend[0] ? 1 : -1), 0},
113 radIntersection.position(),
118 if (bstart[1] != bend[1]) {
121 const auto& phiboundaries = segmentation.
binningData()[1].boundaries();
122 std::vector<double> phibbounds = {
123 phiboundaries.begin() +
std::min(bstart[1], bend[1]) + 1,
124 phiboundaries.begin() + std::max(bstart[1], bend[1]) + 1};
126 for (
const auto&
phi : phibbounds) {
128 referenceR * std::sin(
phi));
129 auto phiIntersection =
132 cSteps.push_back(
ChannelStep{{0, (bstart[1] < bend[1] ? 1 : -1)},
133 phiIntersection.position(),
140 if (not cSteps.empty()) {
145 std::vector<ChannelSegment> cSegments;
146 cSegments.reserve(cSteps.size());
148 Bin2D currentBin = {bstart[0], bstart[1]};
151 double lastPath = 0.;
152 for (
auto& cStep : cSteps) {
153 currentBin[0] += lastDelta[0];
154 currentBin[1] += lastDelta[1];
155 double path = cStep.path - lastPath;
158 lastPath = cStep.path;
159 lastDelta = cStep.delta;
160 lastIntersect = cStep.intersect;