DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Protected Member Functions | Friends | List of all members
dd4hep::Solid_type< T > Class Template Reference

Base class for Solid (shape) objects. More...

#include <Shapes.h>

Inheritance diagram for dd4hep::Solid_type< T >:
dd4hep::Handle< T >

Public Member Functions

 Solid_type ()=default
 Default constructor for uninitialized object. More...
 
 Solid_type (Solid_type &&e)=default
 Move constructor. More...
 
 Solid_type (const Solid_type &e)=default
 Copy constructor. More...
 
 Solid_type (T *p)
 Direct assignment using the implementation pointer. More...
 
 Solid_type (Handle< T > &&e)
 Move Constructor from handle. More...
 
 Solid_type (const Handle< T > &e)
 Copy Constructor from handle. More...
 
template<typename Q >
 Solid_type (const Handle< Q > &e)
 Constructor to be used when passing an already created object: need to check pointers. More...
 
Solid_typeoperator= (Solid_type &&copy)=default
 Assignment move operator. More...
 
Solid_typeoperator= (const Solid_type &copy)=default
 Assignment copy operator. More...
 
const char * name () const
 Access to shape name. More...
 
Solid_type< T > & setName (const char *value)
 Set new shape name. More...
 
Solid_type< T > & setName (const std::string &value)
 Set new shape name. More...
 
const char * title () const
 Access to shape title (GetTitle accessor of the TGeoShape) More...
 
const char * type () const
 Access to shape type (The TClass name of the ROOT implementation) More...
 
 operator T* () const
 Auto conversion to underlying ROOT object. More...
 
T * operator-> () const
 Overloaded operator -> to access underlying object. More...
 
std::vector< double > dimensions ()
 Access the dimensions of the shape: inverse of the setDimensions member function. More...
 
Solid_typesetDimensions (const std::vector< double > &params)
 Set the shape dimensions. As for the TGeo shape, but angles in rad rather than degrees. More...
 
std::string toString (int precision=2) const
 Conversion to string for pretty print. More...
 
TGeoVolume * divide (const Volume &voldiv, const std::string &divname, int iaxis, int ndiv, double start, double step) const
 Divide volume into subsections (See the ROOT manuloa for details) More...
 
- Public Member Functions inherited from dd4hep::Handle< T >
 Handle ()=default
 Default constructor. More...
 
 Handle (Handle< T > &&element)=default
 Copy constructor. More...
 
 Handle (const Handle< T > &element)=default
 Copy constructor. More...
 
 Handle (T *element)
 Initializing constructor from pointer. More...
 
template<typename Q >
 Handle (Q *element)
 Initializing constructor from unrelated pointer with type checking. More...
 
template<typename Q >
 Handle (const Handle< Q > &element)
 Initializing constructor from unrelated handle with type checking. More...
 
Handle< T > & operator= (Handle< T > &&element)=default
 Assignment move operator. More...
 
Handle< T > & operator= (const Handle< T > &element)=default
 Assignment copy operator. More...
 
bool operator== (const Handle< T > &element) const
 Boolean operator == used for RB tree insertions. More...
 
bool operator< (const Handle< T > &element) const
 Boolean operator < used for RB tree insertions. More...
 
bool operator> (const Handle< T > &element) const
 Boolean operator > used for RB tree insertions. More...
 
bool isValid () const
 Check the validity of the object held by the handle. More...
 
bool operator! () const
 Check the validity of the object held by the handle. More...
 
Handle< T > & clear ()
 Release the object held by the handle. More...
 
T * operator-> () const
 Access the held object using the -> operator. More...
 
 operator T& () const
 Automatic type conversion to an object references. More...
 
T & operator* () const
 Access the held object using the * operator. More...
 
T * ptr () const
 Access to the held object. More...
 
template<typename Q >
Q * _ptr () const
 Access to an unrelated object type. More...
 
template<typename Q >
Q * data () const
 Access to an unrelated object type. More...
 
template<typename Q >
Q & object () const
 Access to an unrelated object type. More...
 
T * access () const
 Checked object access. Throws invalid handle runtime exception if invalid handle. More...
 
const char * name () const
 Access the object name (or "" if not supported by the object) More...
 
void assign (Object *n, const std::string &nam, const std::string &title)
 Assign a new named object. Note: object references must be managed by the user. More...
 
void destroy ()
 Destroy the underlying object (be careful here: things are not reference counted)! More...
 
void assign (_Segmentation *s, const std::string &n, const std::string &)
 
const char * name () const
 
const char * name () const
 
void assign (NamedObject *p, const std::string &n, const std::string &t)
 

Protected Member Functions

void _setDimensions (double *param) const
 
void _assign (T *n, const std::string &nam, const std::string &tit, bool cbbox)
 Assign pointrs and register solid to geometry. More...
 

Friends

template<typename Q >
void set_dimensions (Q ptr, const std::vector< double > &params)
 

Additional Inherited Members

- Public Types inherited from dd4hep::Handle< T >
typedef T Object
 Extern accessible definition of the contained element type. More...
 
typedef Handle< T > Base
 Self type: used by sub-classes. More...
 
- Static Public Member Functions inherited from dd4hep::Handle< T >
static void bad_assignment (const std::type_info &from, const std::type_info &to)
 Helper routine called when unrelated types are assigned. More...
 
- Public Attributes inherited from dd4hep::Handle< T >
T * m_element {nullptr}
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

template<typename T>
class dd4hep::Solid_type< T >

Base class for Solid (shape) objects.

