ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::PerigeeSurface Class Referencefinal

Class describing the Line to which the Perigee refers to. More...

#include <PerigeeSurface.h>

Inheritance diagram for Trk::PerigeeSurface:
Collaboration diagram for Trk::PerigeeSurface:

Public Types

using ChargedTrackParametersUniquePtr
 Unique ptr types.
using NeutralTrackParametersUniquePtr

Public Member Functions

 PerigeeSurface ()
 Default Constructor - needed for persistency.
 PerigeeSurface (const PerigeeSurface &pesf)
 Copy constructor.
PerigeeSurfaceoperator= (const PerigeeSurface &slsf)
 Assignment operator.
 PerigeeSurface (PerigeeSurface &&pesf) noexcept=default
 Copy constructor.
PerigeeSurfaceoperator= (PerigeeSurface &&slsf) noexcept=default
 Assignment operator.
virtual ~PerigeeSurface ()=default
 Destructor.
 PerigeeSurface (const Amg::Vector3D &gp)
 Constructor from GlobalPosition.
 PerigeeSurface (const Amg::Transform3D &tTransform)
 Constructor with a Transform by ref - needed for tilt.
 PerigeeSurface (const PerigeeSurface &pesf, const Amg::Transform3D &transf)
 Copy constructor with shift.
virtual PerigeeSurfaceclone () const override final
 Virtual constructor.
virtual bool operator== (const Surface &sf) const override
 Equality operator.
