DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Static Public Member Functions | List of all members
dd4hep::IDDescriptor Class Reference

Class implementing the ID encoding of the detector response. More...

#include <DDCore/IDDescriptor.h>

Inheritance diagram for dd4hep::IDDescriptor:
dd4hep::Handle< IDDescriptorObject >

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< IDDescriptorObjectBase
 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 FieldIDsids () const
 Access the field-id container. More...
 
const FieldMapfields () 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...
 
BitFieldCoderdecoder () 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...
 
IDDescriptorObjectoperator-> () const
 Access the held object using the -> operator. More...
 
 operator IDDescriptorObject & () const
 Automatic type conversion to an object references. More...
 
IDDescriptorObjectoperator* () const
 Access the held object using the * operator. More...
 
IDDescriptorObjectptr () 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...
 
IDDescriptorObjectaccess () 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 >
IDDescriptorObjectm_element
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

Class implementing the ID encoding of the detector response.

Author
M.Frank
Version
1.0
Date
2012/07/31

Definition at line 37 of file IDDescriptor.h.

Member Typedef Documentation

◆ Field

typedef BitFieldElement dd4hep::IDDescriptor::Field

Definition at line 39 of file IDDescriptor.h.

◆ FieldIDs

typedef std::vector<std::pair<size_t, std::string> > dd4hep::IDDescriptor::FieldIDs

Definition at line 41 of file IDDescriptor.h.

◆ FieldMap

typedef std::vector<std::pair<std::string, const Field*> > dd4hep::IDDescriptor::FieldMap

Definition at line 40 of file IDDescriptor.h.

Constructor & Destructor Documentation

◆ IDDescriptor() [1/3]

dd4hep::IDDescriptor::IDDescriptor ( )
default

Default constructor.

◆ IDDescriptor() [2/3]

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

Constructor to be used when reading the already parsed object.

Definition at line 47 of file IDDescriptor.h.

◆ IDDescriptor() [3/3]

IDDescriptor::IDDescriptor ( const std::string &  name,
const std::string &  description 
)

Initializing constructor.

Definition at line 44 of file IDDescriptor.cpp.

Member Function Documentation

◆ decodeFields()

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.

◆ decoder()

BitFieldCoder * IDDescriptor::decoder ( ) const

Access the BitFieldCoder object.

Definition at line 198 of file IDDescriptor.cpp.

◆ encode() [1/2]

VolumeID IDDescriptor::encode ( const Field fld,
VolumeID  value 
)
static

Encode partial volume identifiers to a volumeID.

Definition at line 148 of file IDDescriptor.cpp.

◆ encode() [2/2]

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.

◆ encode_reverse()

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.

◆ field() [1/2]

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.

◆ field() [2/2]

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.

◆ fieldDescription()

std::string IDDescriptor::fieldDescription ( ) const

The string description of all fields from the BitField.

Definition at line 67 of file IDDescriptor.cpp.

◆ fieldID()

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.

◆ fields()

const IDDescriptor::FieldMap & IDDescriptor::fields ( ) const

Access the fieldmap container.

Definition at line 87 of file IDDescriptor.cpp.

◆ get_mask()

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.

◆ ids()

const IDDescriptor::FieldIDs & IDDescriptor::ids ( ) const

Access the field-id container.

Definition at line 78 of file IDDescriptor.cpp.

◆ maxBit()

unsigned IDDescriptor::maxBit ( ) const

The total number of encoding bits for this descriptor.

Definition at line 73 of file IDDescriptor.cpp.

◆ rebuild()

void IDDescriptor::rebuild ( const std::string &  description)

Re-build object in place.

Definition at line 51 of file IDDescriptor.cpp.

◆ str() [1/2]

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.

◆ str() [2/2]

std::string IDDescriptor::str ( VolumeID  vid,
VolumeID  mask 
) const

Decode volume IDs and return string reprensentation for debugging purposes.

Definition at line 185 of file IDDescriptor.cpp.

◆ toString()

std::string IDDescriptor::toString ( ) const

Access string representation.

Acces std::string representation.

Definition at line 60 of file IDDescriptor.cpp.


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