File indexing completed on 2026-05-27 07:24:51
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsFatras/Digitization/Channelizer.hpp"
0010
0011 namespace ActsFatras {
0012
0013 Acts::Result<std::vector<Segmentizer::ChannelSegment>> Channelizer::channelize(
0014 const Hit& hit, const Acts::Surface& surface,
0015 const Acts::GeometryContext& gctx, const Acts::Vector3& driftDir,
0016 const Acts::BinUtility& segmentation, double thickness,
0017 double minRelPerpDrift) const {
0018
0019
0020
0021 const auto atReadoutPlane = m_surfaceDrift.toReadout(
0022 gctx, surface, thickness, hit.position(), hit.direction(), driftDir);
0023 if (!atReadoutPlane.ok()) {
0024 return atReadoutPlane.error();
0025 }
0026
0027 const auto& [driftedSegment, fullSegment] = *atReadoutPlane;
0028
0029
0030 const auto maskedSegmentRes = m_surfaceMask.apply(surface, driftedSegment);
0031 if (!maskedSegmentRes.ok()) {
0032 return maskedSegmentRes.error();
0033 }
0034
0035
0036 auto segments =
0037 m_segmentizer.segments(gctx, surface, segmentation, *maskedSegmentRes);
0038
0039 const double driftedPathLength =
0040 (driftedSegment[1] - driftedSegment[0]).norm();
0041
0042
0043 if (std::abs(driftedPathLength) < minRelPerpDrift * thickness &&
0044 segments.size() == 1) {
0045 segments[0].activation = thickness;
0046 return segments;
0047 }
0048
0049 const double fullPathLength = (fullSegment[1] - fullSegment[0]).norm();
0050 const double scale2Dto3D = fullPathLength / driftedPathLength;
0051
0052 for (auto& segment : segments) {
0053 segment.activation *= scale2Dto3D;
0054 }
0055
0056 return segments;
0057 }
0058
0059 }