ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Trk::PerigeeSurface Class Referencefinal

#include <PerigeeSurface.h>

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

Public Types

using ChargedTrackParametersUniquePtr = std::unique_ptr< ParametersBase< 5, Trk::Charged > >
 Unique ptr types. More...
 
using NeutralTrackParametersUniquePtr = std::unique_ptr< ParametersBase< 5, Trk::Neutral > >
 

Public Member Functions

 PerigeeSurface ()
 Default Constructor - needed for persistency. More...
 
 PerigeeSurface (const PerigeeSurface &pesf)
 Copy constructor. More...
 
PerigeeSurfaceoperator= (const PerigeeSurface &slsf)
 Assignment operator. More...
 
 PerigeeSurface (PerigeeSurface &&pesf) noexcept=default
 Copy constructor. More...
 
PerigeeSurfaceoperator= (PerigeeSurface &&slsf) noexcept=default
 Assignment operator. More...
 
virtual ~PerigeeSurface ()=default
 Destructor. More...
 
 PerigeeSurface (const Amg::Vector3D &gp)
 Constructor from GlobalPosition. More...
 
 PerigeeSurface (const Amg::Transform3D &tTransform)
 Constructor with a Transform by ref - needed for tilt. More...
 
 PerigeeSurface (const PerigeeSurface &pesf, const Amg::Transform3D &transf)
 Copy constructor with shift. More...
 
virtual PerigeeSurfaceclone () const override final
 Virtual constructor. More...
 
virtual bool operator== (const Surface &sf) const override
 Equality operator. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
constexpr virtual SurfaceType type () const override final
 Return the surface type. More...
 
virtual const Amg::Vector3Dnormal () const override final
 Returns the x global axis. More...
 
virtual Amg::Vector3D normal (const Amg::Vector2D &lp) const override final
 Returns a normal vector at a specific localPosition. More...
 
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. More...
 
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. More...
 
Amg::Vector3D localToGlobal (const LocalParameters &locpos, const Amg::Vector3D &glomom) const
 This method is the true local->global transformation. More...
 
