DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
OpticalSurfaces.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_OPTICALSURFACES_H
14 #define DD4HEP_OPTICALSURFACES_H
15 
16 // Framework include files
17 #include <DD4hep/Volumes.h>
18 #include <DD4hep/DetElement.h>
19 
20 // ROOT include files
21 #include <TGeoOpticalSurface.h>
22 
24 namespace dd4hep {
25 
27 
42  class OpticalSurface : public Handle<TGeoOpticalSurface> {
43  public:
44  typedef TGeoOpticalSurface Object;
45  typedef Object Finish;
46  typedef Object Model;
47  typedef Object Type;
48  typedef Object::ESurfaceModel EModel;
49  typedef Object::ESurfaceFinish EFinish;
50  typedef Object::ESurfaceType EType;
51  typedef const TGDMLMatrix* Property;
52 
53  public:
55  OpticalSurface() = default;
57  OpticalSurface(const OpticalSurface& e) = default;
59  OpticalSurface(Object* obj) : Handle<Object>(obj) { }
63  template <typename Q>
64  OpticalSurface(const Handle<Q>& e) : Handle<Object>(e) { }
66  OpticalSurface(Detector& detector,
67  const std::string& name,
68  EModel model = Model::kMglisur,
69  EFinish finish = Finish::kFpolished,
70  EType type = Type::kTdielectric_dielectric,
71  double value = 1.0);
72 
74  OpticalSurface& operator=(const OpticalSurface& m) = default;
75 
77  Property property(const char* name) const;
78 
80  Property property(const std::string& name) const;
81 
83  static EType stringToType(const std::string& type) {
84  return Object::StringToType(type.c_str());
85  }
87  static std::string typeToString(EType type) {
88  return Object::TypeToString(type);
89  }
90  static EModel stringToModel(const std::string& model) {
91  return Object::StringToModel(model.c_str());
92  }
93  static std::string modelToString(EModel model) {
94  return Object::ModelToString(model);
95  }
96  static EFinish stringToFinish(const std::string& finish) {
97  return Object::StringToFinish(finish.c_str());
98  }
99  static std::string finishToString(EFinish finish) {
100  return Object::FinishToString(finish);
101  }
102  };
103 
105 
111  class SkinSurface : public Handle<TGeoSkinSurface> {
112  public:
113  typedef TGeoSkinSurface Object;
114  typedef const TGDMLMatrix* Property;
115 
116  public:
118  SkinSurface() = default;
120  SkinSurface(const SkinSurface& e) = default;
122  SkinSurface(Object* obj) : Handle<Object>(obj) { }
126  template <typename Q>
127  SkinSurface(const Handle<Q>& e) : Handle<Object>(e) { }
129  SkinSurface(Detector& detector,
130  DetElement de,
131  const std::string& nam,
132  OpticalSurface surf,
133  Volume vol);
134 
136  SkinSurface& operator=(const SkinSurface& m) = default;
137 
139  OpticalSurface surface() const;
141  Volume volume() const;
143  Property property(const char* name) const;
145  Property property(const std::string& name) const;
146  };
147 
149 
155  class BorderSurface : public Handle<TGeoBorderSurface> {
156  public:
157  typedef TGeoBorderSurface Object;
158  typedef const TGDMLMatrix* Property;
159 
160  public:
162  BorderSurface() = default;
164  BorderSurface(const BorderSurface& e) = default;
166  BorderSurface(Object* obj) : Handle<Object>(obj) { }
170  template <typename Q>
171  BorderSurface(const Handle<Q>& e) : Handle<Object>(e) { }
173  BorderSurface(Detector& detector,
174  DetElement de,
175  const std::string& nam,
176  OpticalSurface surf,
179 
181  BorderSurface& operator=(const BorderSurface& m) = default;
183  OpticalSurface surface() const;
185  Property property(const char* name) const;
187  Property property(const std::string& name) const;
189  PlacedVolume left() const;
191  PlacedVolume right() const;
192  };
193 } /* End namespace dd4hep */
194 #endif // DD4HEP_OPTICALSURFACES_H
dd4hep::BorderSurface::property
Property property(const char *name) const
Access to tabular properties of the optical surface.
Definition: OpticalSurfaces.cpp:124
dd4hep::BorderSurface::BorderSurface
BorderSurface(Object *obj)
Constructor taking object pointer.
Definition: OpticalSurfaces.h:166
dd4hep::OpticalSurface::stringToType
static EType stringToType(const std::string &type)
Convenience function forwarding to TGeoOpticalSurface.
Definition: OpticalSurfaces.h:83
dd4hep::SkinSurface::Property
const TGDMLMatrix * Property
Definition: OpticalSurfaces.h:114
Volumes.h
dd4hep::OpticalSurface::operator=
OpticalSurface & operator=(const OpticalSurface &m)=default
Assignment operator.
dd4hep::OpticalSurface::Finish
Object Finish
Definition: OpticalSurfaces.h:45
dd4hep::BorderSurface::right
PlacedVolume right() const
Access the right node of the border surface.
Definition: OpticalSurfaces.cpp:141
dd4hep::PlacedVolume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:173
dd4hep::OpticalSurface::Object
TGeoOpticalSurface Object
Definition: OpticalSurfaces.h:44
dd4hep::OpticalSurface::typeToString
static std::string typeToString(EType type)
Convenience function forwarding to TGeoOpticalSurface.
Definition: OpticalSurfaces.h:87
dd4hep::Handle
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:84
dd4hep::OpticalSurface::OpticalSurface
OpticalSurface(Object *obj)
Constructor taking object pointer.
Definition: OpticalSurfaces.h:59
dd4hep::Handle< TGeoOpticalSurface >::name
const char * name() const
Access the object name (or "" if not supported by the object)
dd4hep::BorderSurface::BorderSurface
BorderSurface(const BorderSurface &e)=default
Copy constructor.
dd4hep::OpticalSurface::OpticalSurface
OpticalSurface(const OpticalSurface &e)=default
Copy constructor.
dd4hep::SkinSurface::volume
Volume volume() const
Access the node of the skin surface.
Definition: OpticalSurfaces.cpp:91
dd4hep::SkinSurface::SkinSurface
SkinSurface(const Handle< Object > &e)
Constructor from same-type handle.
Definition: OpticalSurfaces.h:124
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::BorderSurface::operator=
BorderSurface & operator=(const BorderSurface &m)=default
Assignment operator.
dd4hep::Volume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:378
dd4hep::OpticalSurface::EFinish
Object::ESurfaceFinish EFinish
Definition: OpticalSurfaces.h:49
dd4hep::BorderSurface::BorderSurface
BorderSurface(const Handle< Object > &e)
Constructor from same-type handle.
Definition: OpticalSurfaces.h:168
dd4hep::SkinSurface::SkinSurface
SkinSurface(const SkinSurface &e)=default
Copy constructor.
dd4hep::OpticalSurface::Property
const TGDMLMatrix * Property
Definition: OpticalSurfaces.h:51
dd4hep::SkinSurface
Class to support the handling of optical surfaces.
Definition: OpticalSurfaces.h:111
dd4hep::SkinSurface::SkinSurface
SkinSurface(Object *obj)
Constructor taking object pointer.
Definition: OpticalSurfaces.h:122
dd4hep::BorderSurface::BorderSurface
BorderSurface()=default
Default constructor.
dd4hep::OpticalSurface::Type
Object Type
Definition: OpticalSurfaces.h:47
dd4hep::SkinSurface::SkinSurface
SkinSurface(const Handle< Q > &e)
Constructor from arbitrary handle.
Definition: OpticalSurfaces.h:127
dd4hep::SkinSurface::surface
OpticalSurface surface() const
Access surface data.
Definition: OpticalSurfaces.cpp:74
dd4hep::OpticalSurface::Model
Object Model
Definition: OpticalSurfaces.h:46
dd4hep::SkinSurface::Object
TGeoSkinSurface Object
Definition: OpticalSurfaces.h:113
dd4hep::BorderSurface::Object
TGeoBorderSurface Object
Definition: OpticalSurfaces.h:157
dd4hep::OpticalSurface::OpticalSurface
OpticalSurface(const Handle< Object > &e)
Constructor from same-type handle.
Definition: OpticalSurfaces.h:61
dd4hep::SkinSurface::property
Property property(const char *name) const
Access to tabular properties of the optical surface.
Definition: OpticalSurfaces.cpp:79
dd4hep::BorderSurface::surface
OpticalSurface surface() const
Access surface data.
Definition: OpticalSurfaces.cpp:119
dd4hep::BorderSurface::Property
const TGDMLMatrix * Property
Definition: OpticalSurfaces.h:158
dd4hep::OpticalSurface::stringToModel
static EModel stringToModel(const std::string &model)
Definition: OpticalSurfaces.h:90
dd4hep::BorderSurface::BorderSurface
BorderSurface(const Handle< Q > &e)
Constructor from arbitrary handle.
Definition: OpticalSurfaces.h:171
DetElement.h
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::BorderSurface::left
PlacedVolume left() const
Access the left node of the border surface.
Definition: OpticalSurfaces.cpp:136
dd4hep::OpticalSurface::EModel
Object::ESurfaceModel EModel
Definition: OpticalSurfaces.h:48
dd4hep::OpticalSurface::modelToString
static std::string modelToString(EModel model)
Definition: OpticalSurfaces.h:93
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::OpticalSurface::stringToFinish
static EFinish stringToFinish(const std::string &finish)
Definition: OpticalSurfaces.h:96
dd4hep::SkinSurface::SkinSurface
SkinSurface()=default
Default constructor.
dd4hep::OpticalSurface::property
Property property(const char *name) const
Access to tabular properties of the surface.
Definition: OpticalSurfaces.cpp:46
dd4hep::BorderSurface
Class to support the handling of optical surfaces.
Definition: OpticalSurfaces.h:155
dd4hep::OpticalSurface::EType
Object::ESurfaceType EType
Definition: OpticalSurfaces.h:50
dd4hep::SkinSurface::operator=
SkinSurface & operator=(const SkinSurface &m)=default
Assignment operator.
dd4hep::OpticalSurface
Class to support the handling of optical surfaces.
Definition: OpticalSurfaces.h:42
dd4hep::OpticalSurface::OpticalSurface
OpticalSurface()=default
Default constructor.
dd4hep::OpticalSurface::OpticalSurface
OpticalSurface(const Handle< Q > &e)
Constructor from arbitrary handle.
Definition: OpticalSurfaces.h:64
dd4hep::OpticalSurface::finishToString
static std::string finishToString(EFinish finish)
Definition: OpticalSurfaces.h:99