DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | List of all members
dd4hep::DetectorHelper Class Reference

DetectorHelper: class to shortcut certain questions to the dd4hep detector description interface. More...

#include <DetectorHelper.h>

Inheritance diagram for dd4hep::DetectorHelper:
dd4hep::Handle< Detector >

Public Member Functions

 DetectorHelper ()=default
 Default constructor. More...
 
 DetectorHelper (const DetectorHelper &h)=default
 Copy constructor. More...
 
 DetectorHelper (Detector *description_ptr)
 Initializing constructor from pointer. More...
 
 DetectorHelper (Detector &description_ref)
 Initializing constructor from pointer. More...
 
 DetectorHelper (const Handle< Detector > &h)
 Copy constructor. More...
 
 ~DetectorHelper ()=default
 Default destructor. More...
 
DetectorHelperoperator= (const DetectorHelper &c)=default
 Assignment operator. More...
 
SensitiveDetector sensitiveDetector (const std::string &detector) const
 Access the sensitive detector of a given subdetector (if the sub-detector is sensitive!) More...
 
SensitiveDetector sensitiveDetector (DetElement detector) const
 Given a detector element, access its sensitive detector (if the sub-detector is sensitive!) More...
 
DetElement detectorByID (int id) const
 Find a detector element by its system ID. More...
 
Atom element (const std::string &name) const
 Access an element from the element table by name. More...
 
Material material (const std::string &name) const
 Access a material from the material table by name. More...
 
- Public Member Functions inherited from dd4hep::Handle< Detector >
 Handle ()=default
 Default constructor. More...
 
 Handle (Handle< Detector > &&element)=default
 Copy constructor. More...
 
 Handle (const Handle< Detector > &element)=default
 Copy constructor. More...
 
 Handle (Detector *element)
 Initializing constructor from pointer. More...
 
 Handle (Q *element)
 Initializing constructor from unrelated pointer with type checking. More...
 
 Handle (const Handle< Q > &element)
 Initializing constructor from unrelated handle with type checking. More...
 
Handle< Detector > & operator= (Handle< Detector > &&element)=default
 Assignment move operator. More...
 
Handle< Detector > & operator= (const Handle< Detector > &element)=default
 Assignment copy operator. More...
 
bool operator== (const Handle< Detector > &element) const
 Boolean operator == used for RB tree insertions. More...
 
bool operator< (const Handle< Detector > &element) const
 Boolean operator < used for RB tree insertions. More...
 
bool operator> (const Handle< Detector > &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< Detector > & clear ()
 Release the object held by the handle. More...
 
Detectoroperator-> () const
 Access the held object using the -> operator. More...
 
 operator Detector & () const
 Automatic type conversion to an object references. More...
 
Detectoroperator* () const
 Access the held object using the * operator. More...
 
Detectorptr () const
 Access to the held object. More...
 
Q * _ptr () const
 Access to an unrelated object type. More...
 
Q * data () const
 Access to an unrelated object type. More...
 
Q & object () const
 Access to an unrelated object type. More...
 
Detectoraccess () 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...
 
const char * name () const
 
const char * name () const
 
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 assign (_Segmentation *s, const std::string &n, const std::string &)
 
void assign (NamedObject *p, const std::string &n, const std::string &t)
 
void destroy ()
 Destroy the underlying object (be careful here: things are not reference counted)! More...
 

Additional Inherited Members

- Public Types inherited from dd4hep::Handle< Detector >
typedef Detector Object
 Extern accessible definition of the contained element type. More...
 
typedef Handle< DetectorBase
 Self type: used by sub-classes. More...
 
- Static Public Member Functions inherited from dd4hep::Handle< Detector >
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< Detector >
Detectorm_element
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

DetectorHelper: class to shortcut certain questions to the dd4hep detector description interface.

Note: This class may be extended with additional useful (generic) functionality, which requires the use of the main Detector object.

Author
M.Frank
Version
1.0

Definition at line 32 of file DetectorHelper.h.

Constructor & Destructor Documentation

◆ DetectorHelper() [1/5]

dd4hep::DetectorHelper::DetectorHelper ( )
default

Default constructor.

◆ DetectorHelper() [2/5]

dd4hep::DetectorHelper::DetectorHelper ( const DetectorHelper h)
default

Copy constructor.

◆ DetectorHelper() [3/5]

dd4hep::DetectorHelper::DetectorHelper ( Detector description_ptr)
inline

Initializing constructor from pointer.

Definition at line 39 of file DetectorHelper.h.

◆ DetectorHelper() [4/5]

dd4hep::DetectorHelper::DetectorHelper ( Detector description_ref)
inline

Initializing constructor from pointer.

Definition at line 41 of file DetectorHelper.h.

◆ DetectorHelper() [5/5]

dd4hep::DetectorHelper::DetectorHelper ( const Handle< Detector > &  h)
inline

Copy constructor.

Definition at line 43 of file DetectorHelper.h.

◆ ~DetectorHelper()

dd4hep::DetectorHelper::~DetectorHelper ( )
default

Default destructor.

Member Function Documentation

◆ detectorByID()

DetElement DetectorHelper::detectorByID ( int  id) const

Find a detector element by its system ID.

Definition at line 48 of file DetectorHelper.cpp.

◆ element()

Atom DetectorHelper::element ( const std::string &  name) const

Access an element from the element table by name.

Definition at line 58 of file DetectorHelper.cpp.

◆ material()

Material DetectorHelper::material ( const std::string &  name) const

Access a material from the material table by name.

Definition at line 79 of file DetectorHelper.cpp.

◆ operator=()

DetectorHelper& dd4hep::DetectorHelper::operator= ( const DetectorHelper c)
default

Assignment operator.

◆ sensitiveDetector() [1/2]

SensitiveDetector DetectorHelper::sensitiveDetector ( const std::string &  detector) const

Access the sensitive detector of a given subdetector (if the sub-detector is sensitive!)

Definition at line 23 of file DetectorHelper.cpp.

◆ sensitiveDetector() [2/2]

SensitiveDetector DetectorHelper::sensitiveDetector ( DetElement  detector) const

Given a detector element, access its sensitive detector (if the sub-detector is sensitive!)

Definition at line 30 of file DetectorHelper.cpp.


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