bool operator== (const PerigeeSurface &cf) const
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters (double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
 Use the Surface as a ParametersBase constructor, from local parameters - charged.
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters (const Amg::Vector3D &position, const Amg::Vector3D &momentum, double charge, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
 Use the Surface as a ParametersBase constructor, from global parameters - charged.
virtual NeutralTrackParametersUniquePtr createUniqueNeutralParameters (double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
 Use the Surface as a ParametersBase constructor, from local parameters - neutral.
virtual NeutralTrackParametersUniquePtr createUniqueNeutralParameters (const Amg::Vector3D &position, const Amg::Vector3D &momentum, double charge, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
 Use the Surface as a ParametersBase constructor, from global parameters - neutral.
template<int DIM, class T>
std::unique_ptr< ParametersT< DIM, T, PerigeeSurface > > createUniqueParameters (double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(DIM)> cov=std::nullopt) const
 Use the Surface as a ParametersBase constructor, from local parameters.
template<int DIM, class T>
std::unique_ptr< ParametersT< DIM, T, PerigeeSurface > > createUniqueParameters (const Amg::Vector3D &position, const Amg::Vector3D &momentum, double charge, std::optional< AmgSymMatrix(DIM)> cov=std::nullopt) const
 Use the Surface as a ParametersBase constructor, from global parameters.
virtual constexpr SurfaceType type () const override final
 Return the surface type.
virtual const Amg::Vector3Dnormal () const override final
 Returns the x global axis.
virtual Amg::Vector3D normal (const Amg::Vector2D &lp) const override final
 Returns a normal vector at a specific localPosition.
virtual Amg::RotationMatrix3D measurementFrame (const Amg::Vector3D &glopos, const Amg::Vector3D &glomom) const override final
 Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perigee Surface.
Amg::Vector3D localToGlobal (const LocalParameters &locpos) const
 Local to global method: Take care that by just providing locR and locZ the global position cannot be calculated.
Amg::Vector3D localToGlobal (const LocalParameters &locpos, const Amg::Vector3D &glomom) const
 This method is the true local->global transformation.
virtual void localToGlobal (const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
 LocalToGlobal method without dynamic memory allocation.
virtual bool globalToLocal (const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
 GlobalToLocal method without dynamic memory allocation - boolean checks if on surface.
virtual Intersection straightLineIntersection (const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool forceDir=false, Trk::BoundaryCheck bchk=false) const override final
 fast straight line intersection schema - standard: provides closest intersection and (signed) path length forceDir is to provide the closest forward solution
virtual DistanceSolution straightLineDistanceEstimate (const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override final
 fast straight line distance evaluation to Surface
virtual DistanceSolution straightLineDistanceEstimate (const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool Bound) const override final
 fast straight line distance evaluation to Surface - with bound option
virtual double pathCorrection (const Amg::Vector3D &, const Amg::Vector3D &) const override final
 the pathCorrection for derived classes with thickness
virtual bool isOnSurface (const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const override final
 This method checks if a globalPosition in on the Surface or not.
virtual bool insideBounds (const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const override final
 This surface calls the iside method of the bounds.
virtual bool insideBoundsCheck (const Amg::Vector2D &locpos, const BoundaryCheck &bchk) const override final
const Amg::Vector3DlineDirection () const
 Special method for StraightLineSurface - provides the Line direction from cache: speedup.
virtual const NoBoundsbounds () const override final
 Return bounds() method.
virtual std::string name () const override final
 Return properly formatted class name for screen output.
virtual MsgStream & dump (MsgStream &sl) const override
 Output Method for MsgStream.
virtual std::ostream & dump (std::ostream &sl) const override
 Output Method for std::ostream.
bool operator!= (const Surface &sf) const
 Non-equality operator.
std::unique_ptr< SurfaceuniqueClone () const
 NVI method returning unique_ptr clone.
const Amg::Transform3DcachedTransform () const
 Return the cached transformation directly.
const Amg::Transform3Dtransform () const
 Returns HepGeom::Transform3D by reference.
const Amg::Vector3Dcenter () const
 Returns the center position of the Surface.
virtual const Amg::Vector3DglobalReferencePoint () const
 Returns a global reference point on the surface, for PlaneSurface, StraightLineSurface, PerigeeSurface this is equal to center(), for CylinderSurface and DiscSurface this is a new member.
const TrkDetElementBaseassociatedDetectorElement () const
 return associated Detector Element
Identifier associatedDetectorElementIdentifier () const
 return Identifier of the associated Detector Element
const Trk::LayerassociatedLayer () const
 return the associated Layer
const Trk::MaterialLayermaterialLayer () const
 return the material Layer
Trk::MaterialLayermaterialLayer ()
virtual const Trk::SurfacebaseSurface () const
 return the base surface (simplified for persistification)
std::optional< Amg::Vector2DpositionOnSurface (const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
 positionOnSurface() returns the LocalPosition on the Surface,
If BoundaryCheck==false it just returns the value of globalToLocal (including nullptr possibility), if BoundaryCheck==true it checks whether the point is inside bounds or not (returns std::nullopt in this case).
template<class T>
bool onSurface (const T &parameters, const BoundaryCheck &bchk=BoundaryCheck(true)) const
 The templated Parameters OnSurface method - checks on surface pointer first.
Amg::Vector3D localToGlobal (const Amg::Vector2D &locpos) const
 This method returns the GlobalPosition from a LocalPosition uses the per surface localToGlobal.
Amg::Vector3D localToGlobal (const Amg::Vector2D &locpos, const Amg::Vector3D &glomom) const
 This method returns the GlobalPosition from a LocalPosition The LocalPosition can be outside Surface bounds - for generality with momentum.
std::optional< Amg::Vector2DglobalToLocal (const Amg::Vector3D &glopos, double tol=0.) const
 This method returns the LocalPosition from a provided GlobalPosition.
std::optional< Amg::Vector2DglobalToLocal (const Amg::Vector3D &glopos, const Amg::Vector3D &glomom) const
 This method returns the LocalPosition from a provided GlobalPosition.
virtual Amg::Vector2D localParametersToPosition (const LocalParameters &locpars) const
 Optionally specified by each surface type : LocalParameters to Vector2D.
template<typename T>
Intersection straightLineIntersection (const T &pars, bool forceDir=false, const Trk::BoundaryCheck &bchk=false) const
 fst straight line intersection schema - templated for charged and neutral parameters
bool isFree () const
 Returns 'true' if this surface is 'free', i.e.
bool isActive () const
 Return 'true' if this surface is owned by the detector element.
void setTransform (const Amg::Transform3D &trans)
 Set the transform updates center and normal.
void setOwner (SurfaceOwner x)
 set Ownership
SurfaceOwner owner () const
 return ownership
void setMaterialLayer (std::shared_ptr< Trk::MaterialLayer > mlay)
 set material layer
void associateLayer (const Layer &lay)
 method to associate a Trk::Layer.

Static Public Member Functions

static std::size_t numberOfInstantiations ()

Static Public Attributes

static constexpr SurfaceType staticType = SurfaceType::Perigee
 The surface type static constexpr.
static std::atomic_size_t s_numberOfInstantiations

Protected Member Functions

Amg::Transform3D inverseTransformHelper () const
 Helper method to factorize in one place common operations calculate inverse transofrm and multiply with position.
Amg::Vector3D inverseTransformMultHelper (const Amg::Vector3D &glopos) const

Protected Attributes

CxxUtils::CachedValue< Amg::Vector3Dm_lineDirection
 < data members cache of the line direction (speeds up)
std::unique_ptr< Transformsm_transforms {}
 Unique Pointer to the Transforms struct.
const TrkDetElementBasem_associatedDetElement {}
 Not owning Pointer to the Detector Element.
Identifier m_associatedDetElementId {}
 Identifier to the Detector Element.
const Layerm_associatedLayer {}
 The associated layer Trk::Layer This is the layer in which the Surface is embedded.
std::shared_ptr< MaterialLayerm_materialLayer {}
 Possibility to attach a material description to the surface.
SurfaceOwner m_owner {SurfaceOwner::noOwn}
 enum for surface owner : default free surface

Static Protected Attributes

static const NoBounds s_perigeeBounds
static constexpr double s_onSurfaceTolerance = 10e-5
 Tolerance for being on Surface.

Detailed Description

Class describing the Line to which the Perigee refers to.

The Surface axis is fixed to be the z-axis of the Tracking frame. It inherits from Surface.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch
Christos Anastopoulos (Thread safety and interface cleanup)
Shaun Roe (interface cleanup)

Definition at line 42 of file PerigeeSurface.h.

Member Typedef Documentation

◆ ChargedTrackParametersUniquePtr

Initial value:
std::unique_ptr<ParametersBase<5, Trk::Charged>>

Unique ptr types.

Definition at line 128 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

◆ NeutralTrackParametersUniquePtr

Initial value:
std::unique_ptr<ParametersBase<5, Trk::Neutral>>

Definition at line 130 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

Constructor & Destructor Documentation

◆ PerigeeSurface() [1/6]

Trk::PerigeeSurface::PerigeeSurface ( )

Default Constructor - needed for persistency.

Definition at line 21 of file PerigeeSurface.cxx.

22 : Surface()
24{}
CxxUtils::CachedValue< Amg::Vector3D > m_lineDirection
< data members cache of the line direction (speeds up)
Surface()
Default Constructor for inheriting classes.

◆ PerigeeSurface() [2/6]

Trk::PerigeeSurface::PerigeeSurface ( const PerigeeSurface & pesf)

Copy constructor.

Definition at line 51 of file PerigeeSurface.cxx.

52 : Surface(pesf)
54{
55 if (pesf.m_transforms) {
56 Surface::m_transforms = std::make_unique<Transforms>(
57 pesf.m_transforms->transform, pesf.m_transforms->center, s_xAxis);
58 }
59}
std::unique_ptr< Transforms > m_transforms
Unique Pointer to the Transforms struct.
static const Amg::Vector3D s_xAxis(1, 0, 0)
global x Axis;

◆ PerigeeSurface() [3/6]

Trk::PerigeeSurface::PerigeeSurface ( PerigeeSurface && pesf)
defaultnoexcept

Copy constructor.

◆ ~PerigeeSurface()

virtual Trk::PerigeeSurface::~PerigeeSurface ( )
virtualdefault

Destructor.

◆ PerigeeSurface() [4/6]

Trk::PerigeeSurface::PerigeeSurface ( const Amg::Vector3D & gp)

Constructor from GlobalPosition.

Definition at line 26 of file PerigeeSurface.cxx.

27 : Surface()
29{
30 Amg::Transform3D transform (Amg::Translation3D(gp.x(), gp.y(), gp.z()));
31 Surface::m_transforms = std::make_unique<Transforms>(transform, gp, s_xAxis);
32}
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Eigen::Affine3d Transform3D
Eigen::Translation< double, 3 > Translation3D

◆ PerigeeSurface() [5/6]

Trk::PerigeeSurface::PerigeeSurface ( const Amg::Transform3D & tTransform)

Constructor with a Transform by ref - needed for tilt.

Definition at line 34 of file PerigeeSurface.cxx.

35 : Surface() // default for base
37{
38
40 std::make_unique<Transforms>(tTransform, tTransform.translation(), s_xAxis);
41}

◆ PerigeeSurface() [6/6]

Trk::PerigeeSurface::PerigeeSurface ( const PerigeeSurface & pesf,
const Amg::Transform3D & transf )

Copy constructor with shift.

Definition at line 61 of file PerigeeSurface.cxx.

62 : Surface()
64{
65 if (pesf.m_transforms) {
67 std::make_unique<Transforms>(shift * pesf.m_transforms->transform,
68 shift * pesf.m_transforms->center,
69 s_xAxis);
70 }
71}

Member Function Documentation

◆ associatedDetectorElement()

const TrkDetElementBase * Trk::Surface::associatedDetectorElement ( ) const
inherited

return associated Detector Element

◆ associatedDetectorElementIdentifier()

Identifier Trk::Surface::associatedDetectorElementIdentifier ( ) const
inherited

return Identifier of the associated Detector Element

◆ associatedLayer()

const Trk::Layer * Trk::Surface::associatedLayer ( ) const
inherited

return the associated Layer

◆ associateLayer()

void Trk::Surface::associateLayer ( const Layer & lay)
inherited

method to associate a Trk::Layer.

We do not take ownership as this is typically already owned by the Geometry

◆ baseSurface()

virtual const Trk::Surface * Trk::Surface::baseSurface ( ) const
virtualinherited

return the base surface (simplified for persistification)

◆ bounds()

virtual const NoBounds & Trk::PerigeeSurface::bounds ( ) const
finaloverridevirtual

Return bounds() method.

Implements Trk::Surface.

◆ cachedTransform()

const Amg::Transform3D * Trk::Surface::cachedTransform ( ) const
inherited

Return the cached transformation directly.

Don't try to make a new transform if it's not here.

◆ center()

const Amg::Vector3D & Trk::Surface::center ( ) const
inherited

Returns the center position of the Surface.

◆ clone()

virtual PerigeeSurface * Trk::PerigeeSurface::clone ( ) const
finaloverridevirtual

Virtual constructor.

Implements Trk::Surface.

◆ createUniqueNeutralParameters() [1/2]

Trk::Surface::NeutralTrackParametersUniquePtr Trk::PerigeeSurface::createUniqueNeutralParameters ( const Amg::Vector3D & position,
const Amg::Vector3D & momentum,
double charge,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
finaloverridevirtual

Use the Surface as a ParametersBase constructor, from global parameters - neutral.

Implements Trk::Surface.

Definition at line 140 of file PerigeeSurface.cxx.

145{
146 return std::make_unique<ParametersT<5, Neutral, PerigeeSurface>>(
147 position, momentum, charge, *this, std::move(cov));
148}
double charge(const T &p)
Definition AtlasPID.h:997

◆ createUniqueNeutralParameters() [2/2]

Trk::Surface::NeutralTrackParametersUniquePtr Trk::PerigeeSurface::createUniqueNeutralParameters ( double l1,
double l2,
double phi,
double theta,
double qop,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
finaloverridevirtual

Use the Surface as a ParametersBase constructor, from local parameters - neutral.

Implements Trk::Surface.

Definition at line 125 of file PerigeeSurface.cxx.

132{
133 return std::make_unique<ParametersT<5, Neutral, PerigeeSurface>>(
134 l1, l2, phi, theta, qop, *this, std::move(cov));
135}
@ theta
Definition ParamDefs.h:66
@ phi
Definition ParamDefs.h:75

◆ createUniqueParameters() [1/2]

template<int DIM, class T>
std::unique_ptr< ParametersT< DIM, T, PerigeeSurface > > Trk::PerigeeSurface::createUniqueParameters ( const Amg::Vector3D & position,
const Amg::Vector3D & momentum,
double charge,
std::optional< AmgSymMatrix(DIM)> cov = std::nullopt ) const

Use the Surface as a ParametersBase constructor, from global parameters.

◆ createUniqueParameters() [2/2]

template<int DIM, class T>
std::unique_ptr< ParametersT< DIM, T, PerigeeSurface > > Trk::PerigeeSurface::createUniqueParameters ( double l1,
double l2,
double phi,
double theta,
double qop,
std::optional< AmgSymMatrix(DIM)> cov = std::nullopt ) const

Use the Surface as a ParametersBase constructor, from local parameters.

◆ createUniqueTrackParameters() [1/2]

Trk::Surface::ChargedTrackParametersUniquePtr Trk::PerigeeSurface::createUniqueTrackParameters ( const Amg::Vector3D & position,
const Amg::Vector3D & momentum,
double charge,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
finaloverridevirtual

Use the Surface as a ParametersBase constructor, from global parameters - charged.

Implements Trk::Surface.

Definition at line 112 of file PerigeeSurface.cxx.

117{
118 return std::make_unique<ParametersT<5, Charged, PerigeeSurface>>(
119 position, momentum, charge, *this, std::move(cov));
120}

◆ createUniqueTrackParameters() [2/2]

Trk::Surface::ChargedTrackParametersUniquePtr Trk::PerigeeSurface::createUniqueTrackParameters ( double l1,
double l2,
double phi,
double theta,
double qop,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
finaloverridevirtual

Use the Surface as a ParametersBase constructor, from local parameters - charged.

Implements Trk::Surface.

Definition at line 98 of file PerigeeSurface.cxx.

105{
106 return std::make_unique<ParametersT<5, Charged, PerigeeSurface>>(
107 l1, l2, phi, theta, qop, *this, std::move(cov));
108}

◆ dump() [1/2]

MsgStream & Trk::PerigeeSurface::dump ( MsgStream & sl) const
overridevirtual

Output Method for MsgStream.

Reimplemented from Trk::Surface.

Definition at line 302 of file PerigeeSurface.cxx.

303{
304 sl << std::setiosflags(std::ios::fixed);
305 sl << std::setprecision(7);
306 sl << "Trk::PerigeeSurface:" << std::endl;
307 sl << " Center position (x, y, z) = (" << center().x() << ", " << center().y() << ", " << center().z() << ")";
308 sl << std::setprecision(-1);
309 return sl;
310}
const Amg::Vector3D & center() const
Returns the center position of the Surface.

◆ dump() [2/2]

std::ostream & Trk::PerigeeSurface::dump ( std::ostream & sl) const
overridevirtual

Output Method for std::ostream.

Reimplemented from Trk::Surface.

Definition at line 314 of file PerigeeSurface.cxx.

315{
316 sl << std::setiosflags(std::ios::fixed);
317 sl << std::setprecision(7);
318 sl << "Trk::PerigeeSurface:" << std::endl;
319 sl << " Center position (x, y, z) = (" << center().x() << ", " << center().y() << ", " << center().z() << ")";
320 sl << std::setprecision(-1);
321 return sl;
322}

◆ globalReferencePoint()

virtual const Amg::Vector3D & Trk::Surface::globalReferencePoint ( ) const
virtualinherited

Returns a global reference point on the surface, for PlaneSurface, StraightLineSurface, PerigeeSurface this is equal to center(), for CylinderSurface and DiscSurface this is a new member.

Reimplemented in GXF::CylinderSurface, GXF::DiscSurface, Trk::ConeSurface, Trk::CylinderSurface, and Trk::DiscSurface.

◆ globalToLocal() [1/3]

bool Trk::PerigeeSurface::globalToLocal ( const Amg::Vector3D & glob,
const Amg::Vector3D & mom,
Amg::Vector2D & loc ) const
finaloverridevirtual

GlobalToLocal method without dynamic memory allocation - boolean checks if on surface.

Implements Trk::Surface.

Definition at line 211 of file PerigeeSurface.cxx.

214{
216 double d0 = perPos.perp();
217 double z0 = perPos.z();
218 // decide the sign of d0
219 d0 *= ((lineDirection().cross(glomom)).dot(perPos) < 0.0) ? -1.0 : 1.0;
220 locpos[Trk::d0] = d0;
221 locpos[Trk::z0] = z0;
222 return true;
223}
const Amg::Vector3D & lineDirection() const
Special method for StraightLineSurface - provides the Line direction from cache: speedup.
Amg::Vector3D inverseTransformMultHelper(const Amg::Vector3D &glopos) const
Eigen::Matrix< double, 3, 1 > Vector3D
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64

◆ globalToLocal() [2/3]

std::optional< Amg::Vector2D > Trk::Surface::globalToLocal ( const Amg::Vector3D & glopos,
const Amg::Vector3D & glomom ) const
inherited

This method returns the LocalPosition from a provided GlobalPosition.

If the GlobalPosition is not on the Surface, it returns a nullopt This method does not check if the calculated LocalPosition is inside surface bounds. If this check is needed, use positionOnSurface - for generality with momentum

◆ globalToLocal() [3/3]

std::optional< Amg::Vector2D > Trk::Surface::globalToLocal ( const Amg::Vector3D & glopos,
double tol = 0. ) const
inherited

This method returns the LocalPosition from a provided GlobalPosition.

If the GlobalPosition is not on the Surface, it returns nullopt This method does not check if the calculated LocalPosition is inside surface bounds. If this check is needed, use positionOnSurface - only for planar, cylinder surface fully defined

◆ insideBounds()

virtual bool Trk::PerigeeSurface::insideBounds ( const Amg::Vector2D & locpos,
double tol1 = 0.,
double tol2 = 0. ) const
finaloverridevirtual

This surface calls the iside method of the bounds.

Implements Trk::Surface.

◆ insideBoundsCheck()

virtual bool Trk::PerigeeSurface::insideBoundsCheck ( const Amg::Vector2D & locpos,
const BoundaryCheck & bchk ) const
finaloverridevirtual

Implements Trk::Surface.

◆ inverseTransformHelper()

Amg::Transform3D Trk::Surface::inverseTransformHelper ( ) const
protectedinherited

Helper method to factorize in one place common operations calculate inverse transofrm and multiply with position.

◆ inverseTransformMultHelper()

Amg::Vector3D Trk::Surface::inverseTransformMultHelper ( const Amg::Vector3D & glopos) const
protectedinherited

◆ isActive()

bool Trk::Surface::isActive ( ) const
inherited

Return 'true' if this surface is owned by the detector element.

◆ isFree()

bool Trk::Surface::isFree ( ) const
inherited

Returns 'true' if this surface is 'free', i.e.

it does not belong to a detector element (and returns false otherwise

◆ isOnSurface()

virtual bool Trk::PerigeeSurface::isOnSurface ( const Amg::Vector3D & glopo,
const BoundaryCheck & bchk = true,
double tol1 = 0.,
double tol2 = 0. ) const
finaloverridevirtual

This method checks if a globalPosition in on the Surface or not.

Reimplemented from Trk::Surface.

◆ lineDirection()

const Amg::Vector3D & Trk::PerigeeSurface::lineDirection ( ) const

Special method for StraightLineSurface - provides the Line direction from cache: speedup.

◆ localParametersToPosition()

virtual Amg::Vector2D Trk::Surface::localParametersToPosition ( const LocalParameters & locpars) const
virtualinherited

Optionally specified by each surface type : LocalParameters to Vector2D.

Reimplemented in Trk::ConeSurface, Trk::CylinderSurface, and Trk::DiscSurface.

◆ localToGlobal() [1/5]

ATH_FLATTEN void Trk::PerigeeSurface::localToGlobal ( const Amg::Vector2D & locp,
const Amg::Vector3D & mom,
Amg::Vector3D & glob ) const
finaloverridevirtual

LocalToGlobal method without dynamic memory allocation.

Implements Trk::Surface.

Definition at line 171 of file PerigeeSurface.cxx.

174{
175 // this is for a tilted perigee surface
177 // get the vector perpendicular to the momentum and the straw axis
178 Amg::Vector3D radiusAxisGlobal(lineDirection().cross(glomom));
179 Amg::Vector3D locZinGlobal = transform() * Amg::Vector3D(0., 0., locpos[Trk::locZ]);
180 // transform zPosition into global coordinates and add locR * radiusAxis
181 glopos = Amg::Vector3D(locZinGlobal + locpos[Trk::locR] * radiusAxisGlobal.normalized());
182 } else {
183 double phi = glomom.phi();
184 glopos[Amg::x] = -locpos[Trk::d0] * sin(phi);
185 glopos[Amg::y] = locpos[Trk::d0] * cos(phi);
186 glopos[Amg::z] = locpos[Trk::z0];
187 glopos += center();
188 }
189}
@ locR
Definition ParamDefs.h:44
@ locZ
local cylindrical
Definition ParamDefs.h:42

◆ localToGlobal() [2/5]

Amg::Vector3D Trk::PerigeeSurface::localToGlobal ( const LocalParameters & locpos) const

Local to global method: Take care that by just providing locR and locZ the global position cannot be calculated.

Therefor only the locZ-coordinate is taken and transformed into the global frame. for calculating the global position, a momentum direction has to be provided as well, use the appropriate function!

Definition at line 152 of file PerigeeSurface.cxx.

153{
154 if (locpars.contains(Trk::phi0)) {
155 Amg::Vector3D loc3Dframe(-locpars[Trk::d0] * sin(locpars[Trk::phi0]),
156 locpars[Trk::d0] * cos(locpars[Trk::phi0]),
157 locpars[Trk::z0]);
158 return Amg::Vector3D(transform() * loc3Dframe);
159 }
160 return {0., 0., locpars[Trk::z0] + (center().z())};
161}
@ phi0
Definition ParamDefs.h:65

◆ localToGlobal() [3/5]

Amg::Vector3D Trk::PerigeeSurface::localToGlobal ( const LocalParameters & locpos,
const Amg::Vector3D & glomom ) const

This method is the true local->global transformation.


by providing a locR and locZ coordinate such as a GlobalMomentum the global position can be calculated. The choice between the two possible canditates is done by the sign of the radius

Definition at line 193 of file PerigeeSurface.cxx.

195{
197 Amg::Vector3D glopos = Amg::Vector3D(0., 0., 0.);
199 Amg::Vector2D(locpars[Trk::d0], locpars[Trk::z0]), glomom, glopos);
200 return glopos;
201 }
202 double phi = glomom.phi();
203 double x = -locpars[Trk::d0] * sin(phi) + center().x();
204 double y = locpars[Trk::d0] * cos(phi) + center().y();
205 double z = locpars[Trk::z0] + center().z();
206 return {x, y, z};
207}
Amg::Vector3D localToGlobal(const LocalParameters &locpos) const
Local to global method: Take care that by just providing locR and locZ the global position cannot be ...
Eigen::Matrix< double, 2, 1 > Vector2D
@ x
Definition ParamDefs.h:55
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ y
Definition ParamDefs.h:56

◆ localToGlobal() [4/5]

Amg::Vector3D Trk::Surface::localToGlobal ( const Amg::Vector2D & locpos) const
inherited

This method returns the GlobalPosition from a LocalPosition uses the per surface localToGlobal.

◆ localToGlobal() [5/5]

Amg::Vector3D Trk::Surface::localToGlobal ( const Amg::Vector2D & locpos,
const Amg::Vector3D & glomom ) const
inherited

This method returns the GlobalPosition from a LocalPosition The LocalPosition can be outside Surface bounds - for generality with momentum.

◆ materialLayer() [1/2]

Trk::MaterialLayer * Trk::Surface::materialLayer ( )
inherited

◆ materialLayer() [2/2]

const Trk::MaterialLayer * Trk::Surface::materialLayer ( ) const
inherited

return the material Layer

◆ measurementFrame()

Amg::RotationMatrix3D Trk::PerigeeSurface::measurementFrame ( const Amg::Vector3D & glopos,
const Amg::Vector3D & glomom ) const
finaloverridevirtual

Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perigee Surface.

Reimplemented from Trk::Surface.

Definition at line 252 of file PerigeeSurface.cxx.

253{
255 // construct the measurement frame
256 const Amg::Vector3D& measY = lineDirection();
257 Amg::Vector3D measX(measY.cross(glomom).unit());
258 Amg::Vector3D measDepth(measX.cross(measY));
259 // assign the columnes
260 mFrame.col(0) = measX;
261 mFrame.col(1) = measY;
262 mFrame.col(2) = measDepth;
263 // return the rotation matrix
264 return mFrame;
265}
Eigen::Matrix< double, 3, 3 > RotationMatrix3D

◆ name()

virtual std::string Trk::PerigeeSurface::name ( ) const
finaloverridevirtual

Return properly formatted class name for screen output.

Implements Trk::Surface.

◆ normal() [1/2]

virtual const Amg::Vector3D & Trk::PerigeeSurface::normal ( ) const
finaloverridevirtual

Returns the x global axis.

Reimplemented from Trk::Surface.

◆ normal() [2/2]

virtual Amg::Vector3D Trk::PerigeeSurface::normal ( const Amg::Vector2D & lp) const
finaloverridevirtual

Returns a normal vector at a specific localPosition.

Reimplemented from Trk::Surface.

◆ numberOfInstantiations()

std::size_t Trk::ObjectCounter< Trk::Surface >::numberOfInstantiations ( )
inlinestaticinherited

Definition at line 25 of file TrkObjectCounter.h.

26 {
27#ifndef NDEBUG
28 return s_numberOfInstantiations.load();
29#endif
30 return 0;
31 }
Helper to enable counting number of instantiations in debug builds.

◆ onSurface()

template<class T>
bool Trk::Surface::onSurface ( const T & parameters,
const BoundaryCheck & bchk = BoundaryCheck(true) ) const
inherited

The templated Parameters OnSurface method - checks on surface pointer first.

◆ operator!=()

bool Trk::Surface::operator!= ( const Surface & sf) const
inherited

Non-equality operator.

◆ operator=() [1/2]

Trk::PerigeeSurface & Trk::PerigeeSurface::operator= ( const PerigeeSurface & slsf)

Assignment operator.

Definition at line 76 of file PerigeeSurface.cxx.

77{
78 if (this != &pesf) {
80 m_lineDirection=pesf.m_lineDirection;
81 }
82 return *this;
83}
Surface & operator=(const Surface &sf)
Definition Surface.cxx:91

◆ operator=() [2/2]

PerigeeSurface & Trk::PerigeeSurface::operator= ( PerigeeSurface && slsf)
defaultnoexcept

Assignment operator.

◆ operator==() [1/2]

bool Trk::PerigeeSurface::operator== ( const PerigeeSurface & cf) const

◆ operator==() [2/2]

bool Trk::PerigeeSurface::operator== ( const Surface & sf) const
overridevirtual

Equality operator.

Implements Trk::Surface.

Definition at line 86 of file PerigeeSurface.cxx.

87{
88 // first check the type not to compare apples with oranges
89 if (sf.type()!=Trk::SurfaceType::Perigee){
90 return false;
91 }
92 return (*this) == static_cast<const Trk::PerigeeSurface&>(sf);
93}

◆ owner()

SurfaceOwner Trk::Surface::owner ( ) const
inherited

return ownership

◆ pathCorrection()

virtual double Trk::PerigeeSurface::pathCorrection ( const Amg::Vector3D & ,
const Amg::Vector3D &  ) const
finaloverridevirtual

the pathCorrection for derived classes with thickness

Reimplemented from Trk::Surface.

◆ positionOnSurface()

std::optional< Amg::Vector2D > Surface::positionOnSurface ( const Amg::Vector3D & glopo,
const BoundaryCheck & bchk = true,
double tol1 = 0.,
double tol2 = 0. ) const
inherited

positionOnSurface() returns the LocalPosition on the Surface,
If BoundaryCheck==false it just returns the value of globalToLocal (including nullptr possibility), if BoundaryCheck==true it checks whether the point is inside bounds or not (returns std::nullopt in this case).

Definition at line 106 of file Surface.cxx.

110{
111 std::optional<Amg::Vector2D> posOnSurface = globalToLocal(glopo, tol1);
112 if (!bchk){
113 return posOnSurface;
114 }
115 if (posOnSurface && insideBounds(*posOnSurface, tol1, tol2)){
116 return posOnSurface;
117 }
118 return std::nullopt;
119}
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces

◆ setMaterialLayer()

void Trk::Surface::setMaterialLayer ( std::shared_ptr< Trk::MaterialLayer > mlay)
inherited

set material layer

◆ setOwner()

void Trk::Surface::setOwner ( SurfaceOwner x)
inherited

set Ownership

◆ setTransform()

void Trk::Surface::setTransform ( const Amg::Transform3D & trans)
inherited

Set the transform updates center and normal.

◆ straightLineDistanceEstimate() [1/2]

Trk::DistanceSolution Trk::PerigeeSurface::straightLineDistanceEstimate ( const Amg::Vector3D & pos,
const Amg::Vector3D & dir ) const
finaloverridevirtual

fast straight line distance evaluation to Surface

distance to surface

Implements Trk::Surface.

Definition at line 269 of file PerigeeSurface.cxx.

270{
271 const Amg::Vector3D& C = center();
272 Amg::Vector3D S(0., 0., 1.);
273
274 double D = dir.dot(S);
275 double A = (1. - D) * (1. + D);
276 if (A == 0.) {
277 return {1, pos.perp(), false, 0.};
278 }
279 double sol = (pos - C).dot(D * S - dir) / A;
280 return {1, pos.perp(), false, sol};
281}
struct color C
dot(G, fn, nodesToHighlight=[])
Definition dot.py:5

◆ straightLineDistanceEstimate() [2/2]

Trk::DistanceSolution Trk::PerigeeSurface::straightLineDistanceEstimate ( const Amg::Vector3D & pos,
const Amg::Vector3D & dir,
bool Bound ) const
finaloverridevirtual

fast straight line distance evaluation to Surface - with bound option

Implements Trk::Surface.

Definition at line 284 of file PerigeeSurface.cxx.

285{
286 const Amg::Transform3D& T = transform();
287
288 double dx = pos[0] - T(3, 0);
289 double dy = pos[1] - T(3, 1);
290 double A = dir[0] * dir[0] + dir[1] * dir[1];
291
292 // Step to surface
293 //
294 if (A > 0.) {
295 return {1, 0., false, -(dir[0] * dx + dir[1] * dy) / A};
296 }
297 return {1, 0., false, 0.};
298}
unsigned long long T

◆ straightLineIntersection() [1/2]

Trk::Intersection Trk::PerigeeSurface::straightLineIntersection ( const Amg::Vector3D & pos,
const Amg::Vector3D & dir,
bool forceDir = false,
Trk::BoundaryCheck bchk = false ) const
finaloverridevirtual

fast straight line intersection schema - standard: provides closest intersection and (signed) path length forceDir is to provide the closest forward solution

b>mathematical motivation: Given two lines in parameteric form:

  • \( \vec l_{a}(\lambda) = \vec m_a + \lambda \cdot \vec e_{a} \)
  • \( \vec l_{b}(\mu) = \vec m_b + \mu \cdot \vec e_{b} \)
    the vector between any two points on the two lines is given by:
  • \( \vec s(\lambda, \mu) = \vec l_{b} - l_{a} = \vec m_{ab} + \mu \cdot \vec e_{b} - \lambda \cdot \vec e_{a} \),
    when \( \vec m_{ab} = \vec m_{b} - \vec m_{a} \).
    \( \vec s(\lambda_0, \mu_0) \) denotes the vector between the two closest points
    \( \vec l_{a,0} = l_{a}(\lambda_0) \) and \( \vec l_{b,0} = l_{b}(\mu_0) \)
    and is perpenticular to both, \( \vec e_{a} \) and \( \vec e_{b} \).

This results in a system of two linear equations:

  • (i) \( 0 = \vec s(\lambda_0, \mu_0) \cdot \vec e_a = \vec m_ab \cdot \vec e_a + \mu_0 \vec e_a \cdot \vec e_b - \lambda_0 \)
  • (ii) \( 0 = \vec s(\lambda_0, \mu_0) \cdot \vec e_b = \vec m_ab \cdot \vec e_b + \mu_0 - \lambda_0 \vec e_b \cdot \vec e_a \)

Solving (i), (ii) for \( \lambda_0 \) and \( \mu_0 \) yields:

  • \( \lambda_0 = \frac{(\vec m_ab \cdot \vec e_a)-(\vec m_ab \cdot \vec e_b)(\vec e_a \cdot \vec e_b)}{1-(\vec e_a \cdot \vec e_b)^2} \)
  • \( \mu_0 = - \frac{(\vec m_ab \cdot \vec e_b)-(\vec m_ab \cdot \vec e_a)(\vec e_a \cdot \vec e_b)}{1-(\vec e_a \cdot \vec e_b)^2} \)

Implements Trk::Surface.

Definition at line 226 of file PerigeeSurface.cxx.

229 {
230 // following nominclature found in header file and doxygen documentation
231 // line one is the straight track
232 const Amg::Vector3D& ma = pos;
233 const Amg::Vector3D& ea = dir;
234 // line two is the line surface
235 const Amg::Vector3D& mb = center();
236 const Amg::Vector3D& eb = lineDirection();
237 // now go ahead
238 Amg::Vector3D mab(mb - ma);
239 double eaTeb = ea.dot(eb);
240 double denom = 1 - eaTeb * eaTeb;
241 if (std::abs(denom) > 10e-7) {
242 double lambda0 = (mab.dot(ea) - mab.dot(eb) * eaTeb) / denom;
243 // evaluate the direction, bounds are always true for Perigee
244 bool isValid = forceDir ? (lambda0 > 0.) : true;
245 return Trk::Intersection((ma + lambda0 * ea), lambda0, isValid);
246 }
247 return Trk::Intersection(pos, 0., false);
248}
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878

◆ straightLineIntersection() [2/2]

template<typename T>
Intersection Trk::Surface::straightLineIntersection ( const T & pars,
bool forceDir = false,
const Trk::BoundaryCheck & bchk = false ) const
inlineinherited

fst straight line intersection schema - templated for charged and neutral parameters

Definition at line 352 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

356 {
358 pars.position(), pars.momentum().unit(), forceDir, bchk);
359 }
Intersection straightLineIntersection(const T &pars, bool forceDir=false, const Trk::BoundaryCheck &bchk=false) const
fst straight line intersection schema - templated for charged and neutral parameters

◆ transform()

const Amg::Transform3D & Trk::Surface::transform ( ) const
inherited

Returns HepGeom::Transform3D by reference.

◆ type()

virtual constexpr SurfaceType Trk::PerigeeSurface::type ( ) const
constexprfinaloverridevirtual

Return the surface type.

Implements Trk::Surface.

◆ uniqueClone()

std::unique_ptr< Surface > Trk::Surface::uniqueClone ( ) const
inherited

NVI method returning unique_ptr clone.

Member Data Documentation

◆ m_associatedDetElement

const TrkDetElementBase* Trk::Surface::m_associatedDetElement {}
protectedinherited

Not owning Pointer to the Detector Element.

Definition at line 441 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

441{};

◆ m_associatedDetElementId

Identifier Trk::Surface::m_associatedDetElementId {}
protectedinherited

Identifier to the Detector Element.

Definition at line 443 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

443{};

◆ m_associatedLayer

const Layer* Trk::Surface::m_associatedLayer {}
protectedinherited

The associated layer Trk::Layer This is the layer in which the Surface is embedded.

so not owning pointer.

Definition at line 448 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

448{};

◆ m_lineDirection

CxxUtils::CachedValue<Amg::Vector3D> Trk::PerigeeSurface::m_lineDirection
protected

< data members cache of the line direction (speeds up)

Definition at line 267 of file PerigeeSurface.h.

◆ m_materialLayer

std::shared_ptr<MaterialLayer> Trk::Surface::m_materialLayer {}
protectedinherited

Possibility to attach a material description to the surface.

In this case the surface is what holds the MaterialLayer. This is usually done for boundary surfaces so shared ptr.

Definition at line 453 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

453{};

◆ m_owner

SurfaceOwner Trk::Surface::m_owner {SurfaceOwner::noOwn}
protectedinherited

enum for surface owner : default free surface

Definition at line 455 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

◆ m_transforms

std::unique_ptr<Transforms> Trk::Surface::m_transforms {}
protectedinherited

Unique Pointer to the Transforms struct.

Definition at line 439 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

439{};

◆ s_numberOfInstantiations

std::atomic_size_t Trk::ObjectCounter< Trk::Surface >::s_numberOfInstantiations
inlinestaticinherited

Definition at line 22 of file TrkObjectCounter.h.

◆ s_onSurfaceTolerance

double Trk::Surface::s_onSurfaceTolerance = 10e-5
staticconstexprprotectedinherited

Tolerance for being on Surface.

Definition at line 458 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

◆ s_perigeeBounds

const Trk::NoBounds Trk::PerigeeSurface::s_perigeeBounds
staticprotected

Definition at line 268 of file PerigeeSurface.h.

◆ staticType

SurfaceType Trk::PerigeeSurface::staticType = SurfaceType::Perigee
staticconstexpr

The surface type static constexpr.

Definition at line 47 of file PerigeeSurface.h.


The documentation for this class was generated from the following files: