DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
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};
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
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 { 0.0 }; // z position of the tip in the volume coordinate system
405  double _zt0 { 0.0 }; // z distance of the front face from the tip
406  double _zt1 { 0.0 }; // z distance of the back face from the tip
407  double _tanTheta { 0.0 }; // 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 
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;
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
dd4hep::rec::VolSurface::v
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:250
dd4hep::rec::VolSurfaceBase::_type
SurfaceType _type
Definition: Surface.h:48
ISurface.h
dd4hep::rec::SurfaceList::SurfaceList
SurfaceList()=default
defaul c'tor - allow to set ownership for surfaces
dd4hep::rec::VolSurfaceBase::_o
Vector3D _o
Definition: Surface.h:52
dd4hep::rec::VolSurfaceBase::length_along_v
virtual double length_along_v() const
Definition: Surface.cpp:142
dd4hep::rec::Surface::initialize
void initialize()
Definition: Surface.cpp:719
dd4hep::rec::VolSurfaceBase::volume
Volume volume() const
the volume to which this surface is attached.
Definition: Surface.h:103
Objects.h
dd4hep::rec::Surface::localToGlobal
virtual Vector3D localToGlobal(const Vector2D &point) const
Definition: Surface.cpp:682
dd4hep::rec::VolCylinderImpl::localToGlobal
virtual Vector3D localToGlobal(const Vector2D &point) const
Definition: Surface.cpp:322
dd4hep::rec::SurfaceType::checkOrthogonalToZ
bool checkOrthogonalToZ(const ISurface &surf, double epsilon=1.e-6) const
Definition: ISurface.h:269
Volumes.h
dd4hep::rec::VolSurface::type
virtual const SurfaceType & type() const
Definition: Surface.cpp:248
dd4hep::rec::VolCylinderImpl::VolCylinderImpl
VolCylinderImpl()
default c'tor
Definition: Surface.h:366
dd4hep::rec::ConeSurface::ConeSurface
ConeSurface(DetElement det, VolSurface volSurf)
Definition: Surface.h:657
dd4hep::rec::VolConeImpl::_tanTheta
double _tanTheta
Definition: Surface.h:407
dd4hep::rec::Surface::_u
Vector3D _u
Definition: Surface.h:509
dd4hep::rec::Vector3D
Definition: Vector3D.h:32
dd4hep::rec::Surface::length_along_v
virtual double length_along_v() const
Definition: Surface.cpp:622
dd4hep::rec::ConeSurface::z1
virtual double z1() const
the end z of the cone
Definition: Surface.cpp:1295
dd4hep::rec::Surface::_det
DetElement _det
Definition: Surface.h:502
dd4hep::rec::VolSurface::getLines
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
Definition: Surface.cpp:265
dd4hep::rec::VolCylinder::VolCylinder
VolCylinder(Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D origin_val)
Definition: Surface.h:479
dd4hep::rec::VolSurfaceBase::normal
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
Definition: Surface.cpp:47
dd4hep::rec::Surface::_wtM
std::unique_ptr< TGeoMatrix > _wtM
Definition: Surface.h:504
dd4hep::rec::ISurface
Definition: ISurface.h:39
dd4hep::rec::SurfaceType::Plane
@ Plane
Definition: ISurface.h:146
dd4hep::rec::VolSurfaceList::VolSurfaceList
VolSurfaceList()
Definition: Surface.h:302
dd4hep::rec::VolSurface::_surf
VolSurfaceBase * _surf
Definition: Surface.h:185
dd4hep::rec::VolCylinderImpl
Definition: Surface.h:361
dd4hep::rec::VolSurface::localToGlobal
virtual Vector3D localToGlobal(const Vector2D &point) const
Definition: Surface.cpp:254
dd4hep::rec::ICone
Definition: ISurface.h:119
dd4hep::rec::VolSurface::length_along_v
virtual double length_along_v() const
Definition: Surface.cpp:260
dd4hep::rec::Surface::volSurface
VolSurface volSurface() const
The VolSurface attched to the volume.
Definition: Surface.h:540
dd4hep::rec::VolConeImpl::localToGlobal
virtual Vector3D localToGlobal(const Vector2D &point) const
Definition: Surface.cpp:426
dd4hep::rec::VolSurfaceHandle::operator->
T * operator->()
Definition: Surface.h:470
dd4hep::rec::VolPlaneImpl::VolPlaneImpl
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.
Definition: Surface.h:339
dd4hep::rec::VolSurface::volume
Volume volume() const
the volume to which this surface is attached.
Definition: Surface.h:214
dd4hep::rec::VolSurface::u
virtual Vector3D u(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:249
dd4hep::rec::VolPlaneImpl
Definition: Surface.h:331
dd4hep::rec::Surface::_type
SurfaceType _type
Definition: Surface.h:508
dd4hep::rec::VolSurfaceBase::distance
virtual double distance(const Vector3D &point) const
Definition: Surface.cpp:205
dd4hep::rec::VolSurfaceBase::id
virtual long64 id() const
The id of this surface.
Definition: Surface.cpp:42
dd4hep::rec::VolSurfaceBase::_th_o
double _th_o
Definition: Surface.h:54
dd4hep::rec::VolSurface::outerThickness
virtual double outerThickness() const
Definition: Surface.cpp:258
dd4hep::rec::VolConeImpl
Definition: Surface.h:401
dd4hep::rec::Surface::detElement
DetElement detElement() const
The DetElement belonging to the surface volume.
Definition: Surface.h:543
dd4hep::rec::SurfaceList::SurfaceList
SurfaceList(bool isOwner)
defaul c'tor - allow to set ownership for surfaces
Definition: Surface.h:690
dd4hep::rec::Surface::~Surface
virtual ~Surface()
Definition: Surface.h:521
dd4hep::rec::Surface::id
virtual long64 id() const
The id of this surface - corresponds to DetElement id.
Definition: Surface.cpp:611
dd4hep::rec::SurfaceType::checkParallelToZ
bool checkParallelToZ(const ISurface &surf, double epsilon=1.e-6) const
Definition: ISurface.h:252
dd4hep::rec::VolSurfaceBase::u
virtual Vector3D u(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:45
dd4hep::rec::VolSurfaceBase::innerThickness
virtual double innerThickness() const
Definition: Surface.cpp:75
dd4hep::rec::ConeSurface::center
virtual Vector3D center() const
the center of the cone
Definition: Surface.cpp:1303
dd4hep::rec::CylinderSurface::localToGlobal
virtual Vector3D localToGlobal(const Vector2D &point) const
Definition: Surface.cpp:1254
dd4hep::rec::CylinderSurface
Definition: Surface.h:614
dd4hep::rec::VolSurfaceBase::_v
Vector3D _v
Definition: Surface.h:50
epsilon
const double epsilon
Definition: test_cellid_position_converter.cpp:42
dd4hep::rec::VolSurfaceBase::_innerMat
MaterialData _innerMat
Definition: Surface.h:55
dd4hep::rec::Surface::outerMaterial
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
Definition: Surface.cpp:645
dd4hep::rec::VolSurfaceBase::_vol
Volume _vol
Definition: Surface.h:57
dd4hep::rec::VolCylinderImpl::globalToLocal
virtual Vector2D globalToLocal(const Vector3D &point) const
Definition: Surface.cpp:310
dd4hep::rec::VolCylinder
Definition: Surface.h:477
dd4hep::rec::VolSurfaceBase::setNormal
virtual void setNormal(const Vector3D &n)
setter for daughter classes
Definition: Surface.cpp:39
dd4hep::rec::VolSurfaceList::~VolSurfaceList
virtual ~VolSurfaceList()
Definition: Surface.cpp:511
dd4hep::rec::VolCylinderImpl::normal
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:304
dd4hep::rec::Surface::innerThickness
virtual double innerThickness() const
Definition: Surface.cpp:619
dd4hep::rec::Surface::_n
Vector3D _n
Definition: Surface.h:511
dd4hep::rec::SurfaceList::_isOwner
bool _isOwner
Definition: Surface.h:684
dd4hep::rec::VolSurfaceBase::setOuterMaterial
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
Definition: Surface.h:170
dd4hep::rec::VolSurface::innerMaterial
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
Definition: Surface.cpp:255
dd4hep::rec::Surface::globalToLocal
virtual Vector2D globalToLocal(const Vector3D &point) const
Definition: Surface.cpp:665
dd4hep::rec::VolSurfaceBase::VolSurfaceBase
VolSurfaceBase(const VolSurfaceBase &c)
Copy the from object.
Definition: Surface.h:95
dd4hep::rec::VolSurfaceList::VolSurfaceList
VolSurfaceList(DetElement &det)
Definition: Surface.h:305
dd4hep::rec::VolSurfaceBase::v
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:46
dd4hep::rec::VolPlane
VolSurfaceHandle< VolPlaneImpl > VolPlane
Definition: Surface.h:474
dd4hep::rec::volSurfaceList
VolSurfaceList * volSurfaceList(DetElement &det)
Definition: Surface.cpp:528
dd4hep::rec::VolSurfaceBase::outerMaterial
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
Definition: Surface.cpp:74
dd4hep::rec::VolConeImpl::VolConeImpl
VolConeImpl()
default c'tor
Definition: Surface.h:412
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::rec::VolSurfaceHandle
Definition: Surface.h:461
dd4hep::rec::VolSurfaceBase::insideBounds
virtual bool insideBounds(const Vector3D &point, double epsilon=1e-4) const
Checks if the given point lies within the surface.
Definition: Surface.cpp:208
dd4hep::Volume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:378
dd4hep::rec::SurfaceList
Definition: Surface.h:681
dd4hep::rec::VolConeImpl::globalToLocal
virtual Vector2D globalToLocal(const Vector3D &point) const
Definition: Surface.cpp:411
dd4hep::rec::VolSurface::id
virtual long64 id() const
The id of this surface - always 0 for VolSurfaces.
Definition: Surface.cpp:247
dd4hep::rec::VolSurfaceBase::localToGlobal
virtual Vector3D localToGlobal(const Vector2D &point) const
Definition: Surface.cpp:66
dd4hep::rec::VolSurfaceBase::globalToLocal
virtual Vector2D globalToLocal(const Vector3D &point) const
Definition: Surface.cpp:50
dd4hep::rec::VolSurface
Definition: Surface.h:181
dd4hep::rec::VolSurfaceBase::setV
virtual void setV(const Vector3D &v)
setter for daughter classes
Definition: Surface.cpp:38
dd4hep::rec::VolConeImpl::normal
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:405
dd4hep::rec::Surface::type
virtual const SurfaceType & type() const
Definition: Surface.cpp:613
dd4hep::rec::long64
long long int long64
Definition: ISurface.h:26
dd4hep::rec::VolSurface::distance
virtual double distance(const Vector3D &point) const
Definition: Surface.cpp:261
dd4hep::rec::Surface::distance
virtual double distance(const Vector3D &point) const
Definition: Surface.cpp:701
dd4hep::rec::VolSurface::operator=
VolSurface & operator=(const VolSurface &vsurf)
Definition: Surface.h:206
dd4hep::rec::VolSurface::origin
virtual const Vector3D & origin() const
Definition: Surface.cpp:252
dd4hep::rec::VolSurfaceList
Definition: Surface.h:300
dd4hep::rec::SurfaceList::SurfaceList
SurfaceList(const SurfaceList &, const DetElement &)
required c'tor for extension mechanism
Definition: Surface.h:696
dd4hep::rec::ICylinder
Definition: ISurface.h:105
dd4hep::rec::Surface::_id
long64 _id
Definition: Surface.h:506
dd4hep::rec::VolSurface::length_along_u
virtual double length_along_u() const
Definition: Surface.cpp:259
dd4hep::rec::CylinderSurface::radius
virtual double radius() const
the radius of the cylinder (rho of the origin vector)
Definition: Surface.cpp:1263
dd4hep::rec::ConeSurface
Definition: Surface.h:655
dd4hep::rec::Surface::Surface
Surface()=delete
default c'tor etc. removed
dd4hep::rec::Surface::length_along_u
virtual double length_along_u() const
Definition: Surface.cpp:621
dd4hep::rec::VolConeImpl::_zt1
double _zt1
Definition: Surface.h:406
dd4hep::rec::VolSurfaceBase::outerThickness
virtual double outerThickness() const
Definition: Surface.cpp:76
dd4hep::rec::VolConeImpl::u
virtual Vector3D u(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:398
dd4hep::rec::SurfaceList::~SurfaceList
virtual ~SurfaceList()
d'tor deletes all owned surfaces
Definition: Surface.cpp:519
dd4hep::rec::Surface::volumeOrigin
virtual Vector3D volumeOrigin() const
Definition: Surface.cpp:689
dd4hep::rec::Vector2D
Definition: Vector2D.h:24
dd4hep::rec::Surface::getLines
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
Definition: Surface.cpp:833
dd4hep::rec::VolConeImpl::_zt0
double _zt0
Definition: Surface.h:405
dd4hep::rec::VolConeImpl::_ztip
double _ztip
Definition: Surface.h:404
dd4hep::rec::VolSurfaceBase::origin
virtual const Vector3D & origin() const
Definition: Surface.cpp:48
dd4hep::rec::VolSurface::~VolSurface
virtual ~VolSurface()
Definition: Surface.h:189
dd4hep::rec::SurfaceList::SurfaceList
SurfaceList(const SurfaceList &other)=default
copy c'tor
dd4hep::rec::VolSurfaceBase::type
virtual const SurfaceType & type() const
Definition: Surface.cpp:44
dd4hep::rec::VolSurfaceBase::innerMaterial
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
Definition: Surface.cpp:73
dd4hep::rec::VolSurface::VolSurface
VolSurface(VolSurfaceBase *p)
Constructor to be used with an existing object.
Definition: Surface.h:199
dd4hep::rec::SurfaceType
Definition: ISurface.h:140
dd4hep::rec::VolSurface::setOuterMaterial
void setOuterMaterial(const IMaterial &mat)
set the outer Materal
Definition: Surface.h:282
dd4hep::rec::VolSurface::VolSurface
VolSurface()
default c'tor
Definition: Surface.h:196
dd4hep::rec::VolSurfaceBase::_th_i
double _th_i
Definition: Surface.h:53
dd4hep::rec::Surface::volume
Volume volume() const
The volume that has the surface attached.
Definition: Surface.h:537
dd4hep::rec::VolSurfaceHandle::VolSurfaceHandle
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
dd4hep::rec::VolSurfaceBase::_refCount
unsigned _refCount
Definition: Surface.h:59
dd4hep::rec::ConeSurface::z0
virtual double z0() const
the start z of the cone
Definition: Surface.cpp:1287
dd4hep::rec::Surface::_volSurf
VolSurface _volSurf
Definition: Surface.h:503
dd4hep::rec::MaterialData
Definition: Material.h:33
dd4hep::rec::VolSurfaceBase
Definition: Surface.h:43
dd4hep::rec::VolSurface::insideBounds
virtual bool insideBounds(const Vector3D &point, double epsilon=1e-4) const
Checks if the given point lies within the surface.
Definition: Surface.cpp:262
dd4hep::rec::ConeSurface::radius0
virtual double radius0() const
the start radius of the cone
Definition: Surface.cpp:1271
dd4hep::rec::VolSurface::innerThickness
virtual double innerThickness() const
Definition: Surface.cpp:257
dd4hep::rec::VolSurfaceBase::VolSurfaceBase
VolSurfaceBase()=default
default c'tor
dd4hep::rec::VolSurface::setInnerMaterial
void setInnerMaterial(const IMaterial &mat)
set the innerMaterial
Definition: Surface.h:279
dd4hep::rec::Surface::innerMaterial
virtual const IMaterial & innerMaterial() const
Access to the material in opposite direction of the normal.
Definition: Surface.cpp:626
dd4hep::rec::VolSurfaceBase::_n
Vector3D _n
Definition: Surface.h:51
dd4hep::rec::VolSurfaceBase::~VolSurfaceBase
virtual ~VolSurfaceBase()=default
dd4hep::rec::SurfaceType::Cylinder
@ Cylinder
Definition: ISurface.h:145
dd4hep::rec::Surface::normal
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
Definition: Surface.cpp:617
dd4hep::rec::VolCone
Definition: Surface.h:483
dd4hep::rec::VolSurfaceBase::_outerMat
MaterialData _outerMat
Definition: Surface.h:56
dd4hep::rec::Surface::Surface
Surface(Surface const &)=delete
dd4hep::rec::VolSurfaceBase::setU
virtual void setU(const Vector3D &u)
setter for daughter classes
Definition: Surface.cpp:37
dd4hep::rec::VolSurfaceBase::getLines
virtual std::vector< std::pair< Vector3D, Vector3D > > getLines(unsigned nMax=100)
Definition: Surface.cpp:238
dd4hep::rec::VolSurfaceBase::_u
Vector3D _u
Definition: Surface.h:49
dd4hep::rec::VolSurfaceBase::setInnerMaterial
void setInnerMaterial(const IMaterial &mat)
set the inner Material
Definition: Surface.h:167
DetElement.h
dd4hep::rec::VolCylinderImpl::u
virtual Vector3D u(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:297
dd4hep::rec::Surface::_v
Vector3D _v
Definition: Surface.h:510
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::rec::VolSurfaceBase::length_along_u
virtual double length_along_u() const
Definition: Surface.cpp:79
dd4hep::rec::VolSurface::globalToLocal
virtual Vector2D globalToLocal(const Vector3D &point) const
Definition: Surface.cpp:253
dd4hep::rec::SurfaceList::SurfaceList
SurfaceList(const DetElement &)
required c'tor for extension mechanism
Definition: Surface.h:694
dd4hep::rec::CylinderSurface::normal
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:1237
dd4hep::rec::Surface::origin
virtual const Vector3D & origin() const
Definition: Surface.cpp:618
det
DetElement::Object * det
Definition: AlignmentsCalculator.cpp:66
dd4hep::rec::ConeSurface::radius1
virtual double radius1() const
the end radius of the cone
Definition: Surface.cpp:1279
dd4hep::rec::Surface::v
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:616
dd4hep::rec::VolCone::VolCone
VolCone(Volume vol, SurfaceType typ_val, double thickness_inner, double thickness_outer, Vector3D v_val, Vector3D origin_val)
Definition: Surface.h:485
dd4hep::rec::VolPlaneImpl::VolPlaneImpl
VolPlaneImpl()
default c'tor
Definition: Surface.h:336
dd4hep::rec::VolSurfaceBase::setOrigin
virtual void setOrigin(const Vector3D &o)
setter for daughter classes
Definition: Surface.cpp:40
dd4hep::rec::SurfaceType::setProperty
void setProperty(unsigned prop, bool val=true)
set the given peorperty
Definition: ISurface.h:196
dd4hep::detail::tools::copy
void copy(Alignment from, Alignment to)
Copy alignment object from source object.
Definition: AlignmentTools.cpp:43
dd4hep::rec::Surface::insideBounds
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
dd4hep::rec::VolConeImpl::distance
virtual double distance(const Vector3D &point) const
Definition: Surface.cpp:442
dd4hep::rec::Surface
Definition: Surface.h:498
dd4hep::rec::CylinderSurface::u
virtual Vector3D u(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:1220
dd4hep::rec::IMaterial
Definition: IMaterial.h:28
dd4hep::rec::VolConeImpl::v
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:392
dd4hep::rec::VolSurface::VolSurface
VolSurface(const VolSurface &vsurf)
Constructor to be used with an existing object.
Definition: Surface.h:202
dd4hep::rec::VolSurfaceBase::VolSurfaceBase
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
dd4hep::rec::CylinderSurface::globalToLocal
virtual Vector2D globalToLocal(const Vector3D &point) const
Definition: Surface.cpp:1245
dd4hep::rec::Surface::_o
Vector3D _o
Definition: Surface.h:512
dd4hep::rec::Surface::operator=
Surface & operator=(Surface const &)=delete
dd4hep::rec::VolCylinderImpl::distance
virtual double distance(const Vector3D &point) const
Definition: Surface.cpp:335
dd4hep::rec::VolPlaneImpl::distance
virtual double distance(const Vector3D &point) const
Definition: Surface.cpp:272
dd4hep::rec::CylinderSurface::center
virtual Vector3D center() const
the center of the cylinder
Definition: Surface.cpp:1265
Material.h
dd4hep::rec::VolSurfaceBase::_id
long64 _id
Definition: Surface.h:58
dd4hep::rec::Surface::outerThickness
virtual double outerThickness() const
Definition: Surface.cpp:620
dd4hep::rec::CylinderSurface::v
virtual Vector3D v(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:1229
dd4hep::rec::CylinderSurface::CylinderSurface
CylinderSurface(DetElement det, VolSurface volSurf)
Standard c'tor.
Definition: Surface.h:619
dd4hep::rec::VolSurface::ptr
VolSurfaceBase * ptr() const
pointer to underlying object
Definition: Surface.h:217
dd4hep::rec::VolConeImpl::getLines
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
dd4hep::rec::Surface::u
virtual Vector3D u(const Vector3D &point=Vector3D()) const
Definition: Surface.cpp:615
dd4hep::rec::SurfaceType::Cone
@ Cone
Definition: ISurface.h:153
dd4hep::rec::VolSurfaceList::VolSurfaceList
VolSurfaceList(const VolSurfaceList &vsl, DetElement &)
Definition: Surface.h:314
dd4hep::rec::VolSurface::normal
virtual Vector3D normal(const Vector3D &point=Vector3D()) const
Access to the normal direction at the given point.
Definition: Surface.cpp:251
dd4hep::rec::VolSurface::outerMaterial
virtual const IMaterial & outerMaterial() const
Access to the material in direction of the normal.
Definition: Surface.cpp:256