virtual void localToGlobal (const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
 LocalToGlobal method without dynamic memory allocation. More...
 
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. More...
 
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 More...
 
virtual DistanceSolution straightLineDistanceEstimate (const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override final
 fast straight line distance evaluation to Surface More...
 
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 More...
 
virtual double pathCorrection (const Amg::Vector3D &, const Amg::Vector3D &) const override final
 the pathCorrection for derived classes with thickness More...
 
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. More...
 
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. More...
 
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. More...
 
virtual const NoBoundsbounds () const override final
 Return bounds() method. More...
 
virtual std::string name () const override final
 Return properly formatted class name for screen output. More...
 
virtual MsgStream & dump (MsgStream &sl) const override
 Output Method for MsgStream. More...
 
virtual std::ostream & dump (std::ostream &sl) const override
 Output Method for std::ostream. More...
 
bool operator!= (const Surface &sf) const
 Non-equality operator. More...
 
std::unique_ptr< SurfaceuniqueClone () const
 NVI method returning unique_ptr clone. More...
 
const Amg::Transform3DcachedTransform () const
 Return the cached transformation directly. More...
 
const Amg::Transform3Dtransform () const
 Returns HepGeom::Transform3D by reference. More...
 
const Amg::Vector3Dcenter () const
 Returns the center position of the Surface. More...
 
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. More...
 
const TrkDetElementBaseassociatedDetectorElement () const
 return associated Detector Element More...
 
Identifier associatedDetectorElementIdentifier () const
 return Identifier of the associated Detector Element More...
 
const Trk::LayerassociatedLayer () const
 return the associated Layer More...
 
const Trk::LayermaterialLayer () const
 return the material Layer More...
 
Trk::LayermaterialLayer ()
 
virtual const Trk::SurfacebaseSurface () const
 return the base surface (simplified for persistification) More...
 
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). More...
 
template<class T >
bool onSurface (const T &parameters, const BoundaryCheck &bchk=BoundaryCheck(true)) const
 The templated Parameters OnSurface method - checks on surface pointer first. More...
 
Amg::Vector3D localToGlobal (const Amg::Vector2D &locpos) const
 This method returns the GlobalPosition from a LocalPosition uses the per surface localToGlobal. More...
 
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. More...
 
std::optional< Amg::Vector2DglobalToLocal (const Amg::Vector3D &glopos, double tol=0.) const
 This method returns the LocalPosition from a provided GlobalPosition. More...
 
std::optional< Amg::Vector2DglobalToLocal (const Amg::Vector3D &glopos, const Amg::Vector3D &glomom) const
 This method returns the LocalPosition from a provided GlobalPosition. More...
 
virtual Amg::Vector2D localParametersToPosition (const LocalParameters &locpars) const
 Optionally specified by each surface type : LocalParameters to Vector2D. More...
 
template<class 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 More...
 
bool isFree () const
 Returns 'true' if this surface is 'free', i.e. More...
 
bool isActive () const
 Return 'true' if this surface is owned by the detector element. More...
 
void setTransform (const Amg::Transform3D &trans)
 Set the transform updates center and normal. More...
 
void setOwner (SurfaceOwner x)
 set Ownership More...
 
SurfaceOwner owner () const
 return ownership More...
 
void setMaterialLayer (std::shared_ptr< Layer > mlay)
 set material layer More...
 
void associateLayer (const Layer &lay)
 method to associate the associated Trk::Layer which is alreay owned More...
 

Static Public Member Functions

static std::size_t numberOfInstantiations ()
 

Static Public Attributes

static constexpr SurfaceType staticType = SurfaceType::Perigee
 The surface type static constexpr. More...
 
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. More...
 
Amg::Vector3D inverseTransformMultHelper (const Amg::Vector3D &glopos) const
 

Protected Attributes

CxxUtils::CachedValue< Amg::Vector3Dm_lineDirection
 < data members cache of the line direction (speeds up) More...
 
std::unique_ptr< Transformsm_transforms {}
 
const TrkDetElementBasem_associatedDetElement {}
 Not owning Pointer to the TrkDetElementBase. More...
 
Identifier m_associatedDetElementId {}
 Identifier for the TrkDetElementBase. More...
 
const Layerm_associatedLayer {}
 The associated layer Trk::Layer. More...
 
std::shared_ptr< Layerm_materialLayer {}
 Possibility to attach a material descrption. More...
 
SurfaceOwner m_owner {SurfaceOwner::noOwn}
 enum for surface owner : 0 free surface More...
 

Static Protected Attributes

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

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

Unique ptr types.

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

◆ NeutralTrackParametersUniquePtr

Constructor & Destructor Documentation

◆ PerigeeSurface() [1/6]

Trk::PerigeeSurface::PerigeeSurface ( )

Default Constructor - needed for persistency.

Definition at line 21 of file PerigeeSurface.cxx.

22  : Surface()
23  , m_lineDirection{}
24 {}

◆ PerigeeSurface() [2/6]

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

Copy constructor.

Definition at line 51 of file PerigeeSurface.cxx.

52  : Surface(pesf)
53  , m_lineDirection{}
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 }

◆ 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()
28  , m_lineDirection{}
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 }

◆ 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
36  , m_lineDirection{}
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()
63  , m_lineDirection{}
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 the associated Trk::Layer which is alreay owned

  • only allowed by LayerBuilder
  • only done if no Layer is set already

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

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

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

◆ 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 Trk::DiscSurface, Trk::CylinderSurface, and Trk::ConeSurface.

◆ 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 {
215  Amg::Vector3D perPos = inverseTransformMultHelper(glopos);
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 }

◆ 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::DiscSurface, Trk::CylinderSurface, and Trk::ConeSurface.

◆ 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
176  if (Surface::m_transforms) {
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 }

