Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DiscSurface.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DiscSurface.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-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 
22 
23 #include <cmath>
24 #include <cstddef>
25 #include <memory>
26 #include <string>
27 
28 namespace Acts {
29 
30 class DetectorElementBase;
31 class DiscBounds;
32 class SurfaceBounds;
33 
53 class DiscSurface : public Surface {
54 #ifndef DOXYGEN
55  friend Surface;
56 #endif
57 
58  protected:
66  DiscSurface(const Transform3& transform, double rmin, double rmax,
67  double hphisec = M_PI);
68 
80  DiscSurface(const Transform3& transform, double minhalfx, double maxhalfx,
81  double minR, double maxR, double avephi = 0., double stereo = 0.);
82 
87  DiscSurface(const Transform3& transform,
88  std::shared_ptr<const DiscBounds> dbounds = nullptr);
89 
94  DiscSurface(std::shared_ptr<const DiscBounds> dbounds,
95  const DetectorElementBase& detelement);
96 
100  DiscSurface(const DiscSurface& other);
101 
107  DiscSurface(const GeometryContext& gctx, const DiscSurface& other,
108  const Transform3& shift);
109 
110  public:
111  ~DiscSurface() override = default;
112  DiscSurface() = delete;
113 
117  DiscSurface& operator=(const DiscSurface& other);
118 
120  SurfaceType type() const override;
121 
128  Vector3 normal(const GeometryContext& gctx,
129  const Vector2& lposition) const final;
130 
132  using Surface::normal;
133 
141  Vector3 binningPosition(const GeometryContext& gctx,
142  BinningValue bValue) const final;
143 
145  const SurfaceBounds& bounds() const final;
146 
156  Vector3 localToGlobal(const GeometryContext& gctx, const Vector2& lposition,
157  const Vector3& direction) const final;
158 
170  Result<Vector2> globalToLocal(
171  const GeometryContext& gctx, const Vector3& position,
172  const Vector3& direction,
173  double tolerance = s_onSurfaceTolerance) const final;
174 
181  Vector2 localPolarToCartesian(const Vector2& lpolar) const;
182 
189  Vector2 localCartesianToPolar(const Vector2& lcart) const;
190 
197  Vector2 localPolarToLocalCartesian(const Vector2& locpol) const;
198 
206  Vector3 localCartesianToGlobal(const GeometryContext& gctx,
207  const Vector2& lposition) const;
208 
216  Vector2 globalToLocalCartesian(const GeometryContext& gctx,
217  const Vector3& position,
218  double tol = 0.) const;
219 
227  BoundToFreeMatrix boundToFreeJacobian(
228  const GeometryContext& gctx, const BoundVector& boundParams) const final;
229 
237  FreeToBoundMatrix freeToBoundJacobian(
238  const GeometryContext& gctx, const FreeVector& parameters) const final;
239 
246  double pathCorrection(const GeometryContext& gctx, const Vector3& position,
247  const Vector3& direction) const final;
248 
276  const GeometryContext& gctx, const Vector3& position,
277  const Vector3& direction, const BoundaryCheck& bcheck = false,
279 
288  double binningPositionValue(const GeometryContext& gctx,
289  BinningValue bValue) const final;
290 
292  std::string name() const override;
293 
302  Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
303  size_t lseg) const override;
304 
313  ActsMatrix<2, 3> localCartesianToBoundLocalDerivative(
314  const GeometryContext& gctx, const Vector3& position) const final;
315 
316  protected:
317  std::shared_ptr<const DiscBounds> m_bounds;
318 };
319 } // end of namespace Acts