1 #ifndef DDRec_Surface_H
2 #define DDRec_Surface_H
18 using namespace DDSurfaces ;
51 virtual void setU(
const Vector3D& u) ;
55 virtual void setNormal(
const Vector3D& n) ;
57 virtual void setOrigin(
const Vector3D& o) ;
81 double thickness_inner ,
double thickness_outer,
89 _th_i( thickness_inner ),
90 _th_o( thickness_outer ),
94 _id( identifier ), _refCount(0) {
119 virtual long64 id()
const ;
138 virtual const Vector3D& origin()
const ;
147 virtual const IMaterial& innerMaterial()
const ;
150 virtual const IMaterial& outerMaterial()
const ;
153 virtual double innerThickness()
const ;
156 virtual double outerThickness()
const ;
162 virtual double length_along_u()
const ;
167 virtual double length_along_v()
const ;
171 virtual double distance(
const Vector3D& point )
const ;
174 virtual bool insideBounds(
const Vector3D& point,
double epsilon=1
e-4 )
const ;
177 virtual std::vector< std::pair<Vector3D, Vector3D> > getLines(
unsigned nMax=100) ;
204 -- _surf->_refCount ;
205 if( _surf->_refCount == 0 )
delete _surf ;
216 ++ _surf->_refCount ;
220 _surf = vsurf.
_surf ;
233 virtual long64 id()
const ;
252 virtual const Vector3D& origin()
const ;
261 virtual const IMaterial& innerMaterial()
const ;
264 virtual const IMaterial& outerMaterial()
const ;
267 virtual double innerThickness()
const ;
270 virtual double outerThickness()
const ;
276 virtual double length_along_u()
const ;
281 virtual double length_along_v()
const ;
284 virtual double distance(
const Vector3D& point )
const ;
287 virtual bool insideBounds(
const Vector3D& point,
double epsilon=1
e-4 )
const ;
289 virtual std::vector< std::pair<Vector3D, Vector3D> > getLines(
unsigned nMax=100) ;
302 struct VolSurfaceList ;
322 std::copy( this->end() , sL->begin() , sL->end() ) ;
329 this->insert( this->end() , vsl.begin() , vsl.end() ) ;
355 VolSurfaceBase( typ, thickness_inner, thickness_outer, u_val,v_val, n_val, o_val, vol, id_val ) {
360 _type.checkParallelToZ( *
this ) ;
361 _type.checkOrthogonalToZ( *
this ) ;
365 virtual double distance(
const Vector3D& point )
const ;
399 virtual double distance(
const Vector3D& point )
const ;
452 virtual double distance(
const Vector3D& point )
const ;
460 virtual std::vector< std::pair<DDSurfaces::Vector3D, DDSurfaces::Vector3D> > getLines(
unsigned nMax=100) ;
480 VolSurface( new
T( typ, thickness_inner, thickness_outer, u_val, v_val, n_val, o_val, vol , 0 ) ){
499 VolSurface( new
VolConeImpl( vol, typ_val, thickness_inner , thickness_outer, v_val, origin_val ) ) {}
540 virtual long64 id()
const ;
566 virtual const Vector3D& origin()
const ;
575 virtual double innerThickness()
const ;
578 virtual double outerThickness()
const ;
581 virtual const IMaterial& innerMaterial()
const ;
584 virtual const IMaterial& outerMaterial()
const ;
587 virtual double distance(
const Vector3D& point )
const ;
590 virtual bool insideBounds(
const Vector3D& point,
double epsilon=1.
e-4)
const ;
593 virtual Vector3D volumeOrigin()
const ;
598 virtual double length_along_u()
const ;
603 virtual double length_along_v()
const ;
608 virtual std::vector< std::pair< Vector3D, Vector3D> > getLines(
unsigned nMax=100) ;
651 virtual double radius()
const ;
668 virtual double radius0()
const ;
671 virtual double radius1()
const ;
674 virtual double z0()
const ;
677 virtual double z1()
const ;
VolSurface()
default c'tor
VolSurface(VolSurfaceBase *p)
Constructor to be used with an existing object.
Geometry::Volume volume() const
the volume to which this surface is attached.
CylinderSurface(Geometry::DetElement det, VolSurface volSurf)
Standard c'tor.
VolCylinderImpl()
default c'tor
VolPlaneImpl(SurfaceType typ, double thickness_inner, double thickness_outer, Vector3D u_val, Vector3D v_val, Vector3D n_val, Vector3D o_val, Geometry::Volume vol, int id_val)
standard c'tor with all necessary arguments - origin is (0,0,0) if not given.
VolCylinder(Geometry::Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D origin_val)
Geometry::DetElement _det
VolPlaneImpl()
default c'tor
VolSurfaceBase()
default c'tor
VolCone(Geometry::Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D v_val, Vector3D origin_val)
VolSurface volSurface() const
The VolSurface attched to the volume.
Handle class holding a placed volume (also called physical volume)
VolSurfaceBase(const VolSurfaceBase &c)
Copy the from object.
SurfaceList(const SurfaceList &, const Geometry::DetElement &)
required c'tor for extension mechanism
SurfaceList(const Geometry::DetElement &)
required c'tor for extension mechanism
VolSurface & operator=(const VolSurface &vsurf)
VolConeImpl()
default c'tor
SurfaceList(bool isOwner=false)
defaul c'tor - allow to set ownership for surfaces
VolSurfaceList(Geometry::DetElement &det)
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
SurfaceList(const SurfaceList &other)
copy c'tor
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
VolSurfaceHandle< VolPlaneImpl > VolPlane
VolSurface(const VolSurface &vsurf)
Constructor to be used with an existing object.
VolSurfaceBase * ptr() const
pointer to underlying object
VolSurfaceList(const VolSurfaceList &vsl, Geometry::DetElement &)
Geometry::Volume volume() const
the volume to which this surface is attached.
virtual ~VolSurfaceBase()
ConeSurface(Geometry::DetElement det, VolSurface volSurf)
Handle class describing a detector element.
VolSurfaceList * volSurfaceList(DetElement &det)
void setInnerMaterial(const IMaterial &mat)
set the inner Material
VolSurfaceBase(SurfaceType typ, double thickness_inner, double thickness_outer, Vector3D u_val, Vector3D v_val, Vector3D n, Vector3D o, Geometry::Volume vol, int identifier)
void setInnerMaterial(const IMaterial &mat)
set the innerMaterial
Geometry::Volume volume() const
The volume that has the surface attached.
VolSurfaceHandle(Geometry::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.))