DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Volumes.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 : M.Frank
11 //
12 //==========================================================================
13 #ifndef DD4HEP_VOLUMES_H
14 #define DD4HEP_VOLUMES_H
15 
16 // Framework include files
17 #include <DD4hep/Handle.h>
18 #include <DD4hep/Shapes.h>
19 #include <DD4hep/Objects.h>
20 #include <DD4hep/BitField64.h>
21 
22 // C/C++ include files
23 #include <map>
24 #include <memory>
25 
26 // ROOT include file (includes TGeoVolume + TGeoShape)
27 #include <TGeoNode.h>
28 #include <TGeoPatternFinder.h>
29 #include <TGeoExtension.h>
30 
32 namespace dd4hep {
33 
34  class Detector;
35  class Region;
36  class LimitSet;
37  class Material;
38  class VisAttr;
39  class DetElement;
40  class SensitiveDetector;
41 
42  // Forward declarations
43  class Volume;
44  class PlacedVolume;
45 
47 
61  public:
65  ~ReflectionBuilder() = default;
67  void execute() const;
68  };
69 
71 
80  public:
81  typedef std::pair<std::string, int> VolID;
83 
88  class VolIDs: public std::vector<VolID> {
89  public:
90  typedef std::vector<VolID> Base;
92  VolIDs() = default;
94  VolIDs(VolIDs&& copy) = default;
96  VolIDs(const VolIDs& copy) = default;
98  VolIDs& operator=(VolIDs&& copy) = default;
100  VolIDs& operator=(const VolIDs& c) = default;
102  std::vector<VolID>::const_iterator find(const std::string& name) const;
104  std::pair<std::vector<VolID>::iterator, bool> insert(const std::string& name, int value);
106  template< class InputIt>
107  iterator insert(InputIt first, InputIt last)
108  { return this->Base::insert(this->Base::end(), first, last); }
109 #if !defined __GNUCC__ || (defined __GNUCC__ && __GNUC__ > 5)
110  template< class InputIt>
112  iterator insert(std::vector<VolID>::const_iterator pos, InputIt first, InputIt last)
113  { return this->Base::insert(pos, first, last); }
114 #endif
115  std::string str() const;
117  };
118  class Parameterisation;
119 
121  unsigned long magic { 0 };
123  long refCount { 0 };
125  Parameterisation* params { nullptr };
128 
129  public:
137  virtual ~PlacedVolumeExtension();
143  virtual TGeoExtension *Grab() override;
145  virtual void Release() const override;
148  };
150  public:
151  public:
152  };
153 
155 
163  class PlacedVolume : public Handle<TGeoNode> {
164  public:
167 
169 
176  class Processor {
177  public:
181  virtual ~Processor();
183  virtual int processPlacement(PlacedVolume pv) = 0;
184  };
185 
187  PlacedVolume() = default;
189  PlacedVolume(PlacedVolume&& e) = default;
191  PlacedVolume(const PlacedVolume& e) = default;
193  template <typename T> PlacedVolume(const Handle<T>& e) : Handle<TGeoNode>(e) { }
195  PlacedVolume(const TGeoNode* e) : Handle<TGeoNode>(e) { }
199  PlacedVolume& operator=(const PlacedVolume& v) = default;
201  template <typename T> bool operator ==(const Handle<T>& e) const {
202  return ptr() == e.ptr();
203  }
205  template <typename T> bool operator !=(const Handle<T>& e) const {
206  return ptr() != e.ptr();
207  }
208 
210  Object* data() const;
212  const char* type() const;
214  int copyNumber() const;
216  Material material() const;
218  Volume volume() const;
220  Volume motherVol() const;
222  std::size_t num_daughters() const;
224  PlacedVolume daughter(std::size_t which) const;
226  const TGeoMatrix& matrix() const;
228  Position position() const;
230  const PlacedVolumeExtension::VolIDs& volIDs() const;
232  PlacedVolume& addPhysVolID(const std::string& name, int value);
234  std::string toString() const;
235  };
236 
237  // This needs full knowledge of the PlacedVolume class, at least for ROOT 6.28/04
238  // so we place it here
240 
247  public:
249  using Dimension = std::pair<Transform3D, size_t>;
253  Dimension trafo1D { {}, 0UL };
255  Dimension trafo2D { {}, 0UL };
257  Dimension trafo3D { {}, 0UL };
259  unsigned long flags { 0 };
261  unsigned long refCount { 0 };
263  std::vector<PlacedVolume> placements { };
265  const detail::BitFieldElement* field { nullptr };
266 
267  public:
269  Parameterisation() = default;
273  Parameterisation(const Parameterisation& c) = default;
275  virtual ~Parameterisation() = default;
283  void release();
286  };
287 
288 
290 
301  public:
303  unsigned long magic = 0;
305  long refCount = 0;
307  int referenced = 0;
309  int flags = 0;
321  TList* properties { nullptr };
323  unsigned char smartLess = 0xFF; // MUST match Volume::NO_SMARTLESS_OPTIMIZATION
324 
326  virtual ~VolumeExtension();
328  VolumeExtension();
338  void copy(const VolumeExtension& c);
340  virtual TGeoExtension *Grab() override;
342  virtual void Release() const override;
345  };
346 
348 
370  class Volume: public Handle<TGeoVolume> {
371  public:
374  enum {
378  REFLECTED = 10,
379  };
381  REPLICATED = 1UL << 4,
382  PARAMETERIZED = 1UL << 5,
383  Undefined = 1UL << 7,
384  X_axis = 1UL << 8,
385  Y_axis = 1UL << 9,
386  Z_axis = 1UL << 10,
387  Rho_axis = 1UL << 11,
388  Phi_axis = 1UL << 12,
389  };
392  };
393  public:
395  Volume() = default;
397  Volume(Volume&& v) = default;
399  Volume(const Volume& v) = default;
401  Volume(const TGeoVolume* v) : Handle<TGeoVolume>(v) { }
403  template <typename T> Volume(const Handle<T>& v) : Handle<TGeoVolume>(v) { }
404 
406  Volume(const std::string& name);
408  Volume(const std::string& name, const std::string& title);
409 
411  Volume(const std::string& name, const Solid& s, const Material& m);
412 
414  Volume(const std::string& name, const std::string& title, const Solid& s, const Material& m);
415 
417  Volume& operator=(Volume&& a) = default;
419  Volume& operator=(const Volume& a) = default;
421  template <typename T> bool operator ==(const Handle<T>& e) const {
422  return ptr() == e.ptr();
423  }
425  template <typename T> bool operator !=(const Handle<T>& e) const {
426  return ptr() != e.ptr();
427  }
428 
430 
431  static void enableCopyNumberCheck(bool value);
432 
434  Object* data() const;
435 
437  const char* type() const;
438 
440  Volume reflect() const;
441 
443 
445  Volume reflect(SensitiveDetector sd) const;
446 
448  Volume& import();
449 
451  Volume divide(const std::string& divname, int iaxis, int ndiv, double start, double step, int numed = 0, const char* option = "");
453  PlacedVolume placeVolume(const Volume& volume) const;
456  PlacedVolume placeVolume(const Volume& volume, const Transform3D& tr) const;
458  PlacedVolume placeVolume(const Volume& volume, const Position& pos) const;
460  PlacedVolume placeVolume(const Volume& volume, const RotationZYX& rot) const;
462  PlacedVolume placeVolume(const Volume& volume, const Rotation3D& rot) const;
463 
465  PlacedVolume placeVolume(const Volume& volume, int copy_no) const;
468  PlacedVolume placeVolume(const Volume& volume, int copy_no, const Transform3D& tr) const;
470  PlacedVolume placeVolume(const Volume& volume, int copy_no, const Position& pos) const;
472  PlacedVolume placeVolume(const Volume& volume, int copy_no, const RotationZYX& rot) const;
474  PlacedVolume placeVolume(const Volume& volume, int copy_no, const Rotation3D& rot) const;
476  PlacedVolume placeVolume(const Volume& volume, TGeoMatrix* tr) const;
478  PlacedVolume placeVolume(const Volume& volume, int copy_nr, TGeoMatrix* tr) const;
480 
487  PlacedVolume replicate(const Volume entity, ReplicationAxis axis, size_t count, double inc, double start=0e0);
489 
495  PlacedVolume paramVolume1D(const Transform3D& start, Volume entity, size_t count, const Transform3D& inc);
497 
502  PlacedVolume paramVolume1D(Volume entity, size_t count, const Transform3D& trafo);
504 
509  PlacedVolume paramVolume1D(Volume entity, size_t count, const Position& inc);
511 
516  PlacedVolume paramVolume1D(Volume entity, size_t count, const RotationZYX& inc);
517 
519 
527  size_t count_1, const Transform3D& inc_1,
528  size_t count_2, const Transform3D& inc_2);
529 
531 
540  Volume entity,
541  size_t count_1,
542  const Position& inc_1,
543  size_t count_2,
544  const Position& inc_2);
545 
547 
556  size_t count_1,
557  const Position& inc_1,
558  size_t count_2,
559  const Position& inc_2);
560 
562 
570  PlacedVolume paramVolume2D(const Transform3D& start, Volume entity,
571  size_t count_1, const Transform3D& inc_1,
572  size_t count_2, const Transform3D& inc_2);
573 
575 
585  size_t count_1, const Transform3D& inc_1,
586  size_t count_2, const Transform3D& inc_2,
587  size_t count_3, const Transform3D& inc_3);
588 
590 
600  PlacedVolume paramVolume3D(const Transform3D& start, Volume entity,
601  size_t count_1, const Transform3D& inc_1,
602  size_t count_2, const Transform3D& inc_2,
603  size_t count_3, const Transform3D& inc_3);
604 
606 
616  size_t count_1, const Position& inc_1,
617  size_t count_2, const Position& inc_2,
618  size_t count_3, const Position& inc_3);
619 
621 
631  PlacedVolume paramVolume3D(const Transform3D& start, Volume entity,
632  size_t count_1, const Position& inc_1,
633  size_t count_2, const Position& inc_2,
634  size_t count_3, const Position& inc_3);
635 
637  void setFlagBit(unsigned int bit);
639  bool testFlagBit(unsigned int bit) const;
640 
642  bool isReflected() const;
643 
645  bool isAssembly() const;
646 
648  unsigned char setSmartlessValue(unsigned char value);
650  unsigned char smartlessValue() const;
651 
653  const Volume& setOption(const std::string& opt) const;
655  std::string option() const;
656 
658  const Volume& setAttributes(const Detector& description, const std::string& region, const std::string& limits,
659  const std::string& vis) const;
660 
662  const Volume& setRegion(const Detector& description, const std::string& name) const;
664  const Volume& setRegion(const Region& obj) const;
666  Region region() const;
667 
669  const Volume& setLimitSet(const Detector& description, const std::string& name) const;
671  const Volume& setLimitSet(const LimitSet& obj) const;
673  LimitSet limitSet() const;
674 
676  const Volume& setVisAttributes(const VisAttr& obj) const;
678  const Volume& setVisAttributes(const Detector& description, const std::string& name) const;
680  VisAttr visAttributes() const;
681 
683  const Volume& setSensitiveDetector(const SensitiveDetector& obj) const;
687  bool isSensitive() const;
688 
690  const Volume& setSolid(const Solid& s) const;
692  Solid solid() const;
694  Box boundingBox() const;
695 
697  const Volume& setMaterial(const Material& m) const;
699  Material material() const;
700 
702  bool hasProperties() const;
703 
705  void addProperty(const std::string& nam, const std::string& val) const;
706 
708  std::string getProperty(const std::string& nam, const std::string& default_val="") const;
709 
711  operator TGeoVolume*() const {
712  return m_element;
713  }
714  };
715 
717 
727  class VolumeMulti : public Volume {
729  void verifyVolumeMulti();
730 
731  public:
733  VolumeMulti() = default;
735  VolumeMulti(const VolumeMulti& v) = default;
737  VolumeMulti(TGeoVolume* v) : Volume(v) {
739  }
741  template <typename T> VolumeMulti(const Handle<T>& v) : Volume(v) {
743  }
745  VolumeMulti(const std::string& name, Material material);
747  VolumeMulti& operator=(const VolumeMulti& a) = default;
748  };
749 
751 
761  class Assembly: public Volume {
762  public:
764  Assembly() = default;
766  Assembly(const Assembly& v) = default;
768  template <typename T> Assembly(const Handle<T>& v) : Volume(v) { }
770  Assembly(const std::string& name);
772  Assembly& operator=(const Assembly& a) = default;
773  };
774 
776  std::string toStringMesh(PlacedVolume solid, int precision=2);
777 } /* End namespace dd4hep */
778 #endif // DD4HEP_VOLUMES_H
dd4hep::VolumeMulti
Implementation class extending the ROOT mulit-volumes (TGeoVolumeMulti)
Definition: Volumes.h:727
dd4hep::Volume::Z_axis
@ Z_axis
Definition: Volumes.h:386
dd4hep::VolumeExtension::Release
virtual void Release() const override
TGeoExtension overload: Method called always when the pointer to the extension is not needed anymore.
Definition: Volumes.cpp:613
dd4hep::Volume::setLimitSet
const Volume & setLimitSet(const Detector &description, const std::string &name) const
Set the limits to the volume. Note: If the name string is empty, the action is ignored.
Definition: Volumes.cpp:1290
Objects.h
dd4hep::Volume::isAssembly
bool isAssembly() const
Test if this volume is an assembly structure.
Definition: Volumes.cpp:723
dd4hep::VolumeExtension
Implementation class extending the ROOT volume (TGeoVolume)
Definition: Volumes.h:300
dd4hep::Volume::setSmartlessValue
unsigned char setSmartlessValue(unsigned char value)
Set the smartless option for G4 voxelization. Returns previous value.
Definition: Volumes.cpp:728
dd4hep::Assembly::operator=
Assembly & operator=(const Assembly &a)=default
Assignment operator (must match copy constructor)
dd4hep::Volume::Volume
Volume(Volume &&v)=default
Move from handle.
dd4hep::DDSegmentation::BitFieldElement
Helper class for BitFieldCoder that corresponds to one field value.
Definition: BitFieldCoder.h:32
dd4hep::Volume::enableCopyNumberCheck
static void enableCopyNumberCheck(bool value)
Set flag to enable copy number checks when inserting new nodes.
Definition: Volumes.cpp:652
dd4hep::Volume::Rho_axis
@ Rho_axis
Definition: Volumes.h:387
dd4hep::Volume::NO_SMARTLESS_OPTIMIZATION
@ NO_SMARTLESS_OPTIMIZATION
Definition: Volumes.h:391
dd4hep::Volume::hasProperties
bool hasProperties() const
Check for existence of properties.
Definition: Volumes.cpp:1327
dd4hep::Volume::Undefined
@ Undefined
Definition: Volumes.h:383
dd4hep::Assembly::Assembly
Assembly()=default
Default constructor.
dd4hep::Volume::ReplicationAxis
ReplicationAxis
Definition: Volumes.h:380
dd4hep::VolumeExtension::region
Region region
Region reference.
Definition: Volumes.h:311
dd4hep::PlacedVolumeExtension::Parameterisation::trafo3D
Dimension trafo3D
Reference to the parameterised transformation for dimension 3.
Definition: Volumes.h:257
v
View * v
Definition: MultiView.cpp:28
dd4hep::PlacedVolumeExtension::Parameterisation::refCount
unsigned long refCount
Number of entries for the parameterisation in dimension 2.
Definition: Volumes.h:261
dd4hep::SensitiveDetector
Handle class to hold the information of a sensitive detector.
Definition: DetElement.h:44
dd4hep::PlacedVolumeExtension
Implementation class extending the ROOT placed volume.
Definition: Volumes.h:79
dd4hep::PlacedVolumeExtension::~PlacedVolumeExtension
virtual ~PlacedVolumeExtension()
Default destructor.
Definition: Volumes.cpp:375
dd4hep::VolumeMulti::VolumeMulti
VolumeMulti()=default
Default constructor.
dd4hep::ReflectionBuilder::~ReflectionBuilder
~ReflectionBuilder()=default
Default descructor.
dd4hep::PlacedVolumeExtension::Release
virtual void Release() const override
TGeoExtension overload: Method called always when the pointer to the extension is not needed anymore.
Definition: Volumes.cpp:405
dd4hep::Assembly::Assembly
Assembly(const Assembly &v)=default
Copy from handle.
dd4hep::PlacedVolumeExtension::Parameterisation::~Parameterisation
virtual ~Parameterisation()=default
Default destructor.
dd4hep::VolumeExtension::reflected
Handle< TGeoVolume > reflected
Reference to the reflected volume (or to the original volume for reflections)
Definition: Volumes.h:319
dd4hep::PlacedVolume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:163
dd4hep::VisAttr
Handle class describing visualization attributes.
Definition: Objects.h:324
dd4hep::PlacedVolume::Processor
Abstract base for processing callbacks to PlacedVolume objects.
Definition: Volumes.h:176
dd4hep::PlacedVolumeFeatureExtension
Definition: Volumes.h:149
dd4hep::PlacedVolumeExtension::VolIDs::operator=
VolIDs & operator=(VolIDs &&copy)=default
Move assignment.
dd4hep::Volume::paramVolume2D
PlacedVolume paramVolume2D(Volume entity, size_t count_1, const Transform3D &inc_1, size_t count_2, const Transform3D &inc_2)
2D Parameterised volume implementation
Definition: Volumes.cpp:969
dd4hep::PlacedVolume::addPhysVolID
PlacedVolume & addPhysVolID(const std::string &name, int value)
Add identifier.
Definition: Volumes.cpp:501
dd4hep::PlacedVolume::operator=
PlacedVolume & operator=(PlacedVolume &&v)=default
Assignment operator (must match copy constructor)
Handle.h
dd4hep::Volume::g4_optimizations
g4_optimizations
Definition: Volumes.h:390
dd4hep::Volume::setOption
const Volume & setOption(const std::string &opt) const
Set the volume's option value.
Definition: Volumes.cpp:1124
dd4hep::Volume::solid
Solid solid() const
Access to Solid (Shape)
Definition: Volumes.cpp:1252
dd4hep::Handle
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:84
dd4hep::Volume::setRegion
const Volume & setRegion(const Detector &description, const std::string &name) const
Set the regional attributes to the volume. Note: If the name string is empty, the action is ignored.
Definition: Volumes.cpp:1271
dd4hep::PlacedVolume::Object
PlacedVolumeExtension Object
Definition: Volumes.h:165
dd4hep::Rotation3D
ROOT::Math::Rotation3D Rotation3D
Definition: Objects.h:113
dd4hep::PlacedVolumeExtension::volIDs
VolIDs volIDs
ID container.
Definition: Volumes.h:127
dd4hep::PlacedVolumeExtension::Parameterisation::trafo2D
Dimension trafo2D
Reference to the parameterised transformation for dimension 2.
Definition: Volumes.h:255
dd4hep::PlacedVolumeExtension::Parameterisation::operator=
Parameterisation & operator=(const Parameterisation &copy)=default
Assignment operator.
dd4hep::PlacedVolume::PlacedVolume
PlacedVolume(PlacedVolume &&e)=default
Move constructor.
dd4hep::Solid_type
Base class for Solid (shape) objects.
Definition: Shapes.h:135
dd4hep::Volume::paramVolume1D
PlacedVolume paramVolume1D(const Transform3D &start, Volume entity, size_t count, const Transform3D &inc)
1D Parameterised volume implementation
Definition: Volumes.cpp:935
dd4hep::PlacedVolumeExtension::VolIDs::insert
iterator insert(std::vector< VolID >::const_iterator pos, InputIt first, InputIt last)
Insert bunch of entries.
Definition: Volumes.h:112
dd4hep::Volume::isSensitive
bool isSensitive() const
Accessor if volume is sensitive (ie. is attached to a sensitive detector)
Definition: Volumes.cpp:1322
dd4hep::PlacedVolume::operator!=
bool operator!=(const Handle< T > &e) const
Non-Equality operator.
Definition: Volumes.h:205
dd4hep::VolumeExtension::magic
unsigned long magic
Magic word to detect memory corruptions.
Definition: Volumes.h:303
dd4hep::Handle< TGeoNode >::name
const char * name() const
Access the object name (or "" if not supported by the object)
dd4hep::VolumeExtension::vis
VisAttr vis
Reference to visualization attributes.
Definition: Volumes.h:315
dd4hep::Assembly
Implementation class extending the ROOT assembly volumes (TGeoVolumeAssembly)
Definition: Volumes.h:761
dd4hep::PlacedVolume::Processor::processPlacement
virtual int processPlacement(PlacedVolume pv)=0
Container callback for object processing.
dd4hep::Volume::placeVolume
PlacedVolume placeVolume(const Volume &volume) const
Place daughter volume. The position and rotation are the identity.
Definition: Volumes.cpp:859
dd4hep::PlacedVolumeExtension::Parameterisation::addref
Parameterisation * addref()
Increase ref count.
Definition: Volumes.cpp:343
dd4hep::Volume::Volume
Volume(const TGeoVolume *v)
Copy from handle.
Definition: Volumes.h:401
dd4hep::Volume::Volume
Volume(const Volume &v)=default
Copy from handle.
dd4hep::Volume::operator=
Volume & operator=(const Volume &a)=default
Assignment operator (must match copy constructor)
dd4hep::VolumeExtension::refCount
long refCount
Reference count on object (used to implement Grab/Release)
Definition: Volumes.h:305
dd4hep::VolumeMulti::VolumeMulti
VolumeMulti(const VolumeMulti &v)=default
Copy from handle.
dd4hep::VolumeExtension::VolumeExtension
VolumeExtension(VolumeExtension &&copy)=delete
No move.
dd4hep::Volume::material
Material material() const
Access to the Volume material.
Definition: Volumes.cpp:1151
dd4hep::PlacedVolumeExtension::Parameterisation::ClassDef
ClassDef(Parameterisation, 200)
Enable ROOT persistency.
dd4hep::PlacedVolumeExtension::Parameterisation::release
void release()
Decrease ref count.
Definition: Volumes.cpp:348
dd4hep::Material
Handle class describing a material.
Definition: Objects.h:272
dd4hep::PlacedVolumeExtension::VolIDs::operator=
VolIDs & operator=(const VolIDs &c)=default
Assignment operator.
dd4hep::Volume::REFLECTED
@ REFLECTED
Definition: Volumes.h:378
dd4hep::Volume::option
std::string option() const
Access the volume's option value.
Definition: Volumes.cpp:1133
dd4hep::PlacedVolume::daughter
PlacedVolume daughter(std::size_t which) const
Access the daughter by index.
Definition: Volumes.cpp:483
dd4hep::Volume::Volume
Volume(const Handle< T > &v)
Copy from arbitrary Element.
Definition: Volumes.h:403
dd4hep::Volume::PARAMETERIZED
@ PARAMETERIZED
Definition: Volumes.h:382
dd4hep::Volume::operator=
Volume & operator=(Volume &&a)=default
Assignment operator (must match move constructor)
dd4hep::PlacedVolume::PlacedVolume
PlacedVolume(const PlacedVolume &e)=default
Copy assignment.
dd4hep::PlacedVolume::Processor::Processor
Processor()
Default constructor.
dd4hep::PlacedVolumeExtension::VolIDs
Volume ID container.
Definition: Volumes.h:88
dd4hep::Volume::REPLICATED
@ REPLICATED
Definition: Volumes.h:381
dd4hep::Volume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:370
dd4hep::Volume::Y_axis
@ Y_axis
Definition: Volumes.h:385
dd4hep::Volume::setSensitiveDetector
const Volume & setSensitiveDetector(const SensitiveDetector &obj) const
Assign the sensitive detector structure.
Definition: Volumes.cpp:1309
dd4hep::PlacedVolume::PlacedVolume
PlacedVolume(const TGeoNode *e)
Constructor taking implementation object pointer.
Definition: Volumes.h:195
dd4hep::PlacedVolume::operator==
bool operator==(const Handle< T > &e) const
Equality operator.
Definition: Volumes.h:201
dd4hep::Volume::operator==
bool operator==(const Handle< T > &e) const
Equality operator.
Definition: Volumes.h:421
dd4hep::PlacedVolumeExtension::Parameterisation::operator=
Parameterisation & operator=(Parameterisation &&copy)=default
Move assignment.
dd4hep::Volume::setSolid
const Volume & setSolid(const Solid &s) const
Set the volume's solid shape.
Definition: Volumes.cpp:1246
dd4hep::VolumeExtension::copy
void copy(const VolumeExtension &c)
Copy the object.
Definition: Volumes.cpp:580
dd4hep::LimitSet
Handle class describing a set of limits as they are used for simulation.
Definition: Objects.h:425
dd4hep::PlacedVolume::material
Material material() const
Volume material.
Definition: Volumes.cpp:463
dd4hep::Volume::limitSet
LimitSet limitSet() const
Access to the limit set.
Definition: Volumes.cpp:1304
dd4hep::Volume::replicate
PlacedVolume replicate(const Volume entity, ReplicationAxis axis, size_t count, double inc, double start=0e0)
1D volume replication implementation
Definition: Volumes.cpp:904
dd4hep::Volume::VETO_SIMU
@ VETO_SIMU
Definition: Volumes.h:375
dd4hep::Volume::region
Region region() const
Access to the handle to the region structure.
Definition: Volumes.cpp:1285
dd4hep::VolumeExtension::sens_det
Handle< NamedObject > sens_det
Reference to the sensitive detector.
Definition: Volumes.h:317
dd4hep::VolumeExtension::flags
int flags
Bit field to determine the usage. Bit 0...15 reserverd for system usage. 16...31 user space.
Definition: Volumes.h:309
dd4hep::Assembly::Assembly
Assembly(const Handle< T > &v)
Copy from arbitrary Element.
Definition: Volumes.h:768
dd4hep::Volume::addProperty
void addProperty(const std::string &nam, const std::string &val) const
Add Volume property (name-value pair)
Definition: Volumes.cpp:1332
dd4hep::Volume::setMaterial
const Volume & setMaterial(const Material &m) const
Set the volume's material.
Definition: Volumes.cpp:1138
dd4hep::Volume::paramVolume3D
PlacedVolume paramVolume3D(Volume entity, size_t count_1, const Transform3D &inc_1, size_t count_2, const Transform3D &inc_2, size_t count_3, const Transform3D &inc_3)
3D Parameterised volume implementation
dd4hep::Volume::testFlagBit
bool testFlagBit(unsigned int bit) const
Test the user flag bit.
Definition: Volumes.cpp:709
dd4hep::PlacedVolumeExtension::VolIDs::insert
iterator insert(InputIt first, InputIt last)
Insert bunch of entries.
Definition: Volumes.h:107
dd4hep::PlacedVolumeExtension::VolIDs::VolIDs
VolIDs(const VolIDs &copy)=default
Copy constructor.
dd4hep::PlacedVolumeExtension::Parameterisation::flags
unsigned long flags
Number of entries for the parameterisation in dimension 2.
Definition: Volumes.h:259
dd4hep::Region
Handle class describing a region as used in simulation.
Definition: Objects.h:462
Shapes.h
dd4hep::Volume::operator!=
bool operator!=(const Handle< T > &e) const
Non-Equality operator.
Definition: Volumes.h:425
dd4hep::PlacedVolumeExtension::Parameterisation::Parameterisation
Parameterisation(const Parameterisation &c)=default
Copy constructor.
BitField64.h
dd4hep::Handle< TGeoVolume >::m_element
TGeoVolume * m_element
Single and only data member: Reference to the actual element.
Definition: Handle.h:93
dd4hep::Volume::smartlessValue
unsigned char smartlessValue() const
access the smartless option for G4 voxelization
Definition: Volumes.cpp:736
dd4hep::PlacedVolume::PlacedVolume
PlacedVolume()=default
Default constructor.
dd4hep::VolumeExtension::ClassDefOverride
ClassDefOverride(VolumeExtension, 200)
Enable ROOT persistency.
dd4hep::PlacedVolume::matrix
const TGeoMatrix & matrix() const
Access the full transformation matrix to the parent volume.
Definition: Volumes.cpp:526
dd4hep::PlacedVolume::VolIDs
PlacedVolumeExtension::VolIDs VolIDs
Definition: Volumes.h:166
dd4hep::VolumeExtension::Grab
virtual TGeoExtension * Grab() override
TGeoExtension overload: Method called whenever requiring a pointer to the extension.
Definition: Volumes.cpp:600
dd4hep::ReflectionBuilder::execute
void execute() const
Perform scan.
dd4hep::PlacedVolume::motherVol
Volume motherVol() const
Parent volume (envelope)
Definition: Volumes.cpp:473
dd4hep::ReflectionBuilder
Scan geometry and create reflected volumes.
Definition: Volumes.h:59
dd4hep::PlacedVolume::toString
std::string toString() const
String dump.
Definition: Volumes.cpp:540
dd4hep::PlacedVolumeExtension::Parameterisation::trafo1D
Dimension trafo1D
Reference to the parameterised transformation for dimension 1.
Definition: Volumes.h:253
dd4hep::PlacedVolumeExtension::PlacedVolumeExtension
PlacedVolumeExtension()
Default constructor.
Definition: Volumes.cpp:354
dd4hep::PlacedVolumeExtension::Parameterisation::Parameterisation
Parameterisation()=default
Default constructor.
dd4hep::ReflectionBuilder::ReflectionBuilder
ReflectionBuilder(Detector &desc)
Initializing constructor.
Definition: Volumes.h:63
dd4hep::Volume::Volume
Volume()=default
Default constructor.
dd4hep::PlacedVolumeExtension::Parameterisation::Dimension
std::pair< Transform3D, size_t > Dimension
Definition: Volumes.h:249
dd4hep::Transform3D
ROOT::Math::Transform3D Transform3D
Definition: Objects.h:117
dd4hep::VolumeMulti::VolumeMulti
VolumeMulti(const Handle< T > &v)
Copy from arbitrary Element.
Definition: Volumes.h:741
dd4hep::PlacedVolume::PlacedVolume
PlacedVolume(const Handle< T > &e)
Copy assignment from other handle type.
Definition: Volumes.h:193
dd4hep::PlacedVolume::num_daughters
std::size_t num_daughters() const
Number of daughters placed in this volume.
Definition: Volumes.cpp:478
dd4hep::Volume::divide
Volume divide(const std::string &divname, int iaxis, int ndiv, double start, double step, int numed=0, const char *option="")
Divide volume into subsections (See the ROOT manual for details)
Definition: Volumes.cpp:741
dd4hep::VolumeExtension::smartLess
unsigned char smartLess
Geant4 optimization flag: Smartless.
Definition: Volumes.h:323
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
dd4hep::Volume::Phi_axis
@ Phi_axis
Definition: Volumes.h:388
dd4hep::PlacedVolumeExtension::VolID
std::pair< std::string, int > VolID
Definition: Volumes.h:81
dd4hep::VolumeExtension::VolumeExtension
VolumeExtension()
Default constructor.
Definition: Volumes.cpp:553
dd4hep::PlacedVolumeExtension::magic
unsigned long magic
Magic word to detect memory corruptions.
Definition: Volumes.h:121
dd4hep::Volume::isReflected
bool isReflected() const
Test if this volume was reflected.
Definition: Volumes.cpp:718
dd4hep::PlacedVolume::type
const char * type() const
Access the object type from the class information.
Definition: Volumes.cpp:453
dd4hep::Box
Class describing a box shape.
Definition: Shapes.h:294
dd4hep::PlacedVolumeExtension::VolIDs::Base
std::vector< VolID > Base
Definition: Volumes.h:90
dd4hep::Handle< TGeoNode >::ptr
TGeoNode * ptr() const
Access to the held object.
Definition: Handle.h:153
dd4hep::PlacedVolumeExtension::Grab
virtual TGeoExtension * Grab() override
TGeoExtension overload: Method called whenever requiring a pointer to the extension.
Definition: Volumes.cpp:396
dd4hep::Volume::type
const char * type() const
Access the object type from the class information.
Definition: Volumes.cpp:663
dd4hep::ReflectionBuilder::detector
Detector & detector
Definition: Volumes.h:60
dd4hep::Volume::boundingBox
Box boundingBox() const
Access the bounding box of the volume (if available)
Definition: Volumes.cpp:1257
dd4hep::VolumeExtension::operator=
VolumeExtension & operator=(VolumeExtension &&copy)=delete
No move assignment.
dd4hep::VolumeMulti::verifyVolumeMulti
void verifyVolumeMulti()
Import volume from pointer as a result of Solid->Divide()
Definition: Volumes.cpp:1369
dd4hep::Volume::setVisAttributes
const Volume & setVisAttributes(const VisAttr &obj) const
Set Visualization attributes to the volume.
Definition: Volumes.cpp:1156
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::PlacedVolumeExtension::VolIDs::str
std::string str() const
String representation for debugging.
Definition: Volumes.cpp:436
dd4hep::PlacedVolumeExtension::VolIDs::VolIDs
VolIDs()=default
Default constructor.
dd4hep::VolumeMulti::VolumeMulti
VolumeMulti(TGeoVolume *v)
Copy from pointer as a result of Solid->Divide()
Definition: Volumes.h:737
dd4hep::PlacedVolume::copyNumber
int copyNumber() const
Access the copy number of this placement within its mother.
Definition: Volumes.cpp:458
dd4hep::PlacedVolume::Processor::~Processor
virtual ~Processor()
Default destructor.
Definition: Volumes.cpp:339
dd4hep::PlacedVolumeExtension::Parameterisation::placements
std::vector< PlacedVolume > placements
Reference to the placements of this volume.
Definition: Volumes.h:263
dd4hep::PlacedVolume::volume
Volume volume() const
Logical volume of this placement.
Definition: Volumes.cpp:468
dd4hep::PlacedVolumeExtension::VolIDs::insert
std::pair< std::vector< VolID >::iterator, bool > insert(const std::string &name, int value)
Insert new entry.
Definition: Volumes.cpp:422
dd4hep::PlacedVolume::data
Object * data() const
Check if placement is properly instrumented.
Definition: Volumes.cpp:447
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::PlacedVolumeExtension::Parameterisation::Parameterisation
Parameterisation(Parameterisation &&copy)=default
Default move.
dd4hep::Volume::getProperty
std::string getProperty(const std::string &nam, const std::string &default_val="") const
Access property value. Returns default_value if the property is not present.
Definition: Volumes.cpp:1348
dd4hep::PlacedVolumeExtension::Parameterisation::field
const detail::BitFieldElement * field
Bitfield from sensitive detector to encode the volume ID on the fly.
Definition: Volumes.h:265
dd4hep::Volume::reflect
Volume reflect() const
Create a reflected volume tree. The reflected volume has left-handed coordinates.
Definition: Volumes.cpp:668
dd4hep::Volume::VETO_RECO
@ VETO_RECO
Definition: Volumes.h:376
dd4hep::VolumeExtension::~VolumeExtension
virtual ~VolumeExtension()
Default destructor.
Definition: Volumes.cpp:559
dd4hep::Volume::setFlagBit
void setFlagBit(unsigned int bit)
Set user flags in bit-field.
Definition: Volumes.cpp:700
TGeoExtension
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:25
dd4hep::detail::tools::copy
void copy(Alignment from, Alignment to)
Copy alignment object from source object.
Definition: AlignmentTools.cpp:43
dd4hep::PlacedVolumeExtension::refCount
long refCount
Reference count on object (used to implement Grab/Release)
Definition: Volumes.h:123
dd4hep::PlacedVolumeExtension::ClassDefOverride
ClassDefOverride(PlacedVolumeExtension, 200)
Enable ROOT persistency.
dd4hep::PlacedVolume::volIDs
const PlacedVolumeExtension::VolIDs & volIDs() const
Access to the volume IDs.
Definition: Volumes.cpp:496
dd4hep::RotationZYX
ROOT::Math::RotationZYX RotationZYX
Definition: Objects.h:105
dd4hep::VolumeMulti::operator=
VolumeMulti & operator=(const VolumeMulti &a)=default
Assignment operator (must match copy constructor)
dd4hep::Volume::setAttributes
const Volume & setAttributes(const Detector &description, const std::string &region, const std::string &limits, const std::string &vis) const
Attach attributes to the volume.
Definition: Volumes.cpp:1229
dd4hep::VolumeExtension::properties
TList * properties
Reference to properties.
Definition: Volumes.h:321
dd4hep::PlacedVolumeExtension::Parameterisation::start
Transform3D start
Reference to the starting point of the parameterisation.
Definition: Volumes.h:251
dd4hep::PlacedVolumeExtension::VolIDs::VolIDs
VolIDs(VolIDs &&copy)=default
Move constructor.
dd4hep::Volume::visAttributes
VisAttr visAttributes() const
Access the visualisation attributes.
Definition: Volumes.cpp:1239
dd4hep::Volume::Object
VolumeExtension Object
Definition: Volumes.h:372
dd4hep::PlacedVolumeExtension::params
Parameterisation * params
Reference to the parameterised transformation.
Definition: Volumes.h:125
dd4hep::PlacedVolume::position
Position position() const
Access the translation vector to the parent volume.
Definition: Volumes.cpp:534
dd4hep::Volume::X_axis
@ X_axis
Definition: Volumes.h:384
dd4hep::PlacedVolumeExtension::Parameterisation
Optional parameters to implement special features such as parametrization.
Definition: Volumes.h:246
dd4hep::PlacedVolumeExtension::VolIDs::find
std::vector< VolID >::const_iterator find(const std::string &name) const
Find entry.
Definition: Volumes.cpp:413
dd4hep::Volume::VETO_DISPLAY
@ VETO_DISPLAY
Definition: Volumes.h:377
dd4hep::toStringMesh
std::string toStringMesh(const TGeoShape *shape, int precision=2)
Output mesh vertices to string.
Definition: ShapeUtilities.cpp:1295
dd4hep::VolumeExtension::referenced
int referenced
Definition: Volumes.h:307
dd4hep::Volume::data
Object * data() const
Check if placement is properly instrumented.
Definition: Volumes.cpp:657
dd4hep::PlacedVolumeExtension::operator=
PlacedVolumeExtension & operator=(PlacedVolumeExtension &&copy)
Move assignment.
Definition: Volumes.cpp:381
dd4hep::PlacedVolume::operator=
PlacedVolume & operator=(const PlacedVolume &v)=default
Assignment operator (must match copy constructor)
dd4hep::Volume::sensitiveDetector
Handle< NamedObject > sensitiveDetector() const
Access to the handle to the sensitive detector.
Definition: Volumes.cpp:1316
dd4hep::VolumeExtension::limits
LimitSet limits
Limit sets used for simulation.
Definition: Volumes.h:313