9#ifndef TRKSURFACES_SURFACE_H
10#define TRKSURFACES_SURFACE_H
35#include "Identifier/Identifier.h"
129 std::unique_ptr<ParametersBase<5, Trk::Charged>>;
131 std::unique_ptr<ParametersBase<5, Trk::Neutral>>;
213 std::optional<
AmgSymMatrix(5)> cov = std::nullopt)
const = 0;
222 std::optional<
AmgSymMatrix(5)> cov = std::nullopt)
const = 0;
233 std::optional<
AmgSymMatrix(5)> cov = std::nullopt)
const = 0;
242 std::optional<
AmgSymMatrix(5)> cov = std::nullopt)
const = 0;
256 double tol2 = 0.)
const;
270 double tol2 = 0.)
const;
275 double tol2 = 0.)
const = 0;
322 double tol = 0.)
const;
354 bool forceDir =
false,
358 pars.position(), pars.momentum().unit(), forceDir, bchk);
368 bool forceDir =
false,
380 bool Bound)
const = 0;
405 virtual MsgStream&
dump(MsgStream& sl)
const;
408 virtual std::ostream&
dump(std::ostream& sl)
const;
411 virtual std::string
name()
const = 0;
436 friend class ::SurfaceCnv_p1;
double charge(const T &p)
Cached unique_ptr with atomic update.
#define AmgSymMatrix(dim)
Handle conditional ownership of surfaces.
Define macros for attributes used to control the static checker.
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Access to distance solutions.
Base Class for a Detector Layer in the Tracking realm.
A material layer is a simple helper class to attach material information to a boundary surface.
Helper to enable counting number of instantiations in debug builds.
Abstract base class for surface bounds to be specified.
Abstract Base Class for tracking surfaces.
Surface & operator=(Surface &&sf) noexcept=default
Amg::Transform3D inverseTransformHelper() const
Helper method to factorize in one place common operations calculate inverse transofrm and multiply wi...
const Amg::Transform3D * cachedTransform() const
Return the cached transformation directly.
std::unique_ptr< ParametersBase< 5, Trk::Charged > > ChargedTrackParametersUniquePtr
Unique ptr types.
Surface & operator=(const Surface &sf)
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
bool onSurface(const T ¶meters, const BoundaryCheck &bchk=BoundaryCheck(true)) const
The templated Parameters OnSurface method - checks on surface pointer first.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
fast straight line distance evaluation to Surface
void associateLayer(const Layer &lay)
method to associate a Trk::Layer.
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.
SurfaceOwner m_owner
enum for surface owner : default free surface
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 le...
std::shared_ptr< MaterialLayer > m_materialLayer
Possibility to attach a material description to the surface.
bool isFree() const
Returns 'true' if this surface is 'free', i.e.
void setTransform(const Amg::Transform3D &trans)
Set the transform updates center and normal.
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 Perig...
static constexpr double s_onSurfaceTolerance
Tolerance for being on Surface.
const TrkDetElementBase * m_associatedDetElement
Not owning Pointer to the Detector Element.
virtual bool operator==(const Surface &sf) const =0
Equality operator.
virtual const Trk::Surface * baseSurface() 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.
Amg::Vector3D localToGlobal(const LocalParameters &locpars) const
This method returns the GlobalPosition from LocalParameters The LocalParameters can be outside Surfac...
Trk::MaterialLayer * materialLayer()
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 po...
Amg::Vector3D localToGlobal(const Amg::Vector2D &locpos) const
This method returns the GlobalPosition from a LocalPosition uses the per surface localToGlobal.
Amg::Vector3D inverseTransformMultHelper(const Amg::Vector3D &glopos) const
const Layer * m_associatedLayer
The associated layer Trk::Layer This is the layer in which the Surface is embedded.
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 ...
virtual Amg::Vector2D localParametersToPosition(const LocalParameters &locpars) const
Optionally specified by each surface type : LocalParameters to Vector2D.
virtual Surface * clone() const =0
Implicit constructor - uses the copy constructor.
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 ~Surface()
Virtual Destructor.
bool isActive() const
Return 'true' if this surface is owned by the detector element.
Surface()
Default Constructor for inheriting classes.
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
bool operator!=(const Surface &sf) const
Non-equality operator.
std::optional< Amg::Vector2D > globalToLocal(const Amg::Vector3D &glopos, double tol=0.) const
This method returns the LocalPosition from a provided GlobalPosition.
virtual bool insideBoundsCheck(const Amg::Vector2D &locpos, const BoundaryCheck &bchk) const =0
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
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
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
virtual Amg::Vector3D normal(const Amg::Vector2D &lp) const
Returns a normal vector at a specific local position.
Amg::Vector3D localToGlobal(const LocalParameters &locpars, const Amg::Vector3D &glomom) const
This method returns the GlobalPosition from LocalParameters The LocalParameters can be outside Surfac...
Identifier m_associatedDetElementId
Identifier to the Detector Element.
virtual constexpr SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
void setOwner(SurfaceOwner x)
set Ownership
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.
virtual const Amg::Vector3D & globalReferencePoint() const
Returns a global reference point on the surface, for PlaneSurface, StraightLineSurface,...
std::unique_ptr< Transforms > m_transforms
Unique Pointer to the Transforms struct.
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...
void setMaterialLayer(std::shared_ptr< Trk::MaterialLayer > mlay)
set material layer
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
const Trk::Layer * associatedLayer() const
return the associated Layer
const Amg::Vector3D & center() const
Returns the center position of the Surface.
std::optional< Amg::Vector2D > globalToLocal(const Amg::Vector3D &glopos, const Amg::Vector3D &glomom) const
This method returns the LocalPosition from a provided GlobalPosition.
virtual std::string name() const =0
Return properly formatted class name.
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.
Surface(Surface &&sf) noexcept=default
SurfaceOwner owner() const
return ownership
std::unique_ptr< Surface > uniqueClone() const
NVI method returning unique_ptr clone.
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
std::unique_ptr< ParametersBase< 5, Trk::Neutral > > NeutralTrackParametersUniquePtr
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...
const Trk::MaterialLayer * materialLayer() const
return the material Layer
This is the base class for all tracking detector elements with read-out relevant information.
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
SurfaceUniquePtrT< Trk::Surface > SurfaceUniquePtr
SurfaceType
This enumerator simplifies the persistency & calculations,.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
SurfaceUniquePtrT< const Trk::Surface > ConstSurfaceUniquePtr
std::unique_ptr< S, SurfaceDeleter< S > > SurfaceUniquePtrT