DD4hep  01.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Surface.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : F.Gaede
11 //
12 //==========================================================================
13 #ifndef DDREC_SURFACE_H
14 #define DDREC_SURFACE_H
15 
16 #include "DD4hep/Objects.h"
17 #include "DD4hep/Volumes.h"
18 #include "DD4hep/DetElement.h"
19 
20 #include "DDRec/ISurface.h"
21 #include "DDRec/Material.h"
22 
23 #include <list>
24 #include <memory>
25 
26 class TGeoMatrix ;
27 
28 namespace dd4hep {
29  namespace rec {
30 
31  //-------------------------------------------------------------------------------------------
32 
33  class VolSurface ;
34 
43  class VolSurfaceBase : public ISurface {
44 
45  friend class VolSurface ;
46 
47  protected:
53  double _th_i {0};
54  double _th_o {0};
57  Volume _vol {};
58  long64 _id {0};
59  unsigned _refCount {0};
60 
62  virtual void setU(const Vector3D& u) ;
64  virtual void setV(const Vector3D& v) ;
66  virtual void setNormal(const Vector3D& n) ;
68  virtual void setOrigin(const Vector3D& o) ;
69 
70  public:
71 
72  virtual ~VolSurfaceBase() = default;
73 
75 
76  VolSurfaceBase() = default;
77 
79  double thickness_inner ,double thickness_outer,
80  Vector3D u_val ,Vector3D v_val ,
81  Vector3D n ,Vector3D o, Volume vol,int identifier ) :
82  _type(typ ) ,
83  _u( u_val ) ,
84  _v( v_val ) ,
85  _n( n ) ,
86  _o( o ),
87  _th_i( thickness_inner ),
88  _th_o( thickness_outer ),
89  _vol(vol) ,
90  _id( identifier ) {
91  }
92 
93 
96  : _type(c._type), _u(c._u), _v(c._v), _n(c._n), _o(c._o),
98  _outerMat(c._innerMat), _vol(c._vol), _id(c._id)
99  {
100  }
101 
103  Volume volume() const { return _vol ; }
104 
106  virtual long64 id() const ;
107 
111  virtual const SurfaceType& type() const ;
112 
113  //==== geometry ====
114 
116  virtual Vector3D u( const Vector3D& point = Vector3D() ) const ;
117 
119  virtual Vector3D v(const Vector3D& point = Vector3D() ) const ;
120 
122  virtual Vector3D normal(const Vector3D& point = Vector3D() ) const ;
123 
125  virtual const Vector3D& origin() const ;
126 
128  virtual Vector2D globalToLocal( const Vector3D& point) const ;
129 
131  virtual Vector3D localToGlobal( const Vector2D& point) const ;
132 
134  virtual const IMaterial& innerMaterial() const ;
135 
137  virtual const IMaterial& outerMaterial() const ;
138 
140  virtual double innerThickness() const ;
141 
143  virtual double outerThickness() const ;
144 
145 
149  virtual double length_along_u() const ;
150 
154  virtual double length_along_v() const ;
155 
156 
158  virtual double distance(const Vector3D& point ) const ;
159 
161  virtual bool insideBounds(const Vector3D& point, double epsilon=1e-4 ) const ;
162 
163 
164  virtual std::vector< std::pair<Vector3D, Vector3D> > getLines(unsigned nMax=100) ;
165 
167  void setInnerMaterial( const IMaterial& mat ){ _innerMat = mat ; }
168 
170  void setOuterMaterial( const IMaterial& mat ){ _outerMat = mat ; }
171 
172  };
173 
174  //---------------------------------------------------------------------------------------------
181  class VolSurface : public ISurface {
182 
183  protected:
184 
186 
187  public:
188 
189  virtual ~VolSurface(){
190  if( _surf ) {
191  -- _surf->_refCount ;
192  if( _surf->_refCount == 0 ) delete _surf ;
193  }
194  }
196  VolSurface() : _surf(0) { }
197 
200 
202  VolSurface(const VolSurface& vsurf) : _surf( vsurf._surf ) {
203  ++ _surf->_refCount ;
204  }
205 
206  VolSurface& operator=(const VolSurface& vsurf) {
207  _surf = vsurf._surf ;
208  ++ _surf->_refCount ;
209  return *this ;
210  }
211 
212 
214  Volume volume() const { return _surf->volume() ; }
215 
217  VolSurfaceBase* ptr() const { return _surf ; }
218 
220  virtual long64 id() const ;
221 
225  virtual const SurfaceType& type() const ;
226 
227  //==== geometry ====
228 
230  virtual Vector3D u( const Vector3D& point = Vector3D() ) const ;
231 
233  virtual Vector3D v(const Vector3D& point = Vector3D() ) const ;
234 
236  virtual Vector3D normal(const Vector3D& point = Vector3D() ) const ;
237 
239  virtual const Vector3D& origin() const ;
240 
242  virtual Vector2D globalToLocal( const Vector3D& point) const ;
243 
245  virtual Vector3D localToGlobal( const Vector2D& point) const ;
246 
248  virtual const IMaterial& innerMaterial() const ;
249 
251  virtual const IMaterial& outerMaterial() const ;
252 
254  virtual double innerThickness() const ;
255 
257  virtual double outerThickness() const ;
258 
259 
263  virtual double length_along_u() const ;
264 
268  virtual double length_along_v() const ;
269 
271  virtual double distance(const Vector3D& point ) const ;
272 
274  virtual bool insideBounds(const Vector3D& point, double epsilon=1e-4 ) const ;
275 
276  virtual std::vector< std::pair<Vector3D, Vector3D> > getLines(unsigned nMax=100) ;
277 
279  void setInnerMaterial( const IMaterial& mat ){ _surf->setInnerMaterial( mat ) ; }
280 
282  void setOuterMaterial( const IMaterial& mat ){ _surf->setOuterMaterial( mat ) ; }
283 
284  };
285 
286  //======================================================================================================
287 
288 
289  struct VolSurfaceList ;
293  VolSurfaceList* volSurfaceList( DetElement& det) ;
294 
300  struct VolSurfaceList : std::list< VolSurface > {
301 
303 
304  // required c'tor for extension mechanism
305  VolSurfaceList(DetElement& det){
306 
307  VolSurfaceList* sL = volSurfaceList( det ) ;
308 
309  std::copy( this->end() , sL->begin() , sL->end() ) ;
310  }
311 
312 
313  // required c'tor for extension mechanism
314  VolSurfaceList(const VolSurfaceList& vsl, DetElement& /*det*/ ){
315 
316  this->insert( this->end() , vsl.begin() , vsl.end() ) ;
317  }
318 
319  virtual ~VolSurfaceList() ;
320 
321  } ;
322 
323 
324  //======================================================================================================
325 
331  class VolPlaneImpl : public VolSurfaceBase {
332 
333  public:
334 
337 
339  VolPlaneImpl( SurfaceType typ, double thickness_inner ,double thickness_outer,
340  Vector3D u_val ,Vector3D v_val ,Vector3D n_val , Vector3D o_val, Volume vol, int id_val ) :
341 
342  VolSurfaceBase( typ, thickness_inner, thickness_outer, u_val,v_val, n_val, o_val, vol, id_val ) {
343 
346  _type.setProperty( SurfaceType::Cone , false ) ;
347  _type.checkParallelToZ( *this ) ;
348  _type.checkOrthogonalToZ( *this ) ;
349  }
350 
352  virtual double distance(const Vector3D& point ) const ;
353  } ;
354 
355  //======================================================================================================
362 
363  public:
364 
367 
368 
373  VolCylinderImpl( Volume vol, SurfaceType type, double thickness_inner ,double thickness_outer, Vector3D origin ) ;
374 
378  virtual Vector3D u( const Vector3D& point = Vector3D() ) const ;
379 
383  virtual Vector3D normal(const Vector3D& point = Vector3D() ) const ;
384 
386  virtual double distance(const Vector3D& point ) const ;
387 
389  virtual Vector2D globalToLocal( const Vector3D& point) const ;
390 
392  virtual Vector3D localToGlobal( const Vector2D& point) const ;
393  } ;
394 
395  //======================================================================================================
401  class VolConeImpl : public VolSurfaceBase {
402 
403  //internal helper variables
404  double _ztip ; // z position of the tip in the volume coordinate system
405  double _zt0 ; // z distance of the front face from the tip
406  double _zt1 ; // z distance of the back face from the tip
407  double _tanTheta ; // tan of half the openeing angle
408 
409  public:
410 
413 
414 
420  VolConeImpl( Volume vol, SurfaceType type, double thickness_inner ,double thickness_outer,
422 
426  virtual Vector3D u( const Vector3D& point = Vector3D() ) const ;
427 
431  virtual Vector3D v( const Vector3D& point = Vector3D() ) const ;
432 
436  virtual Vector3D normal(const Vector3D& point = Vector3D() ) const ;
437 
439  virtual double distance(const Vector3D& point ) const ;
440 
442  virtual Vector2D globalToLocal( const Vector3D& point) const ;
443 
445  virtual Vector3D localToGlobal( const Vector2D& point) const ;
446 
447  virtual std::vector< std::pair<Vector3D, Vector3D> > getLines(unsigned nMax=100) ;
448  } ;
449 
450 
451 
452  //======================================================================================================
453 
460  template <class T>
461  class VolSurfaceHandle : public VolSurface {
462 
463  public:
464  VolSurfaceHandle( Volume vol, SurfaceType typ, double thickness_inner ,double thickness_outer,
465  Vector3D u_val ,Vector3D v_val ,Vector3D n_val , Vector3D o_val = Vector3D(0.,0.,0.) ) :
466 
467  VolSurface( new T( typ, thickness_inner, thickness_outer, u_val, v_val, n_val, o_val, vol , 0 ) ){
468  }
469 
470  T* operator->() { return static_cast<T*>( _surf ) ; }
471  } ;
472 
473  //---------------------------------------------------------------------------------------------
475  //---------------------------------------------------------------------------------------------
476 
477  class VolCylinder : public VolSurface{
478  public:
479  VolCylinder( Volume vol, SurfaceType typ_val, double thickness_inner ,double thickness_outer, Vector3D origin_val ) :
480  VolSurface( new VolCylinderImpl( vol, typ_val, thickness_inner , thickness_outer, origin_val ) ) {}
481  } ;
482 
483  class VolCone : public VolSurface{
484  public:
485  VolCone( Volume vol, SurfaceType typ_val, double thickness_inner ,double thickness_outer, Vector3D v_val, Vector3D origin_val ) :
486  VolSurface( new VolConeImpl( vol, typ_val, thickness_inner , thickness_outer, v_val, origin_val ) ) {}
487  } ;
488 
489  //======================================================================================================
490 
498  class Surface: public ISurface {
499 
500  protected:
501 
502  DetElement _det ;
504  std::unique_ptr<TGeoMatrix> _wtM ; // matrix for world transformation of surface
505 
506  long64 _id {0};
507 
513 
515  Surface() = delete;
516  Surface( Surface const& ) = delete;
517  Surface& operator=( Surface const& ) = delete;
518 
519  public:
520 
521  virtual ~Surface() {}
522 
526  Surface( DetElement det, VolSurface volSurf ) ;
527 
529  virtual long64 id() const ;
530 
534  virtual const SurfaceType& type() const ;
535 
537  Volume volume() const { return _volSurf.volume() ; }
538 
540  VolSurface volSurface() const { return _volSurf ; }
541 
543  DetElement detElement() const { return _det; }
544 
545 
546  //==== geometry ====
547 
549  virtual Vector3D u( const Vector3D& point = Vector3D() ) const ;
550 
552  virtual Vector3D v(const Vector3D& point = Vector3D() ) const ;
553 
555  virtual Vector3D normal(const Vector3D& point = Vector3D() ) const ;
556 
558  virtual const Vector3D& origin() const ;
559 
561  virtual Vector2D globalToLocal( const Vector3D& point) const ;
562 
564  virtual Vector3D localToGlobal( const Vector2D& point) const ;
565 
567  virtual double innerThickness() const ;
568 
570  virtual double outerThickness() const ;
571 
573  virtual const IMaterial& innerMaterial() const ;
574 
576  virtual const IMaterial& outerMaterial() const ;
577 
579  virtual double distance(const Vector3D& point ) const ;
580 
582  virtual bool insideBounds(const Vector3D& point, double epsilon=1.e-4) const ;
583 
585  virtual Vector3D volumeOrigin() const ;
586 
590  virtual double length_along_u() const ;
591 
595  virtual double length_along_v() const ;
596 
600  virtual std::vector< std::pair< Vector3D, Vector3D> > getLines(unsigned nMax=100) ;
601 
602  protected:
603  void initialize() ;
604 
605  };
606 
607  //======================================================================================================
608 
614  class CylinderSurface: public Surface, public ICylinder {
615 
616  public:
617 
619  CylinderSurface( DetElement det, VolSurface volSurf ) : Surface( det, volSurf ) { }
620 
624  virtual Vector3D u( const Vector3D& point = Vector3D() ) const ;
625 
629  virtual Vector3D v(const Vector3D& point = Vector3D() ) const ;
630 
634  virtual Vector3D normal(const Vector3D& point = Vector3D() ) const ;
635 
637  virtual Vector2D globalToLocal( const Vector3D& point) const ;
638 
640  virtual Vector3D localToGlobal( const Vector2D& point) const ;
641 
643  virtual double radius() const ;
644 
646  virtual Vector3D center() const ;
647 
648  } ;
649  //======================================================================================================
650 
655  class ConeSurface : public CylinderSurface, public ICone {
656  public:
657  ConeSurface( DetElement det, VolSurface volSurf ) : CylinderSurface( det, volSurf ) { }
658 
660  virtual double radius0() const ;
661 
663  virtual double radius1() const ;
664 
666  virtual double z0() const ;
667 
669  virtual double z1() const ;
670 
672  virtual Vector3D center() const ;
673 
674  };
675  //======================================================================================================
681  class SurfaceList : public std::list< ISurface* > {
682 
683  protected:
684  bool _isOwner {false};
685 
686  public:
688  SurfaceList() = default;
690  SurfaceList(bool isOwner ) : _isOwner( isOwner ) {}
692  SurfaceList(const SurfaceList& other ) = default;
694  SurfaceList(const DetElement& ) {}
696  SurfaceList(const SurfaceList& ,const DetElement& ) {}
698  virtual ~SurfaceList();
699  };
700 
701  // SurfaceList* surfaceList( DetElement& det ) ;
702 
703  //======================================================================================================
704 
705 
706  } /* namespace */
707 } /* namespace */
708 
709 
710 
711 #endif // DDREC_SURFACE_H
virtual Vector3D center() const
the center of the cone
Definition: Surface.cpp:1303
virtual double z1() const
the end z of the cone
Definition: Surface.cpp:1295
void setProperty(unsigned prop, bool val=true)
set the given peorperty
Definition: ISurface.h:196
virtual double radius() const
the radius of the cylinder (rho of the origin vector)
Definition: Surface.cpp:1263
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
The normal direction at the given point, projected onto the cone.
Definition: Surface.cpp:405
T copy(T...args)
Interface for tracking surfaces.
Definition: ISurface.h:39
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position.
Definition: Surface.cpp:682
virtual double radius0() const
the start radius of the cone
Definition: Surface.cpp:1271
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U - rotated to point projected onto the cylinder.
Definition: Surface.cpp:297
Volume volume() const
The volume that has the surface attached.
Definition: Surface.h:537
Implementation of conical surface attached to a volume.
Definition: Surface.h:401
virtual void setOrigin(const Vector3D &o)
setter for daughter classes
Definition: Surface.cpp:40
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
Definition: Surface.cpp:74
VolSurfaceBase(SurfaceType typ, double thickness_inner, double thickness_outer, Vector3D u_val, Vector3D v_val, Vector3D n, Vector3D o, Volume vol, int identifier)
Definition: Surface.h:78
std::unique_ptr< TGeoMatrix > _wtM
Definition: Surface.h:504
MaterialData _outerMat
Definition: Surface.h:56
MaterialData _innerMat
Definition: Surface.h:55
virtual double distance(const Vector3D &point) const
Distance to surface.
Definition: Surface.cpp:442
virtual double radius1() const
the end radius of the cone
Definition: Surface.cpp:1279
Implementation of cylindrical surface attached to a volume.
Definition: Surface.h:361
void setInnerMaterial(const IMaterial &mat)
set the innerMaterial
Definition: Surface.h:279
std::list of VolSurfaces that takes ownership.
Definition: Surface.h:300
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 ...
Definition: Surface.cpp:833
VolSurface(const VolSurface &vsurf)
Constructor to be used with an existing object.
Definition: Surface.h:202
VolSurface(VolSurfaceBase *p)
Constructor to be used with an existing object.
Definition: Surface.h:199
virtual double z0() const
the start z of the cone
Definition: Surface.cpp:1287
virtual double innerThickness() const
Thickness of inner material.
Definition: Surface.cpp:619
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...
Definition: Surface.cpp:411
VolCylinder(Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D origin_val)
Definition: Surface.h:479
virtual double outerThickness() const
Thickness of outer material.
Definition: Surface.cpp:76
virtual bool insideBounds(const Vector3D &point, double epsilon=1.e-4) const
Checks if the given point lies within the surface.
Definition: Surface.cpp:710
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
Definition: Surface.cpp:265
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position.
Definition: Surface.cpp:254
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface.
Definition: Surface.cpp:50
virtual Vector3D localToGlobal(const Vector2D &point) const
Convert the local position (u,v) on the surface to the global position.
Definition: Surface.cpp:66
virtual const SurfaceType & type() const
properties of the surface encoded in Type.
Definition: Surface.cpp:248
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...
Definition: Surface.cpp:322
Surface()=delete
default c&#39;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.
Definition: Surface.cpp:1237
VolSurfaceBase(const VolSurfaceBase &c)
Copy the from object.
Definition: Surface.h:95
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.))
Definition: Surface.h:464
VolSurface end(VolSurface...args)
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
Definition: Surface.cpp:238
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
Definition: Surface.cpp:645
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coo...
Definition: Vector3D.h:32
Template for VolSurface specializations.
Definition: Surface.h:461
virtual double length_along_v() const
The length of the surface along direction v at the origin.
Definition: Surface.cpp:142
std::list of Surfaces that optionally takes ownership.
Definition: Surface.h:681
virtual void setU(const Vector3D &u)
setter for daughter classes
Definition: Surface.cpp:37
virtual double length_along_v() const
The length of the surface along direction v at the origin.
Definition: Surface.cpp:260
virtual const Vector3D & origin() const
Get Origin of local coordinate system on surface.
Definition: Surface.cpp:618
VolSurfaceList(const VolSurfaceList &vsl, DetElement &)
Definition: Surface.h:314
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U.
Definition: Surface.cpp:249
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
Definition: Surface.cpp:255
virtual double innerThickness() const
Thickness of inner material.
Definition: Surface.cpp:257
VolSurfaceHandle< VolPlaneImpl > VolPlane
Definition: Surface.h:474
virtual double innerThickness() const
Thickness of inner material.
Definition: Surface.cpp:75
VolSurfaceList * volSurfaceList(DetElement &det)
Helper function for accessing the list assigned to a DetElement - attaches empty list if needed...
Definition: Surface.cpp:528
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V - rotated to point projected onto the cylinder. ...
Definition: Surface.cpp:1229
VolSurface()
default c&#39;tor
Definition: Surface.h:196
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
Definition: Surface.cpp:47
virtual long64 id() const
The id of this surface.
Definition: Surface.cpp:42
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&#39;tor with all necessary arguments - origin is (0,0,0) if not given.
Definition: Surface.h:339
Minimal interface to provide acces to radius of cylinder surfaces.
Definition: ISurface.h:105
void setInnerMaterial(const IMaterial &mat)
set the inner Material
Definition: Surface.h:167
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...
Definition: ISurface.h:269
virtual const Vector3D & origin() const
Get Origin of local coordinate system on surface.
Definition: Surface.cpp:48
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U.
Definition: Surface.cpp:615
ConeSurface(DetElement det, VolSurface volSurf)
Definition: Surface.h:657
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
create outer bounding lines for the given symmetry of the polyhedron
Definition: Surface.cpp:467
virtual void setV(const Vector3D &v)
setter for daughter classes
Definition: Surface.cpp:38
VolCone(Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D v_val, Vector3D origin_val)
Definition: Surface.h:485
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...
Definition: Surface.cpp:426
virtual double length_along_u() const
The length of the surface along direction u at the origin.
Definition: Surface.cpp:259
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V.
Definition: Surface.cpp:250
virtual double distance(const Vector3D &point) const
Distance to surface.
Definition: Surface.cpp:261
VolCylinderImpl()
default c&#39;tor
Definition: Surface.h:366
Reference counted handle class for a local surface attached to a volume (VolSurfaceBase).
Definition: Surface.h:181
virtual double distance(const Vector3D &point) const
Distance to surface.
Definition: Surface.cpp:335
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...
Definition: Surface.cpp:310
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U - rotated to point projected onto the cone.
Definition: Surface.cpp:398
SurfaceList(const DetElement &)
required c&#39;tor for extension mechanism
Definition: Surface.h:694
virtual double outerThickness() const
Thickness of outer material.
Definition: Surface.cpp:258
long long int long64
Definition: ISurface.h:26
virtual void setNormal(const Vector3D &n)
setter for daughter classes
Definition: Surface.cpp:39
Implementation of ISurface for a local surface attached to a volume.
Definition: Surface.h:43
virtual double length_along_u() const
The length of the surface along direction u at the origin.
Definition: Surface.cpp:621
Helper class for describing surface properties.
Definition: ISurface.h:140
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
Definition: Surface.h:170
virtual ~SurfaceList()
d&#39;tor deletes all owned surfaces
Definition: Surface.cpp:519
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U.
Definition: Surface.cpp:45
virtual double length_along_v() const
The length of the surface along direction v at the origin.
Definition: Surface.cpp:622
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...
Definition: Surface.cpp:1245
virtual long64 id() const
The id of this surface - always 0 for VolSurfaces.
Definition: Surface.cpp:247
virtual Vector3D u(const Vector3D &point=Vector3D()) const
First direction of measurement U - rotated to point projected onto the cylinder.
Definition: Surface.cpp:1220
Specialization of Surface for cones - specializes CyliderSurface (for lazyness ...)
Definition: Surface.h:655
SurfaceType _type
Definition: Surface.h:508
SurfaceList()=default
defaul c&#39;tor - allow to set ownership for surfaces
VolSurface volSurface() const
The VolSurface attched to the volume.
Definition: Surface.h:540
VolSurface insert(VolSurface...args)
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V - rotated to point projected onto the cone.
Definition: Surface.cpp:392
STL class.
DetElement detElement() const
The DetElement belonging to the surface volume.
Definition: Surface.h:543
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
Definition: Surface.cpp:617
T begin(T...args)
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface.
Definition: Surface.cpp:665
VolSurfaceList(DetElement &det)
Definition: Surface.h:305
Implementation of Surface class holding a local surface attached to a volume and the DetElement holdi...
Definition: Surface.h:498
Volume volume() const
the volume to which this surface is attached.
Definition: Surface.h:103
virtual double distance(const Vector3D &point) const
Distance to surface.
Definition: Surface.cpp:701
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
Definition: Surface.h:282
Simple 2D vector helper class; moved out of ISurface definition.
Definition: Vector2D.h:23
virtual double distance(const Vector3D &point) const
Distance to surface.
Definition: Surface.cpp:205
VolSurfaceBase()=default
default c&#39;tor
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V.
Definition: Surface.cpp:46
virtual const SurfaceType & type() const
properties of the surface encoded in Type.
Definition: Surface.cpp:44
VolSurface & operator=(const VolSurface &vsurf)
Definition: Surface.h:206
virtual bool insideBounds(const Vector3D &point, double epsilon=1e-4) const
Checks if the given point lies within the surface.
Definition: Surface.cpp:262
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
Definition: Surface.cpp:626
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
The normal direction at the given point, projected onto the cylinder.
Definition: Surface.cpp:304
Simple data class that implements the IMaterial interface and is used in the Surface implementation...
Definition: Material.h:33
virtual ~Surface()
Definition: Surface.h:521
virtual long64 id() const
The id of this surface - corresponds to DetElement id.
Definition: Surface.cpp:611
virtual Vector3D volumeOrigin() const
Get Origin of local coordinate system of the associated volume.
Definition: Surface.cpp:689
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
Definition: Surface.cpp:256
virtual ~VolSurface()
Definition: Surface.h:189
virtual double length_along_u() const
The length of the surface along direction u at the origin.
Definition: Surface.cpp:79
VolSurfaceBase * _surf
Definition: Surface.h:185
virtual bool insideBounds(const Vector3D &point, double epsilon=1e-4) const
Checks if the given point lies within the surface.
Definition: Surface.cpp:208
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
Definition: Surface.cpp:73
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
Definition: Surface.cpp:251
Specialization of Surface for cylinders.
Definition: Surface.h:614
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Second direction of measurement V.
Definition: Surface.cpp:616
virtual Vector3D center() const
the center of the cylinder
Definition: Surface.cpp:1265
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...
Definition: Surface.cpp:1254
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...
Definition: ISurface.h:252
VolPlaneImpl()
default c&#39;tor
Definition: Surface.h:336
Implementation of a planar surface attached to a volume.
Definition: Surface.h:331
Minimal interface to provide acces to radii of conical surfaces.
Definition: ISurface.h:119
SurfaceList(bool isOwner)
defaul c&#39;tor - allow to set ownership for surfaces
Definition: Surface.h:690
virtual ~VolSurfaceBase()=default
virtual double outerThickness() const
Thickness of outer material.
Definition: Surface.cpp:620
virtual const SurfaceType & type() const
properties of the surface encoded in Type.
Definition: Surface.cpp:613
virtual const Vector3D & origin() const
Get Origin of local coordinate system on surface.
Definition: Surface.cpp:252
Interface for material description for tracking.
Definition: IMaterial.h:28
DetElement _det
Definition: Surface.h:502
SurfaceList(const SurfaceList &, const DetElement &)
required c&#39;tor for extension mechanism
Definition: Surface.h:696
VolConeImpl()
default c&#39;tor
Definition: Surface.h:412
Surface & operator=(Surface const &)=delete
Volume volume() const
the volume to which this surface is attached.
Definition: Surface.h:214
virtual double distance(const Vector3D &point) const
Distance to surface.
Definition: Surface.cpp:272
VolSurface _volSurf
Definition: Surface.h:503
CylinderSurface(DetElement det, VolSurface volSurf)
Standard c&#39;tor.
Definition: Surface.h:619
virtual Vector2D globalToLocal(const Vector3D &point) const
Convert the global position to the local position (u,v) on the surface.
Definition: Surface.cpp:253
VolSurfaceBase * ptr() const
pointer to underlying object
Definition: Surface.h:217