DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
dd4hep::DDSegmentation::MultiSegmentation Class Reference

Wrapper to support multiple segmentations. More...

#include <MultiSegmentation.h>

Inheritance diagram for dd4hep::DDSegmentation::MultiSegmentation:
dd4hep::DDSegmentation::Segmentation

Classes

struct  Entry
 Helper structure to describe a sub-segmentation entry. More...
 

Public Types

typedef std::vector< EntrySegmentations
 

Public Member Functions

 MultiSegmentation (const std::string &cellEncoding="")
 Default constructor passing the encoding string. More...
 
 MultiSegmentation (const BitFieldCoder *decoder)
 Default constructor used by derived classes passing an existing decoder. More...
 
virtual ~MultiSegmentation ()
 Default destructor. More...
 
virtual void addSubsegmentation (long key_min, long key_max, Segmentation *entry)
 Add subsegmentation. More...
 
const Segmentationsubsegmentation (const CellID &cellID) const
 Access subsegmentation by cell identifier. More...
 
virtual Vector3D position (const CellID &cellID) const
 determine the position based on the cell ID More...
 
virtual CellID cellID (const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
 determine the cell ID based on the position More...
 
virtual 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...
 
const std::string & discriminatorName () const
 access the field name used to discriminate sub-segmentations More...
 
const BitFieldElementdiscriminator () const
 Discriminating bitfield entry. More...
 
virtual void setDecoder (const BitFieldCoder *decoder)
 Set the underlying decoder. More...
 
const SegmentationssubSegmentations () const
 The underlying sub-segementations. More...
 
- Public Member Functions inherited from dd4hep::DDSegmentation::Segmentation
virtual ~Segmentation ()
 Destructor. More...
 
virtual VolumeID volumeID (const CellID &cellID) const
 Determine the volume ID from the full cell ID by removing all local fields. More...
 
virtual 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...
 
virtual std::string fieldDescription () const
 Access the encoding string. More...
 
virtual const std::string & name () const
 Access the segmentation name. More...
 
virtual void setName (const std::string &value)
 Set the segmentation name. More...
 
virtual const std::string & type () const
 Access the segmentation type. More...
 
virtual const std::string & description () const
 Access the description of the segmentation. More...
 
virtual const BitFieldCoderdecoder () const
 Access the underlying decoder. More...
 
virtual Parameter parameter (const std::string &parameterName) const
 Access to parameter by name. More...
 
virtual Parameters parameters () const
 Access to all parameters. More...
 
virtual void setParameters (const Parameters &parameters)
 Set all parameters from an existing set of parameters. More...
 

Protected Attributes

Segmentations m_segmentations
 Sub-segmentaion container. More...
 
std::string m_discriminatorId
 the field name used to discriminate sub-segmentations More...
 
const BitFieldElementm_discriminator
 Bitfield corresponding to dicriminator identifier. More...
 
int m_debug
 Debug flags. More...
 
- Protected Attributes inherited from dd4hep::DDSegmentation::Segmentation
std::string _name
 The segmentation name. More...
 
std::string _type
 The segmentation type. More...
 
std::string _description
 The description of the segmentation. More...
 
std::map< std::string, Parameter_parameters
 The parameters for this segmentation. More...
 
std::map< std::string, StringParameter_indexIdentifiers
 The indices used for the encoding. More...
 
const BitFieldCoder_decoder = 0
 The cell ID encoder and decoder. More...
 
bool _ownsDecoder = false
 Keeps track of the decoder ownership. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dd4hep::DDSegmentation::Segmentation
 Segmentation (const std::string &cellEncoding="")
 Default constructor used by derived classes passing the encoding string. More...
 
 Segmentation (const BitFieldCoder *decoder)
 Default constructor used by derived classes passing an existing decoder. More...
 
template<typename TYPE >
void registerParameter (const std::string &nam, const std::string &desc, TYPE &param, const TYPE &defaultVal, UnitType unitTyp=SegmentationParameter::NoUnit, bool isOpt=false)
 Add a parameter to this segmentation. Used by derived classes to define their parameters. More...
 
void registerIdentifier (const std::string &nam, const std::string &desc, std::string &ident, const std::string &defaultVal)
 Add a cell identifier to this segmentation. Used by derived classes to define their required identifiers. More...
 
- Static Protected Member Functions inherited from dd4hep::DDSegmentation::Segmentation
static double binToPosition (FieldID bin, double cellSize, double offset=0.)
 Helper method to convert a bin number to a 1D position. More...
 
static int positionToBin (double position, double cellSize, double offset=0.)
 Helper method to convert a 1D position to a cell ID. More...
 
static double binToPosition (FieldID bin, std::vector< double > const &cellBoundaries, double offset=0.)
 Helper method to convert a bin number to a 1D position given a vector of binBoundaries. More...
 
static int positionToBin (double position, std::vector< double > const &cellBoundaries, double offset=0.)
 Helper method to convert a 1D position to a cell ID given a vector of binBoundaries. More...
 

Detailed Description

Wrapper to support multiple segmentations.

Author
M.Frank
Version
1.0

Definition at line 29 of file MultiSegmentation.h.

Member Typedef Documentation

◆ Segmentations

Definition at line 36 of file MultiSegmentation.h.

Constructor & Destructor Documentation

◆ MultiSegmentation() [1/2]

dd4hep::DDSegmentation::MultiSegmentation::MultiSegmentation ( const std::string &  cellEncoding = "")

Default constructor passing the encoding string.

default constructor using an encoding string

Definition at line 29 of file MultiSegmentation.cpp.

◆ MultiSegmentation() [2/2]

dd4hep::DDSegmentation::MultiSegmentation::MultiSegmentation ( const BitFieldCoder decoder)

Default constructor used by derived classes passing an existing decoder.

Definition at line 40 of file MultiSegmentation.cpp.

◆ ~MultiSegmentation()

dd4hep::DDSegmentation::MultiSegmentation::~MultiSegmentation ( )
virtual

Default destructor.

destructor

Definition at line 51 of file MultiSegmentation.cpp.

Member Function Documentation

◆ addSubsegmentation()

void dd4hep::DDSegmentation::MultiSegmentation::addSubsegmentation ( long  key_min,
long  key_max,
Segmentation entry 
)
virtual

Add subsegmentation.

Add subsegmentation. Call only valid for Multi-segmentations. Default implementation throws an exception.

Reimplemented from dd4hep::DDSegmentation::Segmentation.

Definition at line 58 of file MultiSegmentation.cpp.

◆ cellDimensions()

std::vector< double > dd4hep::DDSegmentation::MultiSegmentation::cellDimensions ( const CellID cellID) const
virtual

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

Reimplemented from dd4hep::DDSegmentation::Segmentation.

Definition at line 108 of file MultiSegmentation.cpp.

◆ cellID()

CellID dd4hep::DDSegmentation::MultiSegmentation::cellID ( const Vector3D localPosition,
const Vector3D globalPosition,
const VolumeID volumeID 
) const
virtual

determine the cell ID based on the position

Implements dd4hep::DDSegmentation::Segmentation.

Definition at line 104 of file MultiSegmentation.cpp.

◆ discriminator()

const BitFieldElement* dd4hep::DDSegmentation::MultiSegmentation::discriminator ( ) const
inline

Discriminating bitfield entry.

Definition at line 85 of file MultiSegmentation.h.

◆ discriminatorName()

const std::string& dd4hep::DDSegmentation::MultiSegmentation::discriminatorName ( ) const
inline

access the field name used to discriminate sub-segmentations

Definition at line 82 of file MultiSegmentation.h.

◆ position()

Vector3D dd4hep::DDSegmentation::MultiSegmentation::position ( const CellID cellID) const
virtual

determine the position based on the cell ID

Implements dd4hep::DDSegmentation::Segmentation.

Definition at line 99 of file MultiSegmentation.cpp.

◆ setDecoder()

void dd4hep::DDSegmentation::MultiSegmentation::setDecoder ( const BitFieldCoder decoder)
virtual

Set the underlying decoder.

Reimplemented from dd4hep::DDSegmentation::Segmentation.

Definition at line 67 of file MultiSegmentation.cpp.

◆ subsegmentation()

const Segmentation & dd4hep::DDSegmentation::MultiSegmentation::subsegmentation ( const CellID cellID) const

Access subsegmentation by cell identifier.

Definition at line 75 of file MultiSegmentation.cpp.

◆ subSegmentations()

const Segmentations& dd4hep::DDSegmentation::MultiSegmentation::subSegmentations ( ) const
inline

The underlying sub-segementations.

Definition at line 91 of file MultiSegmentation.h.

Member Data Documentation

◆ m_debug

int dd4hep::DDSegmentation::MultiSegmentation::m_debug
protected

Debug flags.

Definition at line 49 of file MultiSegmentation.h.

◆ m_discriminator

const BitFieldElement* dd4hep::DDSegmentation::MultiSegmentation::m_discriminator
protected

Bitfield corresponding to dicriminator identifier.

Definition at line 46 of file MultiSegmentation.h.

◆ m_discriminatorId

std::string dd4hep::DDSegmentation::MultiSegmentation::m_discriminatorId
protected

the field name used to discriminate sub-segmentations

Definition at line 43 of file MultiSegmentation.h.

◆ m_segmentations

Segmentations dd4hep::DDSegmentation::MultiSegmentation::m_segmentations
protected

Sub-segmentaion container.

Definition at line 40 of file MultiSegmentation.h.


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