Generic handle holding an object of base TGeoShape.

One note about divisions:

Since dd4hep requires Volumes (aka TGeoVolume) and PlacedVolumes (aka TGeoNode) to be enhaced with the user extension mechanism shape divisions MUST be done using the division mechanism of the dd4hep shape or volume wrapper. Otherwise the enhancements are not added and you shall get exception when dd4hep is closing the geometry. The same argument holds when a division is made from a Volume. Unfortunately there is no reasonable way to intercept this call to the TGeo objects - except to sub-class each of them, which is not really acceptable either.

For any further documentation please see the following ROOT documentation:

See also
http://root.cern.ch/root/html/TGeoShape.html
Author
M.Frank
Version
1.0

Definition at line 135 of file Shapes.h.

Constructor & Destructor Documentation

◆ Solid_type() [1/7]

template<typename T >
dd4hep::Solid_type< T >::Solid_type ( )
default

Default constructor for uninitialized object.

◆ Solid_type() [2/7]

template<typename T >
dd4hep::Solid_type< T >::Solid_type ( Solid_type< T > &&  e)
default

Move constructor.

◆ Solid_type() [3/7]

template<typename T >
dd4hep::Solid_type< T >::Solid_type ( const Solid_type< T > &  e)
default

Copy constructor.

◆ Solid_type() [4/7]

template<typename T >
dd4hep::Solid_type< T >::Solid_type ( T *  p)
inline

Direct assignment using the implementation pointer.

Definition at line 153 of file Shapes.h.

◆ Solid_type() [5/7]

template<typename T >
dd4hep::Solid_type< T >::Solid_type ( Handle< T > &&  e)
inline

Move Constructor from handle.

Definition at line 155 of file Shapes.h.

◆ Solid_type() [6/7]

template<typename T >
dd4hep::Solid_type< T >::Solid_type ( const Handle< T > &  e)
inline

Copy Constructor from handle.

Definition at line 157 of file Shapes.h.

◆ Solid_type() [7/7]

template<typename T >
template<typename Q >
dd4hep::Solid_type< T >::Solid_type ( const Handle< Q > &  e)
inline

Constructor to be used when passing an already created object: need to check pointers.

Definition at line 159 of file Shapes.h.

Member Function Documentation

◆ _assign()

template<typename T >
void Solid_type::_assign ( T *  n,
const std::string &  nam,
const std::string &  tit,
bool  cbbox 
)
protected

Assign pointrs and register solid to geometry.

Definition at line 47 of file Shapes.cpp.

◆ _setDimensions()

template<typename T >
void Solid_type::_setDimensions ( double *  param) const
protected

Definition at line 39 of file Shapes.cpp.

◆ dimensions()

template<typename T >
std::vector< double > Solid_type::dimensions

Access the dimensions of the shape: inverse of the setDimensions member function.

Definition at line 90 of file Shapes.cpp.

◆ divide()

template<typename T >
TGeoVolume * Solid_type::divide ( const Volume voldiv,
const std::string &  divname,
int  iaxis,
int  ndiv,
double  start,
double  step 
) const

Divide volume into subsections (See the ROOT manuloa for details)

Definition at line 102 of file Shapes.cpp.

◆ name()

template<typename T >
const char * Solid_type::name

Access to shape name.

Definition at line 54 of file Shapes.cpp.

◆ operator T*()

template<typename T >
dd4hep::Solid_type< T >::operator T* ( ) const
inline

Auto conversion to underlying ROOT object.

Definition at line 178 of file Shapes.h.

◆ operator->()

template<typename T >
T* dd4hep::Solid_type< T >::operator-> ( ) const
inline

Overloaded operator -> to access underlying object.

Definition at line 182 of file Shapes.h.

◆ operator=() [1/2]

template<typename T >
Solid_type& dd4hep::Solid_type< T >::operator= ( const Solid_type< T > &  copy)
default

Assignment copy operator.

◆ operator=() [2/2]

template<typename T >
Solid_type& dd4hep::Solid_type< T >::operator= ( Solid_type< T > &&  copy)
default

Assignment move operator.

◆ setDimensions()

template<typename T >
Solid_type< T > & Solid_type::setDimensions ( const std::vector< double > &  params)

Set the shape dimensions. As for the TGeo shape, but angles in rad rather than degrees.

Definition at line 95 of file Shapes.cpp.

◆ setName() [1/2]

template<typename T >
Solid_type< T > & Solid_type::setName ( const char *  value)

Set new shape name.

Definition at line 70 of file Shapes.cpp.

◆ setName() [2/2]

template<typename T >
Solid_type< T > & Solid_type::setName ( const std::string &  value)

Set new shape name.

Definition at line 76 of file Shapes.cpp.

◆ title()

template<typename T >
const char * Solid_type::title

Access to shape title (GetTitle accessor of the TGeoShape)

Access to shape name.

Definition at line 62 of file Shapes.cpp.

◆ toString()

template<typename T >
std::string dd4hep::Solid_type< T >::toString ( int  precision = 2) const
inline

Conversion to string for pretty print.

Definition at line 190 of file Shapes.h.

◆ type()

template<typename T >
const char * Solid_type::type

Access to shape type (The TClass name of the ROOT implementation)

Definition at line 82 of file Shapes.cpp.

Friends And Related Function Documentation

◆ set_dimensions

template<typename T >
template<typename Q >
void set_dimensions ( ptr,
const std::vector< double > &  params 
)
friend

The documentation for this class was generated from the following files: