File CylinderSurface.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

class CylinderSurface : public Acts::Surface
#include <Acts/Surfaces/CylinderSurface.hpp>

Class for a CylinderSurface in the TrackingGeometry.

It inherits from Surface.

The cylinder surface has a special role in the TrackingGeometry, since it builds the surfaces of all TrackingVolumes at container level for a cylindrical tracking geometry.

_build/doxygen-xml/CylinderSurface.png

Subclassed by Acts::CylinderLayer

Public Functions

CylinderSurface() = delete
~CylinderSurface() override = default
virtual AlignmentToPathMatrix alignmentToPathDerivative(const GeometryContext &gctx, const FreeVector &parameters) const final

Calculate the derivative of path length at the geometry constraint or point-of-closest-approach w.r.t.

alignment parameters of the surface (i.e. local frame origin in global 3D Cartesian coordinates and its rotation represented with extrinsic Euler angles)

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • parameters – is the free parameters

Returns

Derivative of path length w.r.t. the alignment parameters

virtual Vector3 binningPosition(const GeometryContext &gctx, BinningValue bValue) const final

The binning position method - is overloaded for r-type binning.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • bValue – is the type of global binning to be done

Returns

is the global position to be used for binning

virtual const CylinderBounds &bounds() const final

This method returns the CylinderBounds by reference.

virtual Result<Vector2> globalToLocal(const GeometryContext &gctx, const Vector3 &position, const Vector3 &momentum, double tolerance = s_onSurfaceTolerance) const final

Global to local transformation.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • position – is the global position to be transformed

  • momentum – is the global momentum (ignored in this operation)

  • tolerance – optional tolerance within which a point is considered valid on surface

Returns

a Result<Vector2> which can be !ok() if the operation fails

virtual SurfaceIntersection intersect(const GeometryContext &gctx, const Vector3 &position, const Vector3 &direction, const BoundaryCheck &bcheck) const final

Straight line intersection schema from position/direction.

If possible returns both solutions for the cylinder

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • position – The position to start from

  • direction – The direction at start

  • bcheck – the Boundary Check

Returns

SurfaceIntersection object (contains intersection & surface)

virtual ActsMatrix<2, 3> localCartesianToBoundLocalDerivative(const GeometryContext &gctx, const Vector3 &position) const final

Calculate the derivative of bound track parameters local position w.r.t.

position in local 3D Cartesian coordinates

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • position – The position of the paramters in global

Returns

Derivative of bound local position w.r.t. position in local 3D cartesian coordinates

virtual Vector3 localToGlobal(const GeometryContext &gctx, const Vector2 &lposition, const Vector3 &momentum) const final

Local to global transformation.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • lposition – is the local position to be transformed

  • momentum – is the global momentum (ignored in this operation)

Returns

The global position by value

virtual std::string name() const override

Return method for properly formatted output string.

virtual Vector3 normal(const GeometryContext &gctx, const Vector2 &lposition) const final

Return method for surface normal information.

Note

for a Cylinder a local position is always required for the normal vector

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • lposition – is the local postion for which the normal vector is requested

Returns

normal vector at the local position by value

virtual Vector3 normal(const GeometryContext &gctx, const Vector3 &position) const final

Return method for surface normal information.

Note

for a Cylinder a local position is always required for the normal vector

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • position – is the global postion for which the normal vector is requested

Returns

normal vector at the global position by value

CylinderSurface &operator=(const CylinderSurface &other)

Assignment operator.

Parameters

other – is the source cylinder for the copy

virtual double pathCorrection(const GeometryContext &gctx, const Vector3 &position, const Vector3 &direction) const final

Path correction due to incident of the track.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • position – is the global position as a starting point

  • direction – is the global momentum at the starting point

Returns

is the correction factor due to incident

virtual Polyhedron polyhedronRepresentation(const GeometryContext &gctx, size_t lseg) const override

