ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::Surface Class Referenceabstract

Abstract Base Class for tracking surfaces. More...

#include <Surface.h>

Inheritance diagram for Trk::Surface:
Collaboration diagram for Trk::Surface:

Classes

struct  Transforms

Public Types

using ChargedTrackParametersUniquePtr
 Unique ptr types.
using NeutralTrackParametersUniquePtr

Public Member Functions

 Surface ()
 Default Constructor for inheriting classes.
virtual ~Surface ()
 Virtual Destructor.
 Surface (const Amg::Transform3D &htrans)
 Constructor with Amg::Transform3D reference.
 Surface (const TrkDetElementBase &detelement)
 Constructor from TrkDetElement.
 Surface (const TrkDetElementBase &detelement, const Identifier &id)
 Constructor form TrkDetElement and Identifier.
virtual bool operator== (const Surface &sf) const =0
 Equality operator.
bool operator!= (const Surface &sf) const
 Non-equality operator.
virtual Surfaceclone () const =0
 Implicit constructor - uses the copy constructor.
std::unique_ptr< SurfaceuniqueClone () const
 NVI method returning unique_ptr clone.
virtual constexpr SurfaceType type () const =0
 Returns the Surface type to avoid dynamic casts.
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::Vector3Dnormal () const
 Returns the normal vector of the Surface (i.e.
virtual Amg::Vector3D normal (const Amg::Vector2D &lp) const
 Returns a normal vector at a specific local position.
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)
virtual ChargedTrackParametersUniquePtr createUniqueTrackParameters (double l1, double l2, double phi, double theat, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const =0
 Use the Surface as a ParametersBase constructor, from local parameters - charged.
virtual ChargedTrackParametersUniquePtr createUniqueTrackParameters (const Amg::Vector3D &, const Amg::Vector3D &, double, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const =0
 Use the Surface as a ParametersBase constructor, from global parameters - charged.
virtual NeutralTrackParametersUniquePtr createUniqueNeutralParameters (double l1, double l2, double phi, double theat, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const =0
 Use the Surface as a ParametersBase constructor, from local parameters - neutral.
virtual NeutralTrackParametersUniquePtr createUniqueNeutralParameters (const Amg::Vector3D &, const Amg::Vector3D &, double charge=0., std::optional< AmgSymMatrix(5)> cov=std::nullopt) const =0
 Use the Surface as a ParametersBase constructor, from global parameters - neutral.
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.
virtual bool isOnSurface (const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
 This method returns true if the GlobalPosition is on the Surface for both, within or without check of whether the local position is inside boundaries or not.
virtual bool insideBounds (const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
 virtual methods to be overwritten by the inherited surfaces
virtual bool insideBoundsCheck (const Amg::Vector2D &locpos, const BoundaryCheck &bchk) const =0
virtual void localToGlobal (const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
 Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
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.
Amg::Vector3D localToGlobal (const LocalParameters &locpars) const
 This method returns the GlobalPosition from LocalParameters The LocalParameters can be outside Surface bounds.
Amg::Vector3D localToGlobal (const LocalParameters &locpars, const Amg::Vector3D &glomom) const
 This method returns the GlobalPosition from LocalParameters The LocalParameters can be outside Surface bounds - for generality with momentum.
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 checks if on surface.
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.
virtual double pathCorrection (const Amg::Vector3D &pos, const Amg::Vector3D &mom) const
 the pathCorrection for derived classes with thickness - it reflects if the direction projection is positive or negative
virtual Amg::RotationMatrix3D measurementFrame (const Amg::Vector3D &glopos, const Amg::Vector3D &glomom) const
 Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perigee Surface.
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
virtual Intersection straightLineIntersection (const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool forceDir=false, Trk::BoundaryCheck bchk=false) const =0
 fast straight line intersection schema - standard: provides closest intersection and (signed) path length forceDir provides the closest forward solution
virtual DistanceSolution straightLineDistanceEstimate (const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
 fast straight line distance evaluation to Surface
virtual DistanceSolution straightLineDistanceEstimate (const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool Bound) const =0
 fast straight line distance evaluation to Surface - with bound option
virtual const SurfaceBoundsbounds () const =0
 Surface Bounds method.
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
virtual MsgStream & dump (MsgStream &sl) const
 Output Method for MsgStream, to be overloaded by child classes.
virtual std::ostream & dump (std::ostream &sl) const
 Output Method for std::ostream, to be overloaded by child classes.
virtual std::string name () const =0
 Return properly formatted class name.
void associateLayer (const Layer &lay)
 method to associate a Trk::Layer.

Static Public Member Functions

static std::size_t numberOfInstantiations ()

Static Public Attributes

static std::atomic_size_t s_numberOfInstantiations

Protected Member Functions

 Surface (const Surface &sf)
 Copy operators for inheriting classes They reset the associated detector element to nullptr and the identifier to invalid.
Surfaceoperator= (const Surface &sf)
 Surface (const Surface &sf, const Amg::Transform3D &transf)
 Copy constructor with shift.
 Surface (Surface &&sf) noexcept=default
Surfaceoperator= (Surface &&sf) noexcept=default
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

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 constexpr double s_onSurfaceTolerance = 10e-5
 Tolerance for being on Surface.

Friends

class ::SurfaceCnv_p1

Detailed Description

Abstract Base Class for tracking surfaces.

For all isOnSurface, or positionOnSurface and insideBounds methods two tolerance parameters can be given which correspond to the two local natural coordinates of the surface loc1, loc2.

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 78 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.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

◆ Surface() [1/7]

Surface::Surface ( )
default

Default Constructor for inheriting classes.

◆ ~Surface()

Surface::~Surface ( )
virtualdefault

Virtual Destructor.

◆ Surface() [2/7]

ATH_FLATTEN Surface::Surface ( const Amg::Transform3D & htrans)

Constructor with Amg::Transform3D reference.

Definition at line 26 of file Surface.cxx.

27 : Trk::ObjectCounter<Trk::Surface>()
28 , m_transforms(std::make_unique<Transforms>(tform))
29{
30}
std::unique_ptr< Transforms > m_transforms
Unique Pointer to the Transforms struct.

◆ Surface() [3/7]

Surface::Surface ( const TrkDetElementBase & detelement)

Constructor from TrkDetElement.

Definition at line 32 of file Surface.cxx.

33 : Trk::ObjectCounter<Trk::Surface>()
34 , m_associatedDetElement(&detelement)
36{
37}
SurfaceOwner m_owner
enum for surface owner : default free surface
const TrkDetElementBase * m_associatedDetElement
Not owning Pointer to the Detector Element.

◆ Surface() [4/7]

Surface::Surface ( const TrkDetElementBase & detelement,
const Identifier & id )

Constructor form TrkDetElement and Identifier.

Definition at line 39 of file Surface.cxx.

41 : Trk::ObjectCounter<Trk::Surface>()
42 , m_associatedDetElement(&detelement)
45{
46}
Identifier m_associatedDetElementId
Identifier to the Detector Element.

◆ Surface() [5/7]

ATH_FLATTEN Surface::Surface ( const Surface & sf)
protected

Copy operators for inheriting classes They reset the associated detector element to nullptr and the identifier to invalid.

The copy cannot be owned by the same detector element as the original

Definition at line 56 of file Surface.cxx.

57 : Trk::ObjectCounter<Trk::Surface>(sf)
58 , m_transforms(std::make_unique<Transforms>(sf.transform()))
59 , m_associatedLayer(sf.m_associatedLayer)
60 , m_materialLayer(sf.m_materialLayer)
62{
63}
std::shared_ptr< MaterialLayer > m_materialLayer
Possibility to attach a material description to the surface.
const Layer * m_associatedLayer
The associated layer Trk::Layer This is the layer in which the Surface is embedded.

◆ Surface() [6/7]

ATH_FLATTEN Surface::Surface ( const Surface & sf,
const Amg::Transform3D & transf )
protected

Copy constructor with shift.

Definition at line 73 of file Surface.cxx.

74 : Trk::ObjectCounter<Trk::Surface>(sf)
76{
77 if (sf.m_transforms) {
78 m_transforms = std::make_unique<Transforms>(
79 shift * sf.m_transforms->transform, shift * sf.m_transforms->center);
80 } else {
81 m_transforms = std::make_unique<Transforms>(Amg::Transform3D(shift));
82 }
83}
Eigen::Affine3d Transform3D

◆ Surface() [7/7]

Trk::Surface::Surface ( Surface && sf)
protecteddefaultnoexcept

Member Function Documentation

◆ associatedDetectorElement()

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

return associated Detector Element

◆ associatedDetectorElementIdentifier()

Identifier Trk::Surface::associatedDetectorElementIdentifier ( ) const

return Identifier of the associated Detector Element

◆ associatedLayer()

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

return the associated Layer

◆ associateLayer()

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

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
virtual

return the base surface (simplified for persistification)

◆ bounds()

◆ cachedTransform()

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

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

Returns the center position of the Surface.

◆ clone()

virtual Surface * Trk::Surface::clone ( ) const
pure virtual

◆ createUniqueNeutralParameters() [1/2]

virtual NeutralTrackParametersUniquePtr Trk::Surface::createUniqueNeutralParameters ( const Amg::Vector3D & ,
const Amg::Vector3D & ,
double charge = 0.,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
pure virtual

◆ createUniqueNeutralParameters() [2/2]

virtual NeutralTrackParametersUniquePtr Trk::Surface::createUniqueNeutralParameters ( double l1,
double l2,
double phi,
double theat,
double qop,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
pure virtual

◆ createUniqueTrackParameters() [1/2]

virtual ChargedTrackParametersUniquePtr Trk::Surface::createUniqueTrackParameters ( const Amg::Vector3D & ,
const Amg::Vector3D & ,
double ,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
pure virtual

◆ createUniqueTrackParameters() [2/2]

virtual ChargedTrackParametersUniquePtr Trk::Surface::createUniqueTrackParameters ( double l1,
double l2,
double phi,
double theat,
double qop,
std::optional< AmgSymMatrix(5)> cov = std::nullopt ) const
pure virtual

◆ dump() [1/2]

MsgStream & Surface::dump ( MsgStream & sl) const
virtual

Output Method for MsgStream, to be overloaded by child classes.

Reimplemented in Trk::DetElementSurface, and Trk::PerigeeSurface.

Definition at line 157 of file Surface.cxx.

158{
159 sl << std::setiosflags(std::ios::fixed);
160 sl << std::setprecision(4);
161 sl << name() << std::endl;
162 if (associatedDetectorElement()!=nullptr){
163 sl<<" Detector Type = "<<associatedDetectorElement()->detectorTypeString()<<std::endl;
164 }
165 sl << " Center position (x, y, z) = (" << center().x() << ", " << center().y() << ", " << center().z() << ")"
166 << std::endl;
168 Amg::Vector3D rotX(rot.col(0));
169 Amg::Vector3D rotY(rot.col(1));
170 Amg::Vector3D rotZ(rot.col(2));
171 sl << std::setprecision(6);
172 sl << " Rotation: colX = (" << rotX(0) << ", " << rotX(1) << ", " << rotX(2) << ")" << std::endl;
173 sl << " colY = (" << rotY(0) << ", " << rotY(1) << ", " << rotY(2) << ")" << std::endl;
174 sl << " colZ = (" << rotZ(0) << ", " << rotZ(1) << ", " << rotZ(2) << ")" << std::endl;
175 sl << " Bounds : " << bounds();
176 if (!checkTransform(*this)) {
177 sl << std::endl << " NOT a strict rotation matrix." << std::endl;
178 }
179 sl << std::setprecision(-1);
180 return sl;
181}
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
virtual std::string name() const =0
Return properly formatted class name.
std::string detectorTypeString() const
Returns a string of the Detector element type.
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Matrix< double, 3, 1 > Vector3D

◆ dump() [2/2]

std::ostream & Surface::dump ( std::ostream & sl) const
virtual

Output Method for std::ostream, to be overloaded by child classes.

Reimplemented in Trk::DetElementSurface, and Trk::PerigeeSurface.

Definition at line 185 of file Surface.cxx.

186{
187 sl << std::setiosflags(std::ios::fixed);
188 sl << std::setprecision(4);
189 sl << name() << std::endl;
190 if (associatedDetectorElement()!=nullptr){
191 sl<<" Detector Type = "<<associatedDetectorElement()->detectorTypeString()<<std::endl;
192 }
193 sl << " Center position (x, y, z) = (" << center().x() << ", " << center().y() << ", " << center().z() << ")"
194 << std::endl;
196 Amg::Vector3D rotX(rot.col(0));
197 Amg::Vector3D rotY(rot.col(1));
198 Amg::Vector3D rotZ(rot.col(2));
199 sl << std::setprecision(6);
200 sl << " Rotation: colX = (" << rotX(0) << ", " << rotX(1) << ", " << rotX(2) << ")" << std::endl;
201 sl << " colY = (" << rotY(0) << ", " << rotY(1) << ", " << rotY(2) << ")" << std::endl;
202 sl << " colZ = (" << rotZ(0) << ", " << rotZ(1) << ", " << rotZ(2) << ")" << std::endl;
203 sl << " Bounds : " << bounds();
204 if (!checkTransform(*this)) {
205 sl << std::endl << " NOT a strict rotation matrix." << std::endl;
206 }
207 sl << std::setprecision(-1);
208 return sl;
209}

◆ globalReferencePoint()

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

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]

virtual bool Trk::Surface::globalToLocal ( const Amg::Vector3D & glob,
const Amg::Vector3D & mom,
Amg::Vector2D & loc ) const
pure virtual

Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean checks if on surface.

Implemented in GXF::CylinderSurface, GXF::DiscSurface, PlaneSurface, Trk::ConeSurface, Trk::CylinderSurface, Trk::DetElementSurface, Trk::DiscSurface, Trk::PerigeeSurface, Trk::PlaneSurface, Trk::SlidingCylinderSurface, Trk::SlidingDiscSurface, and Trk::StraightLineSurface.

◆ globalToLocal() [2/3]

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

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

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::Surface::insideBounds ( const Amg::Vector2D & locpos,
double tol1 = 0.,
double tol2 = 0. ) const
pure virtual

◆ insideBoundsCheck()

virtual bool Trk::Surface::insideBoundsCheck ( const Amg::Vector2D & locpos,
const BoundaryCheck & bchk ) const
pure virtual

◆ inverseTransformHelper()

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

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
protected

◆ isActive()

bool Trk::Surface::isActive ( ) const

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

◆ isFree()

bool Trk::Surface::isFree ( ) const

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

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

◆ isOnSurface()

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

This method returns true if the GlobalPosition is on the Surface for both, within or without check of whether the local position is inside boundaries or not.

Reimplemented in GXF::CylinderSurface, GXF::DiscSurface, PlaneSurface, Trk::CylinderSurface, Trk::DetElementSurface, Trk::DiscSurface, Trk::PerigeeSurface, Trk::PlaneSurface, Trk::SlidingCylinderSurface, Trk::SlidingDiscSurface, and Trk::StraightLineSurface.

Definition at line 123 of file Surface.cxx.

127{
128 std::optional<Amg::Vector2D> posOnSurface =
129 positionOnSurface(glopo, bchk, tol1, tol2);
130 return static_cast<bool>(posOnSurface);
131}
std::optional< Amg::Vector2D > positionOnSurface(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 return...
Definition Surface.cxx:106

◆ localParametersToPosition()

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

Optionally specified by each surface type : LocalParameters to Vector2D.

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

◆ localToGlobal() [1/5]

virtual void Trk::Surface::localToGlobal ( const Amg::Vector2D & locp,
const Amg::Vector3D & mom,
Amg::Vector3D & glob ) const
pure virtual

◆ localToGlobal() [2/5]

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

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

◆ localToGlobal() [3/5]

Amg::Vector3D Trk::Surface::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.

◆ localToGlobal() [4/5]

Amg::Vector3D Trk::Surface::localToGlobal ( const LocalParameters & locpars) const

This method returns the GlobalPosition from LocalParameters The LocalParameters can be outside Surface bounds.

◆ localToGlobal() [5/5]

Amg::Vector3D Trk::Surface::localToGlobal ( const LocalParameters & locpars,
const Amg::Vector3D & glomom ) const

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

◆ materialLayer() [1/2]

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

◆ materialLayer() [2/2]

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

return the material Layer

◆ measurementFrame()

Amg::RotationMatrix3D Surface::measurementFrame ( const Amg::Vector3D & glopos,
const Amg::Vector3D & glomom ) const
virtual

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

Reimplemented in GXF::CylinderSurface, Trk::ConeSurface, Trk::CylinderSurface, Trk::PerigeeSurface, and Trk::StraightLineSurface.

Definition at line 135 of file Surface.cxx.

136{
137 return transform().linear();
138}

◆ name()

◆ normal() [1/2]

virtual const Amg::Vector3D & Trk::Surface::normal ( ) const
virtual

Returns the normal vector of the Surface (i.e.

in generall z-axis of rotation)

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

◆ normal() [2/2]

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

Returns a normal vector at a specific local position.

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

◆ 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

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

◆ operator!=()

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

Non-equality operator.

◆ operator=() [1/2]

Trk::Surface & Surface::operator= ( const Surface & sf)
protected

Definition at line 91 of file Surface.cxx.

92{
93 if (this != &sf) {
94 m_transforms = std::make_unique<Transforms>(sf.transform());
95 m_associatedDetElement = nullptr;
96 m_associatedDetElementId = Identifier();
97 m_associatedLayer = sf.m_associatedLayer;
98 m_materialLayer = sf.m_materialLayer;
100 }
101 return *this;
102}

◆ operator=() [2/2]

Surface & Trk::Surface::operator= ( Surface && sf)
protecteddefaultnoexcept

◆ operator==()

◆ owner()

SurfaceOwner Trk::Surface::owner ( ) const

return ownership

◆ pathCorrection()

virtual double Trk::Surface::pathCorrection ( const Amg::Vector3D & pos,
const Amg::Vector3D & mom ) const
virtual

the pathCorrection for derived classes with thickness - it reflects if the direction projection is positive or negative

Reimplemented in GXF::CylinderSurface, Trk::ConeSurface, Trk::CylinderSurface, Trk::PerigeeSurface, and Trk::StraightLineSurface.

◆ positionOnSurface()

std::optional< Amg::Vector2D > Surface::positionOnSurface ( 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).

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)

set material layer

◆ setOwner()

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

set Ownership

◆ setTransform()

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

Set the transform updates center and normal.

◆ straightLineDistanceEstimate() [1/2]

virtual DistanceSolution Trk::Surface::straightLineDistanceEstimate ( const Amg::Vector3D & pos,
const Amg::Vector3D & dir ) const
pure virtual

◆ straightLineDistanceEstimate() [2/2]

virtual DistanceSolution Trk::Surface::straightLineDistanceEstimate ( const Amg::Vector3D & pos,
const Amg::Vector3D & dir,
bool Bound ) const
pure virtual

◆ straightLineIntersection() [1/2]

virtual Intersection Trk::Surface::straightLineIntersection ( const Amg::Vector3D & pos,
const Amg::Vector3D & dir,
bool forceDir = false,
Trk::BoundaryCheck bchk = false ) const
pure virtual

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

Implemented in GXF::CylinderSurface, GXF::DiscSurface, PlaneSurface, Trk::ConeSurface, Trk::CylinderSurface, Trk::DetElementSurface, Trk::DiscSurface, Trk::PerigeeSurface, Trk::PlaneSurface, and Trk::StraightLineSurface.

◆ straightLineIntersection() [2/2]

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

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

Returns HepGeom::Transform3D by reference.

◆ type()

virtual constexpr SurfaceType Trk::Surface::type ( ) const
constexprpure virtual

◆ uniqueClone()

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

NVI method returning unique_ptr clone.

◆ ::SurfaceCnv_p1

friend class ::SurfaceCnv_p1
friend

Member Data Documentation

◆ m_associatedDetElement

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

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 {}
protected

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 {}
protected

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_materialLayer

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

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}
protected

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 {}
protected

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
staticconstexprprotected

Tolerance for being on Surface.

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


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