13 #ifndef DDREC_SURFACE_H
14 #define DDREC_SURFACE_H
16 #include "DD4hep/Objects.h"
17 #include "DD4hep/Volumes.h"
18 #include "DD4hep/DetElement.h"
79 double thickness_inner ,
double thickness_outer,
87 _th_i( thickness_inner ),
88 _th_o( thickness_outer ),
289 struct VolSurfaceList ;
342 VolSurfaceBase( typ, thickness_inner, thickness_outer, u_val,v_val, n_val, o_val, vol, id_val ) {
467 VolSurface( new T( typ, thickness_inner, thickness_outer, u_val, v_val, n_val, o_val, vol , 0 ) ){
486 VolSurface( new
VolConeImpl( vol, typ_val, thickness_inner , thickness_outer, v_val, origin_val ) ) {}
643 virtual double radius()
const ;
660 virtual double radius0()
const ;
663 virtual double radius1()
const ;
666 virtual double z0()
const ;
669 virtual double z1()
const ;
711 #endif // DDREC_SURFACE_H
virtual Vector3D center() const
the center of the cone
virtual double z1() const
the end z of the cone
void setProperty(unsigned prop, bool val=true)
set the given peorperty
virtual double radius() const
the radius of the cylinder (rho of the origin vector)
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
The normal direction at the given point, projected onto the cone.
Interface for tracking surfaces.
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position.
virtual double radius0() const
the start radius of the cone
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U - rotated to point projected onto the cylinder.
Volume volume() const
The volume that has the surface attached.
Implementation of conical surface attached to a volume.
virtual void setOrigin(const Vector3D &o)
setter for daughter classes
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
virtual ~VolSurfaceList()
VolSurfaceBase(SurfaceType typ, double thickness_inner, double thickness_outer, Vector3D u_val, Vector3D v_val, Vector3D n, Vector3D o, Volume vol, int identifier)
std::unique_ptr< TGeoMatrix > _wtM
virtual double distance(const Vector3D &point) const
Distance to surface.
virtual double radius1() const
the end radius of the cone
Implementation of cylindrical surface attached to a volume.
void setInnerMaterial(const IMaterial &mat)
set the innerMaterial
std::list of VolSurfaces that takes ownership.
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
Get lines constraining the surface for drawing ( might not be exact boundaries) - at most nMax lines ...
VolSurface(const VolSurface &vsurf)
Constructor to be used with an existing object.
VolSurface(VolSurfaceBase *p)
Constructor to be used with an existing object.
virtual double z0() const
the start z of the cone
virtual double innerThickness() const
Thickness of inner material.
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface - v runs along the axis of the...
VolCylinder(Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D origin_val)
virtual double outerThickness() const
Thickness of outer material.
virtual bool insideBounds(const Vector3D &point, double epsilon=1.e-4) const
Checks if the given point lies within the surface.
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position.
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface.
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position.
virtual const SurfaceType & type() const
properties of the surface encoded in Type.
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position - v runs along the axis of the...
Surface()=delete
default c'tor etc. removed
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
The normal direction at the given point - rotated to point projected onto the cylinder.
VolSurfaceBase(const VolSurfaceBase &c)
Copy the from object.
VolSurfaceHandle(Volume vol, SurfaceType typ, double thickness_inner, double thickness_outer, Vector3D u_val, Vector3D v_val, Vector3D n_val, Vector3D o_val=Vector3D(0., 0., 0.))
VolSurface end(VolSurface...args)
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coo...
Template for VolSurface specializations.
virtual double length_along_v() const
The length of the surface along direction v at the origin.
std::list of Surfaces that optionally takes ownership.
virtual void setU(const Vector3D &u)
setter for daughter classes
virtual double length_along_v() const
The length of the surface along direction v at the origin.
virtual const Vector3D & origin() const
Get Origin of local coordinate system on surface.
VolSurfaceList(const VolSurfaceList &vsl, DetElement &)
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U.
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
virtual double innerThickness() const
Thickness of inner material.
VolSurfaceHandle< VolPlaneImpl > VolPlane
virtual double innerThickness() const
Thickness of inner material.
VolSurfaceList * volSurfaceList(DetElement &det)
Helper function for accessing the list assigned to a DetElement - attaches empty list if needed...
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V - rotated to point projected onto the cylinder. ...
VolSurface()
default c'tor
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
virtual long64 id() const
The id of this surface.
VolPlaneImpl(SurfaceType typ, double thickness_inner, double thickness_outer, Vector3D u_val, Vector3D v_val, Vector3D n_val, Vector3D o_val, Volume vol, int id_val)
standard c'tor with all necessary arguments - origin is (0,0,0) if not given.
Minimal interface to provide acces to radius of cylinder surfaces.
void setInnerMaterial(const IMaterial &mat)
set the inner Material
bool checkOrthogonalToZ(const ISurface &surf, double epsilon=1.e-6) const
True if surface is orthogonal to Z with accuracy epsilon - result is cached in bit SurfaceType::Ortho...
virtual const Vector3D & origin() const
Get Origin of local coordinate system on surface.
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U.
ConeSurface(DetElement det, VolSurface volSurf)
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
create outer bounding lines for the given symmetry of the polyhedron
virtual void setV(const Vector3D &v)
setter for daughter classes
VolCone(Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D v_val, Vector3D origin_val)
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position - v runs along the axis of the...
virtual double length_along_u() const
The length of the surface along direction u at the origin.
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V.
virtual double distance(const Vector3D &point) const
Distance to surface.
VolCylinderImpl()
default c'tor
Reference counted handle class for a local surface attached to a volume (VolSurfaceBase).
virtual double distance(const Vector3D &point) const
Distance to surface.
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface - v runs along the axis of the...
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U - rotated to point projected onto the cone.
SurfaceList(const DetElement &)
required c'tor for extension mechanism
virtual double outerThickness() const
Thickness of outer material.
virtual void setNormal(const Vector3D &n)
setter for daughter classes
Implementation of ISurface for a local surface attached to a volume.
virtual double length_along_u() const
The length of the surface along direction u at the origin.
Helper class for describing surface properties.
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
virtual ~SurfaceList()
d'tor deletes all owned surfaces
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U.
virtual double length_along_v() const
The length of the surface along direction v at the origin.
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface - u runs along the axis of the...
virtual long64 id() const
The id of this surface - always 0 for VolSurfaces.
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U - rotated to point projected onto the cylinder.
Specialization of Surface for cones - specializes CyliderSurface (for lazyness ...)
SurfaceList()=default
defaul c'tor - allow to set ownership for surfaces
VolSurface volSurface() const
The VolSurface attched to the volume.
VolSurface insert(VolSurface...args)
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V - rotated to point projected onto the cone.
DetElement detElement() const
The DetElement belonging to the surface volume.
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface.
VolSurfaceList(DetElement &det)
Implementation of Surface class holding a local surface attached to a volume and the DetElement holdi...
Volume volume() const
the volume to which this surface is attached.
virtual double distance(const Vector3D &point) const
Distance to surface.
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
Simple 2D vector helper class; moved out of ISurface definition.
virtual double distance(const Vector3D &point) const
Distance to surface.
VolSurfaceBase()=default
default c'tor
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V.
virtual const SurfaceType & type() const
properties of the surface encoded in Type.
VolSurface & operator=(const VolSurface &vsurf)
virtual bool insideBounds(const Vector3D &point, double epsilon=1e-4) const
Checks if the given point lies within the surface.
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
The normal direction at the given point, projected onto the cylinder.
Simple data class that implements the IMaterial interface and is used in the Surface implementation...
virtual long64 id() const
The id of this surface - corresponds to DetElement id.
virtual Vector3D volumeOrigin() const
Get Origin of local coordinate system of the associated volume.
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
virtual double length_along_u() const
The length of the surface along direction u at the origin.
virtual bool insideBounds(const Vector3D &point, double epsilon=1e-4) const
Checks if the given point lies within the surface.
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
Specialization of Surface for cylinders.
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V.
virtual Vector3D center() const
the center of the cylinder
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position - u runs along the axis of the...
bool checkParallelToZ(const ISurface &surf, double epsilon=1.e-6) const
True if surface is parallel to Z with accuracy epsilon - result is cached in bit SurfaceType::Paralle...
VolPlaneImpl()
default c'tor
Implementation of a planar surface attached to a volume.
Minimal interface to provide acces to radii of conical surfaces.
SurfaceList(bool isOwner)
defaul c'tor - allow to set ownership for surfaces
virtual ~VolSurfaceBase()=default
virtual double outerThickness() const
Thickness of outer material.
virtual const SurfaceType & type() const
properties of the surface encoded in Type.
virtual const Vector3D & origin() const
Get Origin of local coordinate system on surface.
Interface for material description for tracking.
SurfaceList(const SurfaceList &, const DetElement &)
required c'tor for extension mechanism
VolConeImpl()
default c'tor
Surface & operator=(Surface const &)=delete
Volume volume() const
the volume to which this surface is attached.
virtual double distance(const Vector3D &point) const
Distance to surface.
CylinderSurface(DetElement det, VolSurface volSurf)
Standard c'tor.
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface.
VolSurfaceBase * ptr() const
pointer to underlying object