14#include "GaudiKernel/MsgStream.h"
77 if (sf.m_transforms) {
78 m_transforms = std::make_unique<Transforms>(
79 shift * sf.m_transforms->transform, shift * sf.m_transforms->center);
81 m_transforms = std::make_unique<Transforms>(Amg::Transform3D(shift));
94 m_transforms = std::make_unique<Transforms>(sf.transform());
105std::optional<Amg::Vector2D>
111 std::optional<Amg::Vector2D> posOnSurface =
globalToLocal(glopo, tol1);
115 if (posOnSurface &&
insideBounds(*posOnSurface, tol1, tol2)){
128 std::optional<Amg::Vector2D> posOnSurface =
130 return static_cast<bool>(posOnSurface);
144 if (rot.cols() != lin.cols() || rot.rows() != lin.rows())
return false;
146 for (
unsigned int col_i=0; col_i<rot.cols(); ++col_i){
147 for (
unsigned int row_i=0; row_i<rot.rows(); ++row_i){
148 ret &= (std::abs( rot(row_i,col_i) - lin(row_i,col_i))<1e-5);
159 sl << std::setiosflags(std::ios::fixed);
160 sl << std::setprecision(4);
161 sl <<
name() << std::endl;
165 sl <<
" Center position (x, y, z) = (" <<
center().x() <<
", " <<
center().y() <<
", " <<
center().z() <<
")"
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;
179 sl << std::setprecision(-1);
187 sl << std::setiosflags(std::ios::fixed);
188 sl << std::setprecision(4);
189 sl <<
name() << std::endl;
193 sl <<
" Center position (x, y, z) = (" <<
center().x() <<
", " <<
center().y() <<
", " <<
center().z() <<
")"
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;
207 sl << std::setprecision(-1);
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Abstract Base Class for tracking surfaces.
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
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
SurfaceOwner m_owner
enum for surface owner : default free surface
std::shared_ptr< MaterialLayer > m_materialLayer
Possibility to attach a material description to the surface.
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...
const TrkDetElementBase * m_associatedDetElement
Not owning Pointer to the Detector Element.
const Layer * m_associatedLayer
The associated layer Trk::Layer This is the layer in which the Surface is embedded.
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
virtual ~Surface()
Virtual Destructor.
Surface()
Default Constructor for inheriting classes.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Identifier m_associatedDetElementId
Identifier to the Detector Element.
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...
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::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...
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, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output