DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Class to support the retrieval of detector elements and volumes given a valid identifier. More...
#include <VolumeManager.h>
Public Types | |
enum | PopulateFlags { NONE = 0, TREE = 1 << 1, ONE = 1 << 2, LAST } |
Public Types inherited from dd4hep::Handle< detail::VolumeManagerObject > | |
typedef detail::VolumeManagerObject | Object |
Extern accessible definition of the contained element type. More... | |
typedef Handle< detail::VolumeManagerObject > | Base |
Self type: used by sub-classes. More... | |
Public Member Functions | |
VolumeManager ()=default | |
Default constructor. More... | |
VolumeManager (const VolumeManager &e)=default | |
Constructor to be used when reading the already parsed object. More... | |
VolumeManager (const Handle< detail::VolumeManagerObject > &e) | |
Constructor to be used when reading the already parsed object. More... | |
template<typename Q > | |
VolumeManager (const Handle< Q > &e) | |
Constructor to be used when reading the already parsed object. More... | |
VolumeManager (const Detector &description, const std::string &name, DetElement world=DetElement(), Readout ro=Readout(), int flags=NONE) | |
Initializing constructor to create a new object. More... | |
VolumeManager (DetElement subdetector, Readout ro) | |
Initializing constructor for subdetector volume managers. More... | |
VolumeManager & | operator= (const VolumeManager &m)=default |
Assignment operator. More... | |
VolumeManager | addSubdetector (DetElement detector, Readout ro) |
Add a new Volume manager section according to a new subdetector. More... | |
VolumeManager | subdetector (VolumeID id) const |
Access the volume manager by cell id. More... | |
DetElement | detector () const |
Access the top level detector element. More... | |
IDDescriptor | idSpec () const |
Access IDDescription structure. More... | |
bool | adoptPlacement (VolumeManagerContext *context) |
Register physical volume with the manager (normally: section manager) More... | |
bool | adoptPlacement (VolumeID volume_id, VolumeManagerContext *context) |
Register physical volume with the manager and pre-computed volume id. More... | |
VolumeManagerContext * | lookupContext (VolumeID volume_id) const |
Lookup the context, which belongs to a registered physical volume. More... | |
PlacedVolume | lookupVolumePlacement (VolumeID volume_id) const |
Lookup a physical (placed) volume identified by its 64 bit hit ID. More... | |
PlacedVolume | lookupDetElementPlacement (VolumeID volume_id) const |
Lookup a physical (placed) volume of the detector element containing a volume identified by its 64 bit hit ID. More... | |
DetElement | lookupDetector (VolumeID volume_id) const |
Convenience routine: Lookup a top level subdetector detector element according to a contained 64 bit hit ID. More... | |
DetElement | lookupDetElement (VolumeID volume_id) const |
Convenience routine: Lookup the closest subdetector detector element in the hierarchy according to a contained 64 bit hit ID. More... | |
const TGeoMatrix & | worldTransformation (const ConditionsMap &map, VolumeID volume_id) const |
Convenience routine: Access the transformation of a physical volume to the world coordinate system. More... | |
Public Member Functions inherited from dd4hep::Handle< detail::VolumeManagerObject > | |
Handle ()=default | |
Default constructor. More... | |
Handle (Handle< detail::VolumeManagerObject > &&element)=default | |
Copy constructor. More... | |
Handle (const Handle< detail::VolumeManagerObject > &element)=default | |
Copy constructor. More... | |
Handle (detail::VolumeManagerObject *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< detail::VolumeManagerObject > & | operator= (Handle< detail::VolumeManagerObject > &&element)=default |
Assignment move operator. More... | |
Handle< detail::VolumeManagerObject > & | operator= (const Handle< detail::VolumeManagerObject > &element)=default |
Assignment copy operator. More... | |
bool | operator== (const Handle< detail::VolumeManagerObject > &element) const |
Boolean operator == used for RB tree insertions. More... | |
bool | operator< (const Handle< detail::VolumeManagerObject > &element) const |
Boolean operator < used for RB tree insertions. More... | |
bool | operator> (const Handle< detail::VolumeManagerObject > &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< detail::VolumeManagerObject > & | clear () |
Release the object held by the handle. More... | |
detail::VolumeManagerObject * | operator-> () const |
Access the held object using the -> operator. More... | |
operator detail::VolumeManagerObject & () const | |
Automatic type conversion to an object references. More... | |
detail::VolumeManagerObject & | operator* () const |
Access the held object using the * operator. More... | |
detail::VolumeManagerObject * | ptr () 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... | |
detail::VolumeManagerObject * | 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... | |
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... | |
Static Public Member Functions | |
static VolumeManager | getVolumeManager (const Detector &description) |
static accessor calling DD4hepVolumeManagerPlugin if necessary More... | |
Static Public Member Functions inherited from dd4hep::Handle< detail::VolumeManagerObject > | |
static void | bad_assignment (const std::type_info &from, const std::type_info &to) |
Helper routine called when unrelated types are assigned. More... | |
Protected Member Functions | |
Object & | _data () const |
Additional data accessor. More... | |
Additional Inherited Members | |
Public Attributes inherited from dd4hep::Handle< detail::VolumeManagerObject > | |
detail::VolumeManagerObject * | m_element |
Single and only data member: Reference to the actual element. More... | |
Class to support the retrieval of detector elements and volumes given a valid identifier.
The VolumeManager manages the repository of sensitive physical volumes (placements). These volumes can then be accessed together with basic other elements, such as the top level Detector element of the subdetector or the coordinate trasformation to world coordinates. The basic key to access this information is the 'VolumeID', a 64 bit number, which uniquely identifies a placement.
There are 2 working modes:
1) Starting from the top level element, the next level is addressed separately and the volumes are stored in a 2-level 'tree'. Placements this way are partitioned e.g. 'by subdetector'. This tries to keep the number of mapped elements at a reasonable level.
2) All placements are mapped to the top-level element. Good for small setups. Note, that the system field of all IDDescriptors of the subdetectors must have the same length to ensure the uniqueness of the placement keys.
By default the volume manager in TREE mode (-> 1)) is attached to the Detector instance and also managed by this instance. If you wish to create instances yourself, you must ensure that the handle is destroyed once no other references are present. [call DestroyHandle(VolumeManager)]
Definition at line 135 of file VolumeManager.h.
Enumerator | |
---|---|
NONE | |
TREE | |
ONE | |
LAST |
Definition at line 138 of file VolumeManager.h.
|
default |
Default constructor.
|
default |
Constructor to be used when reading the already parsed object.
|
inline |
Constructor to be used when reading the already parsed object.
Definition at line 160 of file VolumeManager.h.
|
inline |
Constructor to be used when reading the already parsed object.
Definition at line 166 of file VolumeManager.h.
VolumeManager::VolumeManager | ( | const Detector & | description, |
const std::string & | name, | ||
DetElement | world = DetElement() , |
||
Readout | ro = Readout() , |
||
int | flags = NONE |
||
) |
Initializing constructor to create a new object.
Initializing constructor. The tree will automatically be built if the detelement is valid Please see enum PopulateFlags for further info. No action whatsoever is performed here, if the detector element is not valid.
Definition at line 395 of file VolumeManager.cpp.
VolumeManager::VolumeManager | ( | DetElement | subdetector, |
Readout | ro | ||
) |
Initializing constructor for subdetector volume managers.
Initializing constructor to create a new object.
Definition at line 413 of file VolumeManager.cpp.
|
inlineprotected |
Additional data accessor.
Definition at line 148 of file VolumeManager.h.
VolumeManager VolumeManager::addSubdetector | ( | DetElement | detector, |
Readout | ro | ||
) |
Add a new Volume manager section according to a new subdetector.
Definition at line 428 of file VolumeManager.cpp.
bool VolumeManager::adoptPlacement | ( | VolumeID | volume_id, |
VolumeManagerContext * | context | ||
) |
Register physical volume with the manager and pre-computed volume id.
Register physical volume with the manager (normally: section manager)
Definition at line 510 of file VolumeManager.cpp.
bool VolumeManager::adoptPlacement | ( | VolumeManagerContext * | context | ) |
Register physical volume with the manager (normally: section manager)
Definition at line 568 of file VolumeManager.cpp.
DetElement VolumeManager::detector | ( | ) | const |
Access the top level detector element.
Definition at line 497 of file VolumeManager.cpp.
|
static |
static accessor calling DD4hepVolumeManagerPlugin if necessary
Definition at line 420 of file VolumeManager.cpp.
IDDescriptor VolumeManager::idSpec | ( | ) | const |
Access IDDescription structure.
Definition at line 505 of file VolumeManager.cpp.
VolumeManagerContext * VolumeManager::lookupContext | ( | VolumeID | volume_id | ) | const |
Lookup the context, which belongs to a registered physical volume.
This set of functions is required when reading/analyzing already created hits which have a VolumeID attached.
First look in our own volume cache if the entry is found.
Second: look in the subdetector volume cache if the entry is found.
Definition at line 605 of file VolumeManager.cpp.
DetElement VolumeManager::lookupDetector | ( | VolumeID | volume_id | ) | const |
Convenience routine: Lookup a top level subdetector detector element according to a contained 64 bit hit ID.
Lookup a top level subdetector detector element according to a contained 64 bit hit ID.
Definition at line 645 of file VolumeManager.cpp.
DetElement VolumeManager::lookupDetElement | ( | VolumeID | volume_id | ) | const |
Convenience routine: Lookup the closest subdetector detector element in the hierarchy according to a contained 64 bit hit ID.
Lookup the closest subdetector detector element in the hierarchy according to a contained 64 bit hit ID.
Definition at line 672 of file VolumeManager.cpp.
PlacedVolume VolumeManager::lookupDetElementPlacement | ( | VolumeID | volume_id | ) | const |
Lookup a physical (placed) volume of the detector element containing a volume identified by its 64 bit hit ID.
Lookup a physical (placed) volume identified by its 64 bit hit ID.
Definition at line 633 of file VolumeManager.cpp.
PlacedVolume VolumeManager::lookupVolumePlacement | ( | VolumeID | volume_id | ) | const |
Lookup a physical (placed) volume identified by its 64 bit hit ID.
Definition at line 639 of file VolumeManager.cpp.
|
default |
Assignment operator.
VolumeManager VolumeManager::subdetector | ( | VolumeID | id | ) | const |
Access the volume manager by cell id.
Need to perform a linear search, because the "system" tag width may vary between subdetectors
Definition at line 479 of file VolumeManager.cpp.
const TGeoMatrix & VolumeManager::worldTransformation | ( | const ConditionsMap & | map, |
VolumeID | volume_id | ||
) | const |
Convenience routine: Access the transformation of a physical volume to the world coordinate system.
Access the transformation of a physical volume to the world coordinate system.
Definition at line 679 of file VolumeManager.cpp.