13 template <
typename SpacePo
int>
14 std::unique_ptr<Acts::SpacePointGrid<SpacePoint>>
19 throw std::runtime_error(
20 "SpacePointGridConfig not in ACTS internal units in "
21 "SpacePointGridCreator::createGrid");
24 throw std::runtime_error(
25 "SpacePointGridOptions not in ACTS internal units in "
26 "SpacePointGridCreator::createGrid");
29 using namespace Acts::UnitLiterals;
37 float minHelixRadius =
44 if (minHelixRadius < config.
rMax / 2) {
45 throw std::domain_error(
46 "The value of minHelixRadius cannot be smaller than rMax / 2. Please "
47 "check the configuration of bFieldInZ and minPt");
50 float maxR2 = config.
rMax * config.
rMax;
51 float xOuter = maxR2 / (2 * minHelixRadius);
52 float yOuter = std::sqrt(maxR2 - xOuter * xOuter);
53 float outerAngle = std::atan(xOuter / yOuter);
57 float rMin = config.
rMax;
62 float xInner = innerCircleR2 / (2 * minHelixRadius);
63 float yInner = std::sqrt(innerCircleR2 - xInner * xInner);
64 innerAngle = std::atan(xInner / yInner);
68 float deltaAngleWithMaxD0 =
69 std::abs(std::asin(config.
impactMax / (rMin)) -
79 float deltaPhi = (outerAngle - innerAngle + deltaAngleWithMaxD0) /
84 if (deltaPhi <= 0.
f) {
85 throw std::domain_error(
86 "Delta phi value is equal to or less than zero, leading to an "
87 "impossible number of bins (negative or infinite)");
92 phiBins =
static_cast<int>(std::ceil(2 * M_PI / deltaPhi));
104 Acts::detail::Axis<detail::AxisType::Equidistant,
105 detail::AxisBoundaryType::Closed>
109 std::vector<AxisScalar> zValues;
119 std::max(1, (
int)std::floor((config.
zMax - config.
zMin) / zBinSize));
121 for (
int bin = 0; bin <= zBins; bin++) {
123 config.
zMin + bin * ((config.
zMax - config.
zMin) / (
float)zBins);
124 zValues.push_back(edge);
130 zValues.push_back(bin);
134 detail::Axis<detail::AxisType::Variable, detail::AxisBoundaryType::Bound>
136 return std::make_unique<Acts::SpacePointGrid<SpacePoint>>(