Return a Polyhedron for a cylinder.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • lseg – Number of segments along curved lines, it represents the full 2*M_PI coverange, if lseg is set to 1 only the extrema are given

Returns

A list of vertices and a face/facett description of it

virtual RotationMatrix3 referenceFrame(const GeometryContext &gctx, const Vector3 &position, const Vector3 &momentum) const final

Return the measurement frame - this is needed for alignment, in particular The measurement frame of a cylinder is the tangential plane at a given position.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • position – is the position where the measurement frame is defined

  • momentum – is the momentum vector (ignored)

Returns

rotation matrix that defines the measurement frame

virtual Vector3 rotSymmetryAxis(const GeometryContext &gctx) const

Return method for the rotational symmetry axis.

Parameters

gctx – The current geometry context object, e.g. alignment

Returns

the z-Axis of transform

virtual SurfaceType type() const override

Return the surface type.

Protected Functions

CylinderSurface(std::shared_ptr<const CylinderBounds> cbounds, const DetectorElementBase &detelement)

Constructor from DetectorElementBase: Element proxy.

Parameters
  • cbounds – are the provided cylinder bounds (shared)

  • detelement – is the linked detector element to this surface

CylinderSurface(const Transform3 &transform, double radius, double halfz, double halfphi = M_PI, double avphi = 0., double bevelMinZ = 0., double bevelMaxZ = 0.)

Constructor from Transform3 and CylinderBounds.

Parameters
  • transform – The transform to position the surface

  • radius – The radius of the cylinder

  • halfz – The half length in z

  • halfphi – The half opening angle

  • avphi – The phi value from which the opening angle spans (both sides)

  • bevelMinZ – (optional) The bevel on the negative z side

  • bevelMaxZ – (optional) The bevel on the positive z sid The bevel on the positive z side

CylinderSurface(const Transform3 &transform, const std::shared_ptr<const CylinderBounds> &cbounds)

Constructor from Transform3 and CylinderBounds arguments.

Parameters
  • transform – The transform to position the surface

  • cbounds – is a shared pointer to a cylindeer bounds object, it must exist (assert test)

CylinderSurface(const CylinderSurface &other)

Copy constructor.

Parameters

other – is the source cylinder for the copy

CylinderSurface(const GeometryContext &gctx, const CylinderSurface &other, const Transform3 &shift)

Copy constructor - with shift.

Parameters
  • gctx – The current geometry context object, e.g. alignment

  • other – is the source cone surface

  • shift – is the additional transfrom applied after copying

Protected Attributes

std::shared_ptr<const CylinderBounds> m_bounds

bounds (shared)

Private Functions

detail::RealQuadraticEquation intersectionSolver(const Transform3 &transform, const Vector3 &position, const Vector3 &direction) const

Implementation of the intersection solver.

mathematical motivation:

The cylinder is given by :

  • cylinder center: ccenter (C)

  • the direction of the cylinder axis: cdirection (DZ)

  • the radius r The line is given by :

  • a reference position : lposition (L0)

  • the line direction: ldirection (DL) the parametric form for the line is then : L(t) = L0 + t * DL

Any point P on infinite cylinder if : ((P - C) x DZ)^2 = r^2 * DZ^2 We know that DZ is a unit vector: DZ^2 == 1 When expanded with the line equation, this is : ((L0 - C) x DZ + t * (DL x DZ))^2 = r^2 * DZ^2 which is a quadratic equation in the form (X + t * Y)^2 = d, where : X = (L0 - C) x DZ Y = DL x DZ d = r^2 * (DZ)^2 Now, expand the equation : t^2 * (Y . Y) + t * (2 * (X . Y)) + (X . X) - d = 0 => second order equation in the form : a*t^2 + b*t + c = 0 where a = (Y . Y) b = 2 * (X . Y) c = (X . X) - d finally solve the second order equation : a*t^2 + b*t + c = 0 reinsertion into the line equation.

Returns

the quadratic equation