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

Handle class supporting generic Segmentations of sensitive detectors. More...

#include <Segmentations.h>

Inheritance diagram for dd4hep::Segmentation:
dd4hep::Handle< SegmentationObject >

Public Member Functions

 Segmentation (const std::string &type, const std::string &name, const BitFieldCoder *decoder)
 Initializing constructor creating a new object of the given DDSegmentation type. More...
 
 Segmentation ()=default
 Default constructor. More...
 
 Segmentation (Segmentation &&e)=default
 Move Constructor. More...
 
 Segmentation (const Segmentation &e)=default
 Copy Constructor. More...
 
 Segmentation (Handle< Object > &&e)
 Move Constructor from handle. More...
 
 Segmentation (const Handle< Object > &e)
 Copy Constructor from handle. More...
 
template<typename Q >
 Segmentation (const Handle< Q > &e)
 Constructor to be used when reading the already parsed object. More...
 
Segmentationoperator= (Segmentation &&seg)=default
 Move Assignment operator. More...
 
Segmentationoperator= (const Segmentation &seg)=default
 Copy Assignment operator. More...
 
bool useForHitPosition () const
 Access flag for hit positioning. More...
 
const char * name () const
 Accessor: Segmentation type. More...
 
std::string type () const
 Accessor: Segmentation type. More...
 
DDSegmentation::Parameters parameters () const
 Access to the parameters. More...
 
DDSegmentation::Parameter parameter (const std::string &parameterName) const
 Access to parameter by name. More...
 
Handle< DetElementObjectdetector () const
 Access the main detector element using this segmentation object. More...
 
Handle< SensitiveDetectorObjectsensitive () const
 Access the sensitive detector using this segmentation object. More...
 
const BitFieldCoder * decoder () const
 Access the underlying decoder. More...
 
void setDecoder (const BitFieldCoder *decoder) const
 Set the underlying decoder. More...
 
Position position (const CellID &cellID) const
 determine the local position based on the cell ID More...
 
CellID cellID (const Position &localPosition, const Position &globalPosition, const VolumeID &volumeID) const
 determine the cell ID based on the local position More...
 
VolumeID volumeID (const CellID &cellID) const
 Determine the volume ID from the full cell ID by removing all local fields. More...
 
void neighbours (const CellID &cellID, std::set< CellID > &neighbours) const
 Calculates the neighbours of the given cell ID and adds them to the list of neighbours. More...
 
std::vector< double > cellDimensions (const CellID &cellID) const
 Returns a vector<double> of the cellDimensions of the given cell ID in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi. More...
 
DDSegmentation::Segmentationsegmentation () const
 Access to the base DDSegmentation object. WARNING: Deprecated call! More...
 
