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();
140  magic = std::move(copy.magic);
141  params = std::move(copy.params);
142  volIDs = std::move(copy.volIDs);
143  return *this;
144  }
147  magic = copy.magic;
148  params = copy.params;
149  volIDs = copy.volIDs;
150  return *this;
151  }
153  virtual TGeoExtension *Grab() override;
155  virtual void Release() const override;
158  };
160  public:
161  public:
162  };
163 
165 
173  class PlacedVolume : public Handle<TGeoNode> {
174  public:
177 
179 
186  class Processor {
187  public:
191  virtual ~Processor();
193  virtual int processPlacement(PlacedVolume pv) = 0;
194  };
195 
197  PlacedVolume() = default;
199  PlacedVolume(PlacedVolume&& e) = default;
201  PlacedVolume(const PlacedVolume& e) = default;
203  template <typename T> PlacedVolume(const Handle<T>& e) : Handle<TGeoNode>(e) { }
205  PlacedVolume(const TGeoNode* e) : Handle<TGeoNode>(e) { }
209  PlacedVolume& operator=(const PlacedVolume& v) = default;
211  template <typename T> bool operator ==(const Handle<T>& e) const {
212  return ptr() == e.ptr();
213  }
215  template <typename T> bool operator !=(const Handle<T>& e) const {
216  return ptr() != e.ptr();
217  }
218 
220  Object* data() const;
222  const char* type() const;
224  int copyNumber() const;
226  Material material() const;
228  Volume volume() const;
230  Volume motherVol() const;
232  std::size_t num_daughters() const;
234  PlacedVolume daughter(std::size_t which) const;
236  const TGeoMatrix& matrix() const;
238  Position position() const;
240  const PlacedVolumeExtension::VolIDs& volIDs() const;
242  PlacedVolume& addPhysVolID(const std::string& name, int value);
244  std::string toString() const;
245  };
246 
247  // This needs full knowledge of the PlacedVolume class, at least for ROOT 6.28/04
248  // so we place it here
250 
257  public:
259  using Dimension = std::pair<Transform3D, size_t>;
263  Dimension trafo1D { {}, 0UL };
265  Dimension trafo2D { {}, 0UL };
267  Dimension trafo3D { {}, 0UL };
269  unsigned long flags { 0 };
271  unsigned long refCount { 0 };
273  std::vector<PlacedVolume> placements { };
275  const detail::BitFieldElement* field { nullptr };
276 
277  public:
279  Parameterisation() = default;
283  Parameterisation(const Parameterisation& c) = default;
285  virtual ~Parameterisation() = default;
293  void release();
296  };
297 
298 
300 
311  public:
313  unsigned long magic = 0;
315  long refCount = 0;
317  int referenced = 0;
319  int flags = 0;
331  TList* properties { nullptr };
332 
334  virtual ~VolumeExtension();
336  VolumeExtension();
346  void copy(const VolumeExtension& c);
348  virtual TGeoExtension *Grab() override;
350  virtual void Release() const override;
353  };
354 
356 
378  class Volume: public Handle<TGeoVolume> {
379  public:
382  enum {
386  REFLECTED = 10,
387  };
389  REPLICATED = 1UL << 4,
390  PARAMETERIZED = 1UL << 5,
391  Undefined = 1UL << 7,
392  X_axis = 1UL << 8,
393  Y_axis = 1UL << 9,
394  Z_axis = 1UL << 10,
395  Rho_axis = 1UL << 11,
396  Phi_axis = 1UL << 12
397  };
398 
399  public:
401  Volume() = default;
403  Volume(Volume&& v) = default;
405  Volume(const Volume& v) = default;
407  Volume(const TGeoVolume* v) : Handle<TGeoVolume>(v) { }
409  template <typename T> Volume(const Handle<T>& v) : Handle<TGeoVolume>(v) { }
410 
412  Volume(const std::string& name);
414  Volume(const std::string& name, const std::string& title);
415 
417  Volume(const std::string& name, const Solid& s, const Material& m);
418 
420  Volume(const std::string& name, const std::string& title, const Solid& s, const Material& m);
421 
423  Volume& operator=(Volume&& a) = default;
425  Volume& operator=(const Volume& a) = default;
427  template <typename T> bool operator ==(const Handle<T>& e) const {
428  return ptr() == e.ptr();
429  }
431  template <typename T> bool operator !=(const Handle<T>& e) const {
432  return ptr() != e.ptr();
433  }
434 
436 
437  static void enableCopyNumberCheck(bool value);
438 
440  Object* data() const;
441 
443  const char* type() const;
444 
446  Volume reflect() const;
447 
449 
451  Volume reflect(SensitiveDetector sd) const;
452 
454  Volume& import();
455 
457  Volume divide(const std::string& divname, int iaxis, int ndiv, double start, double step, int numed = 0, const char* option = "");
459  PlacedVolume placeVolume(const Volume& volume) const;
462  PlacedVolume placeVolume(const Volume& volume, const Transform3D& tr) const;
464  PlacedVolume placeVolume(const Volume& volume, const Position& pos) const;
466  PlacedVolume placeVolume(const Volume& volume, const RotationZYX& rot) const;
468  PlacedVolume placeVolume(const Volume& volume, const Rotation3D& rot) const;
469 
471  PlacedVolume placeVolume(const Volume& volume, int copy_no) const;
474  PlacedVolume placeVolume(const Volume& volume, int copy_no, const Transform3D& tr) const;
476  PlacedVolume placeVolume(const Volume& volume, int copy_no, const Position& pos) const;
478  PlacedVolume placeVolume(const Volume& volume, int copy_no, const RotationZYX& rot) const;
480  PlacedVolume placeVolume(const Volume& volume, int copy_no, const Rotation3D& rot) const;
482  PlacedVolume placeVolume(const Volume& volume, TGeoMatrix* tr) const;
484  PlacedVolume placeVolume(const Volume& volume, int copy_nr, TGeoMatrix* tr) const;
486 
493  PlacedVolume replicate(const Volume entity, ReplicationAxis axis, size_t count, double inc, double start=0e0);
495 
501  PlacedVolume paramVolume1D(const Transform3D& start, Volume entity, size_t count, const Transform3D& inc);
503 
508  PlacedVolume paramVolume1D(Volume entity, size_t count, const Transform3D& trafo);
510 
515  PlacedVolume paramVolume1D(Volume entity, size_t count, const Position& inc);
517 
522  PlacedVolume paramVolume1D(Volume entity, size_t count, const RotationZYX& inc);
523 
525 
533  size_t count_1, const Transform3D& inc_1,
534  size_t count_2, const Transform3D& inc_2);
535 
537 
546  Volume entity,
547  size_t count_1,
548  const Position& inc_1,
549  size_t count_2,
550  const Position& inc_2);
551 
553 
562  size_t count_1,
563  const Position& inc_1,
564  size_t count_2,
565  const Position& inc_2);
566 
568 
576  PlacedVolume paramVolume2D(const Transform3D& start, Volume entity,
577  size_t count_1, const Transform3D& inc_1,
578  size_t count_2, const Transform3D& inc_2);
579 
581 
591  size_t count_1, const Transform3D& inc_1,
592  size_t count_2, const Transform3D& inc_2,
593  size_t count_3, const Transform3D& inc_3);
594 
596 
606  PlacedVolume paramVolume3D(const Transform3D& start, Volume entity,
607  size_t count_1, const Transform3D& inc_1,
608  size_t count_2, const Transform3D& inc_2,
609  size_t count_3, const Transform3D& inc_3);
610 
612 
622  size_t count_1, const Position& inc_1,
623  size_t count_2, const Position& inc_2,
624  size_t count_3, const Position& inc_3);
625 
627 
637  PlacedVolume paramVolume3D(const Transform3D& start, Volume entity,
638  size_t count_1, const Position& inc_1,
639  size_t count_2, const Position& inc_2,
640  size_t count_3, const Position& inc_3);
641 
643  void setFlagBit(unsigned int bit);
645  bool testFlagBit(unsigned int bit) const;
646 
648  bool isReflected() const;
649 
651  bool isAssembly() const;
652 
654  const Volume& setOption(const std::string& opt) const;
656  std::string option() const;
657 
659  const Volume& setAttributes(const Detector& description, const std::string& region, const std::string& limits,
660  const std::string& vis) const;
661 
663  const Volume& setRegion(const Detector& description, const std::string& name) const;
665  const Volume& setRegion(const Region& obj) const;
667  Region region() const;
668 
670  const Volume& setLimitSet(const Detector& description, const std::string& name) const;
672  const Volume& setLimitSet(const LimitSet& obj) const;
674  LimitSet limitSet() const;
675 
677  const Volume& setVisAttributes(const VisAttr& obj) const;
679  const Volume& setVisAttributes(const Detector& description, const std::string& name) const;
681  VisAttr visAttributes() const;
682 
684  const Volume& setSensitiveDetector(const SensitiveDetector& obj) const;
688  bool isSensitive() const;
689 
691  const Volume& setSolid(const Solid& s) const;
693  Solid solid() const;
695  Box boundingBox() const;
696 
698  const Volume& setMaterial(const Material& m) const;
700  Material material() const;
701 
703  bool hasProperties() const;
704 
706  void addProperty(const std::string& nam, const std::string& val) const;
707 
709  std::string getProperty(const std::string& nam, const std::string& default_val="") const;
710 
712  operator TGeoVolume*() const {
713  return m_element;
714  }
715  };
716 
718 
728  class VolumeMulti : public Volume {
730  void verifyVolumeMulti();
731 
732  public:
734  VolumeMulti() = default;
736  VolumeMulti(const VolumeMulti& v) = default;
738  VolumeMulti(TGeoVolume* v) : Volume(v) {
740  }
742  template <typename T> VolumeMulti(const Handle<T>& v) : Volume(v) {
744  }
746  VolumeMulti(const std::string& name, Material material);
748  VolumeMulti& operator=(const VolumeMulti& a) = default;
749  };
750 
752 
762  class Assembly: public Volume {
763  public:
765  Assembly() = default;
767  Assembly(const Assembly& v) = default;
769  template <typename T> Assembly(const Handle<T>& v) : Volume(v) { }
771  Assembly(const std::string& name);
773  Assembly& operator=(const Assembly& a) = default;
774  };
775 
777  std::string toStringMesh(PlacedVolume solid, int precision=2);
778 } /* End namespace dd4hep */
779 #endif // DD4HEP_VOLUMES_H
dd4hep::VolumeMulti
Implementation class extending the ROOT mulit-volumes (TGeoVolumeMulti)
Definition: Volumes.h:728
dd4hep::Volume::Z_axis
@ Z_axis
Definition: Volumes.h:394
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:597
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:1261
Objects.h
dd4hep::Volume::isAssembly
bool isAssembly() const
Test if this volume is an assembly structure.
Definition: Volumes.cpp:707
dd4hep::VolumeExtension
Implementation class extending the ROOT volume (TGeoVolume)
Definition: Volumes.h:310
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:636
dd4hep::Volume::Rho_axis
@ Rho_axis
Definition: Volumes.h:395
dd4hep::PlacedVolumeExtension::operator=
PlacedVolumeExtension & operator=(const PlacedVolumeExtension &copy)
Assignment operator.
Definition: Volumes.h:146
dd4hep::Volume::hasProperties
bool hasProperties() const
Check for existence of properties.
Definition: Volumes.cpp:1298
dd4hep::Volume::Undefined
@ Undefined
Definition: Volumes.h:391
dd4hep::Assembly::Assembly
Assembly()=default
Default constructor.
dd4hep::Volume::ReplicationAxis
ReplicationAxis
Definition: Volumes.h:388
dd4hep::VolumeExtension::region
Region region
Region reference.
Definition: Volumes.h:321
dd4hep::PlacedVolumeExtension::Parameterisation::trafo3D
Dimension trafo3D
Reference to the parameterised transformation for dimension 3.
Definition: Volumes.h:267
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:271
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:374
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:389
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:329
dd4hep::PlacedVolume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:173
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:186
dd4hep::PlacedVolumeFeatureExtension
Definition: Volumes.h:159
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:940
dd4hep::PlacedVolume::addPhysVolID
PlacedVolume & addPhysVolID(const std::string &name, int value)
Add identifier.
Definition: Volumes.cpp:485
dd4hep::PlacedVolume::operator=
PlacedVolume & operator=(PlacedVolume &&v)=default
Assignment operator (must match copy constructor)
Handle.h
dd4hep::Volume::setOption
const Volume & setOption(const std::string &opt) const
Set the volume's option value.
Definition: Volumes.cpp:1095
dd4hep::Volume::solid
Solid solid() const
Access to Solid (Shape)
Definition: Volumes.cpp:1223
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:1242
dd4hep::PlacedVolume::Object
PlacedVolumeExtension Object
Definition: Volumes.h:175
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:265
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:906
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:1293
dd4hep::PlacedVolume::operator!=
bool operator!=(const Handle< T > &e) const
Non-Equality operator.
Definition: Volumes.h:215
dd4hep::VolumeExtension::magic
unsigned long magic
Magic word to detect memory corruptions.
Definition: Volumes.h:313
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:325
dd4hep::Assembly
Implementation class extending the ROOT assembly volumes (TGeoVolumeAssembly)
Definition: Volumes.h:762
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:830
dd4hep::PlacedVolumeExtension::Parameterisation::addref
Parameterisation * addref()
Increase ref count.
Definition: Volumes.cpp:342
dd4hep::Volume::Volume
Volume(const TGeoVolume *v)
Copy from handle.
Definition: Volumes.h:407
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:315
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:1122
dd4hep::PlacedVolumeExtension::Parameterisation::ClassDef
ClassDef(Parameterisation, 200)
Enable ROOT persistency.
dd4hep::PlacedVolumeExtension::Parameterisation::release
void release()
Decrease ref count.
Definition: Volumes.cpp:347
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:386
dd4hep::Volume::option
std::string option() const
Access the volume's option value.
Definition: Volumes.cpp:1104
dd4hep::PlacedVolume::daughter
PlacedVolume daughter(std::size_t which) const
Access the daughter by index.
Definition: Volumes.cpp:467
dd4hep::Volume::Volume
Volume(const Handle< T > &v)
Copy from arbitrary Element.
Definition: Volumes.h:409
dd4hep::Volume::PARAMETERIZED
@ PARAMETERIZED
Definition: Volumes.h:390
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:389
dd4hep::Volume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:378
dd4hep::Volume::Y_axis
@ Y_axis
Definition: Volumes.h:393
dd4hep::Volume::setSensitiveDetector
const Volume & setSensitiveDetector(const SensitiveDetector &obj) const
Assign the sensitive detector structure.
Definition: Volumes.cpp:1280
dd4hep::PlacedVolume::PlacedVolume
PlacedVolume(const TGeoNode *e)
Constructor taking implementation object pointer.
Definition: Volumes.h:205
dd4hep::PlacedVolume::operator==
bool operator==(const Handle< T > &e) const
Equality operator.
Definition: Volumes.h:211
dd4hep::Volume::operator==
bool operator==(const Handle< T > &e) const
Equality operator.
Definition: Volumes.h:427
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:1217
dd4hep::VolumeExtension::copy
void copy(const VolumeExtension &c)
Copy the object.
Definition: Volumes.cpp:564
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:447
dd4hep::Volume::limitSet
LimitSet limitSet() const
Access to the limit set.
Definition: Volumes.cpp:1275
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:875
dd4hep::Volume::VETO_SIMU
@ VETO_SIMU
Definition: Volumes.h:383
dd4hep::Volume::region
Region region() const
Access to the handle to the region structure.
Definition: Volumes.cpp:1256
dd4hep::VolumeExtension::sens_det
Handle< NamedObject > sens_det
Reference to the sensitive detector.
Definition: Volumes.h:327
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:319
dd4hep::Assembly::Assembly
Assembly(const Handle< T > &v)
Copy from arbitrary Element.
Definition: Volumes.h:769
dd4hep::Volume::addProperty
void addProperty(const std::string &nam, const std::string &val) const
Add Volume property (name-value pair)
Definition: Volumes.cpp:1303
dd4hep::Volume::setMaterial
const Volume & setMaterial(const Material &m) const
Set the volume's material.
Definition: Volumes.cpp:1109
dd4hep::PlacedVolumeExtension::operator=
PlacedVolumeExtension & operator=(PlacedVolumeExtension &&copy)
Move assignment.
Definition: Volumes.h:139
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:693
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:269
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:431
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::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:510
dd4hep::PlacedVolume::VolIDs
PlacedVolumeExtension::VolIDs VolIDs
Definition: Volumes.h:176
dd4hep::VolumeExtension::Grab
virtual TGeoExtension * Grab() override
TGeoExtension overload: Method called whenever requiring a pointer to the extension.
Definition: Volumes.cpp:584
dd4hep::ReflectionBuilder::execute
void execute() const
Perform scan.
dd4hep::PlacedVolume::motherVol
Volume motherVol() const
Parent volume (envelope)
Definition: Volumes.cpp:457
dd4hep::ReflectionBuilder
Scan geometry and create reflected volumes.
Definition: Volumes.h:59
dd4hep::PlacedVolume::toString
std::string toString() const
String dump.
Definition: Volumes.cpp:524
dd4hep::PlacedVolumeExtension::Parameterisation::trafo1D
Dimension trafo1D
Reference to the parameterised transformation for dimension 1.
Definition: Volumes.h:263
dd4hep::PlacedVolumeExtension::PlacedVolumeExtension
PlacedVolumeExtension()
Default constructor.
Definition: Volumes.cpp:353
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:259
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:742
dd4hep::PlacedVolume::PlacedVolume
PlacedVolume(const Handle< T > &e)
Copy assignment from other handle type.
Definition: Volumes.h:203
dd4hep::PlacedVolume::num_daughters
std::size_t num_daughters() const
Number of daughters placed in this volume.
Definition: Volumes.cpp:462
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 manuloa for details)
Definition: Volumes.cpp:712
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
dd4hep::Volume::Phi_axis
@ Phi_axis
Definition: Volumes.h:396
dd4hep::PlacedVolumeExtension::VolID
std::pair< std::string, int > VolID
Definition: Volumes.h:81
dd4hep::VolumeExtension::VolumeExtension
VolumeExtension()
Default constructor.
Definition: Volumes.cpp:537
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:702
dd4hep::PlacedVolume::type
const char * type() const
Access the object type from the class information.
Definition: Volumes.cpp:437
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:380
dd4hep::Volume::type
const char * type() const
Access the object type from the class information.
Definition: Volumes.cpp:647
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:1228
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:1340
dd4hep::Volume::setVisAttributes
const Volume & setVisAttributes(const VisAttr &obj) const
Set Visualization attributes to the volume.
Definition: Volumes.cpp:1127
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:420
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:738
dd4hep::PlacedVolume::copyNumber
int copyNumber() const
Access the copy number of this placement within its mother.
Definition: Volumes.cpp:442
dd4hep::PlacedVolume::Processor::~Processor
virtual ~Processor()
Default destructor.
Definition: Volumes.cpp:338
dd4hep::PlacedVolumeExtension::Parameterisation::placements
std::vector< PlacedVolume > placements
Reference to the placements of this volume.
Definition: Volumes.h:273
dd4hep::PlacedVolume::volume
Volume volume() const
Logical volume of this placement.
Definition: Volumes.cpp:452
dd4hep::PlacedVolumeExtension::VolIDs::insert
std::pair< std::vector< VolID >::iterator, bool > insert(const std::string &name, int value)
Insert new entry.
Definition: Volumes.cpp:406
dd4hep::PlacedVolume::data
Object * data() const
Check if placement is properly instrumented.
Definition: Volumes.cpp:431
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:1319
dd4hep::PlacedVolumeExtension::Parameterisation::field
const detail::BitFieldElement * field
Bitfield from sensitive detector to encode the volume ID on the fly.
Definition: Volumes.h:275
dd4hep::Volume::reflect
Volume reflect() const
Create a reflected volume tree. The reflected volume has left-handed coordinates.
Definition: Volumes.cpp:652
dd4hep::Volume::VETO_RECO
@ VETO_RECO
Definition: Volumes.h:384
dd4hep::VolumeExtension::~VolumeExtension
virtual ~VolumeExtension()
Default destructor.
Definition: Volumes.cpp:543
dd4hep::Volume::setFlagBit
void setFlagBit(unsigned int bit)
Set user flags in bit-field.
Definition: Volumes.cpp:684
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:480
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:1200
dd4hep::VolumeExtension::properties
TList * properties
Reference to properties.
Definition: Volumes.h:331
dd4hep::PlacedVolumeExtension::Parameterisation::start
Transform3D start
Reference to the starting point of the parameterisation.
Definition: Volumes.h:261
dd4hep::PlacedVolumeExtension::VolIDs::VolIDs
VolIDs(VolIDs &&copy)=default
Move constructor.
dd4hep::Volume::visAttributes
VisAttr visAttributes() const
Access the visualisation attributes.
Definition: Volumes.cpp:1210
dd4hep::Volume::Object
VolumeExtension Object
Definition: Volumes.h:380
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:518
dd4hep::Volume::X_axis
@ X_axis
Definition: Volumes.h:392
dd4hep::PlacedVolumeExtension::Parameterisation
Optional parameters to implement special features such as parametrization.
Definition: Volumes.h:256
dd4hep::PlacedVolumeExtension::VolIDs::find
std::vector< VolID >::const_iterator find(const std::string &name) const
Find entry.
Definition: Volumes.cpp:397
dd4hep::Volume::VETO_DISPLAY
@ VETO_DISPLAY
Definition: Volumes.h:385
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:317
dd4hep::Volume::data
Object * data() const
Check if placement is properly instrumented.
Definition: Volumes.cpp:641
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:1287
dd4hep::VolumeExtension::limits
LimitSet limits
Limit sets used for simulation.
Definition: Volumes.h:323