◆ localToGlobal() [2/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() [3/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.

◆ localToGlobal() [4/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 }

◆ localToGlobal() [5/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 {
196  if (Surface::m_transforms) {
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 }

◆ materialLayer() [1/2]

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

◆ materialLayer() [2/2]

const Trk::Layer* 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.

  • the default implementation is the the RotationMatrix3D of the transform

Reimplemented from Trk::Surface.

Definition at line 252 of file PerigeeSurface.cxx.

253 {
254  Amg::RotationMatrix3D mFrame;
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 }

◆ 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()

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

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

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

◆ setMaterialLayer()

void Trk::Surface::setMaterialLayer ( std::shared_ptr< Layer 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 }

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

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

◆ straightLineIntersection() [2/2]

template<class 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 351 of file Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h.

355  {
357  pars.position(), pars.momentum().unit(), forceDir, bchk);
358  }

◆ transform()

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

Returns HepGeom::Transform3D by reference.

◆ type()

constexpr virtual 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 TrkDetElementBase.

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

◆ m_associatedDetElementId

Identifier Trk::Surface::m_associatedDetElementId {}
protectedinherited

◆ m_associatedLayer

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

The associated layer Trk::Layer.

  • layer in which the Surface is embedded (not owning pointed)

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

◆ 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<Layer> Trk::Surface::m_materialLayer {}
protectedinherited

Possibility to attach a material descrption.

  • potentially given as the associated material layer (not owning pointer)

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

◆ m_owner

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

enum for surface owner : 0 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

◆ s_numberOfInstantiations

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

Definition at line 22 of file TrkObjectCounter.h.

◆ s_onSurfaceTolerance

constexpr 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

constexpr 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:
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Trk::y
@ y
Definition: ParamDefs.h:62
Trk::Intersection
Definition: Intersection.h:24
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:63
Trk::Surface::straightLineIntersection
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
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:351
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
DMTest::C
C_v1 C
Definition: C.h:26
Amg::y
@ y
Definition: GeoPrimitives.h:35
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Trk::PerigeeSurface::m_lineDirection
CxxUtils::CachedValue< Amg::Vector3D > m_lineDirection
< data members cache of the line direction (speeds up)
Definition: PerigeeSurface.h:267
Trk::PerigeeSurface::lineDirection
const Amg::Vector3D & lineDirection() const
Special method for StraightLineSurface - provides the Line direction from cache: speedup.
Trk::z0
@ z0
Definition: ParamDefs.h:70
Trk::locR
@ locR
Definition: ParamDefs.h:50
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
Trk::PerigeeSurface::localToGlobal
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 ...
Definition: PerigeeSurface.cxx:152
Trk::Surface::inverseTransformMultHelper
Amg::Vector3D inverseTransformMultHelper(const Amg::Vector3D &glopos) const
dqt_zlumi_alleff_HIST.A
A
Definition: dqt_zlumi_alleff_HIST.py:110
Trk::Surface::operator=
Surface & operator=(const Surface &sf)
Definition: Surface.cxx:91
Amg::z
@ z
Definition: GeoPrimitives.h:36
skel.l2
l2
Definition: skel.GENtoEVGEN.py:426
Trk::Surface::m_transforms
std::unique_ptr< Transforms > m_transforms
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:436
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:48
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::theta
@ theta
Definition: ParamDefs.h:72
Amg::x
@ x
Definition: GeoPrimitives.h:34
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
compute_lumi.denom
denom
Definition: compute_lumi.py:76
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::SurfaceType::Perigee
@ Perigee
Trk::d0
@ d0
Definition: ParamDefs.h:69
Trk::Surface::Surface
Surface()
Default Constructor for inheriting classes.
charge
double charge(const T &p)
Definition: AtlasPID.h:494
Trk::Surface::insideBounds
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
Trk::ObjectCounter< Trk::Surface >::s_numberOfInstantiations
static std::atomic_size_t s_numberOfInstantiations
Definition: TrkObjectCounter.h:22
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
PowhegPythia8EvtGen_H2a4X_ctauY.ma
int ma
Definition: PowhegPythia8EvtGen_H2a4X_ctauY.py:26
Trk::Surface::globalToLocal
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...
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
TRT_PAI_physicsConstants::mb
const double mb
1mb to cm2
Definition: TRT_PAI_physicsConstants.h:15
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
Trk::phi
@ phi
Definition: ParamDefs.h:81
skel.l1
l1
Definition: skel.GENtoEVGEN.py:425
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::x
@ x
Definition: ParamDefs.h:61
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Trk::phi0
@ phi0
Definition: ParamDefs.h:71
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35