EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpacePointGrid.ipp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SpacePointGrid.ipp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 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 
10 
11 #include <memory>
12 
13 template <typename SpacePoint>
14 std::unique_ptr<Acts::SpacePointGrid<SpacePoint>>
17  // calculate circle intersections of helix and max detector radius
18  float minHelixRadius = config.minPt / (300. * config.bFieldInZ); // in mm
19  float maxR2 = config.rMax * config.rMax;
20  float xOuter = maxR2 / (2 * minHelixRadius);
21  float yOuter = std::sqrt(maxR2 - xOuter * xOuter);
22  float outerAngle = std::atan(xOuter / yOuter);
23  // intersection of helix and max detector radius minus maximum R distance from
24  // middle SP to top SP
25  float innerAngle = 0;
26  if (config.rMax > config.deltaRMax) {
27  float innerCircleR2 =
28  (config.rMax - config.deltaRMax) * (config.rMax - config.deltaRMax);
29  float xInner = innerCircleR2 / (2 * minHelixRadius);
30  float yInner = std::sqrt(innerCircleR2 - xInner * xInner);
31  innerAngle = std::atan(xInner / yInner);
32  }
33 
34  // FIXME: phibin size must include max impact parameters
35  // divide 2pi by angle delta to get number of phi-bins
36  // size is always 2pi even for regions of interest
37  int phiBins = std::floor(2 * M_PI / (outerAngle - innerAngle));
38  Acts::detail::Axis<detail::AxisType::Equidistant,
39  detail::AxisBoundaryType::Closed>
40  phiAxis(-M_PI, M_PI, phiBins);
41 
42  // TODO: can probably be optimized using smaller z bins
43  // and returning (multiple) neighbors only in one z-direction for forward
44  // seeds
45  // FIXME: zBinSize must include scattering
46  float zBinSize = config.cotThetaMax * config.deltaRMax;
47  int zBins = std::floor((config.zMax - config.zMin) / zBinSize);
48  detail::Axis<detail::AxisType::Equidistant, detail::AxisBoundaryType::Bound>
49  zAxis(config.zMin, config.zMax, zBins);
50  return std::make_unique<Acts::SpacePointGrid<SpacePoint>>(
51  std::make_tuple(phiAxis, zAxis));
52 }