- Public Member Functions inherited from dd4hep::Handle< SegmentationObject >
 Handle ()=default
 Default constructor. More...
 
 Handle (Handle< SegmentationObject > &&element)=default
 Copy constructor. More...
 
 Handle (const Handle< SegmentationObject > &element)=default
 Copy constructor. More...
 
 Handle (SegmentationObject *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< SegmentationObject > & operator= (Handle< SegmentationObject > &&element)=default
 Assignment move operator. More...
 
Handle< SegmentationObject > & operator= (const Handle< SegmentationObject > &element)=default
 Assignment copy operator. More...
 
bool operator== (const Handle< SegmentationObject > &element) const
 Boolean operator == used for RB tree insertions. More...
 
bool operator< (const Handle< SegmentationObject > &element) const
 Boolean operator < used for RB tree insertions. More...
 
bool operator> (const Handle< SegmentationObject > &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< SegmentationObject > & clear ()
 Release the object held by the handle. More...
 
SegmentationObjectoperator-> () const
 Access the held object using the -> operator. More...
 
 operator SegmentationObject & () const
 Automatic type conversion to an object references. More...
 
SegmentationObjectoperator* () const
 Access the held object using the * operator. More...
 
SegmentationObjectptr () 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...
 
SegmentationObjectaccess () 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< SegmentationObject >
typedef SegmentationObject Object
 Extern accessible definition of the contained element type. More...
 
typedef Handle< SegmentationObjectBase
 Self type: used by sub-classes. More...
 
- Static Public Member Functions inherited from dd4hep::Handle< SegmentationObject >
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< SegmentationObject >
SegmentationObjectm_element
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

Handle class supporting generic Segmentations of sensitive detectors.

This basic segmentation implementation supports "generic" access to specific segmentations exporting the common abstract interface. Mostly used in simulation.

Author
M.Frank
Version
1.0

Definition at line 41 of file Segmentations.h.

Constructor & Destructor Documentation

◆ Segmentation() [1/7]

Segmentation::Segmentation ( const std::string &  type,
const std::string &  name,
const BitFieldCoder *  decoder 
)

Initializing constructor creating a new object of the given DDSegmentation type.

Constructor to used when creating a new object.

Definition at line 31 of file Segmentations.cpp.

◆ Segmentation() [2/7]

dd4hep::Segmentation::Segmentation ( )
default

Default constructor.

◆ Segmentation() [3/7]

dd4hep::Segmentation::Segmentation ( Segmentation &&  e)
default

Move Constructor.

◆ Segmentation() [4/7]

dd4hep::Segmentation::Segmentation ( const Segmentation e)
default

Copy Constructor.

◆ Segmentation() [5/7]

dd4hep::Segmentation::Segmentation ( Handle< Object > &&  e)
inline

Move Constructor from handle.

Definition at line 53 of file Segmentations.h.

◆ Segmentation() [6/7]

dd4hep::Segmentation::Segmentation ( const Handle< Object > &  e)
inline

Copy Constructor from handle.

Definition at line 55 of file Segmentations.h.

◆ Segmentation() [7/7]

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

Constructor to be used when reading the already parsed object.

Definition at line 58 of file Segmentations.h.

Member Function Documentation

◆ cellDimensions()

std::vector< double > Segmentation::cellDimensions ( const CellID cell) const

Returns a vector<double> of the cellDimensions of the given cell ID in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi.

Parameters
cellIDcellID of the cell for which parameters are returned
Returns
vector<double> in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi

Definition at line 94 of file Segmentations.cpp.

◆ cellID()

CellID Segmentation::cellID ( const Position localPosition,
const Position globalPosition,
const VolumeID volumeID 
) const

determine the cell ID based on the local position

Definition at line 74 of file Segmentations.cpp.

◆ decoder()

const BitFieldCoder * Segmentation::decoder ( ) const

Access the underlying decoder.

Definition at line 104 of file Segmentations.cpp.

◆ detector()

Handle< DetElementObject > Segmentation::detector ( ) const

Access the main detector element using this segmentation object.

Definition at line 114 of file Segmentations.cpp.

◆ name()

const char * Segmentation::name ( ) const

Accessor: Segmentation type.

Definition at line 45 of file Segmentations.cpp.

◆ neighbours()

void Segmentation::neighbours ( const CellID cellID,
std::set< CellID > &  neighbours 
) const

Calculates the neighbours of the given cell ID and adds them to the list of neighbours.

Definition at line 84 of file Segmentations.cpp.

◆ operator=() [1/2]

Segmentation& dd4hep::Segmentation::operator= ( const Segmentation seg)
default

Copy Assignment operator.

◆ operator=() [2/2]

Segmentation& dd4hep::Segmentation::operator= ( Segmentation &&  seg)
default

Move Assignment operator.

◆ parameter()

DDSegmentation::Parameter Segmentation::parameter ( const std::string &  parameterName) const

Access to parameter by name.

Definition at line 64 of file Segmentations.cpp.

◆ parameters()

DDSegmentation::Parameters Segmentation::parameters ( ) const

Access to the parameters.

Definition at line 59 of file Segmentations.cpp.

◆ position()

Position Segmentation::position ( const CellID cellID) const

determine the local position based on the cell ID

Definition at line 69 of file Segmentations.cpp.

◆ segmentation()

DDSegmentation::Segmentation * Segmentation::segmentation ( ) const

Access to the base DDSegmentation object. WARNING: Deprecated call!

Definition at line 99 of file Segmentations.cpp.

◆ sensitive()

Handle< SensitiveDetectorObject > Segmentation::sensitive ( ) const

Access the sensitive detector using this segmentation object.

Definition at line 119 of file Segmentations.cpp.

◆ setDecoder()

void Segmentation::setDecoder ( const BitFieldCoder *  decoder) const

Set the underlying decoder.

Definition at line 109 of file Segmentations.cpp.

◆ type()

std::string Segmentation::type ( ) const

Accessor: Segmentation type.

Definition at line 50 of file Segmentations.cpp.

◆ useForHitPosition()

bool Segmentation::useForHitPosition ( ) const

Access flag for hit positioning.

Definition at line 54 of file Segmentations.cpp.

◆ volumeID()

VolumeID Segmentation::volumeID ( const CellID cellID) const

Determine the volume ID from the full cell ID by removing all local fields.

Definition at line 79 of file Segmentations.cpp.


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