Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Channelizer.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Channelizer.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
13 
14 #include <array>
15 #include <utility>
16 #include <vector>
17 
18 namespace Acts {
19 class BinUtility;
20 class Surface;
21 } // namespace Acts
22 
23 namespace ActsFatras {
24 
28 struct Channelizer {
30  using Segment2D = std::array<Acts::Vector2, 2>;
32  using Bin2D = std::array<unsigned int, 2>;
34  using BinDelta2D = std::array<int, 2>;
35 
37  struct ChannelStep {
39  BinDelta2D delta = {0, 0};
43  double path = 0.;
44 
50  ChannelStep(BinDelta2D delta_, Acts::Vector2 intersect_,
51  const Acts::Vector2& start)
52  : delta(delta_),
53  intersect(std::move(intersect_)),
54  path((intersect - start).norm()) {}
55 
62  bool operator<(const ChannelStep& cstep) const { return path < cstep.path; }
63  };
64 
66  struct ChannelSegment {
68  Bin2D bin = {0, 0};
72  double activation = 0.;
73 
79  ChannelSegment(Bin2D bin_, Segment2D path2D_, double activation_)
80  : bin(bin_), path2D(std::move(path2D_)), activation(activation_) {}
81  };
82 
98  std::vector<ChannelSegment> segments(const Acts::GeometryContext& geoCtx,
99  const Acts::Surface& surface,
100  const Acts::BinUtility& segmentation,
101  const Segment2D& segment) const;
102 };
103 
104 } // namespace ActsFatras