DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Class implementing the ID encoding of the detector response. More...
#include <DDCore/IDDescriptor.h>
Public Types | |
typedef BitFieldElement | Field |
typedef std::vector< std::pair< std::string, const Field * > > | FieldMap |
typedef std::vector< std::pair< size_t, std::string > > | FieldIDs |
Public Types inherited from dd4hep::Handle< IDDescriptorObject > | |
typedef IDDescriptorObject | Object |
Extern accessible definition of the contained element type. More... | |
typedef Handle< IDDescriptorObject > | Base |
Self type: used by sub-classes. More... | |
Public Member Functions | |
IDDescriptor ()=default | |
Default constructor. More... | |
template<typename Q > | |
IDDescriptor (const Handle< Q > &e) | |
Constructor to be used when reading the already parsed object. More... | |
IDDescriptor (const std::string &name, const std::string &description) | |
Initializing constructor. More... | |
std::string | fieldDescription () const |
The string description of all fields from the BitField. More... | |
unsigned | maxBit () const |
The total number of encoding bits for this descriptor. More... | |
const FieldIDs & | ids () const |
Access the field-id container. More... | |
const FieldMap & | fields () const |
Access the fieldmap container. More... | |
const BitFieldElement * | field (const std::string &field_name) const |
Get the field descriptor of one field by name. More... | |
size_t | fieldID (const std::string &field_name) const |
Get the field identifier of one field by name. More... | |
const BitFieldElement * | field (size_t identifier) const |
Get the field descriptor of one field by its identifier. More... | |
VolumeID | encode (const std::vector< std::pair< std::string, int > > &ids) const |
Encode a set of volume identifiers (corresponding to this description of course!) to a volumeID. More... | |
VolumeID | encode_reverse (const std::vector< std::pair< std::string, int > > &id_vector) const |
Encode a set of volume identifiers to a volumeID with the system ID on the top bits. More... | |
VolumeID | get_mask (const std::vector< std::pair< std::string, int > > &id_vector) const |
Compute the submask for a given set of volume IDs. More... | |
void | decodeFields (VolumeID vid, std::vector< std::pair< const BitFieldElement *, VolumeID > > &fields) const |
Decode volume IDs and return filled descriptor with all fields. More... | |
std::string | str (VolumeID vid) const |
Decode volume IDs and return string reprensentation for debugging purposes. More... | |
std::string | str (VolumeID vid, VolumeID mask) const |
Decode volume IDs and return string reprensentation for debugging purposes. More... | |
std::string | toString () const |
Access string representation. More... | |
BitFieldCoder * | decoder () const |
Access the BitFieldCoder object. More... | |
void | rebuild (const std::string &description) |
Re-build object in place. More... | |
Public Member Functions inherited from dd4hep::Handle< IDDescriptorObject > | |
Handle ()=default | |
Default constructor. More... | |
Handle (Handle< IDDescriptorObject > &&element)=default | |
Copy constructor. More... | |
Handle (const Handle< IDDescriptorObject > &element)=default | |
Copy constructor. More... | |
Handle (IDDescriptorObject *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< IDDescriptorObject > & | operator= (Handle< IDDescriptorObject > &&element)=default |
Assignment move operator. More... | |
Handle< IDDescriptorObject > & | operator= (const Handle< IDDescriptorObject > &element)=default |
Assignment copy operator. More... | |
bool | operator== (const Handle< IDDescriptorObject > &element) const |
Boolean operator == used for RB tree insertions. More... | |
bool | operator< (const Handle< IDDescriptorObject > &element) const |
Boolean operator < used for RB tree insertions. More... | |
bool | operator> (const Handle< IDDescriptorObject > &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< IDDescriptorObject > & | clear () |
Release the object held by the handle. More... | |
IDDescriptorObject * | operator-> () const |
Access the held object using the -> operator. More... | |
operator IDDescriptorObject & () const | |
Automatic type conversion to an object references. More... | |
IDDescriptorObject & | operator* () const |
Access the held object using the * operator. More... | |
IDDescriptorObject * | 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... | |
IDDescriptorObject * | 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 VolumeID | encode (const Field *fld, VolumeID value) |
Encode partial volume identifiers to a volumeID. More... | |
Static Public Member Functions inherited from dd4hep::Handle< IDDescriptorObject > | |
static void | bad_assignment (const std::type_info &from, const std::type_info &to) |
Helper routine called when unrelated types are assigned. More... | |
Additional Inherited Members | |
Public Attributes inherited from dd4hep::Handle< IDDescriptorObject > | |
IDDescriptorObject * | m_element |
Single and only data member: Reference to the actual element. More... | |
Class implementing the ID encoding of the detector response.
Definition at line 37 of file IDDescriptor.h.
typedef BitFieldElement dd4hep::IDDescriptor::Field |
Definition at line 39 of file IDDescriptor.h.
typedef std::vector<std::pair<size_t, std::string> > dd4hep::IDDescriptor::FieldIDs |
Definition at line 41 of file IDDescriptor.h.
typedef std::vector<std::pair<std::string, const Field*> > dd4hep::IDDescriptor::FieldMap |
Definition at line 40 of file IDDescriptor.h.
|
default |
Default constructor.
|
inline |
Constructor to be used when reading the already parsed object.
Definition at line 47 of file IDDescriptor.h.
IDDescriptor::IDDescriptor | ( | const std::string & | name, |
const std::string & | description | ||
) |
Initializing constructor.
Definition at line 44 of file IDDescriptor.cpp.
void IDDescriptor::decodeFields | ( | VolumeID | vid, |
std::vector< std::pair< const BitFieldElement *, VolumeID > > & | fields | ||
) | const |
Decode volume IDs and return filled descriptor with all fields.
Definition at line 164 of file IDDescriptor.cpp.
BitFieldCoder * IDDescriptor::decoder | ( | ) | const |
Access the BitFieldCoder object.
Definition at line 198 of file IDDescriptor.cpp.
Encode partial volume identifiers to a volumeID.
Definition at line 148 of file IDDescriptor.cpp.
VolumeID IDDescriptor::encode | ( | const std::vector< std::pair< std::string, int > > & | ids | ) | const |
Encode a set of volume identifiers (corresponding to this description of course!) to a volumeID.
Definition at line 134 of file IDDescriptor.cpp.
VolumeID IDDescriptor::encode_reverse | ( | const std::vector< std::pair< std::string, int > > & | id_vector | ) | const |
Encode a set of volume identifiers to a volumeID with the system ID on the top bits.
Definition at line 158 of file IDDescriptor.cpp.
const BitFieldElement * IDDescriptor::field | ( | const std::string & | field_name | ) | const |
Get the field descriptor of one field by name.
Definition at line 96 of file IDDescriptor.cpp.
const BitFieldElement * IDDescriptor::field | ( | size_t | identifier | ) | const |
Get the field descriptor of one field by its identifier.
Definition at line 107 of file IDDescriptor.cpp.
std::string IDDescriptor::fieldDescription | ( | ) | const |
The string description of all fields from the BitField.
Definition at line 67 of file IDDescriptor.cpp.
std::size_t IDDescriptor::fieldID | ( | const std::string & | field_name | ) | const |
Get the field identifier of one field by name.
Definition at line 113 of file IDDescriptor.cpp.
const IDDescriptor::FieldMap & IDDescriptor::fields | ( | ) | const |
Access the fieldmap container.
Definition at line 87 of file IDDescriptor.cpp.
VolumeID IDDescriptor::get_mask | ( | const std::vector< std::pair< std::string, int > > & | id_vector | ) | const |
Compute the submask for a given set of volume IDs.
Definition at line 124 of file IDDescriptor.cpp.
const IDDescriptor::FieldIDs & IDDescriptor::ids | ( | ) | const |
Access the field-id container.
Definition at line 78 of file IDDescriptor.cpp.
unsigned IDDescriptor::maxBit | ( | ) | const |
The total number of encoding bits for this descriptor.
Definition at line 73 of file IDDescriptor.cpp.
void IDDescriptor::rebuild | ( | const std::string & | description | ) |
Re-build object in place.
Definition at line 51 of file IDDescriptor.cpp.
std::string IDDescriptor::str | ( | VolumeID | vid | ) | const |
Decode volume IDs and return string reprensentation for debugging purposes.
Definition at line 174 of file IDDescriptor.cpp.
Decode volume IDs and return string reprensentation for debugging purposes.
Definition at line 185 of file IDDescriptor.cpp.
std::string IDDescriptor::toString | ( | ) | const |
Access string representation.
Acces std::string representation.
Definition at line 60 of file IDDescriptor.cpp.